ATLAS Offline Software
CaloProtoCluster.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CaloProtoCluster.h"
7 #include <cmath>
8 //#include "xAODCaloEvent/CaloClusterKineHelper.h"
9 
11  m_cellLinks(new CaloClusterCellLink(cellCont)),
12  m_haveKine(false),
13  m_e(0.),
14  m_et(0.)
15 {}
16 
18  m_cellLinks(new CaloClusterCellLink(cellCont)),
19  m_haveKine(false),
20  m_e(0.),
21  m_et(0.)
22 {}
23 
25  m_cellLinks(new CaloClusterCellLink(*cellLink)),
26  m_haveKine(false),
27  m_e(0.),
28  m_et(0.)
29 {}
30 
31 
33 
34  //Using sinTh saves only 2sec on 1500 events
35 
36  m_e=0;
37  double absEnergySum=0;
38  double etaSum=0;
39  //double sinThSum=0;
40  const CaloClusterCellLink* lnk=m_cellLinks.get();
43 
44  for (;it!=it_e;++it)
46 
47  it=lnk->begin();
48  for (;it!=it_e;++it) {
49 
51 
52  const CaloCell* cell=*it;
53  double cellEta=cell->eta();
54  //double cellSinTh=cell->sinTh();
55  double cellE=cell->e();
56  double cellW=it.weight();
57  double absEW=cellW*std::fabs(cellE);
58 
59 
60 
61  m_e+=cellE*cellW;
62  absEnergySum+=absEW;
63  etaSum += absEW * cellEta;
64  //sinThSum+= absEW * cellSinTh;
65 
66 
67  }
68  double eta=etaSum/absEnergySum;
69  //double sinTh=sinThSum/absEnergySum;
70 
71  //Check difference (numerical precision)
72  //std::cout << "eta=" << eta << ", sinTh=" << sinTh << ", 1/std::cosh(std::fabs(eta))=" << 1/std::cosh(std::fabs(eta))
73  // << ", diff=" << sinTh- 1/std::cosh(std::fabs(eta)) << std::endl;
74 
75  double sinTh = 1.0 / std::cosh( eta );
76  //m_et=m_e/std::cosh(std::fabs(eta));
77  m_et=m_e*sinTh;
78  m_haveKine=true;
79 }
80 
CaloPrefetch.h
CaloProtoCluster::m_haveKine
bool m_haveKine
Definition: CaloProtoCluster.h:72
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloProtoCluster::CaloProtoCluster
CaloProtoCluster()=delete
No default constructor, always need a CaloCellContainer to work with.
CaloProtoCluster::m_e
double m_e
Definition: CaloProtoCluster.h:73
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloProtoCluster::m_cellLinks
std::unique_ptr< CaloClusterCellLink > m_cellLinks
Definition: CaloProtoCluster.h:71
CaloProtoCluster.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CxxUtils::prefetchObj
void prefetchObj(const T *ptr)
Generic prefetch of the object of specific types (sizes).
Definition: prefetch.h:108
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloPrefetch::nextDDE
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
Definition: CaloPrefetch.h:47
CaloProtoCluster::m_et
double m_et
Definition: CaloProtoCluster.h:74
CaloProtoCluster::getKine
void getKine()
update m_e and m_et
Definition: CaloProtoCluster.cxx:32