ATLAS Offline Software
Public Member Functions | List of all members
CaloConstitHelpers::FlowElementExtractor Struct Reference
Inheritance diagram for CaloConstitHelpers::FlowElementExtractor:
Collaboration diagram for CaloConstitHelpers::FlowElementExtractor:

Public Member Functions

virtual ~FlowElementExtractor ()=default
 
virtual bool valid (JetConstitIterator &it) const override
 
virtual double moment (JetConstitIterator &it, xAOD::CaloCluster::MomentType momentType) const override
 
virtual double time (JetConstitIterator &it) const override
 
virtual double energyHEC (JetConstitIterator &it) const override
 

Detailed Description

Definition at line 91 of file JetCaloCalculations.cxx.

Constructor & Destructor Documentation

◆ ~FlowElementExtractor()

virtual CaloConstitHelpers::FlowElementExtractor::~FlowElementExtractor ( )
virtualdefault

Member Function Documentation

◆ energyHEC()

virtual double CaloConstitHelpers::FlowElementExtractor::energyHEC ( JetConstitIterator it) const
inlineoverridevirtual

Reimplemented from CaloConstitHelpers::CaloConstitExtractor.

Definition at line 142 of file JetCaloCalculations.cxx.

151  {
152  sum_HEC = accHEC0(*fe) + accHEC1(*fe) + accHEC2(*fe) + accHEC3(*fe);
153  }
154  else{
155  for (size_t n = 0; n < fe->otherObjects().size(); ++n) {
156  if(! fe->otherObject(n)) continue;
157  const auto* neutralObject = (fe->otherObject(n));
158 
159  const xAOD::CaloCluster* cluster = nullptr;
160 
161  //If we have a cluster, we can directly access the calorimeter information
162  if(neutralObject->type() == xAOD::Type::CaloCluster){
163  cluster = dynamic_cast<const xAOD::CaloCluster*> (neutralObject);
164  }
165  //If we have a PFO (in case of fe being a UFO), we need to get the associated cluster first
166  else {
167  const xAOD::FlowElement* pfo = dynamic_cast<const xAOD::FlowElement*>(neutralObject);
168  if(!pfo->otherObjects().empty() && pfo->otherObject(0) && pfo->otherObject(0)->type() == xAOD::Type::CaloCluster){
169  cluster = dynamic_cast<const xAOD::CaloCluster*> (pfo->otherObject(0));
170  }
171  }
172  if(cluster){
173  sum_HEC += cluster->eSample( CaloSampling::HEC0 ) + cluster->eSample( CaloSampling::HEC1 ) + cluster->eSample( CaloSampling::HEC2 ) + cluster->eSample( CaloSampling::HEC3 );
174  }
175  }
176  }
177  return sum_HEC;
178  }
179 
180  };
181 

◆ moment()

virtual double CaloConstitHelpers::FlowElementExtractor::moment ( JetConstitIterator it,
xAOD::CaloCluster::MomentType  momentType 
) const
inlineoverridevirtual

Reimplemented from CaloConstitHelpers::CaloConstitExtractor.

Definition at line 102 of file JetCaloCalculations.cxx.

106  {
107  const xAOD::FlowElement* fe = static_cast<const xAOD::FlowElement*>(it->rawConstituent());

◆ time()

virtual double CaloConstitHelpers::FlowElementExtractor::time ( JetConstitIterator it) const
inlineoverridevirtual

Reimplemented from CaloConstitHelpers::CaloConstitExtractor.

Definition at line 109 of file JetCaloCalculations.cxx.

112  {
113  timing = accTiming(*fe);
114  }
115  else{
116  if(fe->otherObjects().size() == 1 && fe->otherObject(0)){
117  const auto* neutralObject = (fe->otherObject(0));
118  const xAOD::CaloCluster* cluster = nullptr;
119 
120  if(neutralObject->type() == xAOD::Type::CaloCluster){
121  cluster = dynamic_cast<const xAOD::CaloCluster*> (neutralObject);
122  }
123  //If we have a PFO (in case of fe being a UFO), we need to get the associated cluster first
124  else {
125  const xAOD::FlowElement* pfo = dynamic_cast<const xAOD::FlowElement*>(neutralObject);
126  if(!pfo->otherObjects().empty() && pfo->otherObject(0) && pfo->otherObject(0)->type() == xAOD::Type::CaloCluster){
127  cluster = dynamic_cast<const xAOD::CaloCluster*> (pfo->otherObject(0));
128  }
129  }
130 
131  if(cluster){
132  timing = cluster->time();
133  }
134  }
135  }
136  return timing;
137  }
138 
139  virtual double energyHEC(JetConstitIterator & it ) const override {
140  const xAOD::FlowElement* fe = static_cast<const xAOD::FlowElement*>(it->rawConstituent());

◆ valid()

virtual bool CaloConstitHelpers::FlowElementExtractor::valid ( JetConstitIterator it) const
inlineoverridevirtual

Reimplemented from CaloConstitHelpers::CaloConstitExtractor.

Definition at line 96 of file JetCaloCalculations.cxx.

99  {
100  float m=0.;

The documentation for this struct was generated from the following file:
xAOD::CaloCluster_v1::time
flt_t time() const
Access cluster time.
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
skel.it
it
Definition: skel.GENtoEVGEN.py:396
xAOD::IParticle::type
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
CaloConstitHelpers::JetConstitIterator
xAOD::JetConstituentVector::iterator JetConstitIterator
Definition: JetCaloCalculations.cxx:21
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
trigDumpTimers.timing
def timing(hist)
Definition: trigDumpTimers.py:13
beamspotman.n
n
Definition: beamspotman.py:731
CaloConstitHelpers::FlowElementExtractor::energyHEC
virtual double energyHEC(JetConstitIterator &it) const override
Definition: JetCaloCalculations.cxx:142
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
xAOD::FlowElement_v1::otherObject
const xAOD::IParticle * otherObject(std::size_t i) const
Definition: FlowElement_v1.cxx:196
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
xAOD::FlowElement_v1::otherObjects
std::vector< const xAOD::IParticle * > otherObjects() const
Definition: FlowElement_v1.cxx:163
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25