Commit c95440cc authored by Daniele Zanzi's avatar Daniele Zanzi Committed by Graeme Stewart
Browse files

moved to r21 tau EDM (TrigTauMonitoring-00-00-78)

	* moved to r21 tau EDM
	* TrigTauMonitoring-00-00-78

2016-05-06 Daniele Zanzi
	* activated real Ztt efficiency folder
	* TrigTauMonitoring-00-00-77
parent 07b06472
......@@ -57,7 +57,7 @@ def TrigTauMonitoringTool():
# Ditau Items
'tau35_loose1_tracktwo_tau25_loose1_tracktwo', # seeded by L1_TAU20IM_2TAU12IM_J25_2J20_3J12
'tau35_medium1_tracktwo_tau25_medium1_tracktwo',
#'tau35_medium1_tracktwo_tau25_medium1_tracktwo',
'tau35_tight1_tracktwo_tau25_tight1_tracktwo',
'tau35_loose1_tracktwo_tau25_loose1_tracktwo_L1TAU20IM_2TAU12IM',
'tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM',
......@@ -224,7 +224,7 @@ def TrigTauMonitoringTool():
TurnOnCurves = True,
TurnOnCurvesDenom = "RecoID", # combined string with combination of "Truth", "Reco", "ID" and "Presel". For Truth doTruth=True!
doTruth = False,
doRealZtautauEff = False,
doRealZtautauEff = True,
dodijetFakeTausEff = False,
doBootstrap = False,
doEmulation = True,
......
......@@ -448,11 +448,12 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem){
std::vector< uint32_t > jet_roIWord;
std::vector< float > jet_roi_eta;
std::vector< float > jet_roi_phi;
for(;comb!=combEnd;++comb){
const std::vector< Trig::Feature<TrigRoiDescriptor> > vec_roi = comb->get<TrigRoiDescriptor>("initialRoI",m_L1TriggerCondition);
std::vector< Trig::Feature<TrigRoiDescriptor> >::const_iterator roi = vec_roi.begin(), roi_e = vec_roi.end();
ATH_MSG_DEBUG("Combination with " << vec_roi.size() << "RoIs");
ATH_MSG_DEBUG("Combination with " << vec_roi.size() << "RoIs");
const xAOD::EmTauRoIContainer* l1Tau_cont = 0;
if ( m_storeGate->retrieve( l1Tau_cont, "LVL1EmTauRoIs").isFailure() ){ // retrieve arguments: container type, container key
......@@ -467,6 +468,7 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem){
for(roi = vec_roi.begin(); roi != roi_e; ++roi)
if(roi->cptr()){
for(itEMTau = l1Tau_cont->begin(); itEMTau!=itEMTau_e; ++itEMTau){
if( (*itEMTau)->roiType()!=2 ) continue; // only Run2 TAU RoI!
if(roi->cptr()->roiWord()==(*itEMTau)->roiWord()){
if(!Selection(*itEMTau)) continue;
bool newRoI=true;
......@@ -521,19 +523,22 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem){
}
}
}
}
// if(trig_item_L1=="L1_TAU20IM_2TAU12IM_J25_2J20_3J12"){
// ATH_MSG_WARNING("fired L1_TAU20IM_2TAU12IM_J25_2J20_3J12");
// for(roi = vec_roi.begin(); roi != roi_e; ++roi) if(roi->cptr()){
// ATH_MSG_WARNING("Initial RoI: " << roi->cptr()->roiWord() << ", " << roi->cptr()->phi() << ", " << roi->cptr()->eta() );
// }
// for(itEMTau = l1Tau_cont->begin(); itEMTau!=itEMTau_e; ++itEMTau){
// ATH_MSG_WARNING("EMTau RoI: " << (*itEMTau)->roiWord() << ", " << (*itEMTau)->phi() << ", " << (*itEMTau)->eta() );
// }
// for(itJetRoI = l1jets->begin(); itJetRoI!=itJetRoI_e; ++itJetRoI){
// ATH_MSG_WARNING("Jet RoI: " << (*itJetRoI)->roiWord() << ", " << (*itJetRoI)->phi() << ", " << (*itJetRoI)->eta() );
// }
// }
/*if(trig_item_L1=="L1_TAU20IM_2TAU12IM_J25_2J20_3J12"){
ATH_MSG_WARNING("fired L1_TAU20IM_2TAU12IM_J25_2J20_3J12");
for(roi = vec_roi.begin(); roi != roi_e; ++roi) if(roi->cptr()){
ATH_MSG_WARNING("Initial RoI: " << roi->cptr()->roiWord() << ", " << roi->cptr()->phi() << ", " << roi->cptr()->eta() );
}
for(itEMTau = l1Tau_cont->begin(); itEMTau!=itEMTau_e; ++itEMTau){
if( (*itEMTau)->roiType()!=2 ) continue; // only Run2 TAU RoI!
ATH_MSG_WARNING("EMTau RoI: " << (*itEMTau)->roiWord() << ", " << (*itEMTau)->phi() << ", " << (*itEMTau)->eta() << ", " << (*itEMTau)->eT()/CLHEP::GeV);
}
for(itJetRoI = l1jets->begin(); itJetRoI!=itJetRoI_e; ++itJetRoI){
ATH_MSG_WARNING("Jet RoI: " << (*itJetRoI)->roiWord() << ", " << (*itJetRoI)->phi() << ", " << (*itJetRoI)->eta() << ", " << (*itJetRoI)->etLarge()/CLHEP::GeV);
}
}*/
} //end loop over L1 combinations
if(trig_item_L1=="L1_TAU20IM_2TAU12IM" && getTDT()->isPassed(trig_item_L1,m_L1TriggerCondition)){
......@@ -752,7 +757,7 @@ StatusCode HLTTauMonTool::fillPreselTau(const xAOD::TauJet *aEFTau){
hist2("hEtVsEta")->Fill(aEFTau->eta(),aEFTau->pt()/CLHEP::GeV);
hist2("hEtVsPhi")->Fill(aEFTau->phi(),aEFTau->pt()/CLHEP::GeV);
hist("hFTFnWideTrack")->Fill(aEFTau->nWideTracks());
hist("hFTFnWideTrack")->Fill(aEFTau->nTracksIsolation());
return StatusCode::SUCCESS;
......@@ -824,7 +829,7 @@ StatusCode HLTTauMonTool::fillEFTau(const xAOD::TauJet *aEFTau, const std::strin
hist2("hEFNUMvsmu")->Fill(num_vxt,mu);
hist("hEFPhi")->Fill(aEFTau->phi());
hist("hEFnTrack")->Fill(EFnTrack);
hist("hEFnWideTrack")->Fill(aEFTau->nWideTracks());
hist("hEFnWideTrack")->Fill(aEFTau->nTracksIsolation());
hist2("hEFEtaVsPhi")->Fill(aEFTau->eta(),aEFTau->phi());
hist2("hEFEtVsPhi")->Fill(aEFTau->phi(),aEFTau->pt()/CLHEP::GeV);
hist2("hEFEtVsEta")->Fill(aEFTau->eta(),aEFTau->pt()/CLHEP::GeV);
......@@ -1174,7 +1179,8 @@ StatusCode HLTTauMonTool::fillPreselTauVsOffline(const xAOD::TauJet *aEFTau){
int EFnTrack = aEFTau->nTracks();
hist2("hPreselvsOffnTrks")->Fill(aOfflineTau->nTracks(), EFnTrack);
hist2("hPreselvsOffnWideTrks")->Fill(aOfflineTau->nWideTracks(), aEFTau->nWideTracks());
//Justin Griffiths: is this really a comparison b/w offline and online taus? we may want to do something else.
hist2("hPreselvsOffnWideTrks")->Fill(aOfflineTau->nTracksIsolation(), aEFTau->nTracksIsolation());
FillRelDiffHist(hist("hEFEtRatio"), aOfflineTau->pt(), aEFTau->pt(), 0, 1);
FillRelDiffHist(hist("hEtaRatio"), aOfflineTau->eta(), aEFTau->eta(), 0, 2);
hist("hPhiRatio")->Fill( deltaPhi(aOfflineTau->phi(), aEFTau->phi()));
......@@ -1351,7 +1357,7 @@ StatusCode HLTTauMonTool::fillEFTauVsOffline(const xAOD::TauJet *aEFTau, const s
setCurrentMonGroup("HLT/TauMon/Expert/"+trigItem+"/EFVsOffline");
//Basic Vars
hist2("hEFvsOffnTrks")->Fill(aOfflineTau->nTracks(), aEFTau->nTracks());
hist2("hEFvsOffnWideTrks")->Fill(aOfflineTau->nWideTracks(), aEFTau->nWideTracks());
hist2("hEFvsOffnWideTrks")->Fill(aOfflineTau->nTracksIsolation(), aEFTau->nTracksIsolation());
FillRelDiffHist(hist("hptRatio"), aOfflineTau->pt(), aEFTau->pt(), 0, 1);
FillRelDiffProfile<float>(profile("hEtRatiovspt"), aOfflineTau->pt(), aEFTau->pt(), aOfflineTau->pt()/1000., 0, 1);
FillRelDiffProfile<float>(profile("hEtRatiovseta"), aOfflineTau->pt(), aEFTau->pt(), aOfflineTau->eta(), 0, 1);
......@@ -2051,7 +2057,7 @@ StatusCode HLTTauMonTool::TauEfficiency(const std::string & trigItem, const std:
for(hltItr=hlt_cont->begin(); hltItr!=hlt_cont_end; ++hltItr){
TLorentzVector hltTLV = (*hltItr)->p4();
int ntrack_TAU = (*hltItr)->nTracks();
int nWideTrack_TAU = (*hltItr)->nWideTracks();
int nWideTrack_TAU = (*hltItr)->nTracksIsolation();
if( !L1TauMatching(l1_chain, hltTLV, 0.3) ) continue;
if(ntrack_TAU>3) continue;
if(trigItem.find("perf")==std::string::npos) if(ntrack_TAU==0 || nWideTrack_TAU>1) continue;
......
......@@ -84,7 +84,6 @@
//#define _USE_MATH_DEFINES
#include <math.h>
#include "TrigHLTMonitoring/IHLTMonTool.h"
#include "HLTTauMonTool.h"
......
......@@ -88,6 +88,18 @@ using namespace std;
StatusCode HLTTauMonTool::RealZTauTauEfficiency()
{
ATH_MSG_DEBUG("Real ZTauTau Efficiency");
// compute eff only for events passing single muon triggers
if(! ( getTDT()->isPassed("HLT_mu20_iloose_L1MU15")
|| getTDT()->isPassed("HLT_mu20_ivarloose_L1MU15")
|| getTDT()->isPassed("HLT_mu24_ivarloose")
|| getTDT()->isPassed("HLT_mu24_iloose")
|| getTDT()->isPassed("HLT_mu24_imedium")
|| getTDT()->isPassed("HLT_mu24_ivarmedium")
|| getTDT()->isPassed("HLT_mu26_imedium")
|| getTDT()->isPassed("HLT_mu26_ivarmedium")
|| getTDT()->isPassed("HLT_mu50")
) ) return StatusCode::SUCCESS;
const xAOD::TauJetContainer * reco_cont = 0;
const xAOD::MuonContainer * muon_cont = 0;
......@@ -256,12 +268,12 @@ StatusCode HLTTauMonTool::RealZTauTauEfficiency()
std::string hlt_chain = "HLT_"+m_trigItems[i];
setCurrentMonGroup("HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
hist("hRealZttPtDenom")->Fill(Tau_TLV.Pt()/1000.);
//hist("hRealZttPtDenom")->Fill(Tau_TLV.Pt()/1000.);
//L1
if(getTDT()->isPassed(l1_chain , TrigDefs::Physics | TrigDefs::allowResurrectedDecision))
{
hist("hRealZttL1PtNum")->Fill(Tau_TLV.Pt()/1000.);
//hist("hRealZttL1PtNum")->Fill(Tau_TLV.Pt()/1000.);
profile("TProfRealZttL1PtEfficiency")->Fill(Tau_TLV.Pt()/1000.,1);
}
else profile("TProfRealZttL1PtEfficiency")->Fill(Tau_TLV.Pt()/1000.,0);
......@@ -269,7 +281,7 @@ StatusCode HLTTauMonTool::RealZTauTauEfficiency()
//HLT
if(getTDT()->isPassed(hlt_chain, TrigDefs::Physics | TrigDefs::allowResurrectedDecision))
{
hist("hRealZttHLTPtNum")->Fill(Tau_TLV.Pt()/1000.);
//hist("hRealZttHLTPtNum")->Fill(Tau_TLV.Pt()/1000.);
profile("TProfRealZttHLTPtEfficiency")->Fill(Tau_TLV.Pt()/1000.,1);
}
else profile("TProfRealZttHLTPtEfficiency")->Fill(Tau_TLV.Pt()/1000.,0);
......
......@@ -131,12 +131,12 @@ void HLTTauMonTool::bookHistogramsForItem(const std::string & trigItem){
addHistogram(new TH2F("hL1EtVsPhi","L1 RoI Et vs Phi; E_{T}[GeV]; #phi",100,0.,100.,100,-3.2,3.2));
addHistogram(new TH2F("hL1EtVsEta","L1 RoI Et vs Eta; E_{T}[GeV]; #eta",100,0.,100.,100,-2.6,2.6));
addHistogram(new TH1F("hL1JetRoIEta","L1 Jet RoI Eta ; #eta; N RoI",32,-3.2,3.2));
addHistogram(new TH1F("hL1JetRoIPhi","L1 Jet RoI Phi ; #phi; N RoI",32,-3.2,3.2));
addHistogram(new TH2F("hL1JetEtaVsPhi","L1 Jet RoI Eta vs Phi; #eta; #phi",32,-3.2,3.2,32,-3.2,3.2));
addHistogram(new TH1F("hL1JetRoIEta","L1 Jet RoI Eta ; #eta; N RoI",100,-3.2,3.2));
addHistogram(new TH1F("hL1JetRoIPhi","L1 Jet RoI Phi ; #phi; N RoI",100,-3.2,3.2));
addHistogram(new TH2F("hL1JetEtaVsPhi","L1 Jet RoI Eta vs Phi; #eta; #phi",100,-3.2,3.2,100,-3.2,3.2));
addHistogram(new TH1F("hL1JetRoIeT","L1 Jet RoI Energy; E_{T}[GeV]; N RoI",200,0.,100.));
addHistogram(new TH2F("hL1JetEtVsPhi","L1 Jet RoI Et vs Phi; E_{T}[GeV]; #phi",100,0.,100.,32,-3.2,3.2));
addHistogram(new TH2F("hL1JetEtVsEta","L1 Jet RoI Et vs Eta; E_{T}[GeV]; #eta",100,0.,100.,32,-3.2,3.2));
addHistogram(new TH2F("hL1JetEtVsPhi","L1 Jet RoI Et vs Phi; E_{T}[GeV]; #phi",100,0.,100.,100,-3.2,3.2));
addHistogram(new TH2F("hL1JetEtVsEta","L1 Jet RoI Et vs Eta; E_{T}[GeV]; #eta",100,0.,100.,100,-3.2,3.2));
//--------------------
//Pre-selection Tau
......@@ -816,17 +816,17 @@ void HLTTauMonTool::bookHistogramsAllItem(){
if(m_RealZtautauEff)
{
const int nbin_pt = 11;
double bins_pt[nbin_pt] = {10.,20.,25.,30.,35.,40.,45.,50.,60.,70.,100.};
double bins_pt[nbin_pt] = {20.,25.,30.,35.,40.,45.,50.,60.,70.,100.,150.};
for(unsigned int i=0;i<m_trigItems.size();++i)
{
addMonGroup( new MonGroup(this, "HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i],run) );
setCurrentMonGroup("HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
addHistogram(new TH1F("hRealZttPtDenom","Offline Real Tau;Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
addHistogram(new TH1F("hRealZttL1PtNum","L1 vs Offline Real Tau; Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
addHistogram(new TH1F("hRealZttHLTPtNum","HLT vs Offline Real Tau; Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
addHistogram(new TH1F("hRealZttL1PtEfficiency","L1 vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
addHistogram(new TH1F("hRealZttHLTPtEfficiency","HLT vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
//addHistogram(new TH1F("hRealZttPtDenom","Offline Real Tau;Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
//addHistogram(new TH1F("hRealZttL1PtNum","L1 vs Offline Real Tau; Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
//addHistogram(new TH1F("hRealZttHLTPtNum","HLT vs Offline Real Tau; Offline Tau p_{T} [GeV];",nbin_pt-1,bins_pt));
//addHistogram(new TH1F("hRealZttL1PtEfficiency","L1 vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
//addHistogram(new TH1F("hRealZttHLTPtEfficiency","HLT vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
addProfile(new TProfile("TProfRealZttL1PtEfficiency", "L1 Vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
addProfile(new TProfile("TProfRealZttHLTPtEfficiency", "HLT Vs Offline Real Tau Efficiency; Offline Tau p_{T} [GeV]; Efficiency",nbin_pt-1,bins_pt));
}
......
......@@ -103,9 +103,9 @@ StatusCode HLTTauMonTool::proc(bool endOfEventsBlock, bool endOfLumiBlock, boo
for(unsigned int i=0;i<m_trigItems.size();++i)
{
setCurrentMonGroup("HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
plotUnderOverFlow(hist("hRealZttPtDenom"));
plotUnderOverFlow(hist("hRealZttL1PtNum"));
plotUnderOverFlow(hist("hRealZttHLTPtNum"));
//plotUnderOverFlow(hist("hRealZttPtDenom"));
//plotUnderOverFlow(hist("hRealZttL1PtNum"));
//plotUnderOverFlow(hist("hRealZttHLTPtNum"));
}
}
......@@ -469,8 +469,8 @@ StatusCode HLTTauMonTool::proc(bool endOfEventsBlock, bool endOfLumiBlock, boo
}
if(m_RealZtautauEff)
{
divide("hRealZttL1PtNum","hRealZttPtDenom","hRealZttL1PtEfficiency","HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
divide("hRealZttHLTPtNum","hRealZttPtDenom","hRealZttHLTPtEfficiency","HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
//divide("hRealZttL1PtNum","hRealZttPtDenom","hRealZttL1PtEfficiency","HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
//divide("hRealZttHLTPtNum","hRealZttPtDenom","hRealZttHLTPtEfficiency","HLT/TauMon/Expert/RealZtautauEff/"+m_trigItems[i]);
}
if (m_doTrackCurves)
......
......@@ -43,7 +43,9 @@
#include "xAODTau/TauJet.h"
#include "xAODTau/TauJetContainer.h"
#include "xAODTau/TauJetAuxContainer.h"
#include "xAODTau/TauTrackContainer.h"
#include "xAODTau/TauDefs.h"
#include "xAODTau/TauxAODHelpers.h"
#include "xAODTrigger/EmTauRoI.h"
#include "xAODTrigger/EmTauRoIContainer.h"
......@@ -118,7 +120,7 @@ StatusCode HLTTauMonTool::test2StepTracking(){
ATH_MSG_DEBUG("tauPrecision: pt "<< pt <<", eta " << eta << ", phi " << phi << ", #tracks "<< nTrack);
bool goodLinks(true);
std::vector< ElementLink< xAOD::TrackParticleContainer > > myLinks = (*tauPrecision)->trackLinks();
std::vector< ElementLink< xAOD::TrackParticleContainer > > myLinks = xAOD::TauHelpers::trackParticleLinks((*tauPrecision), xAOD::TauJetParameters::classifiedCharged);
ATH_MSG_DEBUG("Size of links for tauPrecision: " << myLinks.size());
for(unsigned int i=0;i<myLinks.size();++i){
ATH_MSG_DEBUG("Get the link: " << i);
......@@ -130,7 +132,7 @@ StatusCode HLTTauMonTool::test2StepTracking(){
ATH_MSG_DEBUG("TheIndex: " << theLink.index());
}
if(goodLinks)for (unsigned int i=0;i<(*tauPrecision)->nTracks();++i) {
const xAOD::TrackParticle* trk = (*tauPrecision)->track(i);
const xAOD::TrackParticle* trk = (*tauPrecision)->track(i)->track();
ATH_MSG_DEBUG("track "<< i <<"-th: index "<< trk->index() << ", d0 " << trk->d0() << ", phi0 "<< trk->phi0() << ", theta " << trk->theta() << ", qOverP " << trk->qOverP());
}
}
......
......@@ -149,10 +149,11 @@ StatusCode HLTTauMonTool::trackCurves(const std::string & trigItem){
}
hist2("hreco_vs_pres_coreTracks")->Fill((*recoItr)->nTracks(), matchedTau->nTracks());
hist2("hreco_vs_pres_isoTracks")->Fill( (*recoItr)->nWideTracks(), (*recoItr)->nWideTracks() );
hist2("hreco_vs_pres_isoTracks")->Fill( (*recoItr)->nTracksIsolation(),
(*recoItr)->nTracksIsolation() );
for (unsigned int recoTrack = 0; recoTrack < (*recoItr)->nTracks(); ++recoTrack){
const xAOD::TrackParticle* recotau_trk = (*recoItr)->track(recoTrack);
const xAOD::TrackParticle* recotau_trk = (*recoItr)->track(recoTrack)->track();
float recotau_trk_pt = recotau_trk->pt()/1000.;
float recotau_trk_eta = recotau_trk->eta();
float recotau_trk_phi = recotau_trk->phi();
......@@ -172,7 +173,7 @@ StatusCode HLTTauMonTool::trackCurves(const std::string & trigItem){
const xAOD::TrackParticle* pstau_trk_clos = 0;
for (unsigned int i = 0; i < matchedTau->nTracks(); ++i){
const xAOD::TrackParticle* pstau_trk = matchedTau->track(i);
const xAOD::TrackParticle* pstau_trk = matchedTau->track(i)->track();
double dRtracks = deltaR (pstau_trk->eta(), recotau_trk_eta, pstau_trk->phi(), recotau_trk_phi);
if (dRtracks < dRtracksmin) {
dRtracksmin = dRtracks;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment