ATLAS Offline Software
Loading...
Searching...
No Matches
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.
 CaloProtoCluster (const CaloCellContainer *cellCont)
 Constructor with a CaloCellContainer.
 CaloProtoCluster (const DataLink< CaloCellContainer > &cellCont)
 Constructor with a CaloCellContainer link.
 CaloProtoCluster (const CaloClusterCellLink *cellLink)
 Constructor (almost a copy constructor)
double e ()
 Return the weighted energy sum of the list of cells.
double et ()
 Return the weighted Et of the list of cells.
void addCell (const unsigned cellIdx, const CaloClusterCellLink::weight_t weight=1.0)
 Add a cell (forward to underlying CaloClusterCellLink)
CaloClusterCellLinkreleaseCellLinks ()
 Hand over ownership of CaloClusterCellLink to client.
CaloClusterCellLinkgetCellLinks ()
 Get a pointer to the underlying CaloClusterCellLink object.
size_t size ()
 Get the size of the underlying CaloClusterCellLink object.

Private Member Functions

void getKine ()
 update m_e and m_et

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{}
std::unique_ptr< CaloClusterCellLink > m_cellLinks

◆ 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 }
void getKine()
update m_e and m_et

◆ 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();
41 CaloClusterCellLink::const_iterator it=lnk->begin();
42 CaloClusterCellLink::const_iterator it_e=lnk->end();
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}
Scalar eta() const
pseudorapidity method
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

◆ 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: