36{
37 using namespace asg::msgUserCode;
38
39
41
42
43 if (argc < 2)
44 {
46 ANA_MSG_ERROR(
" Usage: %s [xAOD file name] %d Num of events to process %d (0 photons , 1 electrons)");
47 return EXIT_FAILURE;
48 }
49
50
53 std::unique_ptr<TFile>
inputFile(TFile::Open(fileName,
"READ"));
55
56
58
61
62 ANA_MSG_INFO(
"Number of events in the file: " << pers.getEntries());
63
64
65 Long64_t
entries = pers.getEntries();
66 if (argc > 2)
67 {
68 const Long64_t userInputEntries = atoll(argv[2]);
70 {
72 }
73 }
75
76
78 std::string
configFile =
"EGammaVariableCorrection/EGammaVariableCorrectionTool_ExampleConf.conf";
79 ANA_CHECK(myTool.setProperty(
"ConfigFile", configFile));
81
82
84 {
85
86 pers.getEntry(entry);
87
88
89
90
91
92
94 ANA_CHECK(pers.retrieve(photons,
"Photons"));
95
96
97
98 auto photons_copy = std::make_unique<xAOD::PhotonContainer>();
99 auto photons_copy_aux = std::make_unique<xAOD::AuxContainerBase>();
100 photons_copy->setStore (photons_copy_aux.get());
101
102
103 for (auto photon : *photons) {
104
106 photons_copy->push_back (photon_copy);
108 }
109
110
111
112 for (unsigned int photon_itr = 0; photon_itr < photons_copy->size(); photon_itr++)
113 {
115
116
117 ANA_CHECK(myTool->applyCorrection(*photon));
118
119 }
120
121
122
123
124
125
127 ANA_CHECK(pers.retrieve(electrons,
"Electrons"));
128
129
130
131 auto electrons_copy = std::make_unique<xAOD::ElectronContainer>();
132 auto electrons_copy_aux = std::make_unique<xAOD::AuxContainerBase>();
133 electrons_copy->setStore (electrons_copy_aux.get());
134
135
136 for (auto electron : *electrons) {
137
139 electrons_copy->push_back (electron_copy);
141 }
142
143
144
145 for (unsigned int electron_itr = 0; electron_itr < electrons_copy->size(); electron_itr++)
146 {
148
149
150 ANA_CHECK(myTool->applyCorrection(*electron));
151
152 }
153
154 }
155
156 return 0;
157}
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".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".