104 TString outputTree =
"testIsoCloseByTool_out.root";
110 std::unique_ptr< TFile >
ifile( TFile::Open(
fileName,
"READ" ) );
111 if( !
ifile.get() )
return EXIT_FAILURE;
124 ANA_MSG_INFO(
"Initialize instance of the IsolationSelectionTool");
131 ANA_CHECK( IsoSelectionTool.retrieve() );
133 ANA_MSG_INFO(
"Initialize instance of the IsolationCloseByCorrectionTool");
136 ANA_CHECK( IsoCloseByTool.setProperty(
"IsolationSelectionTool", IsoSelectionTool.getHandle()) );
137 ANA_CHECK( IsoCloseByTool.setProperty(
"SelectionDecorator",
"isCloseByObject") );
140 ANA_CHECK( IsoCloseByTool.setProperty(
"IsolationSelectionDecorator",
"correctedIsol") );
150 ANA_CHECK( IsoCloseByTool.setProperty(
"BackupPrefix",
"default") );
155 ofile = TFile::Open(outputTree,
"RECREATE");
157 TTree *
tree =
new TTree(
"otree",
"otree");
162 Long64_t maxEVT = atoll(
argv[ 3 ] );
163 Long64_t
entries =
event.getEntries();
164 if ((
entries < maxEVT) || (maxEVT <= 0)) {
169 const int INTERVAL = maxEVT > 20000 ? 10000 : maxEVT / 10;
181 event.getEntry(
entry);
186 if (
entry % INTERVAL == 0)
187 ANA_MSG_INFO(Form(
"--> Event %lld \t EventNumber: %llu RunNumber: %u",
entry, ei->eventNumber(), ei->runNumber()));
194 for(
const auto el : *Electrons) {
196 const char passIsol = IsoSelectionTool->accept(*
el) ? 1 : 0;
197 dec_PassIsol(*
el) = passIsol;
200 dec_PassQuality(*
el) = passQuality;
202 for(
const auto ph : *Photons) {
204 const char passIsol = IsoSelectionTool->accept(*ph) ? 1 : 0;
205 dec_PassIsol(*ph) = passIsol;
207 const char passQuality = (ph->pt() >
PhotonPt && std::abs(ph->eta()) <
PhotonEta) ? 1 : 0;
208 dec_PassQuality(*ph) = passQuality;
212 const char passIsol = IsoSelectionTool->accept(*
mu) ? 1 : 0;
213 dec_PassIsol(*
mu) = passIsol;
215 const char passQuality = (
mu->pt() >
MuonPt && std::abs(
mu->eta()) <
MuonEta) ? 1 : 0;
216 dec_PassQuality(*
mu) = passQuality;
232 ANA_CHECK( eleBranches.Fill(Electrons) );
243 ANA_MSG_INFO(Form(
"Ran on %i event for testing %s",(
int)maxEVT, std::ctime(&
end)));