ATLAS Offline Software
CaloCalibClusterMomentsMaker2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------
6 // File and Version Information:
7 // $Id: CaloCalibClusterMomentsMaker2.cxx,v 1.16 2009-05-18 16:16:49 pospelov Exp $
8 //
9 // Description: see CaloCalibClusterMomentsMaker2.h
10 //
11 // Environment:
12 // Software developed for the ATLAS Detector at CERN LHC
13 //
14 // Author List:
15 // Sven Menke
16 //
17 //-----------------------------------------------------------------------
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 #include <iterator>
28 #include <sstream>
29 #include <set>
30 
31 #include "CaloEvent/CaloCell.h"
37 
38 #include "StoreGate/ReadHandle.h"
39 
40 #include "CLHEP/Units/SystemOfUnits.h"
41 
42 #include <CLHEP/Vector/LorentzVector.h>
43 #include <cmath>
44 
45 
46 using CLHEP::HepLorentzVector;
47 using CLHEP::MeV;
48 using CLHEP::cm;
49 
50 
51 //###############################################################################
52 
54  const std::string& name,
55  const IInterface* parent)
56  : AthAlgTool(type, name, parent),
57  m_calo_id(nullptr),
58  m_caloDM_ID(nullptr),
59  m_caloDmDescrManager(nullptr),
60  m_useParticleID(true),
61  m_energyMin(200*MeV),
62  m_energyMinCalib(20*MeV),
63  m_apars_alpha(0.5),
64  m_apars_r0(0.2),
65  m_MatchDmType(kMatchDmLoose)
66 {
67  declareInterface<CaloClusterCollectionProcessor> (this);
68  // Name(s) of Moments to calculate
69  declareProperty("MomentsNames",m_momentsNames);
70  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_TOT"),xAOD::CaloCluster::ENG_CALIB_TOT));
71  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_OUT_L"),xAOD::CaloCluster::ENG_CALIB_OUT_L));
72  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_OUT_M"),xAOD::CaloCluster::ENG_CALIB_OUT_M));
73  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_OUT_T"),xAOD::CaloCluster::ENG_CALIB_OUT_T));
74  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_EMB0"),xAOD::CaloCluster::ENG_CALIB_EMB0));
75  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_EME0"),xAOD::CaloCluster::ENG_CALIB_EME0));
76  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_TILEG3"),xAOD::CaloCluster::ENG_CALIB_TILEG3));
77  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_TOT"),xAOD::CaloCluster::ENG_CALIB_DEAD_TOT));
78  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_EMB0"),xAOD::CaloCluster::ENG_CALIB_DEAD_EMB0));
79  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_TILE0"),xAOD::CaloCluster::ENG_CALIB_DEAD_TILE0));
80  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_TILEG3"),xAOD::CaloCluster::ENG_CALIB_DEAD_TILEG3));
81  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_EME0"),xAOD::CaloCluster::ENG_CALIB_DEAD_EME0));
82  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_HEC0"),xAOD::CaloCluster::ENG_CALIB_DEAD_HEC0));
83  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_FCAL"),xAOD::CaloCluster::ENG_CALIB_DEAD_FCAL));
84  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_LEAKAGE"),xAOD::CaloCluster::ENG_CALIB_DEAD_LEAKAGE));
85  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_DEAD_UNCLASS"),xAOD::CaloCluster::ENG_CALIB_DEAD_UNCLASS));
86  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_FRAC_EM"),xAOD::CaloCluster::ENG_CALIB_FRAC_EM));
87  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_FRAC_HAD"),xAOD::CaloCluster::ENG_CALIB_FRAC_HAD));
88  m_validNames.push_back(moment_name_pair(std::string("ENG_CALIB_FRAC_REST"),xAOD::CaloCluster::ENG_CALIB_FRAC_REST));
89 
90  // Name(s) of Moments which can be stored on the AOD - all others go to ESD
91  m_momentsNamesAOD.emplace_back("ENG_CALIB_TOT");
92  m_momentsNamesAOD.emplace_back("ENG_CALIB_OUT_L");
93  m_momentsNamesAOD.emplace_back("ENG_CALIB_OUT_M");
94  m_momentsNamesAOD.emplace_back("ENG_CALIB_OUT_T");
95  m_momentsNamesAOD.emplace_back("ENG_CALIB_EMB0");
96  m_momentsNamesAOD.emplace_back("ENG_CALIB_EME0");
97  m_momentsNamesAOD.emplace_back("ENG_CALIB_TILEG3");
98  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_TOT");
99  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_EMB0");
100  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_TILE0");
101  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_TILEG3");
102  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_EME0");
103  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_HEC0");
104  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_FCAL");
105  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_LEAKAGE");
106  m_momentsNamesAOD.emplace_back("ENG_CALIB_DEAD_UNCLASS");
107  m_momentsNamesAOD.emplace_back("ENG_CALIB_FRAC_EM");
108  m_momentsNamesAOD.emplace_back("ENG_CALIB_FRAC_HAD");
109  m_momentsNamesAOD.emplace_back("ENG_CALIB_FRAC_REST");
110 
111  declareProperty("AODMomentsNames",m_momentsNamesAOD);
112  declareProperty("CalibrationHitContainerNames",m_CalibrationHitContainerNames);
113  declareProperty("DMCalibrationHitContainerNames",m_DMCalibrationHitContainerNames);
114  m_n_phi_out = 127; // not more than 127 since we store indices (-127,...-1,0,...,126) and have 8 bits only
115  m_n_eta_out = 127;
117  m_out_eta_max = 6;
118 
119  m_rmaxOut[0] = 1.0;
120  m_rmaxOut[1] = 0.5;
121  m_rmaxOut[2] = 0.3;
122 
123  for( int im=0;im<3;im++) {
124  m_i_phi_eta[im].resize(m_n_eta_out);
125  }
126  m_doDeadEnergySharing = false;
127  m_foundAllContainers = false;
128  m_doOutOfClusterL = false;
129  m_doOutOfClusterM = false;
130  m_doOutOfClusterT = false;
131  m_doDeadL = false;
132  m_doDeadM = false;
133  m_doDeadT = false;
134  m_doCalibFrac = false;
135 
136  declareProperty("MatchDmType",m_MatchDmType);
137 
138  declareProperty( "UseParticleID",m_useParticleID);
139 }
140 
141 
142 
143 //###############################################################################
144 
146 {
147  ATH_MSG_INFO( "Initializing " << name() );
148 
149  for (const std::string& name : m_momentsNames) {
150  bool isValid(false);
151  for (const moment_name_pair& vname : m_validNames) {
152  if ( name == vname.first ) {
153  m_validMoments.insert(vname);
154  isValid = true;
155  ATH_MSG_DEBUG( "Inserting " << name );
156  break;
157  }
158  }
159  if ( !isValid) {
160  msg() << MSG::ERROR << "Moment " << name
161  << " is not a valid Moment name and will be ignored! "
162  << "Valid names are:";
163  for (unsigned int i=0;i<m_validNames.size();i++)
164  msg() << (i==0?" ":", ") << m_validNames[i].first;
165  msg() << endmsg;
166  }
167  }
168 
169  // to switch on clever DeadMaterial assignment procedure
170  // and check if tight, medium and/or loose versions for out-of-cluster and
171  // simple dead-material assignment are wanted
172  for (const moment_name_pair& vname : m_validNames) {
173  switch (vname.second) {
175  m_doDeadEnergySharing = true;
176  break;
178  m_doOutOfClusterL = true;
179  break;
181  m_doOutOfClusterM = true;
182  break;
184  m_doOutOfClusterT = true;
185  break;
187  m_doCalibFrac = true;
188  break;
190  m_doCalibFrac = true;
191  break;
193  m_doCalibFrac = true;
194  break;
195  default:
196  break;
197  }
198  }
199 
201  ATH_MSG_INFO( "Usage of ParticleID was switched off (UseParticleID==False), no ENG_CALIB_FRAC_* moments will be available" );
202  m_doCalibFrac = false;
203  }
204 
205  for (const std::string& name : m_momentsNamesAOD) {
206  for (const moment_name_pair& vname : m_validNames) {
207  if ( vname.first == name ) {
208  m_momentsAOD.insert(vname.second);
209  break;
210  }
211  }
212  }
214  m_doDeadEnergySharing = true;
215  }
216 
217  // dead material identifier description manager
219 
220  ATH_CHECK( detStore()->retrieve(m_calo_id, "CaloCell_ID") );
222 
223  // initialize distance tables
224  for(int jeta = 0;jeta<m_n_eta_out;jeta++) {
225  double eta0 = (jeta+0.5) * (m_out_eta_max)/m_n_eta_out;
226  HepLorentzVector middle(1,0,0,1);
227  middle.setREtaPhi(1./cosh(eta0),eta0,0);
228  double x_rmaxOut[3];
229  for (int im=0;im<3;im++) {
230  x_rmaxOut[im] = m_rmaxOut[im]*angle_mollier_factor(eta0);
231  }
232  for (int jp=-m_n_phi_out;jp<m_n_phi_out;jp++) {
233  double phi = (jp+0.5) * m_out_phi_max/m_n_phi_out;
234  int ietaMin[3] = {m_n_eta_out,m_n_eta_out,m_n_eta_out};
235  int ietaMax[3] = {-m_n_eta_out,-m_n_eta_out,-m_n_eta_out};
236  for(int je = -m_n_eta_out;je<m_n_eta_out;je++) {
237  double eta = (je+0.5) * m_out_eta_max/m_n_eta_out;
238  HepLorentzVector cpoint(1,0,0,1);
239  cpoint.setREtaPhi(1./cosh(eta),eta,phi);
240  double r = middle.angle(cpoint.vect());
241  for (int im=0;im<3;im++) {
242  if ( r < x_rmaxOut[im] ) {
243  if ( je < ietaMin[im] )
244  ietaMin[im] = je;
245  if ( je > ietaMax[im] )
246  ietaMax[im] = je;
247  }
248  }
249  }
250  for (int im=0;im<3;im++) {
251  if ( ietaMin[im] <= ietaMax[im] ) {
252  CalibHitIPhiIEtaRange theRange{};
253  theRange.iPhi = (char)jp;
254  theRange.iEtaMin = (char)ietaMin[im];
255  theRange.iEtaMax = (char)ietaMax[im];
256  m_i_phi_eta[im][jeta].push_back(theRange);
257  }
258  }
259  }
260  }
261 
264 
266 
268 
269  return StatusCode::SUCCESS;
270 }
271 
272 //###############################################################################
273 
276  xAOD::CaloClusterContainer *theClusColl) const
277 {
278 
279  ATH_MSG_DEBUG("Starting CaloCalibClusterMomentsMaker2::execute");
281  const CaloDetDescrManager* calo_dd_man = *caloMgrHandle;
282 
283  bool foundAllContainers (true);
284  std::vector<const CaloCalibrationHitContainer *> v_cchc;
287  {
289  if ( !cchc.isValid() ) {
290  if (m_foundAllContainers) {
291  // print ERROR message only if there was at least one event with
292  // all containers
293  msg(MSG::ERROR) << "SG does not contain calibration hit container " << key.key() << endmsg;
294  }
295  foundAllContainers = false;
296  }
297  else {
298  v_cchc.push_back(cchc.cptr());
299  }
300  }
301 
302  std::vector<const CaloCalibrationHitContainer *> v_dmcchc;
305  {
307  if ( !cchc.isValid() ) {
308  if (m_foundAllContainers) {
309  // print ERROR message only if there was at least one event with
310  // all containers
311  ATH_MSG_ERROR("SG does not contain DM calibration hit container " << key.key());
312  }
313  foundAllContainers = false;
314  }
315  else {
316  v_dmcchc.push_back(cchc.cptr());
317  }
318  }
319 
320  if ( !m_foundAllContainers && foundAllContainers )
321  m_foundAllContainers = true;
322 
323  if ( !foundAllContainers ) return StatusCode::SUCCESS;
324  ATH_MSG_DEBUG("SG has all containers ");
325 
326  // will contain detailed info about cluster calibration eneries
327  ClusInfo_t clusInfoVec (theClusColl->size());
328 
329  CellInfoSet_t cellInfo;
330 
331  /* ********************************************
332  filling the map with info which cell belongs to which cluster and what
333  is the cell weight in the cluster
334  ******************************************** */
335  xAOD::CaloClusterContainer::iterator clusIter = theClusColl->begin();
336  xAOD::CaloClusterContainer::iterator clusIterEnd = theClusColl->end();
337  int iClus = 0;
338  for( ;clusIter!=clusIterEnd;++clusIter,++iClus) {
339  const xAOD::CaloCluster * theCluster = (*clusIter);
340 
341  // loop over all cell members and fill cell vector for used cells
342  xAOD::CaloCluster::const_cell_iterator cellIter = theCluster->cell_begin();
343  xAOD::CaloCluster::const_cell_iterator cellIterEnd = theCluster->cell_end();
344  for(; cellIter != cellIterEnd; cellIter++ ){
345  const CaloCell* pCell = (*cellIter);
346  Identifier myId = pCell->ID();
347 
348  MyCellInfo info (iClus, cellIter.weight() );
349  CellInfoSet_t::iterator bookmark = cellInfo.lower_bound( myId );
350  if(bookmark == cellInfo.end() || bookmark->first != myId) {
351  // We haven't had a infohit in this cell before. Add it to our set.
352  if (bookmark != cellInfo.begin()) --bookmark;
353  cellInfo.emplace_hint (bookmark, myId, std::move(info));
354  }else{
355  // Update the existing hit.
356  bookmark->second.Add( info );
357  }
358  } // cellIter
359  } // iClus
360 
361 
362  /* ********************************************
363  calculate total calib energy inside clusters
364  ******************************************** */
365  unsigned int nHitsTotal = 0;
366  unsigned int nHitsWithoutParticleID = 0;
367  for (const CaloCalibrationHitContainer* cchc : v_cchc) {
368  //loop over cells in calibration container
369  for (const CaloCalibrationHit* hit : *cchc) {
370  Identifier myId = hit->cellID();
371 
372  CellInfoSet_t::iterator pos = cellInfo.find( myId );
373  if(pos != cellInfo.end() ) {
374  // i.e. given hit id belongs to one or more clusters
376  for ( const std::pair<int, double>& p : pos->second) {
377  int iClus = p.first;
378  double weight = p.second;
379  if(m_useParticleID){
380  const int uniqueID = hit->particleID(); // FIXME barcode-based until xAOD::TruthParticle supports id rather than barcode
382  ATH_MSG_ERROR("Invalid uniqueID (barcode) detected - this sample cannot be properly analysed.");
383  break;
384  }
385  clusInfoVec[iClus].Add(weight * hit->energyTotal(), nsmp, (unsigned int)(hit->particleID()));
386  }else{
387  clusInfoVec[iClus].Add(weight * hit->energyTotal(), nsmp);
388  }
389  }
390  }
391  if( m_useParticleID && hit->particleID() == HepMC::UNDEFINED_ID) {
392  nHitsWithoutParticleID++;
393  }
394  nHitsTotal++;
395  }
396  }
397 
398  // if all calibration hits have ParticleID(i.e barcode)==0 when simulation was done without ParticleID
399  bool doCalibFrac = m_doCalibFrac;
400  bool useParticleID = m_useParticleID;
401  if(m_useParticleID && (nHitsTotal == nHitsWithoutParticleID) ) {
402  ATH_MSG_INFO("Calibration hits do not have ParticleID, barcodes of particle-caused hits are always 0. Continuing without ParticleID machinery.");
403  useParticleID = false;
404  }
405 
406  // reading particle information for later calcution of calibration enegry fraction caused
407  // by particles of different types
408  SG::ReadHandle<xAOD::TruthParticleContainer> truthParticleContainerReadHandle(m_truthParticleContainerKey, ctx);
409 
410  if (doCalibFrac && !truthParticleContainerReadHandle.isValid()){
411  ATH_MSG_WARNING("Invalid read handle to TruthParticleContainer with key: " << m_truthParticleContainerKey.key());
412  doCalibFrac = false;
413  }
414 
415  std::vector<double> engCalibOut[3];
416 
417  /* ****************************************************************
418  lists of clusters populating given area [eta*phi][iClus list]
419  **************************************************************** */
420  std::vector<std::vector <int > > clusListL;
421  std::vector<std::vector <int > > clusListM;
422  std::vector<std::vector <int > > clusListT;
424  clusListL.resize((2*m_n_phi_out+1)*(2*m_n_eta_out+1));
426  clusListM.resize((2*m_n_phi_out+1)*(2*m_n_eta_out+1));
428  clusListT.resize((2*m_n_phi_out+1)*(2*m_n_eta_out+1));
429 
430  for(unsigned int ii=0;ii<3;ii++) {
431  if ( (ii == 0 && (m_doOutOfClusterL || m_doDeadL || (m_doDeadEnergySharing && m_MatchDmType==kMatchDmLoose) ) ) ||
434  engCalibOut[ii].resize(theClusColl->size(),0);
435  iClus = -1;
436  for (const xAOD::CaloCluster * theCluster : *theClusColl) {
437  ++iClus;
438  MyClusInfo& clusInfo = clusInfoVec[iClus];
439 
440  if ( clusInfo.engCalibIn.engTot > 0 ) {
441  int iEtaSign = 1;
442  if ( theCluster->eta() < 0 ) iEtaSign = -1;
443  int jeta = (int)(floor(m_n_eta_out*(theCluster->eta()/(m_out_eta_max))));
444  int jphi = (int)(floor(m_n_phi_out*(theCluster->phi())/(m_out_phi_max)));
445  if ( jeta >= -m_n_eta_out && jeta < m_n_eta_out ) {
446  if ( jphi < -m_n_phi_out ) jphi += 2*m_n_phi_out;
447  if ( jphi >= m_n_phi_out ) jphi -= 2*m_n_phi_out;
448  unsigned int iEtaBin(jeta);
449  if ( jeta < 0 ) iEtaBin = abs(jeta)-1;
450  const std::vector<CalibHitIPhiIEtaRange>& bins
451  = m_i_phi_eta[ii][iEtaBin];
452  for (const CalibHitIPhiIEtaRange& range : bins) {
453  int jp = range.iPhi+jphi;
454  if ( jp < -m_n_phi_out ) jp += 2*m_n_phi_out;
455  if ( jp >= m_n_phi_out ) jp -= 2*m_n_phi_out;
456  int jEtaMin = iEtaSign<0?-range.iEtaMax-1:range.iEtaMin;
457  int jEtaMax = iEtaSign<0?-range.iEtaMin-1:range.iEtaMax;
458  for( int je = jEtaMin;je<=jEtaMax;je++ ) {
459  if(ii == 0 ) clusListL[(jp+m_n_phi_out)*(2*m_n_eta_out+1)+je+m_n_eta_out].push_back(iClus);
460  else if(ii == 1 ) clusListM[(jp+m_n_phi_out)*(2*m_n_eta_out+1)+je+m_n_eta_out].push_back(iClus);
461  else if(ii == 2 ) clusListT[(jp+m_n_phi_out)*(2*m_n_eta_out+1)+je+m_n_eta_out].push_back(iClus);
462  }
463  }
464  }
465  }
466  }
467  }
468  }
469 
470  /* ****************************************************************
471  calculate out-of-cluster energy of clusters
472  **************************************************************** */
474  for (const CaloCalibrationHitContainer* cchc : v_cchc) {
475  //loop over cells in calibration container
476  for (const CaloCalibrationHit* hit : *cchc) {
477  Identifier myId = hit->cellID();
478 
479  CellInfoSet_t::iterator pos = cellInfo.find( myId );
480  if(pos == cellInfo.end() ) {
481  // hit is not inside any cluster
482  const CaloDetDescrElement* myCDDE =
483  calo_dd_man->get_element(myId);
485  if(useParticleID) uniqueID = hit->particleID(); // FIXME barcode-based until xAOD::TruthParticle supports id rather than barcode
486  if ( myCDDE ) {
487  int jeO = (int)floor(m_n_eta_out*(myCDDE->eta()/m_out_eta_max));
488  if ( jeO >= -m_n_eta_out && jeO < m_n_eta_out ) {
489  int jpO = (int)floor(m_n_phi_out*(myCDDE->phi()/m_out_phi_max));
490  if ( jpO < -m_n_phi_out ) jpO += 2*m_n_phi_out;
491  if ( jpO >= m_n_phi_out ) jpO -= 2*m_n_phi_out;
492  for (unsigned int ii=0;ii<3;ii++) {
493  std::vector<std::vector <int > > *pClusList=nullptr;
494  if ( ii == 0 && m_doOutOfClusterL )
495  pClusList = &clusListL;
496  else if ( ii == 1 && m_doOutOfClusterM )
497  pClusList = &clusListM;
498  else if ( ii == 2 && m_doOutOfClusterT )
499  pClusList = &clusListT;
500  if ( pClusList) {
501  // loop over list of potential neighboring clusters
502  double hitClusNorm(0.);
503  std::vector<int> hitClusIndex;
504  std::vector<double > hitClusEffEnergy;
505  // loop over clusters which match given OOC hit
506  for(unsigned int i_cls=0; i_cls<(*pClusList)[(jpO+m_n_phi_out)*(2*m_n_eta_out+1)+jeO+m_n_eta_out].size(); i_cls++){
507  int iClus = (*pClusList)[(jpO+m_n_phi_out)*(2*m_n_eta_out+1)+jeO+m_n_eta_out][i_cls];
508  MyClusInfo& clusInfo = clusInfoVec[iClus];
509  // getting access to calibration energy inside cluster caused by same particleID (barcode)
510  // as given OOC hit
511  auto pos = clusInfo.engCalibParticle.find(uniqueID);
512  if(pos!=clusInfo.engCalibParticle.end()) {
513  // given cluster have some energy inside caused by same particle as given OOC hitClusEffEnergy
514  // so the hit will be assigned to this cluster with some weight
515  hitClusNorm += pos->second.engTot;
516  hitClusEffEnergy.push_back(pos->second.engTot);
517  hitClusIndex.push_back(iClus);
518  }
519  }
520  if ( hitClusNorm > 0 ) {
521  const double inv_hitClusNorm = 1. / hitClusNorm;
522  for(unsigned int i_cls=0; i_cls<hitClusIndex.size(); i_cls++){
523  int iClus = hitClusIndex[i_cls];
524  double w = hitClusEffEnergy[i_cls] * inv_hitClusNorm;
525  engCalibOut[ii][iClus] += w*hit->energyTotal();
526  }
527  }
528  }
529  }
530  }
531  }
532  } // hits not in cluster
533  }
534  }
535  }
536 
537  // ------------------------------------------------------------------------
538  // calculate dead-material energy of clusters (way2)
539  // + energy is shared among clusters within certain area
540  // + distance to clusters and energy in specific samplings are used as sharing criteria
541  // + calculations are done separately for different dead material areas
542  std::vector<std::vector <int > > *pClusList=nullptr;
543  if ( m_MatchDmType == kMatchDmLoose ) {
544  pClusList = &clusListL;
545  } else if ( m_MatchDmType == kMatchDmMedium ) {
546  pClusList = &clusListM;
547  } else if ( m_MatchDmType == kMatchDmTight ) {
548  pClusList = &clusListT;
549  }
550  if( m_doDeadEnergySharing && pClusList) {
551 
552  for (const CaloCalibrationHitContainer* dmcchc : v_dmcchc) {
553  for (const CaloCalibrationHit* hit : *dmcchc) {
554  Identifier myId = hit->cellID();
555  if (m_calo_id->is_lar_dm(myId) || m_calo_id->is_tile_dm(myId)) {
556  CaloDmDescrElement* myCDDE(nullptr);
557  myCDDE = m_caloDmDescrManager->get_element(myId);
558  if ( myCDDE ) {
560  if(useParticleID) uniqueID = hit->particleID(); // FIXME barcode-based until xAOD::TruthParticle supports id rather than barcode
561 
562  int jeO = (int)floor(m_n_eta_out*(myCDDE->eta()/m_out_eta_max));
563  if ( jeO >= -m_n_eta_out && jeO < m_n_eta_out ) {
564  int jpO = (int)floor(m_n_phi_out*(myCDDE->phi()/m_out_phi_max));
565  if ( jpO < -m_n_phi_out ) jpO += 2*m_n_phi_out;
566  if ( jpO >= m_n_phi_out ) jpO -= 2*m_n_phi_out;
567 
568  /* ****************************************
569  share energy of DM hit among different clusters
570  ***************************************** */
571  int nDmArea = m_caloDmDescrManager->get_dm_area(myId);
572  const CaloDmRegion *dmRegion = m_caloDmDescrManager->get_dm_region(myId);
573  int hitClusVecIndex = 0;
574  std::vector<int> hitClusIndex(theClusColl->size());
575  std::vector<double > hitClusEffEnergy(theClusColl->size());
576  double hitClusNorm = 0.0;
577  // loop over clusters which match given DM hit
578  for(unsigned int i_cls=0; i_cls< (*pClusList)[(jpO+m_n_phi_out)*(2*m_n_eta_out+1)+jeO+m_n_eta_out].size(); i_cls++){
579  int iClus = (*pClusList)[(jpO+m_n_phi_out)*(2*m_n_eta_out+1)+jeO+m_n_eta_out][i_cls];
580  xAOD::CaloCluster * theCluster = theClusColl->at(iClus);
581 
582  MyClusInfo& clusInfo = clusInfoVec[iClus];
583  // getting access to calibration energy inside cluster caused by same particleID (barcode)
584  // as given OOC hit
585  auto pos = clusInfo.engCalibParticle.find(uniqueID);
586  if(pos!=clusInfo.engCalibParticle.end()) {
587  double engClusTruthUniqueIDCalib = pos->second.engTot;
588 
589  if(engClusTruthUniqueIDCalib > m_energyMinCalib && theCluster->e()>m_energyMin) {
590  double sum_smp_energy = 0.0;
591  // loop over calo sampling numbers registered for given DM area
592  for(unsigned int i_smp=0; i_smp<dmRegion->m_CaloSampleNeighbours.size(); i_smp++) {
594  if( (dmRegion->m_CaloSampleEtaMin[i_smp]-0.5) <= theCluster->eta() &&
595  theCluster->eta() <= (dmRegion->m_CaloSampleEtaMax[i_smp]+0.5) ){
596  //sum_smp_energy += theCluster->eSample(nsmp);
597  sum_smp_energy += pos->second.engSmp[nsmp];
598  }
599  }
600  if(sum_smp_energy > 0.0) {
601  double phi_diff=myCDDE->phi()-theCluster->phi();
602  if(phi_diff <= -M_PI){
603  phi_diff += 2.*M_PI;
604  } else if (phi_diff > M_PI){
605  phi_diff -= 2.*M_PI;
606  }
607  double eta_diff = (myCDDE->eta()-theCluster->eta());
608  float distance=sqrt(eta_diff * eta_diff + phi_diff * phi_diff);
609 
610  double effEner = pow(sum_smp_energy,m_apars_alpha)*exp(-distance/m_apars_r0);
611 
612  hitClusIndex [hitClusVecIndex] = iClus;
613  hitClusEffEnergy [hitClusVecIndex++]= effEner;
614  hitClusNorm += effEner;
615  }
616  } // good energetic cluster
617  } // we ve found a uniqueID
618  } // loop over clusters in the list
619  hitClusIndex.resize(hitClusVecIndex);
620  hitClusEffEnergy.resize(hitClusVecIndex);
621 
622 
623  // now we have to calculate weight for assignment hit energy to cluster
624  if(hitClusNorm >0.0) {
625  const double inv_hitClusNorm = 1. / hitClusNorm;
626  for(unsigned int i_cls=0; i_cls<hitClusIndex.size(); i_cls++){
627  int iClus = hitClusIndex[i_cls];
628  double dm_weight = hitClusEffEnergy[i_cls] * inv_hitClusNorm;
629  if(dm_weight > 1.0 || dm_weight < 0.0 ){
630  std::cout << "CaloCalibClusterMomentsMaker2::execute() ->Error! Strange weight " << dm_weight<< std::endl;
631  std::cout << hitClusEffEnergy[i_cls] << " " << hitClusNorm << std::endl;
632  }
633  clusInfoVec[iClus].engCalibDeadInArea[nDmArea] += hit->energyTotal()*dm_weight;
634  clusInfoVec[iClus].engCalibDeadInArea[CaloDmDescrArea::DMA_ALL] += hit->energyTotal()*dm_weight;
635  }
636  } // hit clus norm
637 
638  } // loop over united ieta*iphi
639  } // myCDDE
640  } // tile and lar
641  } // eol over DM calibration hits
642  } //eol over containers
643 
644  } // doDeadEnergySharing
645 
646  // fraction of calibration energies caused by different particles
647  std::vector<double> engCalibFrac;
648  engCalibFrac.resize(kCalibFracMax, 0.0);
649 
650  std::map<unsigned int,int> truthIDToPdgCodeMap;
651 
652  //loop on truth particle container is slow, so put needed information in a map for faster key lookup in later loops
653  for ( const auto *thisTruthParticle : *truthParticleContainerReadHandle){
654 
655  if (!thisTruthParticle){
656  ATH_MSG_WARNING("Got invalid pointer to TruthParticle");
657  continue;
658  }
659 
660  truthIDToPdgCodeMap[HepMC::barcode(thisTruthParticle)] = thisTruthParticle->pdgId(); // FIXME barcode-based xAOD::TruthParticle does not support uniqueID yet
661  }//truth particle loop
662 
663  // assign moments
664  for( clusIter = theClusColl->begin(),iClus=0; clusIter!=clusIterEnd;++clusIter,++iClus) {
665  xAOD::CaloCluster * theCluster = *clusIter;
666  MyClusInfo& clusInfo = clusInfoVec[iClus];
667 
668  // total DM energy assigned to cluster
669  double eng_calib_dead_tot = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_ALL]
673  // DM energy before barrel presampler, inside it, and between presampler and strips
674  double eng_calib_dead_emb0 = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_EMB0]
677  // DM energy between barrel and tile
678  double eng_calib_dead_tile0 = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_EMB3_TILE0];
679  // DM energy before scintillator and inside scintillator
680  double eng_calib_dead_tileg3 = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_SCN]
682  // DM energy beforee endcap presampler, inside it and between presampler and strips
683  double eng_calib_dead_eme0 = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_EME0]
686  // DM energy between emec and hec
687  double eng_calib_dead_hec0 = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_EME3_HEC0];
688  // DM energy before FCAL and between HEC and FCAL
689  double eng_calib_dead_fcal = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_FCAL0]
691  // DM leakage behind the calorimeter
692  double eng_calib_dead_leakage = clusInfo.engCalibDeadInArea[CaloDmDescrArea::DMA_LEAK];
693  // the rest of DM energy which remains unclassified
694  double eng_calib_dead_unclass = eng_calib_dead_tot - eng_calib_dead_emb0 - eng_calib_dead_tile0
695  - eng_calib_dead_tileg3 - eng_calib_dead_eme0 - eng_calib_dead_hec0 - eng_calib_dead_fcal
696  - eng_calib_dead_leakage;
697 
698  if(doCalibFrac){
699 /*****************************************************************************
700 Calculation of energy fraction caused by particles of different types
701 *****************************************************************************/
702  engCalibFrac.assign(kCalibFracMax, 0.0);
703  if(clusInfo.engCalibIn.engTot > 0.0) {
704  // each MyClusInfo has a map of particle's barcode and particle calibration deposits in given cluster
705  for (const auto& p : clusInfo.engCalibParticle) {
706  int pdg_id = 0;
707  if ( auto it = truthIDToPdgCodeMap.find(p.first); it != truthIDToPdgCodeMap.end()) { // FIXME barcode-based until xAOD::TruthParticle supports id rather than barcode
708  pdg_id = it->second;
709  } else {
710  ATH_MSG_WARNING("truthIDToPdgCodeMap cannot find an entry with barcode " << p.first);
711  continue;
712  }
713  if( std::abs(pdg_id) == 211) {
714  engCalibFrac[kCalibFracHAD] += p.second.engTot;
715  } else if( pdg_id == 111 || pdg_id == 22 || std::abs(pdg_id)==11) {
716  engCalibFrac[kCalibFracEM] += p.second.engTot;
717  } else {
718  engCalibFrac[kCalibFracREST] += p.second.engTot;
719  }
720  }
721  for(size_t i=0; i<engCalibFrac.size(); i++) engCalibFrac[i] = engCalibFrac[i]/clusInfo.engCalibIn.engTot;
722  }
723  }
724 
725  if ( !m_momentsNames.empty() ) {
726  std::vector<double> myMoments(m_validMoments.size(),0);
727  // assign moments
728  moment_name_set::const_iterator vMomentsIter = m_validMoments.begin();
729  moment_name_set::const_iterator vMomentsIterEnd = m_validMoments.end();
730 
731  int iMoment=0;
732  for(; vMomentsIter!=vMomentsIterEnd; ++vMomentsIter,++iMoment) {
733  // now calculate the actual moments
734  switch (vMomentsIter->second) {
736  ATH_MSG_DEBUG("Inserting ENG_CALIB_TOT");
737  myMoments[iMoment] = clusInfo.engCalibIn.engTot;
738  break;
740  myMoments[iMoment] = engCalibOut[0][iClus];
741  break;
743  myMoments[iMoment] = engCalibOut[1][iClus];
744  break;
746  myMoments[iMoment] = engCalibOut[2][iClus];
747  break;
749  myMoments[iMoment] = clusInfo.engCalibIn.engSmp[CaloSampling::PreSamplerB];
750  break;
752  myMoments[iMoment] = clusInfo.engCalibIn.engSmp[CaloSampling::PreSamplerE];
753  break;
755  myMoments[iMoment] = clusInfo.engCalibIn.engSmp[CaloSampling::TileGap3];
756  break;
758  myMoments[iMoment] = eng_calib_dead_tot;
759  break;
761  myMoments[iMoment] = eng_calib_dead_emb0;
762  break;
764  myMoments[iMoment] = eng_calib_dead_tile0;
765  break;
767  myMoments[iMoment] = eng_calib_dead_tileg3;
768  break;
770  myMoments[iMoment] = eng_calib_dead_eme0;
771  break;
773  myMoments[iMoment] = eng_calib_dead_hec0;
774  break;
776  myMoments[iMoment] = eng_calib_dead_fcal;
777  break;
779  myMoments[iMoment] = eng_calib_dead_leakage;
780  break;
782  myMoments[iMoment] = eng_calib_dead_unclass;
783  break;
785  myMoments[iMoment] = engCalibFrac[kCalibFracEM];
786  break;
788  myMoments[iMoment] = engCalibFrac[kCalibFracHAD];
789  break;
791  myMoments[iMoment] = engCalibFrac[kCalibFracREST];
792  break;
793  default:
794  // nothing to be done for other moments
795  break;
796  }
797 
798  theCluster->insertMoment(vMomentsIter->second, myMoments[iMoment]);
799  }
800  }
801  }
802 
803  return StatusCode::SUCCESS;
804 }
805 
806 
807 
808 /* ****************************************************************************
809 
810 **************************************************************************** */
812 {
813  double eta = fabs(x);
814  double ff;
815  if(eta<1.6){
816  ff = atan(5.0*1.7/(200.0*cosh(eta)));
817  }else if(eta<3.2){
818  ff = atan(5.0*1.6/(420./tanh(eta)));
819  }else{
820  ff = atan(5.0*0.95/(505./tanh(eta)));
821  }
822  return ff*(1./atan(5.0*1.7/200.0));
823 }
grepfile.info
info
Definition: grepfile.py:38
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CaloDmRegion::m_CaloSampleEtaMin
std::vector< float > m_CaloSampleEtaMin
Definition: CaloDmDescrManager.h:107
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
CaloCalibClusterMomentsMaker2::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
ReadHandleKey for truth particle container.
Definition: CaloCalibClusterMomentsMaker2.h:177
CaloDmDescrArea::DMA_EMB3_TILE0
@ DMA_EMB3_TILE0
Definition: CaloDmDescrArea.h:28
beamspotman.r
def r
Definition: beamspotman.py:676
CaloCalibClusterMomentsMaker2::m_apars_r0
float m_apars_r0
Definition: CaloCalibClusterMomentsMaker2.h:214
CaloCalibrationHitContainer
Definition: CaloCalibrationHitContainer.h:25
CaloCalibClusterMomentsMaker2::m_caloDM_ID
const CaloDM_ID * m_caloDM_ID
Definition: CaloCalibClusterMomentsMaker2.h:184
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_UNCLASS
@ ENG_CALIB_DEAD_UNCLASS
Attached Calibration Hit energy in dead material in unclassified areas of the detector.
Definition: CaloCluster_v1.h:246
CaloCalibClusterMomentsMaker2::kCalibFracHAD
@ kCalibFracHAD
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override
Execute on an entire collection of clusters.
Definition: CaloCalibClusterMomentsMaker2.cxx:275
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
CaloCalibrationHit.h
CaloCalibClusterMomentsMaker2::moment_name_pair
std::pair< std::string, xAOD::CaloCluster::MomentType > moment_name_pair
typedef for a pair to index the enums defined in CaloClusterMoment with a string.
Definition: CaloCalibClusterMomentsMaker2.h:100
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCalibClusterMomentsMaker2::m_i_phi_eta
std::array< std::vector< std::vector< CalibHitIPhiIEtaRange > >, 3 > m_i_phi_eta
Definition: CaloCalibClusterMomentsMaker2.h:195
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
CaloDmDescrManager::get_element
CaloDmDescrElement * get_element(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:107
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloCalibClusterMomentsMaker2::m_momentsAOD
std::set< xAOD::CaloCluster::MomentType > m_momentsAOD
set holding the list of moment enums which go in the first store i.e.
Definition: CaloCalibClusterMomentsMaker2.h:160
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloDmDescrArea::DMA_EMB1
@ DMA_EMB1
Definition: CaloDmDescrArea.h:26
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_LEAKAGE
@ ENG_CALIB_DEAD_LEAKAGE
Attached Calibration Hit energy in dead material behind calorimeters.
Definition: CaloCluster_v1.h:243
CaloCalibClusterMomentsMaker2::m_rmaxOut
double m_rmaxOut[3]
Definition: CaloCalibClusterMomentsMaker2.h:193
CaloCalibClusterMomentsMaker2.h
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
CaloDmDescrArea::DMA_SCN
@ DMA_SCN
Definition: CaloDmDescrArea.h:29
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
HepMC::INVALID_PARTICLE_ID
constexpr int INVALID_PARTICLE_ID
Definition: MagicNumbers.h:56
CaloCalibClusterMomentsMaker2::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloCalibClusterMomentsMaker2.h:182
skel.it
it
Definition: skel.GENtoEVGEN.py:396
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::CaloCluster_v1::ENG_CALIB_TILEG3
@ ENG_CALIB_TILEG3
Calibration Hit energy inside the cluster scintillator.
Definition: CaloCluster_v1.h:222
CaloCalibClusterMomentsMaker2::m_energyMin
float m_energyMin
Definition: CaloCalibClusterMomentsMaker2.h:211
python.atlas_oh.im
im
Definition: atlas_oh.py:167
xAOD::CaloCluster_v1::insertMoment
void insertMoment(MomentType type, double value)
Definition: CaloCluster_v1.cxx:754
CaloCell.h
xAOD::CaloCluster_v1::ENG_CALIB_OUT_M
@ ENG_CALIB_OUT_M
Attached Calibration Hit energy outside clusters but inside the calorimeter with medium matching (Ang...
Definition: CaloCluster_v1.h:200
CaloCalibClusterMomentsMaker2::m_useParticleID
bool m_useParticleID
Definition: CaloCalibClusterMomentsMaker2.h:209
CaloCalibClusterMomentsMaker2::m_momentsNamesAOD
std::vector< std::string > m_momentsNamesAOD
vector holding the list of moment names which go in the first store i.e.
Definition: CaloCalibClusterMomentsMaker2.h:152
xAOD::CaloCluster_v1::ENG_CALIB_EMB0
@ ENG_CALIB_EMB0
Calibration Hit energy inside the cluster barrel presampler.
Definition: CaloCluster_v1.h:218
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
CaloDmDescrArea::DMA_EME12
@ DMA_EME12
Definition: CaloDmDescrArea.h:33
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:225
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CaloCalibClusterMomentsMaker2::m_doOutOfClusterL
bool m_doOutOfClusterL
Definition: CaloCalibClusterMomentsMaker2.h:203
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_TILE0
@ ENG_CALIB_DEAD_TILE0
Attached Calibration Hit energy in dead material between EMB3 and TILE0.
Definition: CaloCluster_v1.h:230
SG::ReadHandleKey< CaloCalibrationHitContainer >
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibDeadInArea
std::array< double, CaloDmDescrArea::DMA_MAX > engCalibDeadInArea
Definition: CaloCalibClusterMomentsMaker2.h:91
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
x
#define x
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange::iPhi
char iPhi
Definition: CaloCalibClusterMomentsMaker2.h:52
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloCalibrationHitContainer.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCalibClusterMomentsMaker2::m_apars_alpha
float m_apars_alpha
Definition: CaloCalibClusterMomentsMaker2.h:213
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
CaloDmDescrManager::get_dm_region
CaloDmRegion * get_dm_region(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:159
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
CaloDmDescrManager::instance
static const CaloDmDescrManager * instance()
Definition: CaloDmDescrManager.cxx:67
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
CaloCalibClusterMomentsMaker2::m_energyMinCalib
float m_energyMinCalib
Definition: CaloCalibClusterMomentsMaker2.h:212
CaloDmDescrArea::DMA_LEAK
@ DMA_LEAK
Definition: CaloDmDescrArea.h:44
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
CaloDmDescrArea::DMA_EMB0
@ DMA_EMB0
Definition: CaloDmDescrArea.h:25
CaloCalibClusterMomentsMaker2::CellInfoSet_t
std::map< Identifier, MyCellInfo > CellInfoSet_t
Definition: CaloCalibClusterMomentsMaker2.h:64
CaloCalibClusterMomentsMaker2::m_MatchDmType
int m_MatchDmType
Definition: CaloCalibClusterMomentsMaker2.h:215
CaloCalibClusterMomentsMaker2::CaloCalibClusterMomentsMaker2
CaloCalibClusterMomentsMaker2(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloCalibClusterMomentsMaker2.cxx:53
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloCalibClusterMomentsMaker2::m_n_phi_out
int m_n_phi_out
Definition: CaloCalibClusterMomentsMaker2.h:188
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CaloCalibClusterMomentsMaker2::m_DMCalibrationHitContainerNames
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_DMCalibrationHitContainerNames
vector of dead material calibration hit container names to use.
Definition: CaloCalibClusterMomentsMaker2.h:174
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCalibClusterMomentsMaker2::kCalibFracEM
@ kCalibFracEM
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::ClusInfo_t
std::vector< MyClusInfo > ClusInfo_t
Definition: CaloCalibClusterMomentsMaker2.h:94
CaloCalibClusterMomentsMaker2::m_doOutOfClusterM
bool m_doOutOfClusterM
Definition: CaloCalibClusterMomentsMaker2.h:204
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
CaloDmRegion
Definition: CaloDmDescrManager.h:79
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
D3PDSizeSummary.ff
ff
Definition: D3PDSizeSummary.py:305
CaloDmDescrElement::phi
float phi() const
Definition: CaloDmDescrManager.h:59
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
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::CaloCluster_v1::ENG_CALIB_TOT
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
Definition: CaloCluster_v1.h:195
CaloCalibClusterMomentsMaker2::kMatchDmTight
@ kMatchDmTight
Definition: CaloCalibClusterMomentsMaker2.h:199
xAOD::CaloCluster_v1::ENG_CALIB_FRAC_EM
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
Definition: CaloCluster_v1.h:248
CaloCalibClusterMomentsMaker2::kCalibFracREST
@ kCalibFracREST
Definition: CaloCalibClusterMomentsMaker2.h:200
AtlasDetectorID::is_tile_dm
bool is_tile_dm(Identifier id) const
Definition: AtlasDetectorID.h:748
xAOD::CaloCluster_v1::ENG_CALIB_FRAC_REST
@ ENG_CALIB_FRAC_REST
Calibration Hit energy inside the cluster caused by other particles.
Definition: CaloCluster_v1.h:253
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy::engTot
double engTot
Definition: CaloCalibClusterMomentsMaker2.h:73
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCalibClusterMomentsMaker2::m_n_eta_out
int m_n_eta_out
Definition: CaloCalibClusterMomentsMaker2.h:189
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_FCAL
@ ENG_CALIB_DEAD_FCAL
Attached Calibration Hit energy in dead material before FCAL, between FCAL and HEC.
Definition: CaloCluster_v1.h:241
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloDmDescrElement::eta
float eta() const
Definition: CaloDmDescrManager.h:57
CaloDmDescrArea::DMA_FCAL0
@ DMA_FCAL0
Definition: CaloDmDescrArea.h:43
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
CaloCalibClusterMomentsMaker2::m_doDeadM
bool m_doDeadM
Definition: CaloCalibClusterMomentsMaker2.h:207
CaloDmDescrElement
Definition: CaloDmDescrManager.h:33
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy::engSmp
std::array< double, CaloSampling::Unknown+1 > engSmp
Definition: CaloCalibClusterMomentsMaker2.h:74
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CaloDM_ID.h
CaloDmDescrArea::DMA_HEC_FCAL
@ DMA_HEC_FCAL
Definition: CaloDmDescrArea.h:40
CaloDmRegion::m_CaloSampleEtaMax
std::vector< float > m_CaloSampleEtaMax
Definition: CaloDmDescrManager.h:108
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
CaloCalibClusterMomentsMaker2::m_doDeadEnergySharing
bool m_doDeadEnergySharing
Definition: CaloCalibClusterMomentsMaker2.h:202
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibIn
ClusCalibEnergy engCalibIn
Definition: CaloCalibClusterMomentsMaker2.h:88
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
CaloCalibClusterMomentsMaker2::m_caloDmDescrManager
const CaloDmDescrManager * m_caloDmDescrManager
Definition: CaloCalibClusterMomentsMaker2.h:186
CaloDmDescrArea::DMA_EME3_HEC0
@ DMA_EME3_HEC0
Definition: CaloDmDescrArea.h:37
CaloCalibClusterMomentsMaker2::m_CalibrationHitContainerNames
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_CalibrationHitContainerNames
vector of calibration hit container names to use.
Definition: CaloCalibClusterMomentsMaker2.h:167
CaloCalibrationHit
Class to store calorimeter calibration hit.
Definition: CaloCalibrationHit.h:23
xAOD::CaloCluster_v1::ENG_CALIB_EME0
@ ENG_CALIB_EME0
Calibration Hit energy inside the cluster endcap presampler.
Definition: CaloCluster_v1.h:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloDmDescrArea::DMA_EME0
@ DMA_EME0
Definition: CaloDmDescrArea.h:31
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_HEC0
@ ENG_CALIB_DEAD_HEC0
Attached Calibration Hit energy in dead material between EME3 and HEC0.
Definition: CaloCluster_v1.h:238
CaloCalibClusterMomentsMaker2::MyCellInfo
Class to store cluster number and weight for calorimeter cells.
Definition: CaloCalibClusterMomentsMaker2.h:58
CaloCalibClusterMomentsMaker2::initialize
virtual StatusCode initialize() override
Definition: CaloCalibClusterMomentsMaker2.cxx:145
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCalibClusterMomentsMaker2::m_doOutOfClusterT
bool m_doOutOfClusterT
Definition: CaloCalibClusterMomentsMaker2.h:205
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CaloCalibClusterMomentsMaker2::m_foundAllContainers
std::atomic< bool > m_foundAllContainers
Definition: CaloCalibClusterMomentsMaker2.h:197
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange
Class to define range of valid bins in eta x phi plane.
Definition: CaloCalibClusterMomentsMaker2.h:50
CaloCalibClusterMomentsMaker2::m_caloDetDescrMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Conditions Handle Key to access the CaloDetDescrManager.
Definition: CaloCalibClusterMomentsMaker2.h:180
CaloCalibClusterMomentsMaker2::kMatchDmMedium
@ kMatchDmMedium
Definition: CaloCalibClusterMomentsMaker2.h:199
CaloCalibClusterMomentsMaker2::kMatchDmLoose
@ kMatchDmLoose
Definition: CaloCalibClusterMomentsMaker2.h:199
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_TILEG3
@ ENG_CALIB_DEAD_TILEG3
Attached Calibration Hit energy in dead material before scintillator.
Definition: CaloCluster_v1.h:232
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
CaloCalibClusterMomentsMaker2::m_validNames
moment_name_vector m_validNames
vector holding the names of valid moments which can be calculated.
Definition: CaloCalibClusterMomentsMaker2.h:136
CaloCalibClusterMomentsMaker2::angle_mollier_factor
static double angle_mollier_factor(double x)
Definition: CaloCalibClusterMomentsMaker2.cxx:811
CaloCalibClusterMomentsMaker2::MyClusInfo
Class to store cluster's calibration energies.
Definition: CaloCalibClusterMomentsMaker2.h:69
AtlasDetectorID::is_lar_dm
bool is_lar_dm(Identifier id) const
LAr/Tile dead material:
Definition: AtlasDetectorID.h:736
CaloCalibClusterMomentsMaker2::kCalibFracMax
@ kCalibFracMax
Definition: CaloCalibClusterMomentsMaker2.h:200
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_TOT
@ ENG_CALIB_DEAD_TOT
Attached Calibration Hit energy in dead material.
Definition: CaloCluster_v1.h:224
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
CaloCalibClusterMomentsMaker2::m_doDeadT
bool m_doDeadT
Definition: CaloCalibClusterMomentsMaker2.h:208
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibParticle
std::map< int, ClusCalibEnergy > engCalibParticle
Definition: CaloCalibClusterMomentsMaker2.h:92
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
CaloCalibClusterMomentsMaker2::m_out_phi_max
double m_out_phi_max
Definition: CaloCalibClusterMomentsMaker2.h:190
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
CaloCalibClusterMomentsMaker2::m_out_eta_max
double m_out_eta_max
Definition: CaloCalibClusterMomentsMaker2.h:191
CaloCalibClusterMomentsMaker2::m_doDeadL
bool m_doDeadL
Definition: CaloCalibClusterMomentsMaker2.h:206
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
xAOD::CaloCluster_v1::ENG_CALIB_FRAC_HAD
@ ENG_CALIB_FRAC_HAD
Calibration Hit energy inside the cluster caused by charged pi+ and pi-.
Definition: CaloCluster_v1.h:251
xAOD::CaloCluster_v1::ENG_CALIB_OUT_L
@ ENG_CALIB_OUT_L
Attached Calibration Hit energy outside clusters but inside the calorimeter with loose matching (Angl...
Definition: CaloCluster_v1.h:196
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_EME0
@ ENG_CALIB_DEAD_EME0
Attached Calibration Hit energy in dead material before EME0, between EME0 and EME1.
Definition: CaloCluster_v1.h:235
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
xAOD::CaloCluster_v1::ENG_CALIB_OUT_T
@ ENG_CALIB_OUT_T
Attached Calibration Hit energy outside clusters but inside the calorimeter with tight matching (Angl...
Definition: CaloCluster_v1.h:204
ReadHandle.h
Handle class for reading from StoreGate.
CaloCalibClusterMomentsMaker2::m_momentsNames
std::vector< std::string > m_momentsNames
vector holding the input list of names of moments to calculate.
Definition: CaloCalibClusterMomentsMaker2.h:125
AthAlgTool
Definition: AthAlgTool.h:26
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
CaloCalibClusterMomentsMaker2::m_doCalibFrac
bool m_doCalibFrac
Definition: CaloCalibClusterMomentsMaker2.h:210
CaloDmDescrArea::DMA_ALL
@ DMA_ALL
Definition: CaloDmDescrArea.h:24
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
CaloCalibClusterMomentsMaker2::m_validMoments
moment_name_set m_validMoments
set of moments which will be calculated.
Definition: CaloCalibClusterMomentsMaker2.h:144
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloDmRegion::m_CaloSampleNeighbours
std::vector< short > m_CaloSampleNeighbours
Definition: CaloDmDescrManager.h:106
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
xAOD::CaloCluster_v1::ENG_CALIB_DEAD_EMB0
@ ENG_CALIB_DEAD_EMB0
Attached Calibration Hit energy in dead material before EMB0, between EMB0 and EMB1.
Definition: CaloCluster_v1.h:227
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CaloDmDescrManager::get_dm_area
int get_dm_area(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:147
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14