From 6504115973d3bb8dc62715172c4649ea705c7aa5 Mon Sep 17 00:00:00 2001 From: Harry Simpson Date: Sat, 21 May 2022 00:13:45 +0200 Subject: [PATCH] Migration of offline to new TagNProbe class + updating TnP chains / art tests --- .../T_AnalysisConfigMT_Tier0.h | 6 +- .../T_AnalysisConfigR3_Tier0.h | 8 +- .../src/TrigR3Mon.cxx | 8 +- .../src/TrigTestBase.cxx | 7 +- .../Analysis/src/ConfAnalysis.cxx | 24 +- .../Analysis/src/ConfAnalysis.h | 31 +- .../Analysis/src/rmain.cxx | 1226 ++++++++--------- .../share/TIDAdata-chains-run3.dat | 9 + .../share/TIDAdata-run3-TnP.dat | 42 - .../share/TIDAdata-run3-offline-TnP.dat | 38 - .../share/TIDAhisto-panel-TnP.dat | 12 +- .../TrigInDetAnalysisUtils/TagNProbe.h | 277 ++-- .../TrigInDetAnalysisUtils/TagNProbe2.h | 183 --- .../TrigInDetAnalysisUtils/src/TagNProbe.cxx | 405 +----- .../TrigInDetAnalysisUtils/src/TagNProbe2.cxx | 51 - .../python/TIDAMonitoring.py | 12 +- .../python/TrigIDtrkMonitoringConfig.py | 17 +- .../python/TrigInDetArtSteps.py | 4 +- .../TrigInDetValidation_AODtoTrkNtuple.py | 11 +- .../TrigInDetValidation/share/comparitor.json | 8 +- .../test/test_trigID_el_zee_pu40_TnP.py | 12 +- .../test/test_trigID_el_zee_tier0_pu40_TnP.py | 4 +- 22 files changed, 835 insertions(+), 1560 deletions(-) delete mode 100755 Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat delete mode 100755 Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat delete mode 100644 Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h delete mode 100644 Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h index 42fa8239f33..cd4dd0361af 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/Analysis_Tier0.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" @@ -106,7 +106,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -1362,7 +1362,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool; + TagNProbe* m_TnP_tool; TH1F* m_invmass; TH1F* m_invmass_obj; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h index f52eceb263b..0976472eead 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" #include "TrigInDetAnalysisExample/VtxAnalysis.h" @@ -110,7 +110,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -229,7 +229,7 @@ protected: virtual void loop() { - const TagNProbe2* pTnP_tool = m_TnP_tool; + const TagNProbe* pTnP_tool = m_TnP_tool; if( m_provider->msg().level() <= MSG::VERBOSE) { m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::loop() for " << T_AnalysisConfig::m_analysisInstanceName << endmsg; @@ -1256,7 +1256,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool ; + TagNProbe* m_TnP_tool ; bool m_tnp_flag; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx index c48e38d30d7..3313d712b3d 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx @@ -13,7 +13,7 @@ #include "TrigInDetAnalysisUtils/Filters.h" #include "TrigInDetAnalysisUtils/Filter_Track.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" // #include "AthenaMonitoring/AthenaMonManager.h" // #include "AthenaMonitoring/ManagedMonitorToolTest.h" @@ -385,7 +385,7 @@ StatusCode TrigR3Mon::bookHistograms() { ChainString probe = m_chainNames[i] ; - TagNProbe2* tnp = 0; + TagNProbe* tnp = 0; if ( probe.extra().find("probe")!=std::string::npos ) { @@ -407,8 +407,8 @@ StatusCode TrigR3Mon::bookHistograms() { double massMin = 40; double massMax = 150; - if ( m_mcTruth ) tnp = new TagNProbe2( "Truth", massMin, massMax ); - else tnp = new TagNProbe2( "Offline", massMin, massMax ); + if ( m_mcTruth ) tnp = new TagNProbe( "Truth", massMin, massMax ); + else tnp = new TagNProbe( "Offline", massMin, massMax ); tnp->tag(tag) ; tnp->probe(probe) ; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx index 142170f760d..661c22cd89b 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx @@ -380,7 +380,7 @@ StatusCode TrigTestBase::book(bool newEventsBlock, bool newLumiBlock, bool newRu // tag and probe object creation for (unsigned i=0; itag(tag); tnp->probe(probe); ATH_MSG_DEBUG( "Tag and probe pair found: " + tag + " : " + probe ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx index 6581db1df25..b473a1ff664 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx @@ -65,6 +65,8 @@ void ConfAnalysis::initialise() { void ConfAnalysis::initialiseInternal() { + if ( m_initialised ) return; + m_initialised = true; // std::cout << "ConfAnalysis::initialise() " << name() << std::endl; @@ -314,6 +316,14 @@ void ConfAnalysis::initialiseInternal() { addHistogram( new TH1F( "roi_dphi", "roi_dphi", 50, -1, 1 ) ); addHistogram( new TH1F( "roi_dR", "roi_dR", 50, 0, 1 ) ); + // tag and probe invariant mass histograms + if ( m_TnP_tool ) { + m_invmass = new TH1F( "invmass", "invariant mass;mass [GeV]", 320, 0, 200 ); + m_invmassObj = new TH1F( "invmassObj", "invariant mass;mass [GeV]", 320, 0, 200 ); + addHistogram( m_invmass ); + addHistogram( m_invmassObj ); + } + // efficiencies and purities eff_pt = new Efficiency( find("pT"), "pT_eff" ); eff_pt->Hist()->GetXaxis()->SetTitle("P_{T} [GeV]"); @@ -891,7 +901,6 @@ void ConfAnalysis::finalise() { if ( !m_initialised ) return; - std::cout << "ConfAnalysis::finalise() " << name(); if ( name().size()<19 ) std::cout << "\t"; @@ -899,6 +908,7 @@ void ConfAnalysis::finalise() { if ( name().size()<41 ) std::cout << "\t"; if ( name().size()<52 ) std::cout << "\t"; + std::cout << "\tNreco " << Nreco << "\tNref " << Nref << "\tNmatched " << Nmatched; @@ -918,7 +928,6 @@ void ConfAnalysis::finalise() { std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) hitr->second->Write(); - // std::cout << "DBG >" << eff_pt->Hist()->GetName() << "< DBG" << std::endl; // std::vector heff = { eff_pt, @@ -935,7 +944,7 @@ void ConfAnalysis::finalise() { eff_roi_deta, eff_roi_dphi, eff_roi_dR }; - + for ( unsigned i=0 ; ifinalise(); heff[i]->Bayes()->Write( ( heff[i]->name()+"_tg" ).c_str() ); @@ -943,7 +952,6 @@ void ConfAnalysis::finalise() { // std::cout << "DBG >" << purity_pt->Hist()->GetName() << "< DBG" << std::endl; - eff_vs_mult->finalise(); // Normalise(n_vtx_tracks); @@ -989,8 +997,6 @@ void ConfAnalysis::finalise() { mdeltaR_v_eta->Finalise(); mdeltaR_v_eta->Write(); mdeltaR_v_pt->Finalise(); mdeltaR_v_pt->Write(); - - for ( unsigned i=rDd0res.size() ; i-- ; ) { rDd0res[i]->Finalise(Resplot::FitNull95); rDd0res[i]->Write(); @@ -1174,10 +1180,10 @@ void ConfAnalysis::execute(const std::vector& reftracks, TrigObjectMatcher* objects ) { // leave this commented code in for debug purposes ... - // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; + // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; - if ( !m_initialised ) initialiseInternal(); - + if ( !m_initialised ) initialiseInternal(); + if ( m_print ) { std::cout << "ConfAnalysis::execute() \t " << name() << "\tref " << reftracks.size() diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h index 761d2178cb2..93a0daffea7 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h @@ -24,6 +24,7 @@ #include "TrigInDetAnalysis/TrigObjectMatcher.h" #include "TrigInDetAnalysisExample/ChainString.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "Resplot.h" @@ -50,23 +51,26 @@ class ConfAnalysis : public TrackAnalysis { public: - ConfAnalysis( const std::string& name, const ChainString& config ) : + ConfAnalysis( const std::string& name, const ChainString& config, TagNProbe* TnP_tool=0 ) : TrackAnalysis( clean(name) ), mconfig(config), Nreco(0), Nref(0), Nmatched(0), m_print(false), m_roi(0), m_initialised(false), m_initialiseFirstEvent(false) { // , m_lfirst(true) { std::cout << "ConfAnalysis::ConfAnalysis() " << TrackAnalysis::name() << " ..." << std::endl; - } - + setTnPtool( TnP_tool ); + } + ~ConfAnalysis() { // std::cout << "ConfAnalysis::~ConfAnalysis() " << name() << std::endl; std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) delete hitr->second; - //2D histograms + //2D histograms std::map::iterator hitr2D=m_histos2D.begin(); - std::map::iterator hend2D=m_histos2D.end(); + std::map::iterator hend2D=m_histos2D.end(); for ( ; hitr2D!=hend2D ; hitr2D++ ) delete hitr2D->second; + // tag and probe object + if ( m_TnP_tool ) delete m_TnP_tool; } virtual void initialise(); @@ -108,6 +112,16 @@ public: const ChainString& config() const { return mconfig; } + // methods for tag and probe invariant mass plots + + void setTnPtool(TagNProbe* TnP_tool) { m_TnP_tool = TnP_tool; } + + virtual TagNProbe* getTnPtool() { return m_TnP_tool; } + + virtual TH1F* getHist_invmass() { return m_invmass; } + + virtual TH1F* getHist_invmassObj() { return m_invmassObj; } + private: void addHistogram( TH1F* h ) { @@ -140,6 +154,13 @@ private: std::map m_histos; std::map m_histos2D; + // tag and probe invariant mass histograms + TH1F* m_invmass = 0; + TH1F* m_invmassObj = 0; + + // tag and probe object + TagNProbe* m_TnP_tool; + Efficiency* eff_pt = 0; Efficiency* eff_ptp = 0; Efficiency* eff_ptm = 0; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx index ce84ce93cc4..1e50423d712 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx @@ -386,6 +386,7 @@ bool SelectObjectETovPT(const TrackTrigObject& tobj, TIDA::Track* t=0) { int main(int argc, char** argv) { + signal( SIGABRT, handler ); signal( SIGFPE, handler ); signal( SIGILL, handler ); @@ -427,8 +428,6 @@ int main(int argc, char** argv) bool useoldrms = true; bool nofit = false; - bool doTnP = false; // added for tagNprobe - bool doTnP_histos = false; // added for tagNprobe std::string vertexSelection = ""; std::string vertexSelection_rec = ""; @@ -448,8 +447,6 @@ int main(int argc, char** argv) refChain = argv[i]; } else if ( std::string(argv[i])=="--rms" ) useoldrms = false; - else if ( std::string(argv[i])=="--tnp" ) doTnP = true; - else if ( std::string(argv[i])=="--tnph" ) doTnP_histos = true; else if ( std::string(argv[i])=="-n" || std::string(argv[i])=="--nofit" ) nofit = true; else if ( std::string(argv[i])=="-t" || std::string(argv[i])=="--testChain" ) { if ( ++i>=argc ) return usage(argv[0], -1); @@ -497,10 +494,10 @@ int main(int argc, char** argv) /// true by default - command line options sets to false /// so should override what is in the config file if ( useoldrms ) { - bool oldrms95 = true; - inputdata.declareProperty( "OldRMS95", oldrms95 ); - std::cout << "setting Resplot old rms95 " << oldrms95 << std::endl; - Resplot::setoldrms95( oldrms95 ); + bool oldrms95 = true; + inputdata.declareProperty( "OldRMS95", oldrms95 ); + std::cout << "setting Resplot old rms95 " << oldrms95 << std::endl; + Resplot::setoldrms95( oldrms95 ); } else { std::cout << "setting Resplot old rms95 " << useoldrms << std::endl; @@ -570,10 +567,6 @@ int main(int argc, char** argv) int ntracks = 0; - /// Zmass window cuts for Tag&Probe analysis - double ZmassMax = 110.; // GeV - double ZmassMin = 70.; // GeV - //bool printflag = false; // JK removed (unused) bool rotate_testtracks = false; @@ -647,10 +640,8 @@ int main(int argc, char** argv) if ( inputdata.isTagDefined("Rmatch") ) Rmatch = inputdata.GetValue("Rmatch"); /// set upper and lower Zmass window cuts from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("ZmassMax") ) ZmassMax = inputdata.GetValue("ZmassMax"); - if ( inputdata.isTagDefined("ZmassMin") ) ZmassMin = inputdata.GetValue("ZmassMin"); - /// set doTnP_histos flag from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("doTnPHistos") ) doTnP_histos = ( inputdata.GetValue("doTnPHistos")==0 ? false : true ); + //if ( inputdata.isTagDefined("ZmassMax") ) ZmassMax = inputdata.GetValue("ZmassMax"); + //if ( inputdata.isTagDefined("ZmassMin") ) ZmassMin = inputdata.GetValue("ZmassMin"); std::string useMatcher = "DeltaR"; if ( inputdata.isTagDefined("UseMatcher") ) useMatcher = inputdata.GetString("UseMatcher"); @@ -672,32 +663,6 @@ int main(int argc, char** argv) else if ( inputdata.isTagDefined("testChain") ) testChains.push_back( inputdata.GetString("testChain") ); } - /// get the tag and probe chains for Tag&Probe analysis - - TagNProbe* TnP_tool = 0; // declare T&P tool as null pointer - - if ( inputdata.isTagDefined("TagnProbe") ) { - - /// The TagnProbe chain name vector is stuctured in pairs - /// Each pair has the strucure: tag chain - probe chain - - TnP_tool = new TagNProbe(); // initialise T&P tool - - testChains.clear(); // delete the old testChain vector - - /// get the Tag&Probe chain name vector - std::vector tnpChains = inputdata.GetStringVector("TagnProbe"); - - TnP_tool->FillMap( tnpChains ); // fill tag/probe chains map for bookkeeping - - doTnP = TnP_tool->isTnP(); // set the T&P flag - if ( !doTnP ) doTnP_histos = false; // set this flag to false if doTnP is false - - testChains = TnP_tool->GetProbeChainNames(); // replace testChains - - } - - /// new code - can extract vtx name, pt, any extra options that we want, /// but also chop off everythiung after :post @@ -1126,12 +1091,54 @@ int main(int argc, char** argv) chainnames.push_back(chainname); + // tag and probe object creation and configuration + TagNProbe* TnP_tool = 0; + ChainString probe = chainConfig[i]; + + if ( probe.extra().find("_tag")!=std::string::npos ) continue; + + // probe can be the .head() so convert m_chainNames to a ChainString and search the .extra() specifically + size_t p = probe.extra().find("_probe"); + + if ( p!=std::string::npos ) { + + std::string probe_key = probe.extra().erase( p, 6) ; + + for ( unsigned j=0 ; jtag(tag); + TnP_tool->probe(probe); + std::cout << "Tag and probe pair found! \nTag : " << tag << "\nProbe: " << probe <initialiseFirstEvent(initialiseFirstEvent); analy_conf->initialise(); @@ -1166,13 +1173,21 @@ int main(int argc, char** argv) std::cout << "\tchainconfig: " << ik << "\tkey " << chainConfig[i].keys()[ik] << " " << chainConfig[i].values()[ik] << std::endl; } } - // for (unsigned int ic=0 ; ic::value_type( chainname, analy_conf ) ); + analyses.push_back(analy_conf); + } + else { + std::cerr << "WARNING: Duplicated chain" + << "\n" + << "---------------------------------" + << "---------------------------------" + << "---------------------------------" << std::endl; + continue; + } std::cout << "analysis: " << chainname << "\t" << analy_conf << "\n" @@ -1189,10 +1204,6 @@ int main(int argc, char** argv) analysis[chainnames[0]+"-purity"] = analp; analyses.push_back(analp); } - - /// filling map for Tag&Probe invariant mass histograms - if ( doTnP_histos ) TnP_tool->BookMinvHisto( chainname ); - } std::cout << "main() finished looping" << std::endl; @@ -1238,15 +1249,11 @@ int main(int argc, char** argv) size_t roimult = 1; if ( inputdata.isTagDefined( "FilterRoi" ) ) { - filterRoi = true; - std::vector filter_values = inputdata.GetVector( "FilterRoi" ); - if ( filter_values.size()>0 ) roieta = filter_values[0]; if ( filter_values.size()>1 ) roicomposite = ( filter_values[1]==0 ? false : true ); if ( filter_values.size()>2 ) roimult = int(filter_values[2]+0.5); - } RoiFilter roiFilter( roieta, roicomposite, roimult ); @@ -1310,8 +1317,7 @@ int main(int argc, char** argv) truth_matcher = new Associator_BestDeltaRMatcher("deltaR_truth", Rmatch); } } - - + // NtupleTrackSelector roiTracks( refFilter ); @@ -1324,7 +1330,6 @@ int main(int argc, char** argv) std::vector filenames; - if ( inputdata.isTagDefined("DataSets") ) { std::cout << "fetching dataset details" << std::endl; @@ -1343,7 +1348,6 @@ int main(int argc, char** argv) return (-1); } - /// copy the release data to the output file // TString* releaseMetaData = 0; @@ -1363,7 +1367,6 @@ int main(int argc, char** argv) TFile* finput = TFile::Open( filenames[i].c_str() ); - if ( finput==0 || !finput->IsOpen() || finput->IsZombie() ) { std::cerr << "Error: could not open input file: " << filenames[i] << std::endl; exit(-1); @@ -1414,28 +1417,21 @@ int main(int argc, char** argv) delete dataTree; } } - } // foutput.Write(); // foutput.Close(); // exit(0); - - - + int addedfiles = 0; - - unsigned _Nentries = 0; if ( inputdata.isTagDefined("Nentries") ) { _Nentries = unsigned(inputdata.GetValue("Nentries")); } - - unsigned Nentries = 0; //data->GetEntries(); unsigned event_counter = 0; @@ -1497,8 +1493,6 @@ int main(int argc, char** argv) // return (-1); // } - - /// so we can specify the number of entries /// we like, rather than run on all of them @@ -1520,752 +1514,721 @@ int main(int argc, char** argv) /// we like, rather than run on all of them for (unsigned int i=0; skip && run && iGetEntry(i); + + data->GetEntry(i); - // if (i==0) { - // std::cout << "TrkNtuple generated with: " << *releaseMetaData << std::endl;//Only necessary for first event - // } + // if (i==0) { + // std::cout << "TrkNtuple generated with: " << *releaseMetaData << std::endl;//Only necessary for first event + // } - // if ( r!=h->run_number() ) std::cout <<* h << std::endl; - - r = track_ev->run_number(); - ev = track_ev->event_number(); - lb = track_ev->lumi_block(); - ts = track_ev->time_stamp(); - - int event = track_ev->event_number(); - //int bc = track_ev->bunch_crossing_id(); + // if ( r!=h->run_number() ) std::cout <<* h << std::endl; + r = track_ev->run_number(); + ev = track_ev->event_number(); + lb = track_ev->lumi_block(); + ts = track_ev->time_stamp(); - hipt = false; + int event = track_ev->event_number(); + //int bc = track_ev->bunch_crossing_id(); + hipt = false; + + bool ingrl = goodrunslist.inRange( r, lb ); - - bool ingrl = goodrunslist.inRange( r, lb ); - - pregrl_events++; + pregrl_events++; - /// check whether in good lumi block range - if ( !ingrl ) continue; + /// check whether in good lumi block range + if ( !ingrl ) continue; - grl_counter++; + grl_counter++; - /// check whether it's in the event selector list - if ( event_selector_flag && !es.in( event ) ) continue; + /// check whether it's in the event selector list + if ( event_selector_flag && !es.in( event ) ) continue; - if ( mintime>ts ) mintime = ts; - if ( maxtimets ) mintime = ts; + if ( maxtime0 && event_counter>_Nentries ) { - run = false; - std::cout << "breaking out " << run << std::endl; - break; - } + if ( _Nentries>0 && event_counter>_Nentries ) { + run = false; + std::cout << "breaking out " << run << std::endl; + break; + } - event_counter++; - Nentries++; + event_counter++; + Nentries++; - // if ( !elist.find(event) ) continue; + // if ( !elist.find(event) ) continue; - // std::cout << "run " << r << "\tevent " << event << "\tlb " << lb << std::endl; + // std::cout << "run " << r << "\tevent " << event << "\tlb " << lb << std::endl; - hevent->Fill( event ); + hevent->Fill( event ); - if ( filenames.size()<2 ) { - if ( (cNentries<10) || i%(cNentries/10)==0 || i%1000==0 || debugPrintout ) { - std::cout << "run " << track_ev->run_number() - << "\tevent " << track_ev->event_number() - << "\tlb " << track_ev->lumi_block() - << "\tchains " << track_ev->chains().size() - << "\ttime " << track_ev->time_stamp(); - std::cout << "\t : processed " << i << " events so far (" << int((1000*i)/cNentries)*0.1 << "%)\t" << time_str() << std::endl; - // std::cerr << "\tprocessed " << i << " events so far \t" << time_str() << std::endl; - } - } - else if ( newfile ) { + if ( filenames.size()<2 ) { + if ( (cNentries<10) || i%(cNentries/10)==0 || i%1000==0 || debugPrintout ) { + std::cout << "run " << track_ev->run_number() + << "\tevent " << track_ev->event_number() + << "\tlb " << track_ev->lumi_block() + << "\tchains " << track_ev->chains().size() + << "\ttime " << track_ev->time_stamp(); + std::cout << "\t : processed " << i << " events so far (" << int((1000*i)/cNentries)*0.1 << "%)\t" << time_str() << std::endl; + // std::cerr << "\tprocessed " << i << " events so far \t" << time_str() << std::endl; + } + } + else if ( newfile ) { - int pfiles = filenames.size(); - if ( nfiles>0 ) pfiles = nfiles; + int pfiles = filenames.size(); + if ( nfiles>0 ) pfiles = nfiles; - std::cout << "file entries=" << data->GetEntries(); + std::cout << "file entries=" << data->GetEntries(); - if ( data->GetEntries()<100 ) std::cout << " "; - if ( data->GetEntries()<1000 ) std::cout << " "; - if ( data->GetEntries()<10000 ) std::cout << " "; + if ( data->GetEntries()<100 ) std::cout << " "; + if ( data->GetEntries()<1000 ) std::cout << " "; + if ( data->GetEntries()<10000 ) std::cout << " "; - std::cout << "\t"; + std::cout << "\t"; - std::cout << "run " << track_ev->run_number() - << "\tevent " << track_ev->event_number() - << "\tlb " << track_ev->lumi_block() - << "\tchains " << track_ev->chains().size() - << "\ttime " << track_ev->time_stamp(); + std::cout << "run " << track_ev->run_number() + << "\tevent " << track_ev->event_number() + << "\tlb " << track_ev->lumi_block() + << "\tchains " << track_ev->chains().size() + << "\ttime " << track_ev->time_stamp(); - std::cout << "\t : processed " << ifile << " files so far (" << int((1e3*ifile)/pfiles)*0.1 << "%)\t" << time_str() << std::endl; - - newfile = false; - } + std::cout << "\t : processed " << ifile << " files so far (" << int((1e3*ifile)/pfiles)*0.1 << "%)\t" << time_str() << std::endl; + newfile = false; + } - // if ( printflag ) std::cout << *track_ev << std::endl; + // if ( printflag ) std::cout << *track_ev << std::endl; - r = track_ev->run_number(); - - /// get the reference tracks (or perhaps even the true tracks !!! + r = track_ev->run_number(); - offTracks.clear(); - refTracks.clear(); - truthTracks.clear(); - refPurityTracks.clear(); - // offlineTracks.clear(); + /// get the reference tracks (or perhaps even the true tracks !!! + offTracks.clear(); + refTracks.clear(); + truthTracks.clear(); + refPurityTracks.clear(); + // offlineTracks.clear(); - Nvtxtracks = 0; + Nvtxtracks = 0; - const std::vector& chains = track_ev->chains(); + const std::vector& chains = track_ev->chains(); - dynamic_cast(truthFilter)->setRoi(0); - //// get the truth tracks if required - if ( truthMatch ) { - for (unsigned int ic=0 ; ic(truthFilter)->setRoi(0); + //// get the truth tracks if required + if ( truthMatch ) { + for (unsigned int ic=0 ; ic vertices; // keep for now as needed for line 1709 + std::vector vertices; // keep for now as needed for line 1709 - // const std::vector& mv = track_ev->vertices(); + // const std::vector& mv = track_ev->vertices(); - const TIDA::Chain* vtxchain = track_ev->chain(vertex_refname); + const TIDA::Chain* vtxchain = track_ev->chain(vertex_refname); - if ( vtxchain && vtxchain->size()>0 ) { + if ( vtxchain && vtxchain->size()>0 ) { - const std::vector& mv = vtxchain->at(0).vertices(); + const std::vector& mv = vtxchain->at(0).vertices(); - int selectvtx = -1; - double selection = 0; + int selectvtx = -1; + double selection = 0; - // std::vector& vertices = vertices; - if ( debugPrintout ) std::cout << "vertices:\n" << mv << std::endl; + // std::vector& vertices = vertices; + if ( debugPrintout ) std::cout << "vertices:\n" << mv << std::endl; - if ( bestPTVtx || bestPT2Vtx ) { - for ( size_t iv=0 ; ivpT()); - else if ( bestPT2Vtx ) selection_ += std::fabs(tr->pT())*std::fabs(tr->pT()); - } - if( selection_>selection ) { - selection = selection_; - selectvtx = iv; - } - } - if ( selectvtx!=-1 ) { - vertices.push_back( mv[selectvtx] ); - } - } - else if ( vtxind>=0 ) { - if ( size_t(vtxind)pT()); + else if ( bestPT2Vtx ) selection_ += std::fabs(tr->pT())*std::fabs(tr->pT()); + } + if( selection_>selection ) { + selection = selection_; + selectvtx = iv; + } + } + if ( selectvtx!=-1 ) { + vertices.push_back( mv[selectvtx] ); + } + } + else if ( vtxind>=0 ) { + if ( size_t(vtxind)0 ) std::cout << "vertex " << vertices[0] << std::endl; - // else std::cout << "NO vertex !!!" << std::endl; + // if ( vertices.size()>0 ) std::cout << "vertex " << vertices[0] << std::endl; + // else std::cout << "NO vertex !!!" << std::endl; - /// always push back the vector - if required there will be only one vertex on it - filter_vertex.setVertex( vertices ); + /// always push back the vector - if required there will be only one vertex on it + filter_vertex.setVertex( vertices ); - /// calculate number of "vertex tracks" + /// calculate number of "vertex tracks" - NvtxCount = 0; + NvtxCount = 0; - for ( unsigned iv=0 ; ivNVtxTrackCut ) { /// do we really want this cut ??? - Nvtxtracks += Ntracks; - // vertices.push_back( mv[iv] ); - NvtxCount++; - } + for ( unsigned iv=0 ; ivNVtxTrackCut ) { /// do we really want this cut ??? + Nvtxtracks += Ntracks; + // vertices.push_back( mv[iv] ); + NvtxCount++; + } + } } - } - // filter_vertex.setVertex( vvtx ) ; - hcorr->Fill( vertices.size(), Nvtxtracks ); + // filter_vertex.setVertex( vvtx ) ; + hcorr->Fill( vertices.size(), Nvtxtracks ); + dynamic_cast(refFilter)->setRoi(0); + /// get the tracks from the reference chain - shouldn't be one + /// of the test chains, since there will be a 1-to-1 mapping + /// but might be a useful check + bool foundReference = false; + const TIDA::Chain* refchain = 0; - dynamic_cast(refFilter)->setRoi(0); + TrigObjectMatcher tom; - /// get the tracks from the reference chain - shouldn't be one - /// of the test chains, since there will be a 1-to-1 mapping - /// but might be a useful check - bool foundReference = false; + for (unsigned int ic=0 ; ic0 ) { - tom = TrigObjectMatcher( &refTracks, chains[ic].rois()[0].objects(), SelectObjectETovPT ); - } - - break; + /// get objects if requested + if ( chains[ic].rois()[0].objects().size()>0 ) { + tom = TrigObjectMatcher( &refTracks, chains[ic].rois()[0].objects(), SelectObjectETovPT ); + } + break; + } } - } - if ( !foundReference ) continue; + if ( !foundReference ) continue; - if ( debugPrintout ) { - std::cout << "reference chain:\n" << *refchain << std::endl; - } - - /// configure the T&P tool for this event, if doTnP = true - if ( doTnP ) { - TnP_tool->ResetEventConfiguration(); /// reset the TnP_tool for this event - - /// do the event-by-event configuration - TnP_tool->SetEventConfiguration( - &refTracks, refFilter, // offline tracks and filter - refChain, // offline chain name - &tom, // trigger object matcher - ZmassMin, ZmassMax ); // set the Zmass range - } - - for ( unsigned ic=0 ; icchains().size() ; ic++ ) { - - TIDA::Chain& chain = track_ev->chains()[ic]; - - // std::cout << ic << " chain " << chain.name() << " size " << chain.size() << std::endl; - - /// find the analysis for this chain - is there a matching analysis? - std::map::iterator analitr = analysis.find(chain.name()); - - /// if no matching analysis then continue - - if ( analitr==analysis.end() ) continue; - - if ( debugPrintout ) { - std::cout << "test chain:\n" << chain << std::endl; + std::cout << "reference chain:\n" << *refchain << std::endl; } - - std::vector rois; /// these are the rois to process - - if ( doTnP ) { - /// if doTnP = true, do the T&P selection and get the vector of RoIs - rois = TnP_tool->GetRois( &chain, track_ev->chains() ); - - /// now the TnP_tool object contains all the info on the good probes that have been found - /// including, for each one of them, the invariant mass(es) calculated with the - /// corresponding tag(s). One can access to these info at any time in the following lines - } - else { - /// if doTnP==false, do std analysis and fill the rois vector from chain - rois.reserve( chain.size() ); - for ( size_t ir=0 ; irchains().size() ; ic++ ) { + + TIDA::Chain& chain = track_ev->chains()[ic]; + + /// find the analysis for this chain - is there a matching analysis? + std::map::iterator analitr = analysis.begin(); + while (analitr != analysis.end()) { + std::string analy_chain = analitr->first; // chain stored as a string in analysis map + if ( analy_chain == chain.name() ) break; + ++analitr; + } + /// if no matching analysis then continue + if ( analitr == analysis.end() ) continue ; + + ConfAnalysis* cf = dynamic_cast(analitr->second); + + std::vector rois; /// these are the rois to process + + if ( debugPrintout ) { + std::cout << "test chain:\n" << chain << std::endl; + } + + // tag and probe object retreival and filling of the roi vector + TagNProbe* TnP_tool = cf->getTnPtool(); + if ( TnP_tool ) { + foutdir->cd(); + cf->initialiseInternal(); // changes to output directory and books the invariant mass histograms + TH1F* m_invmass = cf->getHist_invmass(); + TH1F* m_invmass_obj = cf->getHist_invmassObj(); + rois = TnP_tool->GetRois( track_ev->chains(), &refTracks, refFilter, m_invmass, m_invmass_obj ); + } + else { + // if not a tnp analysis then fill rois in the normal way + rois.reserve( chain.size() ); + for ( size_t ir=0 ; irFillMinvHisto( chain.name(), ir ); - } + /// get the rois and filter on them if required + //TIDA::Roi& troi = chain.rois()[ir]; + TIDA::Roi& troi = *rois[ir]; // changed for tagNprobe + TIDARoiDescriptor roi( troi.roi() ); - testTracks.clear(); + testTracks.clear(); - testTracks.selectTracks( troi.tracks() ); + testTracks.selectTracks( troi.tracks() ); - /// trigger tracks already restricted by roi - so no roi filtering required - std::vector testp = testTracks.tracks(); + /// trigger tracks already restricted by roi - so no roi filtering required + std::vector testp = testTracks.tracks(); - /// do we want to filter on the RoI properties? - /// If so, if the RoI fails the cuts, then skip this roi + /// do we want to filter on the RoI properties? + /// If so, if the RoI fails the cuts, then skip this roi - if ( filterRoi && !roiFilter.filter( roi ) ) continue; + if ( filterRoi && !roiFilter.filter( roi ) ) continue; - /// select the test sample (trigger) vertices - const std::vector& mvt = troi.vertices(); + /// select the test sample (trigger) vertices + const std::vector& mvt = troi.vertices(); - std::vector vertices_test; + std::vector vertices_test; - int selectvtx = -1; - double selection = 0; + int selectvtx = -1; + double selection = 0; - if ( bestPTVtx_rec || bestPT2Vtx_rec ) { + if ( bestPTVtx_rec || bestPT2Vtx_rec ) { - // const std::vector& recTracks = troi.tracks(); + // const std::vector& recTracks = troi.tracks(); - for ( unsigned iv=0 ; ivpT()); - else if ( bestPT2Vtx ) selection_ += std::fabs(tr->pT())*std::fabs(tr->pT()); - } - if( selection_>selection){ - selection = selection_; - selectvtx = iv; - } - } - if ( selectvtx!=-1 ) { - TIDA::Vertex selected( mvt[selectvtx] ); - if ( useVertexTracks ) selected.selectTracks( testp ); - vertices_test.push_back(selected); - } - } - - else if ( vtxind_rec!=-1 ) { - if ( unsigned(vtxind_rec)pT()); + else if ( bestPT2Vtx ) selection_ += std::fabs(tr->pT())*std::fabs(tr->pT()); + } + if( selection_>selection){ + selection = selection_; + selectvtx = iv; + } + } + if ( selectvtx!=-1 ) { + TIDA::Vertex selected( mvt[selectvtx] ); + if ( useVertexTracks ) selected.selectTracks( testp ); + vertices_test.push_back(selected); + } + } + + else if ( vtxind_rec!=-1 ) { + if ( unsigned(vtxind_rec)& beamline = chain.rois()[ir].user(); - //beamline_test = chain.rois()[ir].user(); - beamline_test = rois[ir]->user(); // changed for tagNprobe + //extract beamline position values from rois + // const std::vector& beamline = chain.rois()[ir].user(); + //beamline_test = chain.rois()[ir].user(); + beamline_test = rois[ir]->user(); // changed for tagNprobe - // std::cout << "beamline: " << chain.name() << " " << beamline_test << std::endl; + // std::cout << "beamline: " << chain.name() << " " << beamline_test << std::endl; - //set values of track analysis to these so can access elsewhere - for ( size_t i=analyses.size() ; i-- ; ) { + //set values of track analysis to these so can access elsewhere + for ( size_t i=analyses.size() ; i-- ; ) { - TrackAnalysis* analy_track = analyses[i]; + TrackAnalysis* analy_track = analyses[i]; - if ( correctBeamlineTest ) { - if ( beamTest.size()==2 ) analy_track->setBeamTest( beamTest[0], beamTest[1] ); - // else if ( beamTest.size()==3 ) analy_track->setBeamTest( beamTest[0], beamTest[1], beamTest[2] ); - else { - if ( !inputdata.isTagDefined("BeamTest") ) { - if ( beamline_test.size()==2 ) analy_track->setBeamTest( beamline_test[0], beamline_test[1] ); - // else if ( beamline_test.size()==3 ) analy_track->setBeamTest( beamline_test[0], beamline_test[1], beamline_test[2] ); - } - } - } + if ( correctBeamlineTest ) { + if ( beamTest.size()==2 ) analy_track->setBeamTest( beamTest[0], beamTest[1] ); + // else if ( beamTest.size()==3 ) analy_track->setBeamTest( beamTest[0], beamTest[1], beamTest[2] ); + else { + if ( !inputdata.isTagDefined("BeamTest") ) { + if ( beamline_test.size()==2 ) analy_track->setBeamTest( beamline_test[0], beamline_test[1] ); + // else if ( beamline_test.size()==3 ) analy_track->setBeamTest( beamline_test[0], beamline_test[1], beamline_test[2] ); + } + } + } - if ( correctBeamlineRef ) { - if ( beamRef.size()==2 ) analy_track->setBeamRef( beamRef[0], beamRef[1] ); - // else if ( beamRef.size()==3 ) analy_track->setBeamRef( beamRef[0], beamRef[1], beamRef[2] ); - else { - if ( !inputdata.isTagDefined("BeamRef") ) { - if ( beamline_ref.size()==2 ) analy_track->setBeamRef( beamline_ref[0], beamline_ref[1] ); - // else if ( beamline_ref.size()==3 ) analy_track->setBeamRef( beamline_ref[0], beamline_ref[1], beamline_ref[2] ); - } - } - } + if ( correctBeamlineRef ) { + if ( beamRef.size()==2 ) analy_track->setBeamRef( beamRef[0], beamRef[1] ); + // else if ( beamRef.size()==3 ) analy_track->setBeamRef( beamRef[0], beamRef[1], beamRef[2] ); + else { + if ( !inputdata.isTagDefined("BeamRef") ) { + if ( beamline_ref.size()==2 ) analy_track->setBeamRef( beamline_ref[0], beamline_ref[1] ); + // else if ( beamline_ref.size()==3 ) analy_track->setBeamRef( beamline_ref[0], beamline_ref[1], beamline_ref[2] ); + } + } + } - } + } - /// here we set the roi for the filter so we can request only those tracks - /// inside the roi + /// here we set the roi for the filter so we can request only those tracks + /// inside the roi - TIDARoiDescriptor refRoi; + TIDARoiDescriptor refRoi; - if ( select_roi ) { + if ( select_roi ) { - bool customRefRoi_thisChain = false; + bool customRefRoi_thisChain = false; - if ( use_custom_ref_roi ) { // Ideally just want to say ( use_custom_ref_roi && (chain.name() in custRefRoi_chain]sist) ) - if ( customRoi_chains.size() ) { - if ( customRoi_chains.find( chain.name() )!=customRoi_chains.end() ) customRefRoi_thisChain = true; - } - else customRefRoi_thisChain = true; // Apply custom ref roi to all chains - } + if ( use_custom_ref_roi ) { // Ideally just want to say ( use_custom_ref_roi && (chain.name() in custRefRoi_chain]sist) ) + if ( customRoi_chains.size() ) { + if ( customRoi_chains.find( chain.name() )!=customRoi_chains.end() ) customRefRoi_thisChain = true; + } + else customRefRoi_thisChain = true; // Apply custom ref roi to all chains + } - if ( use_custom_ref_roi && customRefRoi_thisChain ) { - refRoi = makeCustomRefRoi( roi, custRefRoi_params[0], custRefRoi_params[1], custRefRoi_params[2] ); - } - else refRoi = roi; + if ( use_custom_ref_roi && customRefRoi_thisChain ) { + refRoi = makeCustomRefRoi( roi, custRefRoi_params[0], custRefRoi_params[1], custRefRoi_params[2] ); + } + else refRoi = roi; - dynamic_cast(refFilter)->setRoi(&refRoi); - } + dynamic_cast(refFilter)->setRoi(&refRoi); + } - // if ( debugPrintout ) { - // std::cout << "refTracks.size() " << refTracks.size() << " before roi filtering" << std::endl; - // std::cout << "filter with roi " << roi << std::endl; - // } + // if ( debugPrintout ) { + // std::cout << "refTracks.size() " << refTracks.size() << " before roi filtering" << std::endl; + // std::cout << "filter with roi " << roi << std::endl; + // } - // Now filterng ref tracks by refFilter, and performing any further filtering and selecting, - // before finally creating the const reference object refp + // Now filterng ref tracks by refFilter, and performing any further filtering and selecting, + // before finally creating the const reference object refp - std::vector refp_vec = refTracks.tracks( refFilter ); + std::vector refp_vec = refTracks.tracks( refFilter ); - // Selecting only truth matched reference tracks - if ( truthMatch ) { - /// get the truth particles ... - if ( select_roi ) dynamic_cast(truthFilter)->setRoi(&roi); - const std::vector& truth = truthTracks.tracks(truthFilter); - const std::vector& refp_tmp = refp_vec; + // Selecting only truth matched reference tracks + if ( truthMatch ) { + /// get the truth particles ... + if ( select_roi ) dynamic_cast(truthFilter)->setRoi(&roi); + const std::vector& truth = truthTracks.tracks(truthFilter); + const std::vector& refp_tmp = refp_vec; - /// truth_matcher match against current reference selection - truth_matcher->match( refp_tmp, truth ); + /// truth_matcher match against current reference selection + truth_matcher->match( refp_tmp, truth ); - std::vector refp_matched; + std::vector refp_matched; - /// which truth tracks have a matching reference track ? - for ( unsigned i=0 ; imatched( refp_vec[i] ) ) refp_matched.push_back( refp_vec[i] ); - } + /// which truth tracks have a matching reference track ? + for ( unsigned i=0 ; imatched( refp_vec[i] ) ) refp_matched.push_back( refp_vec[i] ); + } - refp_vec.clear(); - refp_vec = refp_matched; - } + refp_vec.clear(); + refp_vec = refp_matched; + } - // Choose the pT ordered refp tracks that have been asked for by the user - if ( use_pt_ordered_ref ) { - std::sort(refp_vec.begin(), refp_vec.end(), trackPtGrtr); // Should this sorting be done to a temporary copied object, instead of the object itself? + // Choose the pT ordered refp tracks that have been asked for by the user + if ( use_pt_ordered_ref ) { + std::sort(refp_vec.begin(), refp_vec.end(), trackPtGrtr); // Should this sorting be done to a temporary copied object, instead of the object itself? - int nRefTracks = refp_vec.size(); + int nRefTracks = refp_vec.size(); - std::vector refp_chosenPtOrd; + std::vector refp_chosenPtOrd; - // Checking if any user specifed track indices are out of bounds for this event - for (unsigned int indexIdx = 0; indexIdx < refPtOrd_indices.size(); ++indexIdx) { - if (refPtOrd_indices.at(indexIdx) > nRefTracks) { - std::cout << "WARNING: for event " << event << ", pT ordered reference track at vector position " << refPtOrd_indices.at(indexIdx) << " requested but not found" << std::endl; - } - } + // Checking if any user specifed track indices are out of bounds for this event + for (unsigned int indexIdx = 0; indexIdx < refPtOrd_indices.size(); ++indexIdx) { + if (refPtOrd_indices.at(indexIdx) > nRefTracks) { + std::cout << "WARNING: for event " << event << ", pT ordered reference track at vector position " << refPtOrd_indices.at(indexIdx) << " requested but not found" << std::endl; + } + } - for (int trackIdx = 0; trackIdx < nRefTracks; ++trackIdx) { - for (unsigned int indexIdx = 0; indexIdx < refPtOrd_indices.size(); ++indexIdx) { - if ( trackIdx == refPtOrd_indices.at(indexIdx) ) { - refp_chosenPtOrd.push_back(refp_vec.at(trackIdx)); - break; - } - } - } - - refp_vec.clear(); - refp_vec = refp_chosenPtOrd; // Note: not necessarily pT ordered. - // Ordered by order of indices the user has passed - // (which is ideally pT ordered e.g. 0, 1, 3) - } - - - /// remove any tracks below the pt threshold if one is specifed for the analysis - - ConfAnalysis* cf = dynamic_cast( analitr->second ); - - if ( cf ) { - std::string ptconfig = cf->config().postvalue("pt"); - if ( ptconfig!="" ) { - double pt = std::atof( ptconfig.c_str() ); - if ( pt>0 ) { - std::vector reft; reft.reserve(refp_vec.size()); - for ( std::vector::const_iterator itr=refp_vec.begin() ; itr!=refp_vec.end() ; itr++ ) { - if ( std::fabs((*itr)->pT())>=pt ) reft.push_back( *itr ); - } - refp_vec = reft; - } - } - } + for (int trackIdx = 0; trackIdx < nRefTracks; ++trackIdx) { + for (unsigned int indexIdx = 0; indexIdx < refPtOrd_indices.size(); ++indexIdx) { + if ( trackIdx == refPtOrd_indices.at(indexIdx) ) { + refp_chosenPtOrd.push_back(refp_vec.at(trackIdx)); + break; + } + } + } + + refp_vec.clear(); + refp_vec = refp_chosenPtOrd; // Note: not necessarily pT ordered. + // Ordered by order of indices the user has passed + // (which is ideally pT ordered e.g. 0, 1, 3) + } + + + /// remove any tracks below the pt threshold if one is specifed for the analysis + + if ( cf ) { + std::string ptconfig = cf->config().postvalue("pt"); + if ( ptconfig!="" ) { + double pt = std::atof( ptconfig.c_str() ); + if ( pt>0 ) { + std::vector reft; reft.reserve(refp_vec.size()); + for ( std::vector::const_iterator itr=refp_vec.begin() ; itr!=refp_vec.end() ; itr++ ) { + if ( std::fabs((*itr)->pT())>=pt ) reft.push_back( *itr ); + } + refp_vec = reft; + } + } + } - /// if requesting an object match, remove any tracks which correspond to an object - /// below the object PT threshold + /// if requesting an object match, remove any tracks which correspond to an object + /// below the object PT threshold - /// only bother is objects actual exists + /// only bother is objects actual exists - if ( tom.status() ) { + if ( tom.status() ) { - std::string objectET = cf->config().postvalue("ET"); + std::string objectET = cf->config().postvalue("ET"); - if ( objectET != "" ) { + if ( objectET != "" ) { - double ETconfig = std::atof( objectET.c_str() ); + double ETconfig = std::atof( objectET.c_str() ); - if ( ETconfig>0 ) { + if ( ETconfig>0 ) { - std::vector::iterator itr=refp_vec.begin() ; + std::vector::iterator itr=refp_vec.begin() ; - while ( itr!=refp_vec.end() ) { - const TrackTrigObject* tobj = tom.object( (*itr)->id() ); + while ( itr!=refp_vec.end() ) { + const TrackTrigObject* tobj = tom.object( (*itr)->id() ); - if ( tobj==0 || tobj->pt()pt()& refp = refp_vec; + const std::vector& refp = refp_vec; - // if ( debugPrintout ) { - // std::cout << "refp.size() " << refp.size() << " after roi filtering" << std::endl; - // } + // if ( debugPrintout ) { + // std::cout << "refp.size() " << refp.size() << " after roi filtering" << std::endl; + // } - // std::cout << "ref tracks refp.size() " << refp.size() << "\n" << refp << std::endl; - // std::cout << "test tracks testp.size() " << testp.size() << "\n" << testp << std::endl; + // std::cout << "ref tracks refp.size() " << refp.size() << "\n" << refp << std::endl; + // std::cout << "test tracks testp.size() " << testp.size() << "\n" << testp << std::endl; - groi = &roi; + groi = &roi; - /// now found all the tracks within the RoI - *now* if required find the - /// the count how many of these reference tracks are on each of the - /// offline vertices + /// now found all the tracks within the RoI - *now* if required find the + /// the count how many of these reference tracks are on each of the + /// offline vertices - // new vertex class containing tracks, offline - std::vector vertices_roi; + // new vertex class containing tracks, offline + std::vector vertices_roi; - /// do for all vertices now ... - // if ( chain.name().find("SuperRoi") ) { - { + /// do for all vertices now ... + // if ( chain.name().find("SuperRoi") ) { + { - /// select the reference offline vertices + /// select the reference offline vertices - vertices_roi.clear(); + vertices_roi.clear(); - const std::vector& mv = vertices; + const std::vector& mv = vertices; - // std::cout << "vertex filtering " << mv.size() << std::endl; + // std::cout << "vertex filtering " << mv.size() << std::endl; - for ( unsigned iv=0 ; ivzedMinus()<=vx.z() && roi[ir]->zedPlus()>=vx.z() ) accept_vertex = true; - } - } - else { - if ( roi.zedMinus()<=vx.z() && roi.zedPlus()>=vx.z() ) accept_vertex = true; - } + bool accept_vertex = false; + if ( roi.composite() ) { + for ( size_t ir=0 ; irzedMinus()<=vx.z() && roi[ir]->zedPlus()>=vx.z() ) accept_vertex = true; + } + } + else { + if ( roi.zedMinus()<=vx.z() && roi.zedPlus()>=vx.z() ) accept_vertex = true; + } - if ( !accept_vertex ) continue; + if ( !accept_vertex ) continue; - // std::cout << "\t" << iv << "\t" << vx << std::endl; - - int trackcount = 0; - - if ( useVertexTracks ) { - // refp contains roi filtered tracks, vx contains ids of tracks belonging to vertex - TIDA::Vertex vertex_roi( vx ); - vertex_roi.selectTracks( refp ); - trackcount = vertex_roi.Ntracks(); - if ( trackcount>=ntracks && trackcount>0 ) { - vertices_roi.push_back( vertex_roi ); - } - } - else { - // old track count method still in use? - for (unsigned itr=0; itreta())); - double dzsintheta = std::fabs( (vx.z()-tr->z0()) * std::sin(theta_) ); - if( dzsintheta < 1.5 ) trackcount++; - } - /// don't add vertices with no matching tracks - remember the - /// tracks are filtered by Roi already so some vertices may have - /// no tracks in the Roi - ntracks set to 0 by default - if ( trackcount>=ntracks && trackcount>0 ) { - const TIDA::Vertex& vertex_roi( vx ); - vertices_roi.push_back( vertex_roi ); - } - } - - } - } - // else vertices_roi = vertices; + // std::cout << "\t" << iv << "\t" << vx << std::endl; + + int trackcount = 0; + + if ( useVertexTracks ) { + // refp contains roi filtered tracks, vx contains ids of tracks belonging to vertex + TIDA::Vertex vertex_roi( vx ); + vertex_roi.selectTracks( refp ); + trackcount = vertex_roi.Ntracks(); + if ( trackcount>=ntracks && trackcount>0 ) { + vertices_roi.push_back( vertex_roi ); + } + } + else { + // old track count method still in use? + for (unsigned itr=0; itreta())); + double dzsintheta = std::fabs( (vx.z()-tr->z0()) * std::sin(theta_) ); + if( dzsintheta < 1.5 ) trackcount++; + } + /// don't add vertices with no matching tracks - remember the + /// tracks are filtered by Roi already so some vertices may have + /// no tracks in the Roi - ntracks set to 0 by default + if ( trackcount>=ntracks && trackcount>0 ) { + const TIDA::Vertex& vertex_roi( vx ); + vertices_roi.push_back( vertex_roi ); + } + } + + } + } + // else vertices_roi = vertices; - if ( rotate_testtracks ) for ( size_t i=testp.size() ; i-- ; ) testp[i]->rotate(); + if ( rotate_testtracks ) for ( size_t i=testp.size() ; i-- ; ) testp[i]->rotate(); - foutdir->cd(); + foutdir->cd(); - // do analysing + // do analysing - if ( monitorZBeam ) { - if ( beamline_ref.size()>2 && beamline_test.size()>2 ) { - refz.push_back( zpair( lb, beamline_ref[2]) ); - testz.push_back( zpair( lb, beamline_test[2]) ); - } - } + if ( monitorZBeam ) { + if ( beamline_ref.size()>2 && beamline_test.size()>2 ) { + refz.push_back( zpair( lb, beamline_ref[2]) ); + testz.push_back( zpair( lb, beamline_test[2]) ); + } + } - _matcher->match( refp, testp); - - if ( tom.status() ) analitr->second->execute( refp, testp, _matcher, &tom ); - else analitr->second->execute( refp, testp, _matcher ); + _matcher->match( refp, testp); - ConfVtxAnalysis* vtxanal = 0; - analitr->second->store().find( vtxanal, "rvtx" ); + if ( tom.status() ) analitr->second->execute( refp, testp, _matcher, &tom ); + else analitr->second->execute( refp, testp, _matcher ); - /// NB: because ntracks = 0 by default, this second clause should - /// always be true unless ntracks has been set to some value - if ( vtxanal && ( refp.size() >= size_t(ntracks) ) ) { + ConfVtxAnalysis* vtxanal = 0; + analitr->second->store().find( vtxanal, "rvtx" ); - /// AAAAAARGH!!! because you cannot cast vector to const vector - /// we first need to copy the actual elements from the const vector, to a normal - /// vector. This is because if we take the address of elements of a const vector - /// they will by of type const T*, so we can only add them to a vector - /// and all our functions are using const vector&, so we would need to duplicate - /// all the functions to allow over riding with vector *and* vector - /// to get this nonsense to work + /// NB: because ntracks = 0 by default, this second clause should + /// always be true unless ntracks has been set to some value + if ( vtxanal && ( refp.size() >= size_t(ntracks) ) ) { - /// so we now use a handy wrapper function to do the conversion for us ... + /// AAAAAARGH!!! because you cannot cast vector to const vector + /// we first need to copy the actual elements from the const vector, to a normal + /// vector. This is because if we take the address of elements of a const vector + /// they will by of type const T*, so we can only add them to a vector + /// and all our functions are using const vector&, so we would need to duplicate + /// all the functions to allow over riding with vector *and* vector + /// to get this nonsense to work - if ( vertices_roi.size()>0 ) vtxanal->execute( pointers(vertices_roi), pointers(vertices_test), track_ev ); + /// so we now use a handy wrapper function to do the conversion for us ... - } + if ( vertices_roi.size()>0 ) vtxanal->execute( pointers(vertices_roi), pointers(vertices_test), track_ev ); + + } - if ( debugPrintout ) { - // std::cout << "-----------------------------------\n\nselected tracks:" << chain.name() << std::endl; - std::cout << "\nselected tracks:" << chain.name() << std::endl; - std::cout << "ref tracks refp.size() " << refp.size() << "\n" << refp << std::endl; - std::cout << "test tracks testp.size() " << testp.size() << "\n" << testp << std::endl; + if ( debugPrintout ) { + // std::cout << "-----------------------------------\n\nselected tracks:" << chain.name() << std::endl; + std::cout << "\nselected tracks:" << chain.name() << std::endl; + std::cout << "ref tracks refp.size() " << refp.size() << "\n" << refp << std::endl; + std::cout << "test tracks testp.size() " << testp.size() << "\n" << testp << std::endl; - TrackAssociator::map_type::const_iterator titr = _matcher->TrackAssociator::matched().begin(); - TrackAssociator::map_type::const_iterator tend = _matcher->TrackAssociator::matched().end(); - int im=0; - std::cout << "track matches:\n"; - while (titr!=tend) { - std::cout << "\t" << im++ << "\t" << *titr->first << " ->\n\t\t" << *titr->second << std::endl; - ++titr; - } + TrackAssociator::map_type::const_iterator titr = _matcher->TrackAssociator::matched().begin(); + TrackAssociator::map_type::const_iterator tend = _matcher->TrackAssociator::matched().end(); + int im=0; + std::cout << "track matches:\n"; + while (titr!=tend) { + std::cout << "\t" << im++ << "\t" << *titr->first << " ->\n\t\t" << *titr->second << std::endl; + ++titr; + } - std::cout << "completed : " << chain.name() << "\n"; - std::cout << "-----------------------------------" << std::endl; + std::cout << "completed : " << chain.name() << "\n"; + std::cout << "-----------------------------------" << std::endl; - } + } #if 0 - if ( _matcher->size()size()chains()[ic] <chains()[ic].rois()[ir] << endl; - } + if ( refp.size()==1 && testp.size()==0 ) { + std::cout << track_ev->chains()[ic] <chains()[ic].rois()[ir] << endl; + } - } + } #endif - /// run the analysis for this chain + /// run the analysis for this chain - if ( doPurity ) { + if ( doPurity ) { - const std::vector& refpp = refPurityTracks.tracks( refFilter ); + const std::vector& refpp = refPurityTracks.tracks( refFilter ); - testPurityTracks.clear(); + testPurityTracks.clear(); - testPurityTracks.selectTracks( troi.tracks() ); - std::vector testpp = testPurityTracks.tracks(); + testPurityTracks.selectTracks( troi.tracks() ); + std::vector testpp = testPurityTracks.tracks(); - _matcher->match(refpp, testpp); /// ??? + _matcher->match(refpp, testpp); /// ??? - std::map::iterator analitrp = analysis.find(chain.name()+"-purity"); + std::map::iterator analitrp = analysis.find(chain.name()+"-purity"); - if ( analitrp == analysis.end() ) continue; + if ( analitrp == analysis.end() ) continue; - analitrp->second->execute( refpp, testpp, _matcher ); + analitrp->second->execute( refpp, testpp, _matcher ); - static int ecounter = 0; - ecounter++; - } - } // loop through rois - } // loop through chanines - } // loop through nentries + static int ecounter = 0; + ecounter++; + } + } // loop through rois + } // loop through chanines + } // loop through nentries - delete track_ev; - delete data; - delete finput; + delete track_ev; + delete data; + delete finput; - // std::cout << "run: " << run << std::endl; + // std::cout << "run: " << run << std::endl; } // loop through files @@ -2293,13 +2256,6 @@ int main(int argc, char** argv) delete analyses[i]; } - /// write out the histograms - if ( doTnP ) { - // saving Minv histos for Tag&Probe analysis if doTnP_histos = true - if ( doTnP_histos ) TnP_tool->WriteMinvHisto( foutdir ); - delete TnP_tool; // deleting T&P tool - } - foutput.Write(); foutput.Close(); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat index 9c15bd454c6..862bdb0204a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat @@ -58,6 +58,15 @@ testChains = { "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_FTF:HLT_Roi_FastElectron_LRT:0", "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_IDTrig:HLT_Roi_FastElectron_LRT:0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1", + "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso", diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat deleted file mode 100755 index 747a00e6958..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat +++ /dev/null @@ -1,42 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - - -refChain = "Truth"; -//refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - - -MinVertices = 0; - - -// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - - -InitialiseFirstEvent = 1; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"./"} - - -#include "TIDAbeam.dat" - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat deleted file mode 100755 index 64ce7e2cdd4..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat +++ /dev/null @@ -1,38 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts-offline.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - -//refChain = "Truth"; -refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - -MinVertices = 0; - -/// do not loadthe chains for the TnP analyses -/// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00363979.physics_Main.merge.AOD.f1002_m2037-20191004-141732_EXT0"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00358395.physics_Main.merge.AOD.f961_m2015-20191004-141716_EXT0"}; - -#include "TIDAbeam.dat" - - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat index 612d89ee58a..33c3049d418 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat @@ -1,6 +1,6 @@ // emacs: this is -*- c++ -*- -panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel, tnp_panel }; +panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel }; panel_columns = { eff_panel, 3 }; @@ -63,7 +63,10 @@ dist_panel = { "a0_rec", "a0 rec", "xaxis:lin:autosym:-3:3", "Trigger a_{0} [mm]", "yaxis:log:auton", "Normalised entries", "z0", "z0", "xaxis:lin:-200:200", "Reference z_{0} [mm]", "yaxis:log:auton", "Normalised entries", - "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries" + "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries", + + "invmass", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "Entries" , + "invmass_obj", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "Entries", }; @@ -96,8 +99,3 @@ trt_panel = { }; -tnp_panel = { - "Minv_TnP", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "" , - "Minv_obj_TnP", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h index 51f53e9eff6..d54e99c8fd9 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h @@ -2,221 +2,182 @@ /** ** @file TagNProbe.h ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #ifndef TIDAUTILS_TAGNPROBE_H #define TIDAUTILS_TAGNPROBE_H -#include +#include -#include "TLorentzVector.h" +#include "TrigInDetAnalysis/TIDAChain.h" +#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TrigInDetAnalysis/TrigObjectMatcher.h" +#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDAEvent.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/Filters.h" -#include "TrigInDetAnalysisUtils/Filter_Offline2017.h" -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TH1D.h" -#include -#include -#include - -#include "TrigInDetAnalysis/TrackAnalysis.h" -#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDDirectory.h" -#include "TrigInDetAnalysis/Efficiency.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TLorentzVector.h" class TagNProbe { public: - TagNProbe() { } - + TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); + virtual ~TagNProbe() { } + /// getters and setters - /// configuration methods - - void SetEventConfiguration( - TrackSelector * refTracks, // reference tracks - TrackFilter* refFilter, // reference filter - std::string refName, // reference objects name - TrigObjectMatcher* tom, // trigger object matcher - double ZmassMin, // ZmassMin - double ZmassMax, // ZmassMax - bool unique_flag=true ) { // unique flag (default=true) - m_refTracks = refTracks; - m_refFilter = refFilter; - m_particleType = refName; - m_tom = tom; - m_ZmassMin = ZmassMin; - m_ZmassMax = ZmassMax; - m_unique = unique_flag; - } - - void ResetEventConfiguration() { - m_refTracks = 0; - m_refFilter = 0; - m_particleType = ""; - m_tom = 0; - m_ZmassMin = 0.; - m_ZmassMax = 999.; - m_unique = false; - } - - void SetUniqueFlag( bool flag ) { m_unique = flag; } - - void SetParticleType( std::string type ) { m_particleType = type; } - - void SetZmassWindow( double ZmassMin, double ZmassMax ) { m_ZmassMin = ZmassMin; m_ZmassMax = ZmassMax; } - - void SetObjMatcher( TrigObjectMatcher* tom ) { m_tom = tom; } - - void SetOfflineTracks( TrackSelector * refTracks, TrackFilter* refFilter ) { - m_refTracks = refTracks; - m_refFilter = refFilter; - } - - void SetChains( TIDA::Chain * chain, TIDA::Chain * chain_tnp ) { - m_chain = chain; - m_chain_tnp = chain_tnp; - } - - template - void Fill( T* h, T* h1, int i ) { - /// don't need to check both these, we can just call this as many times as we like, - /// could pass in the vector even so that - // we leave the old code in, but commented, since we are still developing, so once - // we know everything is working we can delete all the older code - // if ( m_masses[i].size() == m_masses_obj[i].size() && m_masses[i].size() > 0 ) { - - /// don't understand this - why is this method filling lots of masses - /// from an vector of masses from 0 up to the input index ? - /// isn't this index just the index of the roi ? Why the loop ? - for ( size_t im=0 ; imFill( m_masses[i].at(im) ); - } - for ( size_t im=0 ; imFill( m_masses_obj[i].at(im) ); - } - } - - - /// probe searching method - - bool FindProbes(); - - void FindTIDAChains( std::vector& chains ) ; - - /// getter methods + /// could be moved to the constructor now ... + void tag( const std::string& chainName ) { m_tagChainName = chainName; } + void probe( const std::string& chainName ) { m_probeChainName = chainName; } - std::vector GetProbes() { return m_probes; } + const std::string& tag() const { return m_tagChainName; } + const std::string& probe() const { return m_probeChainName; } - std::vector GetTags( unsigned int probe_index=0 ) { return m_tags[ probe_index ]; } - - std::vector GetInvMasses( unsigned int probe_index=0 ) { return m_masses[ probe_index ]; } - - std::vector GetInvMasses_obj( unsigned int probe_index=0 ) { return m_masses_obj[ probe_index ]; } - - std::vector GetRois( TIDA::Chain * chain, std::vector& chains ); - - std::vector GetRois( std::vector& chains ); - - void tag( const std::string& chainName ) { m_tagChainName = chainName ; } - - const std::string& tag() { return m_tagChainName ; } - - void probe( const std::string& chainName ) { m_probeChainName = chainName ; } - - const std::string& probe() { return m_probeChainName ; } +public: - TIDA::Chain* GetTIDAProbe() { return m_chain_tnp ; } + template + std::vector GetRois( std::vector& chains, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0 ) const { - TIDA::Chain* GetTIDATag() { return m_chain ; } + std::vector probes; - TH1D* GetMinvHisto() { return m_hMinv ; } + TIDA::Chain* chain_tag = findChain( tag(), chains ); + TIDA::Chain* chain_probe = findChain( probe(), chains ); - TH1D* GetMinvObjHisto() { return m_hMinv_obj ; } + if ( chain_tag==0 || chain_probe==0 ) return probes; + // loop for possible probes + for ( size_t ip=0 ; ipsize() ; ip++ ) { + + TIDA::Roi& proi = chain_probe->rois()[ip]; + + TIDARoiDescriptor roi_probe( proi.roi() ); + + bool found_tnp = false; + + // loop for possible tags + for ( size_t it=0 ; itsize() ; it++ ) { + + TIDA::Roi& troi = chain_tag->rois()[it]; + TIDARoiDescriptor roi_tag( troi.roi() ); + + /// tag and probe are the same: skip this tag + if ( roi_probe == roi_tag ) continue; + + if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { + found_tnp = true; + if ( m_unique ) break; + } + + } // end loop on tags + + if ( found_tnp ) probes.push_back( &proi ); + + } // end loop on probes + + return probes; + + } - /// utility methods +protected: - void FillMap( std::vector& tnpChains ); + double pt( const TIDA::Track* t ) const { return t->pT(); } + double pt( const TrackTrigObject* t ) const { return t->pt(); } - std::vector GetProbeChainNames() { return m_probe_chain_names; } - - bool isTnP() { return m_tnp_map.size()>0; } - - TIDA::Chain* GetTagChain( std::string probe_name, std::vector& chains ); + template + double mass( const T* t1, const T* t2 ) const { + TLorentzVector v1; + v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); + TLorentzVector v2; + v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); + return (v1+v2).M(); + } - void BookMinvHisto( std::string chain_name ); - void BookMinvHisto(); + template + bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0) const { + + /// get reference tracks from the tag roi + TIDARoiDescriptor roi_tag( troi.roi() ); - void FillMinvHisto( std::string chain_name, unsigned int probe_index ); + dynamic_cast(refFilter)->setRoi( &roi_tag ); - void FillMinvHisto( unsigned int probe_index ); + std::vector refp_tag = refTracks->tracks( refFilter ); - void WriteMinvHisto( TDirectory* foutdir ); + /// get reference tracks from the probe roi + TIDARoiDescriptor roi_probe( proi.roi() ); + dynamic_cast( refFilter )->setRoi( &roi_probe ); - /// internal methods for computation (protected) + std::vector refp_probe = refTracks->tracks( refFilter ); -protected: + /// loop over tag ref tracks + bool found = false; - std::pair selection( TIDA::Roi & troi, TIDA::Roi & proi ); + for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); + + if ( invmass_obj>m_massMin && invmass_objFill( invmass ); + hmass_obj->Fill( invmass_obj ); + found = true; + } + } + } - /// internally used variables + return found; -private: + } - TrackSelector * m_refTracks; - TrackFilter * m_refFilter; - TIDA::Chain * m_chain; - TIDA::Chain * m_chain_tnp; + double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - std::string m_probeChainName ; - std::string m_tagChainName ; + TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - std::vector m_probes; - std::vector< std::vector > m_masses; - std::vector< std::vector > m_masses_obj; - std::vector< std::vector > m_tags; - bool m_unique; +private: std::string m_particleType; - double m_ZmassMin, m_ZmassMax; + double m_mass; - TrigObjectMatcher* m_tom; + double m_massMin; + double m_massMax; - /// supporting variables for utility methods + bool m_unique; - std::map m_tnp_map; - std::vector m_probe_chain_names; + std::string m_probeChainName ; + std::string m_tagChainName ; - std::map m_hMinv_map; - std::map m_hMinv_obj_map; +}; - TH1D* m_hMinv ; - TH1D* m_hMinv_obj ; -}; +#endif /// TIDAUTILS_TAGNPROBE_H + -#endif // TIDAUTILS_TAGNPROBE_H diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h deleted file mode 100644 index 73f74c10550..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h +++ /dev/null @@ -1,183 +0,0 @@ -/// emacs: this is -*- c++ -*- -/** - ** @file TagNProbe2.h - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#ifndef TIDAUTILS_TAGNPROBE2_H -#define TIDAUTILS_TAGNPROBE2_H - -#include - -#include "TrigInDetAnalysis/TIDAChain.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TrigInDetAnalysis/Track.h" - -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysisUtils/Filters.h" - -#include "TLorentzVector.h" - - -class TagNProbe2 { - -public: - - TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); - - virtual ~TagNProbe2() { } - - /// getters and setters - - /// could be moved to the constructor now ... - void tag( const std::string& chainName ) { m_tagChainName = chainName; } - void probe( const std::string& chainName ) { m_probeChainName = chainName; } - - const std::string& tag() const { return m_tagChainName; } - const std::string& probe() const { return m_probeChainName; } - -public: - - template - std::vector GetRois( std::vector& chains, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0 ) const { - - std::vector probes; - - TIDA::Chain* chain_tag = findChain( tag(), chains ); - TIDA::Chain* chain_probe = findChain( probe(), chains ); - - if ( chain_tag==0 || chain_probe==0 ) return probes; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = chain_probe->rois()[ip]; - - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = chain_tag->rois()[it]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { - found_tnp = true; - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) probes.push_back( &proi ); - - } // end loop on probes - - return probes; - - } - -protected: - - double pt( const TIDA::Track* t ) const { return t->pT(); } - double pt( const TrackTrigObject* t ) const { return t->pt(); } - - template - double mass( const T* t1, const T* t2 ) const { - TLorentzVector v1; - v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); - TLorentzVector v2; - v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); - return (v1+v2).M(); - } - - - template - bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0) const { - - /// get reference tracks from the tag roi - TIDARoiDescriptor roi_tag( troi.roi() ); - - dynamic_cast(refFilter)->setRoi( &roi_tag ); - - std::vector refp_tag = refTracks->tracks( refFilter ); - - /// get reference tracks from the probe roi - TIDARoiDescriptor roi_probe( proi.roi() ); - - dynamic_cast( refFilter )->setRoi( &roi_probe ); - - std::vector refp_probe = refTracks->tracks( refFilter ); - - /// loop over tag ref tracks - bool found = false; - - for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); - - if ( invmass_obj>m_massMin && invmass_objFill( invmass ); - hmass_obj->Fill( invmass_obj ); - found = true; - } - - } - } - - return found; - - } - - - double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - - TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - - -private: - - std::string m_particleType; - - double m_mass; - - double m_massMin; - double m_massMax; - - bool m_unique; - - std::string m_probeChainName ; - std::string m_tagChainName ; - -}; - - -#endif /// TIDAUTILS_TAGNPROBE2_H - - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx index c85753f5dc7..daba62319fb 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx @@ -1,408 +1,51 @@ /** ** @file TagNProbe.cxx ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #include "TrigInDetAnalysisUtils/TagNProbe.h" -double TagNProbe::computeZ_obj( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1, v2; - double z0_1, z0_2; - if ( tnpType.Contains("Electron") ) { - - if ( m_tom != 0 && !m_tom->status() ) - return -1.0; - - const TrackTrigObject* tobj1 = m_tom->object( t1->id() ); - const TrackTrigObject* tobj2 = m_tom->object( t2->id() ); - - v1.SetPtEtaPhiM( (tobj1->pt())/1000., tobj1->eta(), tobj1->phi(), mass ); - v2.SetPtEtaPhiM( (tobj2->pt())/1000., tobj2->eta(), tobj2->phi(), mass ); - z0_1 = (double)(tobj1->z0()); - z0_2 = (double)(tobj2->z0()); - } - else { - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - z0_1 = (double)(t1->z0()); - z0_2 = (double)(t2->z0()); - } - - double invMass = (double)( v1 + v2 ).M(); - double z0diff = std::fabs( z0_1 - z0_2 ); - - if ( invMass > m_ZmassMin && invMass < m_ZmassMax && z0diff < 5 ) return invMass; - - return -1.0; - -} - - - - -// ------------------------------------------------------------------ - -double TagNProbe::computeZ( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1; - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - - TLorentzVector v2; - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - - double invMass = (double)( v1 + v2 ).M(); - - /// this cut is performed on the object-based inv. mass - return invMass; - -} - - - - -// ------------------------------------------------------------------ - -std::pair TagNProbe::selection( TIDA::Roi& troi, TIDA::Roi& proi ) +TagNProbe::TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag ) : + m_particleType(refName), + m_mass(0), + m_massMin(massMin), + m_massMax(massMax), + m_unique(unique_flag) { + double muonMass = 0.10565; // GeV + double electronMass = 0.000510; // GeV + double tauMass = 1.77686; // GeV - TIDARoiDescriptor roi_tag( troi.roi() ); - TIDARoiDescriptor roi_probe( proi.roi() ); - - /// getting reference tracks from the tag roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_tag ); - std::vector< TIDA::Track* > refp_tag = m_refTracks->tracks( m_refFilter ); - - /// getting reference tracks from the probe roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_probe ); - std::vector< TIDA::Track* > refp_probe = m_refTracks->tracks( m_refFilter ); - - /// loop on tag ref tracks - for ( size_t it=0; it InvMass = std::make_pair( pair_mass, pair_mass_obj ); - if ( pair_mass_obj > 0 ) - return InvMass; - - } - - } - - std::pair pNull = std::make_pair( 0., 0. ); - - return pNull; - -} - - - - -// ------------------------------------------------------------------ - -bool TagNProbe::FindProbes() -{ - - m_probes.clear(); - m_tags.clear(); - m_masses.clear(); - m_masses_obj.clear(); - - if ( m_chain==0 || m_chain_tnp==0 ) - return false; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = m_chain_tnp->rois()[ ip ]; - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - std::vector tags; - std::vector masses; - std::vector masses_obj; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = m_chain->rois()[ it ]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - std::pair InvMasses = selection( troi, proi ); - double mass = InvMasses.first; - double mass_obj = InvMasses.second; - - if ( !found_tnp && mass>0 ) found_tnp = true; - - if ( mass>0 ) { - tags.push_back( &troi ); - masses.push_back( mass ); - masses_obj.push_back( mass_obj ); - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) { - m_probes.push_back( &proi ); - m_tags.push_back( tags ); - m_masses.push_back( masses ); - m_masses_obj.push_back( masses_obj ); - } - - } // end loop on probes - - return true; - + if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; + else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; + else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; } -// ------------------------------------------------------------------ -void TagNProbe::FillMap( std::vector& tnpChains ) { - /// first clear the map - m_tnp_map.clear(); +double TagNProbe::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - for ( size_t i=0 ; i::value_type( chain_probe_name, chain_tag_name ) ); - - /// new testChain vector is filled only with probe chain names - m_probe_chain_names.push_back( tnpChains[i+1] ); + if ( tom!=0 && tom->status() ) { + return mass( tom->object(t1->id()), tom->object(t2->id()) ); } - -} - -// ------------------------------------------------------------------ - -TIDA::Chain* TagNProbe::GetTagChain( std::string probe_name, std::vector& chains ) { - - TIDA::Chain* chain_tag = 0; - - std::map::const_iterator tnpitr = m_tnp_map.find( probe_name ); - - if ( tnpitr != m_tnp_map.end() ) { - - for ( size_t icp=0 ; icpsecond ) { - chain_tag = &( chains[icp] ); - break; - } - } + else { + return mass( t1, t2 ); } - - return chain_tag; - -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( TIDA::Chain * chain, std::vector& chains ) { - - std::vector rois; - TIDA::Chain* chain_tag = 0; - - /// for each configured probe chain find the correspondig tag chain in the event - chain_tag = GetTagChain( chain->name(), chains ); - if ( chain_tag == 0 ) return rois; - - /// resetting the chains - m_chain = 0; - m_chain_tnp = 0; - - /// setting the chains - SetChains( chain, chain_tag ); - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( std::vector& chains ) { - - std::vector rois; - FindTIDAChains(chains) ; - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( std::string chain_name ) { - - std::string hname_base = chain_name; - std::replace( hname_base.begin(), hname_base.end(), '/', '_' ); - std::replace( hname_base.begin(), hname_base.end(), ':', '_' ); - - std::string hname_1 = hname_base + "_Minv_TnP"; - std::string hname_2 = hname_base + "_Minv_obj_TnP"; - - m_hMinv_map[ chain_name ] = new TH1D( hname_1.c_str(), hname_1.c_str(), 320, 0, 200 ); - m_hMinv_obj_map[ chain_name ] = new TH1D( hname_2.c_str(), hname_2.c_str(), 320, 0, 200 ); - -} - -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( ) { - - m_hMinv = new TH1D( "Minv_TnP", "Tag&Probe invariant mass", 320, 0, 200 ); - m_hMinv_obj = new TH1D( "Minv_obj_TnP", "Tag&Probe invariant mass (object-based)", 320, 0, 200 ); - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FillMinvHisto( std::string chain_name, unsigned int probe_index ) { - - /// find the histogram for chain_name - std::map::iterator hMinv_itr = m_hMinv_map.find( chain_name ); - std::map::iterator hMinv_obj_itr = m_hMinv_obj_map.find( chain_name ); - - /// check if histod exist, if yes fill them - if ( hMinv_itr != m_hMinv_map.end() && - hMinv_obj_itr != m_hMinv_obj_map.end() && - m_masses[probe_index].size() == m_masses_obj[probe_index].size() ) { - - // for ( size_t im=0 ; imsecond->Fill( m_masses[probe_index].at(im) ); - // hMinv_obj_itr->second->Fill( m_masses_obj[probe_index].at(im) ); - // } - } } -// ------------------------------------------------------------------ -void TagNProbe::FillMinvHisto( unsigned int probe_index ) { - - if ( m_masses[probe_index].size() == m_masses_obj[probe_index].size() && - m_masses[probe_index].size() > 0 ) { - - // for ( size_t im=0 ; imFill( m_masses[probe_index].at(im) ); - // m_hMinv_obj->Fill( m_masses_obj[probe_index].at(im) ); - // } +TIDA::Chain* TagNProbe::findChain( const std::string& chainname, std::vector& chains ) const { + for ( size_t i=chains.size() ; i-- ; ) { + if ( chains[i].name() == chainname ) return &chains[i]; } + return 0; } -// ------------------------------------------------------------------ - -void TagNProbe::WriteMinvHisto( TDirectory* foutdir ) { - - foutdir->cd(); - - std::map::iterator hMinv_itr; - for ( hMinv_itr=m_hMinv_map.begin() ; hMinv_itr!=m_hMinv_map.end() ; hMinv_itr++ ) { - - std::string dirname = hMinv_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_itr->second->SetTitle( "Tag&Probe invariant mass" ); - hMinv_itr->second->SetName( "Minv_TnP" ); - hMinv_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - - std::map::iterator hMinv_obj_itr; - for ( hMinv_obj_itr=m_hMinv_obj_map.begin() ; hMinv_obj_itr!=m_hMinv_obj_map.end() ; hMinv_obj_itr++ ) { - - std::string dirname = hMinv_obj_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos and - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_obj_itr->second->SetTitle( "Tag&Probe invariant mass (object-based)" ); - hMinv_obj_itr->second->SetName( "Minv_obj_TnP" ); - hMinv_obj_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FindTIDAChains( std::vector& chains ) { - - for ( int ic=0 ; ic<(int)(chains.size()) ; ++ic ){ - std::string chainConfig = chains[ic].name() ; - if ( (chainConfig) == m_probeChainName ) m_chain_tnp = &( chains[ic] ) ; - if ( (chainConfig) == m_tagChainName ) m_chain = &( chains[ic] ) ; - } -} diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx deleted file mode 100644 index beec1a880b7..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx +++ /dev/null @@ -1,51 +0,0 @@ -/** - ** @file TagNProbe2.cxx - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#include "TrigInDetAnalysisUtils/TagNProbe2.h" - - -TagNProbe2::TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag ) : - m_particleType(refName), - m_mass(0), - m_massMin(massMin), - m_massMax(massMax), - m_unique(unique_flag) -{ - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; - else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; - else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; -} - - - -double TagNProbe2::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - - if ( tom!=0 && tom->status() ) { - return mass( tom->object(t1->id()), tom->object(t2->id()) ); - } - else { - return mass( t1, t2 ); - } - -} - - -TIDA::Chain* TagNProbe2::findChain( const std::string& chainname, std::vector& chains ) const { - for ( size_t i=chains.size() ; i-- ; ) { - if ( chains[i].name() == chainname ) return &chains[i]; - } - return 0; -} - - diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TIDAMonitoring.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TIDAMonitoring.py index 6b5f8b9c050..afb2889e367 100644 --- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TIDAMonitoring.py +++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TIDAMonitoring.py @@ -44,12 +44,12 @@ def TIDAMonitoring( flags=None, name=None, monlevel=None, mcTruth=False ) : chains = getchains( [ "HLT_e.*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron", "HLT_e.*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_IDTrig", "HLT_e.*idperf(?!.*lrtloose.*)(?!.*nogsf.*).*:key=HLT_IDTrack_Electron_GSF", - "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_tag:te=0", - "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_probe:te=1", - "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", - "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", - "HLT_e.*_lhtight_.*_e.*_idperf_gsf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", - "HLT_e.*_lhtight_.*_e.*_idperf_gsf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1" ], monlevel ) + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_probe:te=1", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1" ], monlevel ) if len(chains)>0 : diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py index fdd396945e6..0512ef09fc1 100644 --- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py @@ -93,17 +93,12 @@ def TrigIDtrkMonitoringTool( legacy_monitoring=False ): "HLT_e.*idperf.*:key=HLT_IDTrack_Electron_IDTrig", "HLT_e.*gsf.*:key=HLT_IDTrack_Electron_GSF", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el1_tag:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el1_probe:te=1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:roi=HLT_Roi_FastElectron:extra=el1_tag:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:roi=HLT_Roi_FastElectron:extra=el1_probe:te=1", - - "HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el2_tag:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el2_probe:te=1", - - "HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:roi=HLT_Roi_FastElectron:extra=el2_tag:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:roi=HLT_Roi_FastElectron:extra=el2_probe:te=1" + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:extra=el_probe:te=1", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e.*_lhtight_.*_e.*_idperf_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1" ] else: tidaegamma.ntupleChainNames += [ diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py index 427c0c0d503..41a96ec62ec 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py +++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py @@ -106,7 +106,7 @@ class TrigInDetReco(ExecStep): flags += 'doEgammaSlice=True;' if (i=='electron-tnp') : chains += "'HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI'," - chains += "'HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI'," + chains += "'HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI'," flags += 'doEgammaSlice=True;' if (i=='tau') : chains += "'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM'," @@ -300,7 +300,6 @@ class TrigInDetRdictStep(Step): os.system( 'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-fslrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' ) - os.system( 'get_files -data TIDAdata-run3-TnP.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata_cuts.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-rzMatcher.dat &> /dev/null' ) @@ -311,7 +310,6 @@ class TrigInDetRdictStep(Step): os.system( 'get_files -data TIDAdata-run3-offline-fslrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-vtx.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-minbias-offline.dat &> /dev/null' ) - os.system( 'get_files -data TIDAdata-run3-offline-TnP.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-cosmic.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata_cuts-offline.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-chains-run3.dat &> /dev/null' ) diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py index 3ea0291acd6..565c265f339 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py @@ -222,11 +222,14 @@ if ( True ) : "HLT_e30_lhloose_nopix_lrtmedium_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_IDTrig:roi=HLT_Roi_FastElectron_LRT:te=0", # double electron chains for tag and probe analysis - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=1", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:te=1", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1", # two stage tau FTF "HLT_tau.*_idperf.*tracktwo.*:HLT_IDTrack_TauCore_FTF:roi=HLT_Roi_TauCore", diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json index 153b5cedeeb..21bc11467d3 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json +++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json @@ -85,16 +85,16 @@ "chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig" }, "L2electronTnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_FTF_HLT_Roi_FastElectron_1_el_probe" }, "EFelectronTnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_FTF_HLT_Roi_FastElectron_1_el_probe HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_IDTrig_1_el_probe HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_GSF_1_el_probe" }, "L2electronTier0TnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el2_probe:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el_probe:HLT_Roi_FastElectron:1" }, "EFelectronTier0TnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el2_probe:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el_probe:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_GSF:el_probe:1" }, "EFcosmic":{ "chains" : "HLT_mu4_cosmic_L1MU3V_EMPTY:HLT_IDTrack_Cosmic_IDTrig" diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py index 49e0b903bd1..7b62769a2dd 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py @@ -37,13 +37,13 @@ Release = "current" GridFiles = True preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for ATR-23982. In future find a more recent RDO -Jobs = [( "Truth", " TIDAdata-run3-TnP.dat -o data-hists.root -p 11" ), - ( "Offline", " TIDAdata-run3-offline-TnP.dat -r Offline -o data-hists-offline.root" )] +Jobs = [( "Truth", " TIDAdata-run3.dat -o data-hists.root -p 11" ), + ( "Offline", " TIDAdata-run3-offline.dat -r Offline -o data-hists-offline.root" )] -Comp = [( "L2ele", "L2electronTnP", "data-hists.root", " -c TIDAhisto-panel.dat -d HLTL2-plots " ), - ( "L2eleoffline", "L2electronTnP", "data-hists-offline.root", " -c TIDAhisto-panel.dat -d HLTL2-plots-offline " ), - ( "EFele", "EFelectronTnP", "data-hists.root", " -c TIDAhisto-panel.dat -d HLTEF-plots " ), - ( "EFeleoffline", "EFelectronTnP", "data-hists-offline.root", " -c TIDAhisto-panel.dat -d HLTEF-plots-offline " ) ] +Comp = [( "L2ele", "L2electronTnP", "data-hists.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_1 -d HLTL2-plots " ), + ( "L2eleoffline", "L2electronTnP", "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_1 -d HLTL2-plots-offline " ), + ( "EFele", "EFelectronTnP", "data-hists.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_nogsf_idperf_50invmAB130_FTF_FE_1 e26_e14_etcut_nogsf_idperf_50invmAB130_IDTrig_1 e26_e14_etcut_idperf_50invmAB130_GSF_1 -d HLTEF-plots " ), + ( "EFeleoffline", "EFelectronTnP", "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_nogsf_idperf_50invmAB130_FTF_FE_1 e26_e14_etcut_nogsf_idperf_50invmAB130_IDTrig_1 e26_e14_etcut_idperf_50invmAB130_GSF_1 -d HLTEF-plots-offline " ) ] diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py index 235c6974640..e6447ce8133 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py @@ -39,8 +39,8 @@ preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for Jobs = [] -Comp = [ ( "L2electron", "L2electronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el1_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_FTF_FE_el2_probe_1 --ncols 3 -d HLTL2-plots-electron " ), - ( "EFelectron", "EFelectronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el1_probe_1 e26_e14_etcut_idperf_50invmAB130_IDTrig_FE_el1_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_IDTrig_FE_el2_probe_1 --ncols 3 -d HLTEF-plots-electron " ) ] +Comp = [ ( "L2electron", "L2electronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el_probe_1 --ncols 3 -d HLTL2-plots-electron " ), + ( "EFelectron", "EFelectronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el_probe_1 e26_e14_etcut_idperf_50invmAB130_IDTrig_el_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_GSF_el_probe_1 --ncols 3 -d HLTEF-plots-electron " ) ] from AthenaCommon.Include import include include("TrigInDetValidation/TrigInDetValidation_Base.py") -- GitLab