36{
37 using namespace asg::msgUserCode;
38
40
41 if (argc < 2)
42 {
44 ANA_MSG_ERROR(
" Usage: %s [xAOD file name] %d Num of events to process %d (0 photons , 1 electrons)");
45 return EXIT_FAILURE;
46 }
47
48
51 std::unique_ptr<TFile>
inputFile(TFile::Open(fileName,
"READ"));
53
54
56
59
60 ANA_MSG_INFO(
"Number of events in the file: " << pers.getEntries());
61
62
63 Long64_t
entries = pers.getEntries();
64 if (argc > 2)
65 {
66 const Long64_t userInputEntries = atoll(argv[2]);
68 {
70 }
71 }
72
73
75 ANA_CHECK(fudgeTool.setProperty(
"ConfigFile",
"EGammaVariableCorrection/ElectronPhotonVariableCorrectionBase_ExampleIsoCorrectionConf.conf"));
77
78
79
81 ANA_CHECK(isoCorrToolFull.setProperty(
"Apply_etaEDPar_mc_correction",
true));
82 ANA_CHECK(isoCorrToolFull.setProperty(
"Apply_etaEDParPU_correction",
true));
84
86 ANA_CHECK(isoCorrToolStep.setProperty(
"Apply_etaEDPar_mc_correction",
false));
87 ANA_CHECK(isoCorrToolStep.setProperty(
"Apply_etaEDParPU_correction",
true));
89
92
93
95 {
96
97 pers.getEntry(entry);
100
101
103 ANA_CHECK(pers.retrieve(photons,
"Photons"));
106
107
108 for (
unsigned int idx = 0;
idx < photons->
size();
idx++)
109 {
112 ANA_CHECK(isoCorrToolFull.applyCorrection(*(photons_isocorr.first->at(idx))));
113 ANA_CHECK(isoCorrToolStep.applyCorrection(*(photons_fudge.first->at(idx))));
114 ANA_CHECK(fudgeTool.applyCorrection(*(photons_fudge.first->at(idx))));
115 ANA_MSG_INFO(
"topoetcone40 fudge before applyCorrection: " << topoEtCone40OriginalAcc(*photons_fudge.first->at(idx)));
116 ANA_MSG_INFO(
"topoetcone40 fudge after applyCorrection : " << topoEtCone40Acc(*photons_fudge.first->at(idx)));
117 ANA_MSG_INFO(
"topoetcone40 with IsolationCorrectionTool : " << topoEtCone40Acc(*photons_isocorr.first->at(idx)));
118 }
119 }
120
121 return 0;
122}
size_type size() const noexcept
Returns the number of elements in the collection.
Class to correct electron and photon MC variables.
Helper class to provide constant type-safe access to aux data.
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.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container 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.