41using namespace TestCB;
50 if(env.ReadFile(conf, kEnvAll) != 0){
51 ANA_MSG_INFO(
"Cannot read config file: " << conf);
52 return StatusCode::FAILURE;
55 MuonIso = env.GetValue(
"MuonIso",
"PflowTight_FixedRad");
56 MuonPt = env.GetValue(
"MuonPt", 7000.);
57 MuonEta = env.GetValue(
"MuonEta", 2.5);
59 ElectronIso = env.GetValue(
"ElectronIso",
"PLImprovedTight");
60 ElectronPt = env.GetValue(
"ElectronPt", 7000.);
63 PhotonIso = env.GetValue(
"PhotonIso",
"FixedCutTight");
64 PhotonPt = env.GetValue(
"PhotonPt", 7000.);
65 PhotonEta = env.GetValue(
"PhotonEta", 2.47);
68 return StatusCode::SUCCESS;
75 if (!Ev.
retrieve(InCont, Key).isSuccess()) {
76 ANA_MSG_ERROR(
"RetrieveContainer() Could not retrieve " << Key.c_str());
77 return StatusCode::FAILURE;
80 Aux = shallowcopy.second;
81 C = shallowcopy.first;
83 ANA_MSG_ERROR(
"RetrieveContainer() Failed to set Object links to " << Key.c_str());
85 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
90int main(
int argc,
char** argv){
92 gErrorIgnoreLevel = 0;
101 auto start = std::time(
nullptr);
104 TString outputTree =
"testIsoCloseByTool_out.root";
108 const TString fileName = argv[ 2 ];
110 std::unique_ptr< TFile > ifile( TFile::Open( fileName,
"READ" ) );
111 if( !ifile.get() )
return EXIT_FAILURE;
113 const TString configFile = argv[ 1 ];
118 ANA_CHECK( event.readFrom(ifile.get()) );
119 ANA_MSG_INFO(
"Number of events in the file " <<
static_cast<int>(event.getEntries()));
124 ANA_MSG_INFO(
"Initialize instance of the IsolationSelectionTool");
133 ANA_MSG_INFO(
"Initialize instance of the IsolationCloseByCorrectionTool");
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;
180 for (Long64_t entry(0); entry < maxEVT; ++entry) {
181 event.getEntry(entry);
184 ANA_CHECK(event.retrieve(ei,
"EventInfo"));
186 if (entry % INTERVAL == 0)
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;
210 for (
const auto mu : *
Muons) {
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;
242 auto end = std::time(
nullptr);
243 ANA_MSG_INFO(Form(
"Ran on %i event for testing %s",(
int)maxEVT, std::ctime(&end)));
@ Error
Some error happened during the object correction.
StatusCode Fill(const xAOD::IParticleContainer *Particles)
storage of the time histories of all the cells
SG::Decorator< T, ALLOC > Decorator
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
StatusCode retrieve(const T *&obj, const std::string &key)
Retrieve either an input or an output object from the event.
Class creating a shallow copy of an existing auxiliary container.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
A relatively simple transient store for objects created in analysis.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".