ATLAS Offline Software
CaloClusterMomentsMaker_DigiHSTruth.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 //-----------------------------------------------------------------------
5 // File and Version Information:
6 //
7 // Description: see CaloClusterMomentsMaker.h
8 //
9 // Environment:
10 // Software developed for the ATLAS Detector at CERN LHC
11 //
12 // Author List:
13 // Sven Menke
14 //
15 //-----------------------------------------------------------------------
16 
18 #include "CaloEvent/CaloClusterContainer.h"
19 #include "CaloEvent/CaloCluster.h"
20 #include "CaloGeoHelpers/proxim.h"
21 #include "CaloEvent/CaloPrefetch.h"
25 
28 
29 #include "CLHEP/Units/SystemOfUnits.h"
30 #include "CxxUtils/prefetch.h"
31 #include <Eigen/Dense>
32 #include <cmath>
33 #include <cstdint>
34 #include <iterator>
35 #include <limits>
36 #include <sstream>
37 
38 
39 using CLHEP::deg;
40 using CLHEP::cm;
42 
43 namespace {
44 
45 
46  //FIXME, somehow make sure these names are in sync with the xAOD variable names
47 struct MomentName
48 {
49  const char* name;
51 };
52 
53 
54 // Must be sorted by name.
55 const MomentName moment_names[] = {
56  { "ENERGY_DigiHSTruth", ENERGY_DigiHSTruth },
57  { "ETA_DigiHSTruth", ETA_DigiHSTruth },
58  { "PHI_DigiHSTruth", PHI_DigiHSTruth },
59  { "AVG_LAR_Q_DigiHSTruth", AVG_LAR_Q_DigiHSTruth },
60  { "AVG_TILE_Q_DigiHSTruth", AVG_TILE_Q_DigiHSTruth },
61  { "BADLARQ_FRAC_DigiHSTruth", BADLARQ_FRAC_DigiHSTruth },
62  { "BAD_CELLS_CORR_E_DigiHSTruth", BAD_CELLS_CORR_E_DigiHSTruth },
63  { "CELL_SIGNIFICANCE_DigiHSTruth", CELL_SIGNIFICANCE_DigiHSTruth },
64  { "CELL_SIG_SAMPLING_DigiHSTruth", CELL_SIG_SAMPLING_DigiHSTruth },
65  { "CENTER_LAMBDA_DigiHSTruth", CENTER_LAMBDA_DigiHSTruth },
66  { "CENTER_MAG_DigiHSTruth", CENTER_MAG_DigiHSTruth },
67  { "CENTER_X_DigiHSTruth", CENTER_X_DigiHSTruth },
68  { "CENTER_Y_DigiHSTruth", CENTER_Y_DigiHSTruth },
69  { "CENTER_Z_DigiHSTruth", CENTER_Z_DigiHSTruth },
70  { "DELTA_ALPHA_DigiHSTruth", DELTA_ALPHA_DigiHSTruth },
71  { "DELTA_PHI_DigiHSTruth", DELTA_PHI_DigiHSTruth },
72  { "DELTA_THETA_DigiHSTruth", DELTA_THETA_DigiHSTruth },
73  { "ENG_BAD_CELLS_DigiHSTruth", ENG_BAD_CELLS_DigiHSTruth },
74  { "ENG_BAD_HV_CELLS_DigiHSTruth", ENG_BAD_HV_CELLS_DigiHSTruth },
75  { "ENG_FRAC_CORE_DigiHSTruth", ENG_FRAC_CORE_DigiHSTruth },
76  { "ENG_FRAC_EM_DigiHSTruth", ENG_FRAC_EM_DigiHSTruth },
77  { "ENG_FRAC_MAX_DigiHSTruth", ENG_FRAC_MAX_DigiHSTruth },
78  { "ENG_POS_DigiHSTruth", ENG_POS_DigiHSTruth },
79  { "FIRST_ENG_DENS_DigiHSTruth", FIRST_ENG_DENS_DigiHSTruth },
80  { "FIRST_ETA_DigiHSTruth", FIRST_ETA_DigiHSTruth },
81  { "FIRST_PHI_DigiHSTruth", FIRST_PHI_DigiHSTruth },
82  { "ISOLATION_DigiHSTruth", ISOLATION_DigiHSTruth },
83  { "LATERAL_DigiHSTruth", LATERAL_DigiHSTruth },
84  { "LONGITUDINAL_DigiHSTruth", LONGITUDINAL_DigiHSTruth },
85  { "N_BAD_CELLS_DigiHSTruth", N_BAD_CELLS_DigiHSTruth },
86  { "N_BAD_HV_CELLS_DigiHSTruth", N_BAD_HV_CELLS_DigiHSTruth },
87  { "N_BAD_CELLS_CORR_DigiHSTruth", N_BAD_CELLS_CORR_DigiHSTruth },
88  { "SECOND_ENG_DENS_DigiHSTruth", SECOND_ENG_DENS_DigiHSTruth },
89  { "SECOND_LAMBDA_DigiHSTruth", SECOND_LAMBDA_DigiHSTruth },
90  { "SECOND_R_DigiHSTruth", SECOND_R_DigiHSTruth },
91  { "SIGNIFICANCE_DigiHSTruth", SIGNIFICANCE_DigiHSTruth },
92 };
93 
94 const MomentName* const moment_names_end =
95  moment_names + sizeof(moment_names)/sizeof(moment_names[0]);
96 
97 #if 0
98 bool operator< (const std::string& v, const MomentName& m)
99 {
100  return strcmp (v.c_str(), m.name) < 0;
101 }
102 #endif
103 bool operator< (const MomentName& m, const std::string& v)
104 {
105  return strcmp (m.name, v.c_str()) < 0;
106 }
107 
108 
109 }
110 
111 
112 //###############################################################################
113 
115  const std::string& name,
116  const IInterface* parent)
118  m_calo_id(nullptr),
119  m_maxAxisAngle(20*deg),
120  m_minRLateral(4*cm),
121  m_minLLongitudinal(10*cm),
122  m_minBadLArQuality(4000),
123  m_calculateSignificance(false),
124  m_calculateIsolation(false),
125  m_calculateLArHVFraction(false),
126  m_twoGaussianNoise(false),
127  m_caloDepthTool("CaloDepthTool",this),
128  m_larHVFraction("LArHVFraction",this),
129  m_absOpt(false)
130 {
131  // Name(s) of Moments to calculate
132  declareProperty("MomentsNames",m_momentsNames);
133 
134  // Name(s) of Moments which can be stored on the AOD - all others go to ESD
135  // m_momentsNamesAOD.push_back(std::string("FIRST_PHI"));
136  // m_momentsNamesAOD.push_back(std::string("FIRST_ETA"));
137  // m_momentsNamesAOD.push_back(std::string("SECOND_R"));
138  // m_momentsNamesAOD.push_back(std::string("SECOND_LAMBDA"));
139  // m_momentsNamesAOD.push_back(std::string("CENTER_LAMBDA"));
140  // m_momentsNamesAOD.push_back(std::string("FIRST_ENG_DENS"));
141  // m_momentsNamesAOD.push_back(std::string("ENG_BAD_CELLS"));
142  // m_momentsNamesAOD.push_back(std::string("N_BAD_CELLS"));
143 
144  //declareProperty("AODMomentsNames",m_momentsNamesAOD);
145  // maximum allowed angle between shower axis and the vector pointing
146  // to the shower center from the IP in degrees. This property is need
147  // to protect against cases where all significant cells are in one sampling
148  // and the shower axis can not be defined from them
149  declareProperty("MaxAxisAngle",m_maxAxisAngle);
150  declareProperty("MinRLateral",m_minRLateral);
151  declareProperty("MinLLongitudinal",m_minLLongitudinal);
152  declareProperty("MinBadLArQuality",m_minBadLArQuality);
153  // use 2-gaussian noise for Tile
154  declareProperty("TwoGaussianNoise",m_twoGaussianNoise);
155  declareProperty("LArHVFraction",m_larHVFraction,"Tool Handle for LArHVFraction");
156 
158  declareProperty("AODMomentsNames",m_momentsNamesAOD);
159  // Use weighting of neg. clusters option?
160  declareProperty("WeightingOfNegClusters", m_absOpt);
161 }
162 
163 //###############################################################################
164 
166 {
167 
168  //FIXME: All that could be done at initialize!
169  m_calculateSignificance = false;
170  m_calculateIsolation = false;
171 
172  // translate all moment names specified in MomentsNames property to moment enums,
173  // check that they are all valid and there are no repeating names
174  for(const auto& name: m_momentsNames) {
175  const MomentName* it =
176  std::lower_bound (moment_names, moment_names_end, name);
177  //std::find(moment_names, moment_names_end, name);
178  //moment_names.find(name);
179 
180  for(const auto& testName: moment_names){
181  if(name == testName.name) it = &testName;
182  }
183  if (it != moment_names_end) {
184  m_validMoments.push_back (it->mom);
185  switch (it->mom) {
186  case SIGNIFICANCE_DigiHSTruth:
187  case CELL_SIGNIFICANCE_DigiHSTruth:
189  break;
190  case ISOLATION_DigiHSTruth:
191  m_calculateIsolation = true;
192  break;
193  case ENG_BAD_HV_CELLS_DigiHSTruth:
195  default:
196  break;
197  }
198  }
199  else {
200  msg(MSG::ERROR) << "Moment " << name
201  << " is not a valid Moment name and will be ignored! "
202  << "Valid names are:";
203  int count = 0;
204  for (const MomentName& m : moment_names)
205  msg() << ((count++)==0?" ":", ") << m.name;
206  msg() << endmsg;
207  }
208  }
209 
210  // sort and remove duplicates, order is not required for any of the code below
211  // but still may be useful property
212  std::stable_sort(m_validMoments.begin(), m_validMoments.end());
213 /*
214  m_validMoments.erase(std::unique(m_validMoments.begin(),
215  m_validMoments.end()),
216  m_validMoments.end());
217 */
218 
219 
220  /*
221  // translate moment names in AODMomentsNames property into set of enums,
222  // only take valid names which are also in MomentsNames property
223  m_momentsAOD.reserve(m_momentsNamesAOD.size());
224  for(const auto& name: m_momentsNamesAOD) {
225  const MomentName* it =
226  std::lower_bound (moment_names, moment_names_end, name);
227  if (it != moment_names_end) {
228  if (std::find(m_validMoments.begin(), m_validMoments.end(), it->mom)
229  != m_validMoments.end())
230  {
231  m_momentsAOD.push_back(it->mom);
232  }
233  }
234  }
235  */
236 
237  ATH_CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID"));
238 
239  ATH_CHECK(m_caloDepthTool.retrieve());
241 
244  }
245 
247  ATH_CHECK(m_larHVFraction.retrieve());
248  }
249  else {
250  m_larHVFraction.disable();
251  }
252 
253  return StatusCode::SUCCESS;
254 
255 }
256 
257 //#############################################################################
258 
260 
261 struct cellinfo {
262  double x;
263  double y;
264  double z;
265  double energy;
266  double eta;
267  double phi;
268  double r;
269  double lambda;
270  double volume;
272 };
273 
274 } // namespace CaloClusterMomentsMaker_DigiHSTruth_detail
275 
278  xAOD::CaloClusterContainer *theClusColl)
279  const
280 {
281 
282  ATH_MSG_DEBUG("Executing " << name());
283 
285 
286  // Maps cell IdentifierHash to cluster index in cluster collection.
287  // Only used when cluster isolation moment is calculated.
288  using clusterIdx_t = std::uint16_t;
289  typedef std::pair<clusterIdx_t, clusterIdx_t> clusterPair_t;
290  std::vector<clusterPair_t> clusterIdx;
291  const clusterIdx_t noCluster = std::numeric_limits<clusterIdx_t>::max();
292 
293  const CaloNoise* noise=nullptr;
296  noise=*noiseHdl;
297  }
298 
300  const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
301 
302  // Counters for number of empty and non-empty neighbor cells per sampling layer
303  // Only used when cluster isolation moment is calculated.
304  int nbEmpty[CaloCell_ID::Unknown];
305  int nbNonEmpty[CaloCell_ID::Unknown];
306 
307  // prepare stuff from entire collection in case isolation moment
308  // should be calculated
309 
310  if ( m_calculateIsolation ) {
311 
312  if (theClusColl->size() >= noCluster) {
313  msg(MSG::ERROR) << "Too many clusters" << endmsg;
314  return StatusCode::FAILURE;
315  }
316 
317  // initialize with "empty" values
318  clusterIdx.resize(m_calo_id->calo_cell_hash_max(),
319  clusterPair_t(noCluster, noCluster));
320 
321  int iCluster = 0;
322  for (xAOD::CaloCluster* theCluster : *theClusColl) {
323  // loop over all cell members and fill cell vector for used cells
324  xAOD::CaloCluster::cell_iterator cellIter = theCluster->cell_begin();
325  xAOD::CaloCluster::cell_iterator cellIterEnd = theCluster->cell_end();
326  for(; cellIter != cellIterEnd; cellIter++ ){
327  CxxUtils::prefetchNext(cellIter, cellIterEnd);
328  const CaloCell* myCell = *cellIter;
329 
330  const CaloDetDescrElement * caloDDE = myCell->caloDDE();
331  IdentifierHash hashid=caloDDE->calo_hash() ;
332  if(! hashid.is_valid() ) continue;
333  if(hashid >= (signalCells)->size()) continue;
334  myCell = (*signalCells).findCell(hashid);
335  if(!myCell) continue;
336 
337 
338  Identifier myId = myCell->ID();
339  IdentifierHash myHashId = m_calo_id->calo_cell_hash(myId);
340  if ( clusterIdx[(unsigned int)myHashId].first != noCluster) {
341  // check weight and assign to current cluster if weight is > 0.5
342  double weight = cellIter.weight();
343  if ( weight > 0.5 )
344  clusterIdx[(unsigned int)myHashId].first = iCluster;
345  }
346  else {
347  clusterIdx[(unsigned int)myHashId].first = iCluster;
348  }
349  }
350  ++iCluster;
351  }
352  }
353 
354  // Move allocation of temporary arrays outside the cluster loop.
355  // That way, we don't need to delete and reallocate them
356  // each time through the loop.
357 
358  std::vector<CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo> cellinfo;
359  std::vector<double> maxSampE (CaloCell_ID::Unknown);
360  std::vector<double> myMoments(m_validMoments.size(),0);
361  std::vector<double> myNorms(m_validMoments.size(),0);
362  std::vector<IdentifierHash> theNeighbors;
363  // loop over individual clusters
364  xAOD::CaloClusterContainer::iterator clusIter = theClusColl->begin();
365  xAOD::CaloClusterContainer::iterator clusIterEnd = theClusColl->end();
366  int iClus = 0;
367  for( ;clusIter!=clusIterEnd;++clusIter,++iClus) {
368  xAOD::CaloCluster * theCluster = *clusIter;
369 
370  double w(0),xc(0),yc(0),zc(0);
371  double eBad(0),ebad_dac(0),ePos(0),eBadLArQ(0),sumSig2(0),maxAbsSig(0);
372  double eLAr2(0),eLAr2Q(0);
373  double eTile2(0),eTile2Q(0);
374  double eBadLArHV(0);
375  int nbad(0),nbad_dac(0),nBadLArHV(0);
376  unsigned int ncell(0),i,nSigSampl(0);
377  unsigned int theNumOfCells = theCluster->size();
378  double theClusterEnergy = 0;
379  double theClusterAbsEnergy = 0;
380  double theClusterEta = 0;
381  double theClusterPhi = 0;
382 
383  // these two are needed for the LATERAL moment
384  int iCellMax(-1);
385  int iCellScndMax(-1);
386 
387  if (cellinfo.capacity() == 0)
388  cellinfo.reserve (theNumOfCells*2);
389  cellinfo.resize (theNumOfCells);
390 
391  double phi0 = theCluster->phi();;
392  for(i=0;i<(unsigned int)CaloCell_ID::Unknown;i++)
393  maxSampE[i] = 0;
394 
395  if ( !m_momentsNames.empty() ) {
396  std::fill (myMoments.begin(), myMoments.end(), 0);
397  std::fill (myNorms.begin(), myNorms.end(), 0);
398  if ( m_calculateIsolation ) {
399  std::fill_n(nbNonEmpty, CaloCell_ID::Unknown, 0);
400  std::fill_n(nbEmpty, CaloCell_ID::Unknown, 0);
401  }
402 
403  // loop over all cell members and calculate the center of mass
404  xAOD::CaloCluster::cell_iterator cellIter = theCluster->cell_begin();
405  xAOD::CaloCluster::cell_iterator cellIterEnd = theCluster->cell_end();
406  for(; cellIter != cellIterEnd; cellIter++ ){
407  CaloPrefetch::nextDDE(cellIter, cellIterEnd);
408  const CaloCell* pCell = (*cellIter);
409  const CaloDetDescrElement * caloDDE = pCell->caloDDE();
410  IdentifierHash hashid=caloDDE->calo_hash() ;
411  if(! hashid.is_valid() ) continue;
412 
413  if(hashid >= (signalCells)->size()) continue;
414  pCell = (*signalCells).findCell(hashid);
415 
416  Identifier myId = pCell->ID();
417 
418  const CaloDetDescrElement* myCDDE = pCell->caloDDE();
419  double ene = pCell->e();
420  if(m_absOpt) ene = std::abs(ene);
421  double weight = cellIter.weight();//theCluster->getCellWeight(cellIter);
422 
423  double thePhi;
424  double cellPhi = myCDDE->phi();
425  thePhi = proxim (cellPhi, phi0);
426 
427  theClusterEnergy += weight * ene;
428  theClusterAbsEnergy += weight*std::abs(ene);
429  theClusterEta += weight*std::abs(ene)*pCell->eta();
430  theClusterPhi += weight*std::abs(ene)* thePhi;
431  if ( pCell->badcell() ) {
432  eBad += ene*weight;
433  nbad++;
434  if(ene!=0){
435  ebad_dac+=ene*weight;
436  nbad_dac++;
437  }
438  }
439  else {
440  if ( ! (myCDDE->is_tile())
441  && ((pCell->provenance() & 0x2000) == 0x2000)
442  && !((pCell->provenance() & 0x0800) == 0x0800)) {
443  if ( pCell->quality() > m_minBadLArQuality ) {
444  eBadLArQ += ene*weight;
445  }
446  eLAr2 += ene*weight*ene*weight;
447  eLAr2Q += ene*weight*ene*weight*pCell->quality();
448  }
449  if ( myCDDE->is_tile() ) {
450  uint16_t tq = pCell->quality();
451  uint8_t tq1 = (0xFF00&tq)>>8; // quality in channel 1
452  uint8_t tq2 = (0xFF&tq); // quality in channel 2
453  // reject cells with either 0xFF00 or 0xFF
454  if ( ((tq1&0xFF) != 0xFF) && ((tq2&0xFF) != 0xFF) ) {
455  eTile2 += ene*weight*ene*weight;
456  // take the worse of both qualities (one might be 0 in
457  // 1-channel cases)
458  eTile2Q += ene*weight*ene*weight*(tq1>tq2?tq1:tq2);
459  }
460  }
461  }
462  if ( ene > 0 ) {
463  ePos += ene*weight;
464  }
465  if ( m_calculateSignificance ) {
466  const float sigma = m_twoGaussianNoise ? \
467  noise->getEffectiveSigma(pCell->ID(),pCell->gain(),pCell->energy()) : \
468  noise->getNoise(pCell->ID(),pCell->gain());
469  sumSig2 += sigma*sigma;
470  // use geomtery weighted energy of cell for leading cell significance
471  double Sig = (sigma>0?ene*weight/sigma:0);
472  if ( std::abs(Sig) > std::abs(maxAbsSig) ) {
473  maxAbsSig = Sig;
474  nSigSampl = myCDDE->getSampling();
475  }
476  }
477  if ( m_calculateIsolation ) {
478  // get all 2D Neighbours if the cell is not inside another cluster with
479  // larger weight
480 
481  IdentifierHash myHashId = m_calo_id->calo_cell_hash(myId);
482  if ( clusterIdx[myHashId].first == iClus ) {
483  theNeighbors.clear();
484  m_calo_id->get_neighbours(myHashId, LArNeighbours::all2D, theNeighbors);
485  for (const auto& nhash: theNeighbors) {
486  clusterPair_t& idx = clusterIdx[nhash];
487 
488  // only need to look at each cell once per cluster
489  if ( idx.second == iClus ) continue;
490  idx.second = iClus;
491 
492  if ( idx.first == noCluster ) {
493  ++ nbEmpty[m_calo_id->calo_sample(nhash)];
494  } else if ( idx.first != iClus ) {
495  ++ nbNonEmpty[m_calo_id->calo_sample(nhash)];
496  }
497 
498  }
499  }
500  }
501 
502  if ( myCDDE && ene > 0. && weight > 0) {
503  // get all geometric information needed ...
505  ci.x = myCDDE->x();
506  ci.y = myCDDE->y();
507  ci.z = myCDDE->z();
508  ci.eta = myCDDE->eta();
509  ci.phi = myCDDE->phi();
510  ci.energy = ene*weight;
511  ci.volume = myCDDE->volume();
512  ci.sample = myCDDE->getSampling();
513  if ( ci.energy > maxSampE[(unsigned int)ci.sample] )
514  maxSampE[(unsigned int)ci.sample] = ci.energy;
515 
516  if (iCellMax < 0 || ci.energy > cellinfo[iCellMax].energy ) {
517  iCellScndMax = iCellMax;
518  iCellMax = ncell;
519  }
520  else if (iCellScndMax < 0 ||
521  ci.energy > cellinfo[iCellScndMax].energy )
522  {
523  iCellScndMax = ncell;
524  }
525 
526  xc += ci.energy*ci.x;
527  yc += ci.energy*ci.y;
528  zc += ci.energy*ci.z;
529  w += ci.energy;
530 
531  ncell++;
532  }
533  } //end of loop over all cells
534 
535  if ( w > 0 ) {
536  xc/=w;
537  yc/=w;
538  zc/=w;
539  Amg::Vector3D showerCenter(xc,yc,zc);
540  w=0;
541 
542 
543  //log << MSG::WARNING << "Found bad cells " << xbad_dac << " " << ybad_dac << " " << zbad_dac << " " << ebad_dac << endmsg;
544  //log << MSG::WARNING << "Found Cluster " << xbad_dac << " " << ybad_dac << " " << zbad_dac << " " << endmsg;
545  // shower axis is just the vector pointing from the IP to the shower center
546  // in case there are less than 3 cells in the cluster
547 
548  Amg::Vector3D showerAxis(xc,yc,zc);
549  Amg::setMag(showerAxis,1.0);
550 
551  // otherwise the principal direction with the largest absolute
552  // eigenvalue will be used unless it's angle w.r.t. the vector pointing
553  // from the IP to the shower center is larger than allowed by the
554  // property m_maxAxisAngle
555 
556  double angle(0),deltaPhi(0),deltaTheta(0);
557  if ( ncell > 2 ) {
558  Eigen::Matrix3d C=Eigen::Matrix3d::Zero();
559  for(i=0;i<ncell;i++) {
561  const double e2 = ci.energy * ci.energy;
562 
563  C(0,0) += e2*(ci.x-xc)*(ci.x-xc);
564  C(1,0) += e2*(ci.x-xc)*(ci.y-yc);
565  C(2,0) += e2*(ci.x-xc)*(ci.z-zc);
566 
567  C(1,1) += e2*(ci.y-yc)*(ci.y-yc);
568  C(2,1) += e2*(ci.y-yc)*(ci.z-zc);
569 
570  C(2,2) += e2*(ci.z-zc)*(ci.z-zc);
571  w += e2;
572  }
573 
574  C/=w;
575 
576 
577  Eigen::SelfAdjointEigenSolver<Eigen::Matrix3d> eigensolver(C);
578  if (eigensolver.info() != Eigen::Success) {
579  msg(MSG::WARNING) << "Failed to compute Eigenvalues -> Can't determine shower axis" << endmsg;
580  }
581  else {
582  // don't use the principal axes if at least one of the 3
583  // diagonal elements is 0
584 
585 
586  const Eigen::Vector3d& S=eigensolver.eigenvalues();
587  const Eigen::Matrix3d& U=eigensolver.eigenvectors();
588 
589  const double epsilon = 1.E-6;
590 
591  if ( std::abs(S[0]) >= epsilon && std::abs(S[1]) >= epsilon && std::abs(S[2]) >= epsilon ) {
592 
593  Amg::Vector3D prAxis(showerAxis);
594 
595  int iEigen = -1;
596 
597  for (i=0;i<3;i++) {
598  Amg::Vector3D tmpAxis=U.col(i);
599 
600  // calculate the angle
601  double tmpAngle=Amg::angle(tmpAxis,showerAxis);
602 
603  if ( tmpAngle > 90*deg ) {
604  tmpAngle = 180*deg - tmpAngle;
605  tmpAxis = -tmpAxis;
606  }
607 
608  if ( iEigen == -1 || tmpAngle < angle ) {
609  iEigen = i;
610  angle = tmpAngle;
611  prAxis = tmpAxis;
612  }
613 
614  }//end for loop
615 
616  // calculate theta and phi angle differences
617 
618  deltaPhi = CaloPhiRange::diff(showerAxis.phi(),prAxis.phi());
619 
620  deltaTheta = showerAxis.theta() - prAxis.theta();
621 
622  // check the angle
623 
624  if ( angle < m_maxAxisAngle ) {
625  showerAxis = prAxis;
626  }
627  else
628  ATH_MSG_DEBUG("principal Direction (" << prAxis[Amg::x] << ", "
629  << prAxis[Amg::y] << ", " << prAxis[Amg::z] << ") deviates more than "
630  << m_maxAxisAngle*(1./deg)
631  << " deg from IP-to-ClusterCenter-axis (" << showerAxis[Amg::x] << ", "
632  << showerAxis[Amg::y] << ", " << showerAxis[Amg::z] << ")");
633  }//end if !S[i]==0
634  }// end else got Eigenvalues
635  } //end if ncell>2
636 
637  ATH_MSG_DEBUG("Shower Axis = (" << showerAxis.x() << ", "
638  << showerAxis.y() << ", " << showerAxis.z() << ")");
639 
640  // calculate radial distance from and the longitudinal distance
641  // along the shower axis for each cell. The cluster center is
642  // at r=0 and lambda=0
643 
644  for (auto& ci : cellinfo) {
645  const Amg::Vector3D currentCell(ci.x,ci.y,ci.z);
646  // calculate distance from shower axis r
647  ci.r = ((currentCell-showerCenter).cross(showerAxis)).mag();
648  // calculate distance from shower center along shower axis
649  ci.lambda = (currentCell-showerCenter).dot(showerAxis);
650  }
651 
652  // loop over all positive energy cells and calculate all desired moments
653 
654  // define common norm for all simple moments
655  double commonNorm = 0;
656  double phi0 = ncell > 0 ? cellinfo[0].phi : 0;
657  for(i=0;i<ncell;i++) {
659  // loop over all valid moments
660  commonNorm += ci.energy;
661  for(size_t iMoment = 0, size = m_validMoments.size();
662  iMoment != size;
663  ++ iMoment)
664  {
665  // now calculate the actual moments
666  switch (m_validMoments[iMoment]) {
667  case FIRST_ETA_DigiHSTruth:
668  myMoments[iMoment] += ci.energy*ci.eta;
669  break;
670  case FIRST_PHI_DigiHSTruth:
671  // first cell decides the sign in order to avoid
672  // overlap problem at phi = -pi == +pi
673  // need to be normalized to the range [-pi,+pi] in the end
674  myMoments[iMoment] += ci.energy * proxim (ci.phi, phi0);
675  break;
676  case SECOND_R_DigiHSTruth:
677  myMoments[iMoment] += ci.energy*ci.r*ci.r;
678  break;
679  case SECOND_LAMBDA_DigiHSTruth:
680  myMoments[iMoment] += ci.energy*ci.lambda*ci.lambda;
681  break;
682  case LATERAL_DigiHSTruth:
683  if ( (int)i != iCellMax && (int)i != iCellScndMax ) {
684  myMoments[iMoment] += ci.energy*ci.r*ci.r;
685  myNorms[iMoment] += ci.energy*ci.r*ci.r;
686  }
687  else {
688  double rm = ci.r;
689  if ( rm < m_minRLateral )
690  rm = m_minRLateral;
691  myNorms[iMoment] += rm*rm*ci.energy;
692  }
693  break;
694  case LONGITUDINAL_DigiHSTruth:
695  if ( (int)i != iCellMax && (int)i != iCellScndMax ) {
696  myMoments[iMoment] += ci.energy*ci.lambda*ci.lambda;
697  myNorms[iMoment] += ci.energy*ci.lambda*ci.lambda;
698  }
699  else {
700  double lm = ci.lambda;
701  if ( lm < m_minLLongitudinal )
702  lm = m_minLLongitudinal;
703  myNorms[iMoment] += lm*lm*ci.energy;
704  }
705  break;
706  case FIRST_ENG_DENS_DigiHSTruth:
707  if ( ci.volume > 0 ) {
708  myMoments[iMoment] += ci.energy*ci.energy/ci.volume;
709  myNorms[iMoment] += ci.energy;
710  }
711  break;
712  case SECOND_ENG_DENS_DigiHSTruth:
713  if ( ci.volume > 0 ) {
714  myMoments[iMoment] += ci.energy*std::pow(ci.energy/ci.volume,2);
715  myNorms[iMoment] += ci.energy;
716  }
717  break;
718  case ENG_FRAC_EM_DigiHSTruth:
719  if ( ci.sample == CaloCell_ID::EMB1
720  || ci.sample == CaloCell_ID::EMB2
721  || ci.sample == CaloCell_ID::EMB3
722  || ci.sample == CaloCell_ID::EME1
723  || ci.sample == CaloCell_ID::EME2
724  || ci.sample == CaloCell_ID::EME3
725  || ci.sample == CaloCell_ID::FCAL0 )
726  myMoments[iMoment] += ci.energy;
727  break;
728  case ENG_FRAC_MAX_DigiHSTruth:
729  if ( (int)i == iCellMax )
730  myMoments[iMoment] = ci.energy;
731  break;
732  default:
733  // nothing to be done for other moments
734  break;
735  }
736  }
737  } //end of loop over cell
738 
739  const auto hvFrac=m_larHVFraction->getLArHVFrac(theCluster->getCellLinks(),ctx);
740  eBadLArHV= hvFrac.first;
741  nBadLArHV=hvFrac.second;
742 
743 
744  // assign moments which don't need the loop over the cells
745  for (size_t iMoment = 0, size = m_validMoments.size();
746  iMoment != size;
747  ++ iMoment)
748  {
749  // now calculate the actual moments
750  switch (m_validMoments[iMoment]) {
751  case FIRST_ETA_DigiHSTruth:
752  case FIRST_PHI_DigiHSTruth:
753  case SECOND_R_DigiHSTruth:
754  case SECOND_LAMBDA_DigiHSTruth:
755  case ENG_FRAC_EM_DigiHSTruth:
756  case ENG_FRAC_MAX_DigiHSTruth:
757  myNorms[iMoment] = commonNorm;
758  break;
759  case DELTA_PHI_DigiHSTruth:
760  myMoments[iMoment] = deltaPhi;
761  break;
762  case DELTA_THETA_DigiHSTruth:
763  myMoments[iMoment] = deltaTheta;
764  break;
765  case DELTA_ALPHA_DigiHSTruth:
766  myMoments[iMoment] = angle;
767  break;
768  case CENTER_X_DigiHSTruth:
769  myMoments[iMoment] = showerCenter.x();
770  break;
771  case CENTER_Y_DigiHSTruth:
772  myMoments[iMoment] = showerCenter.y();
773  break;
774  case CENTER_Z_DigiHSTruth:
775  myMoments[iMoment] = showerCenter.z();
776  break;
777  case CENTER_MAG_DigiHSTruth:
778  myMoments[iMoment] = showerCenter.mag();
779  break;
780  case CENTER_LAMBDA_DigiHSTruth:
781  // calculate the longitudinal distance along the shower axis
782  // of the shower center from the calorimeter start
783 
784  // first need calo boundary at given eta phi try LAREM barrel
785  // first, then LAREM endcap OW, then LAREM endcap IW, then
786  // FCal
787  {
788  double r_calo(0),z_calo(0),lambda_c(0);
789  r_calo = m_caloDepthTool->get_entrance_radius(CaloCell_ID::EMB1,
790  showerCenter.eta(),
791  showerCenter.phi(),
792  caloDDMgr);
793  if ( r_calo == 0 ) {
794  z_calo = m_caloDepthTool->get_entrance_z(CaloCell_ID::EME1,
795  showerCenter.eta(),
796  showerCenter.phi(),
797  caloDDMgr);
798  if ( z_calo == 0 )
799  z_calo = m_caloDepthTool->get_entrance_z(CaloCell_ID::EME2,
800  showerCenter.eta(),
801  showerCenter.phi(),
802  caloDDMgr);
803  if ( z_calo == 0 )
804  z_calo = m_caloDepthTool->get_entrance_z(CaloCell_ID::FCAL0,
805  showerCenter.eta(),
806  showerCenter.phi(),
807  caloDDMgr);
808  if ( z_calo == 0 ) // for H6 TB without EMEC outer wheel
809  z_calo = m_caloDepthTool->get_entrance_z(CaloCell_ID::HEC0,
810  showerCenter.eta(),
811  showerCenter.phi(),
812  caloDDMgr);
813  if ( z_calo != 0 && showerAxis.z() != 0 ) {
814  lambda_c = std::abs((z_calo-showerCenter.z())/showerAxis.z());
815  }
816  }
817  else {
818  double r_s2 = showerAxis.x()*showerAxis.x()
819  +showerAxis.y()*showerAxis.y();
820  double r_cs = showerAxis.x()*showerCenter.x()
821  +showerAxis.y()*showerCenter.y();
822  double r_cr = showerCenter.x()*showerCenter.x()
823  +showerCenter.y()*showerCenter.y()-r_calo*r_calo;
824  if ( r_s2 > 0 ) {
825  double det = r_cs*r_cs/(r_s2*r_s2) - r_cr/r_s2;
826  if ( det > 0 ) {
827  det = sqrt(det);
828  double l1(-r_cs/r_s2);
829  double l2(l1);
830  l1 += det;
831  l2 -= det;
832  if ( std::abs(l1) < std::abs(l2) )
833  lambda_c = std::abs(l1);
834  else
835  lambda_c = std::abs(l2);
836  }
837  }
838  }
839  myMoments[iMoment] = lambda_c;
840  }
841  break;
842  case ENG_FRAC_CORE_DigiHSTruth:
843  for(i=0;i<(int)CaloCell_ID::Unknown;i++)
844  myMoments[iMoment] += maxSampE[i];
845  myNorms[iMoment] = commonNorm;
846  break;
847  case ISOLATION_DigiHSTruth:
848  {
849  // loop over empty and filled perimeter cells and
850  // get a weighted ratio by means of energy fraction per layer
851  for(unsigned int i=0; i != CaloSampling::Unknown; ++ i) {
853  if (theCluster->hasSampling(s)) {
854  const double eSample = theCluster->eSample(s);
855  if (eSample > 0) {
856  int nAll = nbEmpty[i]+nbNonEmpty[i];
857  if (nAll > 0) {
858  myMoments[iMoment] += (eSample*nbEmpty[i])/nAll;
859  myNorms[iMoment] += eSample;
860  }
861  }//end of eSample>0
862  }//end has sampling
863  }//end loop over samplings
864  }
865  break;
866  case ENG_BAD_CELLS_DigiHSTruth:
867  myMoments[iMoment] = eBad;
868  break;
869  case N_BAD_CELLS_DigiHSTruth:
870  myMoments[iMoment] = nbad;
871  break;
872  case N_BAD_CELLS_CORR_DigiHSTruth:
873  myMoments[iMoment] = nbad_dac;
874  break;
875  case BAD_CELLS_CORR_E_DigiHSTruth:
876  myMoments[iMoment] = ebad_dac;
877  break;
878  case BADLARQ_FRAC_DigiHSTruth:
879  myMoments[iMoment] = eBadLArQ/(theCluster->e()!=0.?theCluster->e():1.);
880  break;
881  case ENG_POS_DigiHSTruth:
882  myMoments[iMoment] = ePos;
883  break;
884  case SIGNIFICANCE_DigiHSTruth:
885  myMoments[iMoment] = (sumSig2>0?theCluster->e()/sqrt(sumSig2):0.);
886  break;
887  case CELL_SIGNIFICANCE_DigiHSTruth:
888  myMoments[iMoment] = maxAbsSig;
889  break;
890  case CELL_SIG_SAMPLING_DigiHSTruth:
891  myMoments[iMoment] = nSigSampl;
892  break;
893  case AVG_LAR_Q_DigiHSTruth:
894  myMoments[iMoment] = eLAr2Q/(eLAr2>0?eLAr2:1);
895  break;
896  case AVG_TILE_Q_DigiHSTruth:
897  myMoments[iMoment] = eTile2Q/(eTile2>0?eTile2:1);
898  break;
899  case ENG_BAD_HV_CELLS_DigiHSTruth:
900  myMoments[iMoment] = eBadLArHV;
901  break;
902  case N_BAD_HV_CELLS_DigiHSTruth:
903  myMoments[iMoment] = nBadLArHV;
904  break;
905  case ENERGY_DigiHSTruth:
906  myMoments[iMoment] = theClusterEnergy;
907  break;
908  case ETA_DigiHSTruth:
909  if(theClusterAbsEnergy > 0)
910  myMoments[iMoment] = theClusterEta / theClusterAbsEnergy;
911  else{
912  myMoments[iMoment] = 0;
913  }
914  break;
915  case PHI_DigiHSTruth:
916  if(theClusterAbsEnergy > 0)
917  myMoments[iMoment] = CaloPhiRange::fix(theClusterPhi / theClusterAbsEnergy);
918  else{
919  myMoments[iMoment] = 0;
920  }
921  break;
922  default:
923  // nothing to be done for other moments
924  break;
925  }
926  }
927  }
928 
929  // normalize moments and copy to Cluster Moment Store
930  size_t size= m_validMoments.size();
931  for (size_t iMoment = 0; iMoment != size; ++iMoment) {
933  if ( myNorms[iMoment] != 0 )
934  myMoments[iMoment] /= myNorms[iMoment];
935  if ( moment == FIRST_PHI_DigiHSTruth )
936  myMoments[iMoment] = CaloPhiRange::fix(myMoments[iMoment]);
937 
938  theCluster->insertMoment(moment,myMoments[iMoment]);
939  }
940  }
941  }
942 
943  return StatusCode::SUCCESS;
944 }
945 
947 {
948  return StatusCode::SUCCESS;
949 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloClusterMomentsMaker_DigiHSTruth::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Key of the CaloNoise Conditions data object.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:133
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
operator<
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloPrefetch.h
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Amg::setMag
void setMag(Amg::Vector3D &v, double mag)
scales the vector length without changing the angles
Definition: GeoPrimitivesHelpers.h:104
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::CaloCluster_v1::CaloSample
CaloSampling::CaloSample CaloSample
Definition: CaloCluster_v1.h:66
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
CaloDetDescrElement::y
float y() const
cell y
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:365
Amg::angle
double angle(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
calculates the opening angle between two vectors
Definition: GeoPrimitivesHelpers.h:41
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
CaloClusterMomentsMaker_DigiHSTruth::m_momentsNames
std::vector< std::string > m_momentsNames
vector holding the input list of names of moments to calculate.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:65
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
DMTest::C
C_v1 C
Definition: C.h:26
proxim
double proxim(double b, double a)
Definition: proxim.h:17
Amg::y
@ y
Definition: GeoPrimitives.h:35
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloClusterMomentsMaker_DigiHSTruth::m_twoGaussianNoise
bool m_twoGaussianNoise
if set to true use 2-gaussian noise description for TileCal
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:119
deg
#define deg
Definition: SbPolyhedron.cxx:17
xAOD::CaloCluster_v1::insertMoment
void insertMoment(MomentType type, double value)
Definition: CaloCluster_v1.cxx:754
CaloCell::e
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition: CaloCell.h:317
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:261
CaloClusterMomentsMaker_DigiHSTruth::m_calculateIsolation
bool m_calculateIsolation
Set to true if cluster isolation is to be calculated.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:111
CaloCell_Base_ID::calo_sample
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
Definition: CaloCell_Base_ID.cxx:141
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:338
CaloClusterMomentsMaker_DigiHSTruth::m_maxAxisAngle
double m_maxAxisAngle
the maximal allowed deviation from the IP-to-ClusterCenter-axis.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:79
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
CaloCell_ID.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xAOD::CaloCluster_v1::MomentType
MomentType
Enums to identify different moments.
Definition: CaloCluster_v1.h:120
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
GeoPrimitives.h
ArenaPoolSTLAllocator.h
STL-style allocator wrapper for ArenaPoolAllocator.
proxim.h
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::lambda
double lambda
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:269
CaloClusterMomentsMaker_DigiHSTruth::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override final
Execute on an entire collection of clusters.
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:277
Amg::z
@ z
Definition: GeoPrimitives.h:36
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
CaloClusterMomentsMaker_DigiHSTruth::m_validMoments
std::vector< xAOD::CaloCluster::MomentType > m_validMoments
set of moments which will be calculated.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:73
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloClusterMomentsMaker_DigiHSTruth::initialize
virtual StatusCode initialize() override
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:165
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
Amg::x
@ x
Definition: GeoPrimitives.h:34
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
CaloClusterMomentsMaker_DigiHSTruth::m_calculateLArHVFraction
bool m_calculateLArHVFraction
Set to true to calculate E and N of cells affected by LAr HV corrections.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:114
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell::badcell
virtual bool badcell() const
check is cell is dead
Definition: CaloCell.cxx:210
xAOD::CaloCluster_v1::size
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
Definition: CaloCluster_v1.cxx:996
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CaloPhiRange.h
CaloPhiRange class declaration.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloClusterMomentsMaker_DigiHSTruth::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:75
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
Definition: CaloCluster_v1.cxx:905
CaloCell::quality
uint16_t quality() const
get quality (data member)
Definition: CaloCell.h:332
IdentifierHash::is_valid
bool is_valid() const
Check if id is in a valid state.
CxxUtils::prefetchNext
void prefetchNext(Iter iter, Iter endIter)
Prefetch next object in sequence.
Definition: prefetch.h:130
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloClusterMomentsMaker_DigiHSTruth::m_signalCellKey
SG::ReadHandleKey< CaloCellContainer > m_signalCellKey
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:129
CaloNoise
Definition: CaloNoise.h:16
ReadCellNoiseFromCool.ncell
ncell
Definition: ReadCellNoiseFromCool.py:197
CaloDetDescrElement::volume
float volume() const
cell volume
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:381
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloClusterMomentsMaker_DigiHSTruth_detail
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:259
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:345
CaloCell_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
Definition: CaloCell_Base_ID.cxx:190
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CaloClusterMomentsMaker_DigiHSTruth::m_minRLateral
double m_minRLateral
the minimal in the definition of the Lateral moment
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:87
CaloClusterMomentsMaker_DigiHSTruth.h
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::z
double z
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:264
CaloClusterMomentsMaker_DigiHSTruth::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:123
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::y
double y
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:263
CaloClusterMomentsMaker_DigiHSTruth::m_absOpt
bool m_absOpt
if set to true use abs E value of cells to calculate
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:141
CaloDetDescrElement::x
float x() const
cell x
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:363
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::x
double x
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:262
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.PyAthena.v
v
Definition: PyAthena.py:154
CaloClusterMomentsMaker_DigiHSTruth::m_momentsNamesAOD
std::string m_momentsNamesAOD
Not used anymore (with xAOD), but required when configured from COOL.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:137
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
CaloClusterMomentsMaker_DigiHSTruth::m_caloDepthTool
ToolHandle< CaloDepthTool > m_caloDepthTool
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:121
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::eta
double eta
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:266
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::r
double r
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:268
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::volume
double volume
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:270
CaloDetDescrElement::z
float z() const
cell z
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:367
GeoPrimitivesHelpers.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
CaloClusterMomentsMaker_DigiHSTruth::CaloClusterMomentsMaker_DigiHSTruth
CaloClusterMomentsMaker_DigiHSTruth(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:114
xAOD::CaloCluster_v1::cell_end
const_cell_iterator cell_end() const
Definition: CaloCluster_v1.h:813
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CaloClusterMomentsMaker_DigiHSTruth::m_calculateSignificance
bool m_calculateSignificance
Set to true if significance moments are need.
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:108
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition: CaloCluster_v1.h:890
CaloClusterMomentsMaker_DigiHSTruth::m_minBadLArQuality
double m_minBadLArQuality
the minimal cell quality in the LAr for declaring a cell bad
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:105
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::phi
double phi
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:267
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloClusterMomentsMaker_DigiHSTruth::finalize
virtual StatusCode finalize() override
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:946
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::energy
double energy
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:265
CaloPrefetch::nextDDE
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
Definition: CaloPrefetch.h:47
CaloClusterMomentsMaker_DigiHSTruth_detail::cellinfo::sample
CaloCell_ID::CaloSample sample
Definition: CaloClusterMomentsMaker_DigiHSTruth.cxx:271
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
CaloClusterMomentsMaker_DigiHSTruth::m_larHVFraction
ToolHandle< ILArHVFraction > m_larHVFraction
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:134
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366
prefetch.h
Functions to prefetch blocks of memory.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
CaloPhiRange::diff
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
Definition: CaloPhiRange.cxx:22
CaloClusterMomentsMaker_DigiHSTruth::m_minLLongitudinal
double m_minLLongitudinal
the minimal in the definition of the Longitudinal moment
Definition: CaloClusterMomentsMaker_DigiHSTruth.h:97
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
Identifier
Definition: IdentifierFieldParser.cxx:14