54{
55
56
58
59
60 if(argc < 2) {
63 return 1;
64 }
65
66
68 StatusCode::enableFailure();
69
70
73 std::unique_ptr<TFile>
ifile(TFile::Open(fileName,
"READ"));
75
76
80 static_cast<int>(
event.getEntries()));
81
82
84
85
86
87 Long64_t
entries =
event.getEntries();
88 if(argc > 2) {
89 const Long64_t
e = atoll(argv[2]);
92 }
93 }
94
95
98 std::string esModel = "es2017_R21_v1";
99 CHECK( energyRescaler->setProperty(
"ESModel", esModel) );
101 ToolHandle<CP::IEgammaCalibrationAndSmearingTool> energyRescalerTool(energyRescaler->name());
102
103
105 CHECK( fsrTool.setProperty<
double>(
"far_fsr_drcut", 0.12) );
106 fsrTool.msg().setLevel(MSG::DEBUG);
107 CHECK( fsrTool.setProperty(
"egCalibToolName", energyRescaler->name()) );
108 CHECK( fsrTool.initialize() );
109
110
112
113
115
117
118
119 event.getEntry(entry);
120
121
122
123
124
125
126
127
128
129
130
131
132
135
136
139
140 std::pair< xAOD::ElectronContainer*, xAOD::ShallowAuxContainer* > electrons_shallowCopy =
142
143
145 CHECK(
store->
record( electrons_shallowCopy.second,
"ElectronsCorrAux." ) );
146
148
149
151 Error(
APP_NAME,
"Unable to setOriginalObjectLink for electron containers ");
152 return 1;
153 }
154
155
158
159 std::pair< xAOD::PhotonContainer*, xAOD::ShallowAuxContainer* > photons_shallowCopy =
161
162
166
168 Error(
APP_NAME,
"Unable to setOriginalObjectLink for photon containers ");
169 return 1;
170 }
171
172
173
174 double tmp_energy = -999.;
175 double fsr_energy = 0.;
176 TLorentzVector fsr_tlv;
177
178
179 for( auto muon : *muons ) {
180
182 {
184 Info(
APP_NAME,
" container = %s deltaR = %f Et = %f f1 = %f"
185 " eta = %f phi = %f phIso = %f fsrtype = %i",
188 candidate.
eta, candidate.
phi,
190 }
191
194 if (photon) fsr_energy =
photon->e();
195 }
196 else if (candidate.
container ==
"electron" ) {
198 if (electron) fsr_energy =
electron->e();
199 } else
201
202 if ( fsr_energy > tmp_energy ) {
203 tmp_energy = fsr_energy;
204 fsr_tlv.SetPtEtaPhiE(candidate.
Et, candidate.
eta, candidate.
phi, fsr_energy);
205 }
206
207 }
208
210
211 }
212
214
215 return EXIT_SUCCESS;
216
217}
@ Ok
The correction was done successfully.
Simple interface for searching the FSR candidate.
const xAOD::IParticle * particle
void record(const T *p, const std::string &key)
ReadStats & stats()
Access the object belonging to the current thread.
static IOStats & instance()
Singleton object accessor.
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.
A relatively simple transient store for objects created in analysis.
Error
The different types of error that can be flagged in the L1TopoRDO.
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".
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...
Photon_v1 Photon
Definition of the current "egamma version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Electron_v1 Electron
Definition of the current "egamma version".