ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloRec
src
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
"
6
#include "
CaloEvent/CaloPrefetch.h
"
7
#include <cmath>
8
//#include "xAODCaloEvent/CaloClusterKineHelper.h"
9
10
CaloProtoCluster::CaloProtoCluster
(
const
CaloCellContainer
* cellCont) :
11
m_cellLinks
(new
CaloClusterCellLink
(cellCont)),
12
m_haveKine
(false),
13
m_e
(0.),
14
m_et
(0.)
15
{}
16
17
CaloProtoCluster::CaloProtoCluster
(
const
DataLink<CaloCellContainer>
& cellCont) :
18
m_cellLinks
(new
CaloClusterCellLink
(cellCont)),
19
m_haveKine
(false),
20
m_e
(0.),
21
m_et
(0.)
22
{}
23
24
CaloProtoCluster::CaloProtoCluster
(
const
CaloClusterCellLink
* cellLink) :
25
m_cellLinks
(new
CaloClusterCellLink
(*cellLink)),
26
m_haveKine
(false),
27
m_e
(0.),
28
m_et
(0.)
29
{}
30
31
32
void
CaloProtoCluster::getKine
() {
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();
41
CaloClusterCellLink::const_iterator
it=lnk->
begin
();
42
CaloClusterCellLink::const_iterator
it_e=lnk->
end
();
43
44
for
(;it!=it_e;++it)
45
CxxUtils::prefetchObj
(*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
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
CaloPrefetch.h
CaloProtoCluster.h
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterCellLink::const_iterator
const_iterator to loop over cells belonging to a cluster
Definition
CaloClusterCellLink.h:57
CaloClusterCellLink
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Definition
CaloClusterCellLink.h:24
CaloClusterCellLink::end
const_iterator end() const
const end method
Definition
CaloClusterCellLink.h:112
CaloClusterCellLink::begin
const_iterator begin() const
const begin method
Definition
CaloClusterCellLink.h:107
CaloProtoCluster::m_et
double m_et
Definition
CaloProtoCluster.h:74
CaloProtoCluster::m_e
double m_e
Definition
CaloProtoCluster.h:73
CaloProtoCluster::m_cellLinks
std::unique_ptr< CaloClusterCellLink > m_cellLinks
Definition
CaloProtoCluster.h:71
CaloProtoCluster::m_haveKine
bool m_haveKine
Definition
CaloProtoCluster.h:72
CaloProtoCluster::CaloProtoCluster
CaloProtoCluster()=delete
No default constructor, always need a CaloCellContainer to work with.
CaloProtoCluster::getKine
void getKine()
update m_e and m_et
Definition
CaloProtoCluster.cxx:32
DataLink
Object reference supporting deferred reading from StoreGate.
Definition
AthLinks/DataLink.h:93
CaloPrefetch::nextDDE
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
Definition
CaloPrefetch.h:47
CxxUtils::prefetchObj
void prefetchObj(const T *ptr)
Generic prefetch of the object of specific types (sizes).
Definition
prefetch.h:108
Generated on
for ATLAS Offline Software by
1.17.0