53 if(env.ReadFile(conf, kEnvAll) != 0){
54 ANA_MSG_INFO(
"Cannot read config file " << conf);
55 return StatusCode::FAILURE;
58 MuonIso = env.GetValue(
"MuonIso",
"PflowTight_FixedRad");
59 MuonPt = env.GetValue(
"MuonPt", 7000.);
60 MuonEta = env.GetValue(
"MuonEta", 2.5);
62 ElectronIso = env.GetValue(
"ElectronIso",
"PLImprovedTight");
63 ElectronPt = env.GetValue(
"ElectronPt", 7000.);
64 ElectronEta = env.GetValue(
"ElectronEta", 2.47);
66 PhotonIso = env.GetValue(
"PhotonIso",
"FixedCutTight");
67 PhotonPt = env.GetValue(
"PhotonPt", 7000.);
68 PhotonEta = env.GetValue(
"PhotonEta", 2.47);
71 return StatusCode::SUCCESS;
88 auto start = std::time(
nullptr);
89 char tbuf_start[26]; ::ctime_r(&start, tbuf_start);
93 const TString fileName = argv[ 2 ];
95 std::unique_ptr< TFile > ifile( TFile::Open( fileName,
"READ" ) );
96 if( !ifile.get() )
return EXIT_FAILURE;
103 ANA_CHECK( event.readFrom( ifile.get() ) );
104 ANA_MSG_INFO(
"Number of events in the file" <<
static_cast<int>(event.getEntries()));
110 Long64_t
entries =
event.getEntries();
112 const Long64_t e = atoll( argv[ 3 ] );
117#ifdef XAOD_STANDALONE
118 StatusCode::enableFailure();
121 ANA_MSG_INFO(
"Initialize the standard instance of the tool");
123 ANA_CHECK( IsoSelectionTool.setProperty(
"MuonWP", MuonIso) );
124 ANA_CHECK( IsoSelectionTool.setProperty(
"ElectronWP", ElectronIso) );
125 ANA_CHECK( IsoSelectionTool.setProperty(
"PhotonWP", PhotonIso) );
127 ANA_CHECK( IsoSelectionTool.setProperty(
"OutputLevel", MSG::DEBUG) );
130 ANA_MSG_INFO(
"Initialize the low-Pt augmentation (PLV-only)");
132 ANA_CHECK( IsoSelectionTool_lowPt.setProperty(
"OutputLevel", MSG::DEBUG) );
135 std::string sgKeyPhotons(
"Photons");
136 std::string sgKeyElectrons(
"Electrons");
137 std::string sgKeyMuons(
"Muons");
140 for( Long64_t entry(0); entry<
entries; entry++ ) {
142 event.getEntry( entry );
145 ANA_CHECK( event.retrieve(photons,sgKeyPhotons) );
148 for (
auto ph : *photons) {
149 if (ph->caloCluster() ==
nullptr)
continue;
150 if (ph->pt() < PhotonPt || std::abs(ph->caloCluster()->eta()) > PhotonEta)
continue;
152 if (IsoSelectionTool.
accept( *ph ))
153 ANA_MSG_INFO(Form(
" --> Photon (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",ph->pt(),ph->eta(),ph->phi(),PhotonIso.c_str()));
155 ANA_MSG_INFO(Form(
" --> Photon (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",ph->pt(),ph->eta(),ph->phi(),PhotonIso.c_str()));
160 ANA_CHECK( event.retrieve(electrons,sgKeyElectrons) );
161 ANA_MSG_INFO(
" Number of pre-selected electrons: " << (
int)electrons->size());
163 for (
auto el : *electrons) {
164 if (el->caloCluster() ==
nullptr)
continue;
165 if (el->pt() < ElectronPt || std::abs(el->caloCluster()->eta()) > ElectronEta)
continue;
166 if(ElectronIso.find(
"PLV") != std::string::npos)
ANA_CHECK( IsoSelectionTool_lowPt.
augmentPLV(*el) );
168 if (IsoSelectionTool.
accept( *el ))
169 ANA_MSG_INFO(Form(
" --> Electron (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",el->pt(),el->eta(),el->phi(), ElectronIso.c_str()));
171 ANA_MSG_INFO(Form(
" --> Electron (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",el->pt(),el->eta(),el->phi(), ElectronIso.c_str()));
176 ANA_CHECK( event.retrieve(muons,sgKeyMuons) );
179 for (
auto mu : *muons) {
180 if (mu->pt() < MuonPt || std::abs(mu->eta()) > MuonEta)
continue;
181 if(MuonIso.find(
"PLV") != std::string::npos)
ANA_CHECK( IsoSelectionTool_lowPt.
augmentPLV(*mu) );
183 if (IsoSelectionTool.
accept( *mu ))
184 ANA_MSG_INFO(Form(
" --> Muon (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",mu->pt(),mu->eta(),mu->phi(), MuonIso.c_str()));
186 ANA_MSG_INFO(Form(
" --> Muon (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",mu->pt(),mu->eta(),mu->phi(), MuonIso.c_str()));
193 auto end = std::time(
nullptr);
194 char tbuf_end[26]; ::ctime_r(&end, tbuf_end);