ATLAS Offline Software
ParticleCaloExtension.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAOD_PARTICLECALOEXTENSION_H
6 #define XAOD_PARTICLECALOEXTENSION_H
7 
10 
11 #ifndef XAOD_ANALYSIS
12 // Athena includes
14 #endif // not XAOD_ANALYSIS
15 
16 #include <vector>
17 class CaloCell;
18 
19 namespace xAOD {
20 
23  public:
26  std::vector<std::vector<float> >&& parameters,
27  std::vector<std::vector<float> >&& parametersCovariance,
28  std::vector<int>&& identifiers );
29 
32 
35 
38 
40  size_t numberOfParameters() const;
41 
43  const CurvilinearParameters_t trackParameters(unsigned int index) const;
44 
46  int parameterIdentifier(unsigned int index) const;
47 
49  bool trackParameterCovarianceMatrix(ParametersCovMatrix_t& matrix, unsigned int index) const;
50 
51 #ifndef XAOD_ANALYSIS
52  const Trk::CurvilinearParameters curvilinearParameters(unsigned int index) const;
55 #endif // not XAOD_ANALYSIS
56 
58  bool cellsAreAssociated() const;
59 
61  const std::vector<CaloCell*>& caloCells() const;
62 
64  void setCaloCells(const std::vector<CaloCell*>& cells);
65 
66  private:
68 #ifdef __clang__
69  [[maybe_unused]]
70 #endif
71  float m_charge;
72 
74  std::vector<std::vector<float> > m_parameters;
75 
77  std::vector<std::vector<float> > m_parametersCovariance;
78 
80  std::vector<int> m_identifiers;
81 
83  bool m_cellsAreSet; // bool to store whether already set
84  std::vector<CaloCell*> m_caloCells; // vector of cells
85  };
86 
89  return m_parameters.size();
90  }
91 
93  inline const CurvilinearParameters_t ParticleCaloExtension::trackParameters(unsigned int index) const {
94  CurvilinearParameters_t tmp;
97  return tmp;
98  }
99 
100  inline bool ParticleCaloExtension::trackParameterCovarianceMatrix(ParametersCovMatrix_t& cov, unsigned int index) const {
101  const std::vector<float>& covVec = m_parametersCovariance[index];
102  if( !covVec.empty() ) Amg::expand( covVec.begin(), covVec.end(),cov );
103  else{
104  cov.setIdentity();
105  return false;
106  }
107  return true;
108  }
109 
111  inline int ParticleCaloExtension::parameterIdentifier(unsigned int index) const {
112  return m_identifiers[index];
113  }
114 
116  return m_cellsAreSet;
117  }
118 
119  inline const std::vector<CaloCell*>& ParticleCaloExtension::caloCells() const {
120  return m_caloCells;
121  }
122 
123  inline void ParticleCaloExtension::setCaloCells(const std::vector<CaloCell*>& cells) {
124  m_caloCells = cells;
125  m_cellsAreSet=true;
126  }
127 
128 #ifndef XAOD_ANALYSIS
130 
131  // copy the correct values into the temp matrix
132  ParametersCovMatrix_t cov;
135  }
136  // retrieve the parameters to build the curvilinear frame
139  Trk::CurvilinearParameters param(pos,mom,m_charge,std::move(cov));
140 
141  return param;
142  }
143 #endif // not XAOD_ANALYSIS
144 
145 }
146 
147 #include "xAODCore/CLASS_DEF.h"
151 
152 #endif
xAOD::ParticleCaloExtension::ParticleCaloExtension
ParticleCaloExtension(float charge, std::vector< std::vector< float > > &&parameters, std::vector< std::vector< float > > &&parametersCovariance, std::vector< int > &&identifiers)
constructor taking calo extrapolation as input.
Definition: ParticleCaloExtension.cxx:9
xAOD::ParticleCaloExtension::curvilinearParameters
const Trk::CurvilinearParameters curvilinearParameters(unsigned int index) const
Returns a curvilinear representation of the parameters at 'index'.
Definition: ParticleCaloExtension.h:129
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
TrackParameters.h
IDTPM::covVec
std::vector< float > covVec(const U &p)
Definition: TrackParametersHelper.h:179
xAOD::ParticleCaloExtension::setCaloCells
void setCaloCells(const std::vector< CaloCell * > &cells)
set vector of cells
Definition: ParticleCaloExtension.h:123
index
Definition: index.py:1
EventPrimitivesHelpers.h
xAOD::ParticleCaloExtension::m_parameters
std::vector< std::vector< float > > m_parameters
parameters of the intersections with detector layers
Definition: ParticleCaloExtension.h:74
xAOD::ParticleCaloExtension::operator=
ParticleCaloExtension & operator=(const ParticleCaloExtension &)=delete
no assignment operator
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
xAOD::ParticleCaloExtension::caloCells
const std::vector< CaloCell * > & caloCells() const
return vector of cells
Definition: ParticleCaloExtension.h:119
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::ParticleCaloExtension::parameterIdentifier
int parameterIdentifier(unsigned int index) const
Return the ParameterPosition of the parameters at 'index'.
Definition: ParticleCaloExtension.h:111
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
xAOD::ParticleCaloExtension::trackParameterCovarianceMatrix
bool trackParameterCovarianceMatrix(ParametersCovMatrix_t &matrix, unsigned int index) const
fill the matrix with the covariance at position 'index', returns false if the parameters at 'index' d...
Definition: ParticleCaloExtension.h:100
Amg::expand
void expand(std::vector< float >::const_iterator it, std::vector< float >::const_iterator, AmgSymMatrix(N) &covMatrix)
Definition: EventPrimitivesHelpers.h:75
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
xAOD::ParticleCaloExtension::numberOfParameters
size_t numberOfParameters() const
Returns the number of additional parameters stored in the Particle.
Definition: ParticleCaloExtension.h:88
xAOD::ParticleCaloExtension::m_parametersCovariance
std::vector< std::vector< float > > m_parametersCovariance
covariance of parameters of the intersections with detector layers
Definition: ParticleCaloExtension.h:77
xAOD::charge
charge
Definition: TrigElectron_v1.cxx:85
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
xAOD::ParticleCaloExtension::m_charge
float m_charge
charge (unused in AnalysisBase)
Definition: ParticleCaloExtension.h:71
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::ParticleCaloExtension::ParticleCaloExtension
ParticleCaloExtension(const ParticleCaloExtension &)=delete
no copy constructor
xAOD::ParticleCaloExtension::m_caloCells
std::vector< CaloCell * > m_caloCells
Definition: ParticleCaloExtension.h:84
xAOD::ParticleCaloExtension::m_cellsAreSet
bool m_cellsAreSet
cell information
Definition: ParticleCaloExtension.h:83
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CLASS_DEF.h
File providing the different SG_BASE macros.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::ParticleCaloExtension::~ParticleCaloExtension
~ParticleCaloExtension()
destructor
Definition: ParticleCaloExtension.cxx:16
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
DeMoScan.index
string index
Definition: DeMoScan.py:364
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
InDetSimDataHelpers::identifiers
std::vector< Identifier > identifiers(const InDetSimDataCollection &coll)
Definition: InDetSimDataDict.h:15
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
xAOD::ParticleCaloExtension::m_identifiers
std::vector< int > m_identifiers
identifiers of the intersections with detector layers
Definition: ParticleCaloExtension.h:80
xAOD::ParticleCaloExtension::trackParameters
const CurvilinearParameters_t trackParameters(unsigned int index) const
Returns the track parameter vector at 'index'.
Definition: ParticleCaloExtension.h:93
TrackingPrimitives.h
ParticleCaloExtensionCollection
DataVector< xAOD::ParticleCaloExtension > ParticleCaloExtensionCollection
Definition: ParticleCaloExtension.h:149
xAOD::ParticleCaloExtension
class storing calorimeter information associated with track based objects
Definition: ParticleCaloExtension.h:22
xAOD::ParticleCaloExtension::cellsAreAssociated
bool cellsAreAssociated() const
return whether cells were already associated or not
Definition: ParticleCaloExtension.h:115