191{
192
193
194
195
196
198
199
200
201
204#ifdef HEPMC3
206#else
207 HepMC::GenEvent::particle_const_iterator pit = truthEvent->
at(0)->particles_begin();
208 const HepMC::GenParticle *
gen = *pit;
209#endif
210
211 double mc_eta =
gen->momentum().pseudoRapidity();
212 double mc_phi =
gen->momentum().phi();
213
215
218 m_data->m_mc_eta = mc_eta;
219 m_data->m_mc_phi = mc_phi;
220
221 int nClus = pClusColl->size();
223 m_data->m_cls_ener->resize(nClus, 0.0);
224 m_data->m_cls_ener_unw->resize(nClus, 0.0);
225 m_data->m_cls_lambda->resize(nClus, 0.0);
226 m_data->m_cls_eta->resize(nClus, 0.0);
227 m_data->m_cls_phi->resize(nClus, 0.0);
228
229 m_data->m_cls_smpener->resize(nClus);
230 m_data->m_cls_smpener_unw->resize(nClus);
231
232 m_data->m_cls_eprep->resize(nClus);
233 m_data->m_cls_dmener->resize(nClus);
235 for(int i_cls=0; i_cls<nClus; i_cls++){
236
237 (*
m_data->m_cls_smpener)[i_cls].resize(CaloSampling::Unknown, 0.0);
238 (*
m_data->m_cls_smpener_unw)[i_cls].resize(CaloSampling::Unknown, 0.0);
239 (*
m_data->m_cls_eprep)[i_cls].resize(
m_data->m_narea, 0.0);
240 (*
m_data->m_cls_dmener)[i_cls].resize(
m_data->m_narea, 0.0);
241 }
242 m_data->m_cls_engcalib->resize(nClus, 0.0);
243 m_data->m_cls_recostat->resize(nClus, 0);
244 m_data->m_cls_pi0prob->resize(nClus, 0.0);
245 m_data->m_cls_isol->resize(nClus, 0.0);
246 m_data->m_cls_oocener->resize(nClus, 0.0);
247 m_data->m_cls_calib_emfrac->resize(nClus, 0.0);
248 m_data->m_cls_engcalibpres->resize(nClus, 0.0);
249
252 unsigned int iClus = 0;
253 for( ;clusIter!=clusIterEnd;++clusIter,++iClus) {
255
256 (*
m_data->m_cls_ener)[iClus] = theCluster->
e();
257
258 for(
int i_smp=0; i_smp<(
int)CaloSampling::Unknown; i_smp++){
260 }
261
262
263 double mx_calib_tot=0;
266 return StatusCode::FAILURE;
267 }
268 m_data->m_engClusSumCalib += mx_calib_tot;
269 (*
m_data->m_cls_engcalib)[iClus] = mx_calib_tot;
270
271 double mx_calib_emb0=0, mx_calib_eme0=0, mx_calib_tileg3=0;
275 ATH_MSG_ERROR(
"One of the moment ENG_CALIB_EMB0, ENG_CALIB_EME0, ENG_CALIB_TILEG3 is absent" );
276 return StatusCode::FAILURE;
277 }else{
278 (*
m_data->m_cls_engcalibpres)[iClus] = (mx_calib_emb0+mx_calib_eme0+mx_calib_tileg3);
279 }
280
283 if(pClusColl->size() != pClusCollCalib->size()) {
284 ATH_MSG_WARNING(
"Different size of calibrated and uncalibrated cluster collection "
285 << pClusColl->size() << " " << pClusCollCalib->size() );
286 return StatusCode::SUCCESS;
287 }
288
290
291
292 const CaloRecoStatus& recoStatus = theClusterCalib->
recoStatus();
293
295
296
297 double pi0Prob = 0;
299
300 pi0Prob = -1.0;
301 } else {
302 if ( pi0Prob < 0 ) pi0Prob = 0;
303 if ( pi0Prob > 1 ) pi0Prob = 1;
304 }
305 (*
m_data->m_cls_pi0prob)[iClus] = pi0Prob;
306 }
307
308
309 double mx_isol;
312 return StatusCode::FAILURE;
313 }else{
314 (*
m_data->m_cls_isol)[iClus] = mx_isol;
315 }
316
317 double mx_calib_oocL;
320 return StatusCode::FAILURE;
321 }else{
322 (*
m_data->m_cls_oocener)[iClus] = mx_calib_oocL;
323 }
324
325 double mx_calib_emfrac;
328 return StatusCode::FAILURE;
329 }else{
330 (*
m_data->m_cls_calib_emfrac)[iClus] = mx_calib_emfrac;
331 }
332
333
334
335
338 for(; cellIter != cellIterEnd; cellIter++ ){
339 const CaloCell* pCell = (*cellIter);
340 Identifier myId = pCell->
ID();
342 (*
m_data->m_cls_ener_unw)[iClus] += pCell->
e();
343 (*
m_data->m_cls_smpener_unw)[iClus][(
int)nsmp] += pCell->
e();
344 }
345
346 double clusEner = (*
m_data->m_cls_ener_unw)[iClus];
347 double clusLambda=0;
350 return StatusCode::FAILURE;
351 }
352 (*
m_data->m_cls_lambda)[iClus] = clusLambda;
353 (*
m_data->m_cls_eta)[iClus] = theCluster->
eta();
354 (*
m_data->m_cls_phi)[iClus] = theCluster->
phi();
356
357
358
359
360
361
362 for(
int i_dma=0; i_dma<
m_data->m_narea; i_dma++){
363
364 double dmVal=0;
367 return StatusCode::FAILURE;
368 }
369 (*
m_data->m_cls_dmener)[iClus][i_dma] = dmVal;
370
371
372
373 double eprep = 0.0;
377 x = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::PreSamplerB];
380 }
381 break;
383 x = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::EMB3];
384 y = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::TileBar0];
387 }
388 break;
390 x = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::TileGap3];
393 }
394 break;
396 x = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::PreSamplerE];
399 }
400 break;
402 x = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::EME3];
403 y = (*
m_data->m_cls_smpener_unw)[iClus][CaloSampling::HEC0];
406 }
407 break;
409 eprep = (*
m_data->m_cls_ener_unw)[iClus];
410 break;
412 eprep = (*
m_data->m_cls_ener_unw)[iClus];
413 break;
415 eprep = (*
m_data->m_cls_ener_unw)[iClus];
416 break;
417 default:
419 return StatusCode::FAILURE;
420 break;
421 }
422 (*
m_data->m_cls_eprep)[iClus][i_dma] = eprep;
423
424 }
425
426 }
427 }
428
429
430
431
432 for(
int i_cls=0; i_cls<
m_data->m_ncls; i_cls++){
433 double edm_uncorrected = 0.0;
434 for(
int i_dma=0; i_dma<
m_data->m_narea; i_dma++){
436 if( (*
m_data->m_cls_eprep)[i_cls][i_dma] <= 0.0 &&
442 {
443 edm_uncorrected += (*
m_data->m_cls_dmener)[i_cls][i_dma];
444 (*
m_data->m_cls_dmener)[i_cls][i_dma] = 0.0;
445 }
446 }
447
448 for(
int i_dma=0; i_dma<
m_data->m_narea; i_dma++){
450 (*
m_data->m_cls_dmener)[i_cls][i_dma] += edm_uncorrected;
451 }
452 }
453 }
454
456
457 return StatusCode::SUCCESS;
458}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
ServiceHandle< StoreGateSvc > & evtStore()
virtual double e() const override final
get energy (data member) (synonym to method energy()
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
virtual const store_type & getStatusWord() const
retrieve the entire status word
DataModel_detail::const_iterator< DataVector > const_iterator
const T * at(size_type n) const
Access an element, as an rvalue.
std::vector< xAOD::CaloCluster::MomentType > m_momentForDMArea
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version)
const_cell_iterator cell_end() const
float eSample(const CaloSample sampling) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
MomentType
Enums to identify different moments.
@ ENG_CALIB_OUT_L
Attached Calibration Hit energy outside clusters but inside the calorimeter with loose matching (Angl...
@ EM_PROBABILITY
Classification probability to be em-like.
@ ENG_CALIB_DEAD_UNCLASS
Attached Calibration Hit energy in dead material in unclassified areas of the detector.
@ ENG_CALIB_DEAD_HEC0
Attached Calibration Hit energy in dead material between EME3 and HEC0.
@ ENG_CALIB_DEAD_TILEG3
Attached Calibration Hit energy in dead material before scintillator.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ ENG_CALIB_DEAD_EME0
Attached Calibration Hit energy in dead material before EME0, between EME0 and EME1.
@ ENG_CALIB_DEAD_TILE0
Attached Calibration Hit energy in dead material between EMB3 and TILE0.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_CALIB_DEAD_FCAL
Attached Calibration Hit energy in dead material before FCAL, between FCAL and HEC.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ ENG_CALIB_DEAD_LEAKAGE
Attached Calibration Hit energy in dead material behind calorimeters.
@ ENG_CALIB_EMB0
Calibration Hit energy inside the cluster barrel presampler.
@ ENG_CALIB_EME0
Calibration Hit energy inside the cluster endcap presampler.
@ ENG_CALIB_DEAD_EMB0
Attached Calibration Hit energy in dead material before EMB0, between EMB0 and EMB1.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
@ ENG_CALIB_TILEG3
Calibration Hit energy inside the cluster scintillator.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const)
const GenParticle * ConstGenParticlePtr
retrieve(aClass, aKey=None)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.