ATLAS Offline Software
Loading...
Searching...
No Matches
CaloProtoCluster.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
50 CaloPrefetch::nextDDE(it,it_e);
51
52 const CaloCell* cell=*it;
53 double cellEta=cell->eta();
54 double cellE=cell->e();
55 double cellW=it.weight();
56 double absEW=cellW*std::fabs(cellE);
57
58 m_e+=cellE*cellW;
59 absEnergySum+=absEW;
60 etaSum += absEW * cellEta;
61 }
62
63 if (absEnergySum != 0) {
64 double eta=etaSum/absEnergySum;
65
66 double sinTh = 1.0 / std::cosh( eta );
67 m_et=m_e*sinTh;
68 m_haveKine=true;
69 }
70}
71
Scalar eta() const
pseudorapidity method
Container class for CaloCell.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
std::unique_ptr< CaloClusterCellLink > m_cellLinks
CaloProtoCluster()=delete
No default constructor, always need a CaloCellContainer to work with.
void getKine()
update m_e and m_et
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
void prefetchObj(const T *ptr)
Generic prefetch of the object of specific types (sizes).
Definition prefetch.h:108