ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloProtoCluster Class Reference

#include <CaloProtoCluster.h>

Collaboration diagram for CaloProtoCluster:

Public Member Functions

 CaloProtoCluster ()=delete
 No default constructor, always need a CaloCellContainer to work with. More...
 
 CaloProtoCluster (const CaloCellContainer *cellCont)
 Constructor with a CaloCellContainer. More...
 
 CaloProtoCluster (const DataLink< CaloCellContainer > &cellCont)
 Constructor with a CaloCellContainer link. More...
 
 CaloProtoCluster (const CaloClusterCellLink *cellLink)
 Constructor (almost a copy constructor) More...
 
double e ()
 Return the weighted energy sum of the list of cells. More...
 
double et ()
 Return the weighted Et of the list of cells. More...
 
void addCell (const unsigned cellIdx, const CaloClusterCellLink::weight_t weight=1.0)
 Add a cell (forward to underlying CaloClusterCellLink) More...
 
CaloClusterCellLinkreleaseCellLinks ()
 Hand over ownership of CaloClusterCellLink to client. More...
 
CaloClusterCellLinkgetCellLinks ()
 Get a pointer to the underlying CaloClusterCellLink object. More...
 
size_t size ()
 Get the size of the underlying CaloClusterCellLink object. More...
 

Private Member Functions

void getKine ()
 update m_e and m_et More...
 

Private Attributes

std::unique_ptr< CaloClusterCellLinkm_cellLinks
 
bool m_haveKine
 
double m_e
 
double m_et
 

Detailed Description

Definition at line 14 of file CaloProtoCluster.h.

Constructor & Destructor Documentation

◆ CaloProtoCluster() [1/4]

CaloProtoCluster::CaloProtoCluster ( )
delete

No default constructor, always need a CaloCellContainer to work with.

◆ CaloProtoCluster() [2/4]

CaloProtoCluster::CaloProtoCluster ( const CaloCellContainer cellCont)

Constructor with a CaloCellContainer.

Definition at line 10 of file CaloProtoCluster.cxx.

10  :
11  m_cellLinks(new CaloClusterCellLink(cellCont)),
12  m_haveKine(false),
13  m_e(0.),
14  m_et(0.)
15 {}

◆ CaloProtoCluster() [3/4]

CaloProtoCluster::CaloProtoCluster ( const DataLink< CaloCellContainer > &  cellCont)

Constructor with a CaloCellContainer link.

Definition at line 17 of file CaloProtoCluster.cxx.

17  :
18  m_cellLinks(new CaloClusterCellLink(cellCont)),
19  m_haveKine(false),
20  m_e(0.),
21  m_et(0.)
22 {}

◆ CaloProtoCluster() [4/4]

CaloProtoCluster::CaloProtoCluster ( const CaloClusterCellLink cellLink)

Constructor (almost a copy constructor)

Parameters
cellLinkPtr to an existng CaloClusterCellLink. Will create a deep copy of the CaloClusterCellLink

Definition at line 24 of file CaloProtoCluster.cxx.

24  :
25  m_cellLinks(new CaloClusterCellLink(*cellLink)),
26  m_haveKine(false),
27  m_e(0.),
28  m_et(0.)
29 {}

Member Function Documentation

◆ addCell()

void CaloProtoCluster::addCell ( const unsigned  cellIdx,
const CaloClusterCellLink::weight_t  weight = 1.0 
)
inline

Add a cell (forward to underlying CaloClusterCellLink)

Definition at line 46 of file CaloProtoCluster.h.

46  {
47  m_cellLinks->addCell(cellIdx,weight);
48  m_haveKine=false;
49  }

◆ e()

double CaloProtoCluster::e ( )
inline

Return the weighted energy sum of the list of cells.

Definition at line 34 of file CaloProtoCluster.h.

34  {
35  if (!m_haveKine) getKine();
36  return m_e;
37  }

◆ et()

double CaloProtoCluster::et ( )
inline

Return the weighted Et of the list of cells.

Definition at line 40 of file CaloProtoCluster.h.

40  {
41  if (!m_haveKine) getKine();
42  return m_et;
43  }

◆ getCellLinks()

CaloClusterCellLink* CaloProtoCluster::getCellLinks ( )
inline

Get a pointer to the underlying CaloClusterCellLink object.

Definition at line 58 of file CaloProtoCluster.h.

58  {
59  return m_cellLinks.get();
60  }

◆ getKine()

void CaloProtoCluster::getKine ( )
private

update m_e and m_et

Definition at line 32 of file CaloProtoCluster.cxx.

32  {
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 }

◆ releaseCellLinks()

CaloClusterCellLink* CaloProtoCluster::releaseCellLinks ( )
inline

Hand over ownership of CaloClusterCellLink to client.

Definition at line 53 of file CaloProtoCluster.h.

53  {
54  return m_cellLinks.release();
55  }

◆ size()

size_t CaloProtoCluster::size ( )
inline

Get the size of the underlying CaloClusterCellLink object.

Definition at line 63 of file CaloProtoCluster.h.

63  {
64  return m_cellLinks->size();
65  }

Member Data Documentation

◆ m_cellLinks

std::unique_ptr<CaloClusterCellLink> CaloProtoCluster::m_cellLinks
private

Definition at line 71 of file CaloProtoCluster.h.

◆ m_e

double CaloProtoCluster::m_e
private

Definition at line 73 of file CaloProtoCluster.h.

◆ m_et

double CaloProtoCluster::m_et
private

Definition at line 74 of file CaloProtoCluster.h.

◆ m_haveKine

bool CaloProtoCluster::m_haveKine
private

Definition at line 72 of file CaloProtoCluster.h.


The documentation for this class was generated from the following files:
CaloProtoCluster::m_haveKine
bool m_haveKine
Definition: CaloProtoCluster.h:72
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloProtoCluster::m_e
double m_e
Definition: CaloProtoCluster.h:73
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
skel.it
it
Definition: skel.GENtoEVGEN.py:396
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
CaloProtoCluster::m_cellLinks
std::unique_ptr< CaloClusterCellLink > m_cellLinks
Definition: CaloProtoCluster.h:71
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