57 {
58
59
61
62
63 if (argc < 2) {
66 return 1;
67 }
68
69
71
72
75 std::unique_ptr<TFile>
ifile(TFile::Open( fileName,
"READ"));
79 return 1;
80 }
81
82
86 static_cast< int >(
event.getEntries() ) );
87
88
89 Long64_t
entries =
event.getEntries();
90 if( argc > 2 ) {
91 const Long64_t
e = atoll( argv[ 2 ] );
94 }
95 }
96
97
102
103
104
107 std::vector<CP::SystematicSet> sysList;
108
109 std::cout <<
"SIZE of the systematics set:" << recommendedSystematics.
size() << std::endl;
110
112
113
114
116
117
118 event.getEntry(entry);
119
120 std::cout << "=================NEXT EVENT==========================" << std::endl;
121
123 CHECK(
event.retrieve( event_info,
"EventInfo" ) );
124
125
128
129
131
132
134 if (ph->
pt() <
MIN_PT) {
continue; }
135 std::cout << std::string(80, '-') << std::endl;
136 std::cout <<
"eta|phi|pt|xAOD e = " << ph->
eta() <<
"|" << ph->
phi() <<
"|" << ph->
pt() <<
"|" << ph->
e() << std::endl;
138 std::cout << "ERROR: particle has no calocluster" << std::endl;
139 continue;
140 }
143 std::cout << "particle is not electron of photon" << std::endl;
144 continue;
145 }
146
148 std::cout <<
"Calibrated e = " << ph->
e() << std::endl;
149
150
151 std::cout << "\n=============SYSTEMATICS CHECK NOW";
152 for (auto sys : sysList) {
153
154 if (
tool->applySystematicVariation(sys) != StatusCode::SUCCESS) {
155 Error(
APP_NAME,
"Cannot configure calibration tool for systematics");
156 }
157
159 std::cout <<
"\nCalibrated pt with systematic " <<
sys.name() <<
" = " << ph->
pt();
160 }
161 std::cout << "\n=============END SYSTEMATICS " << std::endl;
162 }
163
164
165
167 CHECK(
event.retrieve(electrons,
"Electrons") );
168
169
170 std::pair< xAOD::ElectronContainer*, xAOD::ShallowAuxContainer* > electrons_shallowCopy =
xAOD::shallowCopyContainer( *electrons );
171
172
174 if (
el->pt() <
MIN_PT) {
continue; }
175 std::cout << std::string(80, '-') << std::endl;
176 std::cout <<
"eta|phi|pt|xAOD e = " <<
el->eta() <<
"|" <<
el->phi() <<
"|" <<
el->pt() <<
"|" <<
el->e() << std::endl;
177 if (not
el->caloCluster()) {
178 std::cout << "ERROR: particle has no calocluster" << std::endl;
179 continue;
180 }
181 std::cout <<
"raw E = " <<
el->caloCluster()->energyBE(1) +
el->caloCluster()->energyBE(2) +
el->caloCluster()->energyBE(3) << std::endl;
183 std::cout << "particle is not electron of photon" << std::endl;
184 continue;
185 }
186
188 std::cout <<
"Calibrated e = " <<
el->e() << std::endl;
189
190
191 std::cout << "\n=============SYSTEMATICS CHECK NOW";
192 for (auto sys : sysList) {
193
194 if (
tool->applySystematicVariation(sys) != StatusCode::SUCCESS) {
195 Error(
APP_NAME,
"Cannot configure calibration tool for systematics");
196 }
197
199 std::cout <<
"\nCalibrated pt with systematic " <<
sys.name() <<
" = " <<
el->pt();
200 }
201 std::cout << "\n=============END SYSTEMATICS " << std::endl;
202 }
203
205 "===>>> done processing event #%i, "
206 "run #%i %i events processed so far <<<===",
208 static_cast< int >( event_info->
runNumber() ),
209 static_cast< int >( entry + 1 ) );
210
211 }
212
214
215 return 0;
216}
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
This module implements the central registry for handling systematic uncertainties with CP tools.
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
size_t size() const
returns: size of the set
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
ReadStats & stats()
Access the object belonging to the current thread.
static IOStats & instance()
Singleton object accessor.
virtual double e() const override final
The total energy of the particle.
void printSmartSlimmingBranchList(bool autoIncludeLinks=false) const
Print the accessed variables, formatted for smart slimming.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
Error
The different types of error that can be flagged in the L1TopoRDO.
static StatusCode setProperty(IAsgTool *tool, const std::string &property, W &&value)
Helper method for calling setProperty on an interface class Usage: asg::setProperty( myTool ,...
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
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.
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".