ATLAS Offline Software
Loading...
Searching...
No Matches
eflowRecCluster Class Reference

This class extends the information about a xAOD::CaloCluster. More...

#include <eflowRecCluster.h>

Collaboration diagram for eflowRecCluster:

Classes

class  SortDescendingPt

Public Member Functions

 eflowRecCluster (const ElementLink< xAOD::CaloClusterContainer > &clusElementLink, xAOD::CaloClusterContainer &newClusContainer)
 eflowRecCluster (const eflowRecCluster &originalEflowRecCluster)
eflowRecClusteroperator= (const eflowRecCluster &originalEflowRecCluster)=delete
virtual ~eflowRecCluster ()
xAOD::CaloClustergetCluster ()
const xAOD::CaloClustergetCluster () const
ElementLink< xAOD::CaloClusterContainergetClusElementLink () const
ElementLink< xAOD::CaloClusterContainergetOriginalClusElementLink () const
eflowMatchClustergetMatchCluster () const
double getSumExpectedEnergy ()
double getVarianceOfSumExpectedEnergy ()
bool isEOverPFail (bool consistencySigmaCut, bool useGoldenMode)
void addTrackMatch (eflowTrackClusterLink *trackMatch)
const std::vector< eflowTrackClusterLink * > & getTrackMatches () const
void clearTrackMatches ()
int getNTracks () const
int getClusterId () const
void setClusterId (int clusterId)
void setCellsWeight (std::map< IdentifierHash, double > &&cellsWeight)
const std::map< IdentifierHash, double > & getCellsWeight () const
int getClusterType () const
 Specifies if we have a cluster mainly in ECAL, HCAL or FCAL.
bool isTouchable () const

Private Types

enum  CalorimeterType {
  CALORIMETER_START = 0 , UNASSIGNED = CALORIMETER_START , ECAL = 1 , HCAL = 2 ,
  FCAL = 3 , UNKNOWN = 4 , CALORIMETER_END = 5
}
 ENUM that defines calorimeter regions as ECAL, HCAL or FCAL. More...

Private Member Functions

void setClusterType ()

Private Attributes

int m_clusterId
int m_calorimeterType
xAOD::CaloClusterm_cluster
ElementLink< xAOD::CaloClusterContainerm_originalClusElementLink
ElementLink< xAOD::CaloClusterContainerm_clusElementLink
bool m_isTouchable
std::map< IdentifierHash, double > m_cellsWeightMap
std::unique_ptr< eflowMatchClusterm_matchCluster
std::vector< eflowTrackClusterLink * > m_trackMatches

Detailed Description

This class extends the information about a xAOD::CaloCluster.

It includes an element link and raw pointer back to the CaloCluster, the index of the cluster in the CaloClusterContainer, a bool to determine if the CaloCluster is allowed to be modified or not (only if we have already copied the CaloCluster), the type (ECAL/HCAL), a map to store the LC weights for the calorimeter cluster cells, a pointer to an eflowMatchCluster and a vector of eflowTrackClusterLink

Definition at line 39 of file eflowRecCluster.h.

Member Enumeration Documentation

◆ CalorimeterType

ENUM that defines calorimeter regions as ECAL, HCAL or FCAL.

Enumerator
CALORIMETER_START 
UNASSIGNED 
ECAL 
HCAL 
FCAL 
UNKNOWN 
CALORIMETER_END 

Definition at line 96 of file eflowRecCluster.h.

Constructor & Destructor Documentation

◆ eflowRecCluster() [1/2]

eflowRecCluster::eflowRecCluster ( const ElementLink< xAOD::CaloClusterContainer > & clusElementLink,
xAOD::CaloClusterContainer & newClusContainer )

Definition at line 17 of file eflowRecCluster.cxx.

17 :
19 const xAOD::CaloCluster* originalCluster = *clusElementLink;
21 newClusContainer.push_back(m_cluster);
22 m_clusElementLink = ElementLink<xAOD::CaloClusterContainer>(newClusContainer,newClusContainer.size()-1);
23
24 const CaloClusterCellLink* theOldCellLinks = originalCluster->getCellLinks();
25
26 CaloClusterCellLink *newLinks = new CaloClusterCellLink(*theOldCellLinks);
27 m_cluster->addCellLink(newLinks);
30
31 m_cluster->setRawE(m_cluster->calE());
32 m_cluster->setRawEta(m_cluster->calEta());
33 m_cluster->setRawPhi(m_cluster->calPhi());
34 m_cluster->setRawM(m_cluster->calM());
35
36 m_matchCluster = std::make_unique<eflowMatchCluster>(this);
38}
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink< xAOD::CaloClusterContainer > m_originalClusElementLink
std::unique_ptr< eflowMatchCluster > m_matchCluster
xAOD::CaloCluster * m_cluster
ElementLink< xAOD::CaloClusterContainer > m_clusElementLink
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ eflowRecCluster() [2/2]

eflowRecCluster::eflowRecCluster ( const eflowRecCluster & originalEflowRecCluster)

Definition at line 40 of file eflowRecCluster.cxx.

41 : m_clusterId (originalEflowRecCluster.m_clusterId),
42 m_calorimeterType (originalEflowRecCluster.m_calorimeterType),
43 m_cluster (originalEflowRecCluster.m_cluster),
45 m_clusElementLink (originalEflowRecCluster.m_clusElementLink),
46 m_isTouchable (originalEflowRecCluster.m_isTouchable),
47 m_matchCluster (std::make_unique<eflowMatchCluster>(this))
48{
49}

◆ ~eflowRecCluster()

eflowRecCluster::~eflowRecCluster ( )
virtualdefault

Member Function Documentation

◆ addTrackMatch()

void eflowRecCluster::addTrackMatch ( eflowTrackClusterLink * trackMatch)
inline

Definition at line 69 of file eflowRecCluster.h.

70 {
71 m_trackMatches.push_back(trackMatch);
72 }
std::vector< eflowTrackClusterLink * > m_trackMatches

◆ clearTrackMatches()

void eflowRecCluster::clearTrackMatches ( )
inline

Definition at line 77 of file eflowRecCluster.h.

77{ m_trackMatches.clear(); }

◆ getCellsWeight()

const std::map< IdentifierHash, double > & eflowRecCluster::getCellsWeight ( ) const
inline

Definition at line 85 of file eflowRecCluster.h.

86 {
87 return m_cellsWeightMap;
88 }
std::map< IdentifierHash, double > m_cellsWeightMap

◆ getClusElementLink()

ElementLink< xAOD::CaloClusterContainer > eflowRecCluster::getClusElementLink ( ) const
inline

Definition at line 54 of file eflowRecCluster.h.

55 {
56 return m_clusElementLink;
57 }

◆ getCluster() [1/2]

xAOD::CaloCluster * eflowRecCluster::getCluster ( )
inline

Definition at line 49 of file eflowRecCluster.h.

49{ return m_cluster; }

◆ getCluster() [2/2]

const xAOD::CaloCluster * eflowRecCluster::getCluster ( ) const
inline

Definition at line 50 of file eflowRecCluster.h.

50{ return m_cluster; }

◆ getClusterId()

int eflowRecCluster::getClusterId ( ) const
inline

Definition at line 79 of file eflowRecCluster.h.

79{ return m_clusterId; }

◆ getClusterType()

int eflowRecCluster::getClusterType ( ) const
inline

Specifies if we have a cluster mainly in ECAL, HCAL or FCAL.

Definition at line 90 of file eflowRecCluster.h.

90{ return m_calorimeterType; }

◆ getMatchCluster()

eflowMatchCluster * eflowRecCluster::getMatchCluster ( ) const
inline

Definition at line 63 of file eflowRecCluster.h.

63{ return m_matchCluster.get(); }

◆ getNTracks()

int eflowRecCluster::getNTracks ( ) const
inline

Definition at line 78 of file eflowRecCluster.h.

78{ return m_trackMatches.size(); }

◆ getOriginalClusElementLink()

ElementLink< xAOD::CaloClusterContainer > eflowRecCluster::getOriginalClusElementLink ( ) const
inline

Definition at line 58 of file eflowRecCluster.h.

59 {
61 }

◆ getSumExpectedEnergy()

double eflowRecCluster::getSumExpectedEnergy ( )

Definition at line 69 of file eflowRecCluster.cxx.

69 {
70 double expectedEnergy(0);
71 int nTrk = getNTracks();
72 for (int iTrk = 0; iTrk < nTrk; ++iTrk){
73 expectedEnergy += m_trackMatches[iTrk]->getTrack()->getEExpect();
74 }
75 return expectedEnergy;
76}
int getNTracks() const

◆ getTrackMatches()

const std::vector< eflowTrackClusterLink * > & eflowRecCluster::getTrackMatches ( ) const
inline

Definition at line 73 of file eflowRecCluster.h.

74 {
75 return m_trackMatches;
76 }

◆ getVarianceOfSumExpectedEnergy()

double eflowRecCluster::getVarianceOfSumExpectedEnergy ( )

Definition at line 77 of file eflowRecCluster.cxx.

77 {
78 double varianceExpectedEnergy(0);
79 int nTrk = getNTracks();
80 for (int iTrk = 0; iTrk < nTrk; ++iTrk){
81 varianceExpectedEnergy += m_trackMatches[iTrk]->getTrack()->getVarEExpect();
82 }
83 return varianceExpectedEnergy;
84}

◆ isEOverPFail()

bool eflowRecCluster::isEOverPFail ( bool consistencySigmaCut,
bool useGoldenMode )

Definition at line 53 of file eflowRecCluster.cxx.

53 {
54
55 double expectedEnergy = getSumExpectedEnergy();
56 double clusterEnergy = m_cluster->e();
57
58 if ((expectedEnergy == 0) && (clusterEnergy > 0)) {
59 return false;
60 }
61
63
64 bool result = useGoldenMode ? fabs(clusterEnergy - expectedEnergy) > consistencySigmaCut*sigma
65 : clusterEnergy < expectedEnergy - consistencySigmaCut*sigma;
66 return result;
67}
double getVarianceOfSumExpectedEnergy()
double getSumExpectedEnergy()

◆ isTouchable()

bool eflowRecCluster::isTouchable ( ) const
inline

Definition at line 91 of file eflowRecCluster.h.

91{ return m_isTouchable; }

◆ operator=()

eflowRecCluster & eflowRecCluster::operator= ( const eflowRecCluster & originalEflowRecCluster)
delete

◆ setCellsWeight()

void eflowRecCluster::setCellsWeight ( std::map< IdentifierHash, double > && cellsWeight)
inline

Definition at line 81 of file eflowRecCluster.h.

82 {
83 m_cellsWeightMap = std::move(cellsWeight);
84 }

◆ setClusterId()

void eflowRecCluster::setClusterId ( int clusterId)
inline

Definition at line 80 of file eflowRecCluster.h.

80{ m_clusterId = clusterId; }

◆ setClusterType()

void eflowRecCluster::setClusterType ( )
private

Definition at line 86 of file eflowRecCluster.cxx.

86 {
87
88 double EMB_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::PreSamplerB)
89 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EMB1)
90 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EMB2)
91 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EMB3);
92 double EME_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::PreSamplerE)
93 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EME1)
94 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EME2)
95 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::EME3);
96 double HEC_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::HEC0)
97 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::HEC1)
98 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::HEC2)
99 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::HEC3);
100 double Tile_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileBar0)
101 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileBar1)
102 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileBar2)
103 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileGap1)
104 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileGap2)
105 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileGap3)
106 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileExt0)
107 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileExt1)
108 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::TileExt2);
109 double FCAL_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::FCAL0)
110 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::FCAL1)
111 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::FCAL2);
112 double MiniFCAL_E = m_cluster->eSample(xAOD::CaloCluster::CaloSample::MINIFCAL0)
113 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::MINIFCAL1)
114 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::MINIFCAL2)
115 + m_cluster->eSample(xAOD::CaloCluster::CaloSample::MINIFCAL3);
116
117 double totalEnergy = EMB_E + EME_E + HEC_E + Tile_E + FCAL_E + MiniFCAL_E;
118 if(std::abs(totalEnergy) < 1.0e-4){
120 return;
121 }
122 double ratioEM = (EMB_E+EME_E)/totalEnergy;
123 double ratioHCAL = (HEC_E+Tile_E)/totalEnergy;
124 double ratioFCAL = (FCAL_E + MiniFCAL_E)/totalEnergy;
126 if(ratioEM > 0.5) {
128 } else if (ratioHCAL > 0.5) {
130 } else if (ratioFCAL > 0.5) {
132 } else {
134 }
136}

Member Data Documentation

◆ m_calorimeterType

int eflowRecCluster::m_calorimeterType
private

Definition at line 108 of file eflowRecCluster.h.

◆ m_cellsWeightMap

std::map<IdentifierHash, double> eflowRecCluster::m_cellsWeightMap
private

Definition at line 117 of file eflowRecCluster.h.

◆ m_clusElementLink

ElementLink<xAOD::CaloClusterContainer> eflowRecCluster::m_clusElementLink
private

Definition at line 111 of file eflowRecCluster.h.

◆ m_cluster

xAOD::CaloCluster* eflowRecCluster::m_cluster
private

Definition at line 109 of file eflowRecCluster.h.

◆ m_clusterId

int eflowRecCluster::m_clusterId
private

Definition at line 107 of file eflowRecCluster.h.

◆ m_isTouchable

bool eflowRecCluster::m_isTouchable
private

Definition at line 112 of file eflowRecCluster.h.

◆ m_matchCluster

std::unique_ptr<eflowMatchCluster> eflowRecCluster::m_matchCluster
private

Definition at line 119 of file eflowRecCluster.h.

◆ m_originalClusElementLink

ElementLink<xAOD::CaloClusterContainer> eflowRecCluster::m_originalClusElementLink
private

Definition at line 110 of file eflowRecCluster.h.

◆ m_trackMatches

std::vector<eflowTrackClusterLink*> eflowRecCluster::m_trackMatches
private

Definition at line 120 of file eflowRecCluster.h.


The documentation for this class was generated from the following files: