ATLAS Offline Software
eflowObject.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EFLOWEVENT_EFLOWOBJECT_H
6 #define EFLOWEVENT_EFLOWOBJECT_H
7 /********************************************************************
8 
9 NAME: eflowObject.h
10 PACKAGE: offline/Reconstruction/eflowRec
11 
12 AUTHORS: D.R. Tovey
13 CREATED: 22nd November, 2001
14 
15 UPDATED: 14th March 2003 (P Loch) implement navigation system
16 
17 PURPOSE: eflow object data class
18 
19 ********************************************************************/
20 
21 // INCLUDE HEADER FILES:
22 
23 
24 #include "GaudiKernel/ContainedObject.h"
25 
26 #include "AthLinks/ElementLink.h"
27 
28 #include "CaloEvent/CaloCluster.h"
29 #include "CaloEvent/CaloClusterContainer.h"
31 
32 #include "Particle/TrackParticle.h"
34 
35 #include "muonEvent/Muon.h"
37 
38 #include "VxVertex/VxContainer.h"
39 
40 #include "FourMom/P4EEtaPhiM.h"
41 
43 #include "Navigation/Navigable.h"
44 
46 
47 #include <vector>
48 
50 // temporary for navigation !!
51 #include <any>
52 
53 class VxCandidate;
54 
55 // class eflowObject
56 //
57 // Navigation requires eflowObject to implement INavigable interface!
58 
59 class eflowObject : public P4EEtaPhiM, virtual public INavigable4Momentum
60 {
61 
62  public:
63 
64 // constructor
65  eflowObject();
66 
67  //copy constructors
68 
69  eflowObject(eflowObject* eflowObj);
70  eflowObject(eflowObject* eflowObj, bool useClus);
71 
72 // destructor
73  ~eflowObject();
74 
75  //new enum for object type
76  enum ParticleType { ChargedPion = 0, Electron = 1, Photon = 2 };
77 
78  //initialize things for copy constructors
79  void initialize(eflowObject* eflowObj, bool useClus);
80 
81  // typedef std::vector<const Rec::TrackParticle*> eflowTrack_type;
83 
85 
86  // typedefs for vector eflowClus of pointers to clus objects and
87  // corresponding iterators
88  //
89  // general cluster typedef's
92 
95 
96  // TrackParticle Accessor Methods:
97 
100 
101  const Rec::TrackParticle* track(size_t i) const { return m_eflowTrack[i]; }
103  { return m_eflowTrack.linkAt(i); }
104 
105  void addTrack(const ElementLink<Rec::TrackParticleContainer>& trackElementLink);
106 
107  // clus Accessor Methods:
108 
111 
112  const CaloCluster* clus(size_t i) const { return m_eflowClus[i]; }
114  { return m_eflowClus.linkAt(i); }
115 
116  void addClus(const ElementLink<CaloClusterContainer>& clusElementLink);
117  void addClus(const CaloCluster* clus);
118 
119  // Other Methods
120 
121  int numTrack() const { return m_eflowTrack.size(); }
122  int numClus() const { return m_eflowClus.size(); }
123 
124  const Analysis::Muon* muon() const ;
126  void addMuon(const ElementLink<Analysis::MuonContainer>& muonElementLink) { m_muonElementLink = muonElementLink; }
127 
128  const Trk::VxCandidate* conversion() const { return *m_convElementLink; }
130  void addConversion(const ElementLink<VxContainer>& convElementLink) { m_convElementLink = convElementLink; }
131 
132  // Set/get parameters
133 
134  // most of these methods are in P4EEtaPhiM!
135 
136  void set_eta(double ceta) { this->setEta(ceta); }
137 
138  void set_phi(double cphi) { this->setPhi(cphi); } // phi convention
139 
140  double d0() const { return m_d0; }
141  void set_d0(double cd0) { m_d0 = cd0; }
142 
143  double z0() const { return m_z0; }
144  void set_z0(double cz0) { m_z0 = cz0; }
145 
146  double energy() const { return this->e(); }
147  void set_energy(double cenergy) { this->setE(cenergy); }
148 
149  void set_m(double cm) { this->setM(cm); }
150 
151  int eflowType() const { return m_eflowType; }
152  void set_type(int ctype) { m_eflowType = ctype; }
153 
154  int charge() const { return m_charge; }
155  void set_charge(int ccharge) { m_charge = ccharge; }
156 
157  bool isValid() const { return m_valid; }
158  void set_notValid() { m_valid = false; }
159  void set_valid(bool flag=true) { m_valid = flag; }
160 
161  double getPi0MVA() const { return m_pi0MVA;}
162  void setPi0MVA(double Pi0MVA) {m_pi0MVA = Pi0MVA;}
163 
164  // new navigation system
165  virtual void fillToken(INavigationToken& thisToken) const
166  {
167  this->fillToken(thisToken,double(1.0));
168  }
169  virtual void fillToken(INavigationToken& thisToken,
170  const std::any& aRelation ) const;
171 
174 
176  bool getPassEOverPCheck() const { return m_passedEOverPCheck;}
177 
178  void setIsSubtracted(bool isSubtracted) { m_isSubtracted = isSubtracted;}
179  bool getIsSubtracted() const { return m_isSubtracted;}
180 
181  void setIsDuplicated(bool isDuplicated) { m_isDuplicated = isDuplicated;}
182  bool getIsDuplicated() const { return m_isDuplicated;}
183 
186 
187  void setCenterMag(double centerMag) { m_centerMag = centerMag;}
188  double getCenterMag() const { return m_centerMag;}
189 
192 
193  protected:
194 
195  bool m_passedEOverPCheck = false;
196  bool m_isSubtracted = false;
197  bool m_isDuplicated = false;
198 
199  void navigateClusters(const cluster_type& theClusters,
200  INavigationToken& aToken,
201  double weight) const;
202 
203  bool navigateTrackParticles(INavigationToken& aToken, double weight) const;
204  bool navigateMuons( INavigationToken& aToken, double weight) const;
205  bool navigateConversions( INavigationToken& aToken, double weight) const;
206 
207  template< typename CONT, typename TOKEN >
208  void toToken(const CONT& theClusters,
209  TOKEN* aToken,
210  double weight) const;
211 
212  template< typename CONT, typename TOKEN >
213  void toToken(const CONT& theClusters,
214  TOKEN* aToken) const;
215 
216  private:
217 
219 
220  std::vector<CaloClusterContainer*> m_eflowClusContainers;
221 
222  // Calorimeter private data members:
224 
225  // Track private data member
227 
228  //Cluster Reco Status
230 
231  double m_d0 = 0.0, m_z0 = 0.0;
232 
233  int m_eflowType = 0, m_charge = 0;
234  int m_nTrack = 0, m_nClus = 0;
235 
236  bool m_valid = false;
237 
240 
241  double m_pi0MVA = 0.0;
242  double m_centerMag = 0.0;
243 
244 inline double phicorr(double a)
245 {
246  if (a <= -M_PI)
247  {
248  return a+(2*M_PI*floor(-(a-M_PI)/(2*M_PI)));
249  }
250  else if (a > M_PI)
251  {
252  return a-(2*M_PI*floor((a+M_PI)/(2*M_PI)));
253  }
254  else
255  {
256  return a;
257  }
258 }
259 
260 };
261 
262 #endif
NavigableVector::size
unsigned int size() const
Definition: NavigableVector.h:61
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
eflowObject::eflowObject
eflowObject()
Definition: eflowObject.cxx:43
eflowObject::energy
double energy() const
Definition: eflowObject.h:146
eflowObject::navigateMuons
bool navigateMuons(INavigationToken &aToken, double weight) const
Definition: eflowObject.cxx:286
eflowObject::set_z0
void set_z0(double cz0)
Definition: eflowObject.h:144
eflowObject::clus_end
eflowClus_iterator clus_end() const
Definition: eflowObject.h:110
eflowObject::m_passedEOverPCheck
bool m_passedEOverPCheck
Definition: eflowObject.h:195
eflowObject::setIsDuplicated
void setIsDuplicated(bool isDuplicated)
Definition: eflowObject.h:181
eflowObject::setCenterMag
void setCenterMag(double centerMag)
Definition: eflowObject.h:187
TrackParticle.h
P4EEtaPhiM::setEta
virtual void setEta(double theEta)
set eta data member
Definition: P4EEtaPhiM.h:117
eflowObject::set_phi
void set_phi(double cphi)
Definition: eflowObject.h:138
INavigable4Momentum.h
NavigableVectorIterator
Definition: NavigableVectorIterator.h:15
eflowObject::set_d0
void set_d0(double cd0)
Definition: eflowObject.h:141
eflowObject::d0
double d0() const
Definition: eflowObject.h:140
eflowObject::setPassEOverPCheck
void setPassEOverPCheck(bool check)
Definition: eflowObject.h:175
eflowObject::z0
double z0() const
Definition: eflowObject.h:143
eflowObject::conversionLink
const ElementLink< VxContainer > & conversionLink() const
Definition: eflowObject.cxx:367
eflowObject::addConversion
void addConversion(const ElementLink< VxContainer > &convElementLink)
Definition: eflowObject.h:130
eflowObject::getCaloRecoStatus
CaloRecoStatus getCaloRecoStatus() const
Definition: eflowObject.h:185
P4EEtaPhiM
Definition: P4EEtaPhiM.h:25
MuonContainer.h
eflowObject::m_nTrack
int m_nTrack
Definition: eflowObject.h:234
eflowObject::eflowTrack_type
NavigableVector< Rec::TrackParticleContainer > eflowTrack_type
Definition: eflowObject.h:82
M_PI
#define M_PI
Definition: ActiveFraction.h:11
eflowObject::set_eta
void set_eta(double ceta)
Definition: eflowObject.h:136
eflowObject::clusLink
const ElementLink< CaloClusterContainer > clusLink(size_t i) const
Definition: eflowObject.h:113
eflowObject::eflowType
int eflowType() const
Definition: eflowObject.h:151
NavigableVector::begin
const_iterator begin() const
Definition: NavigableVector.h:64
eflowObject::clus_begin
eflowClus_iterator clus_begin() const
Definition: eflowObject.h:109
eflowObject::set_notValid
void set_notValid()
Definition: eflowObject.h:158
eflowObject::eflowClus_iterator
cluster_iterator eflowClus_iterator
Definition: eflowObject.h:94
eflowObject
Definition: eflowObject.h:60
eflowObject::addClus
void addClus(const ElementLink< CaloClusterContainer > &clusElementLink)
Definition: eflowObject.cxx:115
P4EEtaPhiM::e
virtual double e() const
get energy data member
Definition: P4EEtaPhiM.h:102
particleType
Definition: particleType.h:29
eflowObject::setIsSubtracted
void setIsSubtracted(bool isSubtracted)
Definition: eflowObject.h:178
eflowObject::track
const Rec::TrackParticle * track(size_t i) const
Definition: eflowObject.h:101
Photon
Class describing an photon
eflowObject::m_isDuplicated
bool m_isDuplicated
Definition: eflowObject.h:197
eflowObject::navigateConversions
bool navigateConversions(INavigationToken &aToken, double weight) const
Definition: eflowObject.cxx:315
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
eflowObject::set_energy
void set_energy(double cenergy)
Definition: eflowObject.h:147
eflowObject::track_end
eflowTrack_iterator track_end() const
Definition: eflowObject.h:99
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
eflowObject::getPi0MVA
double getPi0MVA() const
Definition: eflowObject.h:161
eflowObject::eflowClus_type
cluster_type eflowClus_type
Definition: eflowObject.h:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
eflowObject::m_pi0MVA
double m_pi0MVA
Definition: eflowObject.h:241
eflowObject::lastClusContainer
std::vector< CaloClusterContainer * >::iterator lastClusContainer()
Definition: eflowObject.h:173
eflowObject::~eflowObject
~eflowObject()
Definition: eflowObject.cxx:95
NavigableVector< Rec::TrackParticleContainer >
master.flag
bool flag
Definition: master.py:29
eflowObject::muon
const Analysis::Muon * muon() const
Definition: eflowObject.cxx:105
eflowObject::eflowTrack_iterator
eflowTrack_type::const_iterator eflowTrack_iterator
Definition: eflowObject.h:84
eflowObject::initialize
void initialize(eflowObject *eflowObj, bool useClus)
Definition: eflowObject.cxx:63
INavigationToken
Definition: INavigationToken.h:24
eflowObject::m_recoStatus
CaloRecoStatus m_recoStatus
Definition: eflowObject.h:229
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
eflowObject::set_type
void set_type(int ctype)
Definition: eflowObject.h:152
eflowObject::toToken
void toToken(const CONT &theClusters, TOKEN *aToken, double weight) const
Definition: eflowObject.cxx:344
eflowObject::addTrack
void addTrack(const ElementLink< Rec::TrackParticleContainer > &trackElementLink)
Definition: eflowObject.cxx:130
Analysis::Muon
The ATLAS Muon object - see doxygen, physics workbookd and the Muon Combined Performance WG's pages f...
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:48
VxContainer.h
eflowObject::m_eflowObjectType
ParticleType m_eflowObjectType
Definition: eflowObject.h:218
eflowObject::ParticleType
ParticleType
Definition: eflowObject.h:76
eflowObject::conversion
const Trk::VxCandidate * conversion() const
Definition: eflowObject.h:128
eflowObject::m_eflowClusContainers
std::vector< CaloClusterContainer * > m_eflowClusContainers
Definition: eflowObject.h:220
P4EEtaPhiM::setPhi
virtual void setPhi(double thePhi)
set phi data member
Definition: P4EEtaPhiM.h:120
eflowObject::cluster_type
NavigableVector< CaloClusterContainer > cluster_type
Definition: eflowObject.h:90
eflowObject::m_d0
double m_d0
Definition: eflowObject.h:231
eflowObject::set_charge
void set_charge(int ccharge)
Definition: eflowObject.h:155
eflowObject::setCaloRecoStatus
void setCaloRecoStatus(CaloRecoStatus status)
Definition: eflowObject.h:184
P4EEtaPhiM.h
CaloRecoStatus.h
NavigableVector::end
const_iterator end() const
Definition: NavigableVector.h:68
eflowObject::numClus
int numClus() const
Definition: eflowObject.h:122
eflowObject::ChargedPion
@ ChargedPion
Definition: eflowObject.h:76
eflowObject::m_valid
bool m_valid
Definition: eflowObject.h:236
eflowObject::set_m
void set_m(double cm)
Definition: eflowObject.h:149
eflowObject::m_centerMag
double m_centerMag
Definition: eflowObject.h:242
eflowObject::m_isSubtracted
bool m_isSubtracted
Definition: eflowObject.h:196
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:267
eflowObject::m_eflowTrack
eflowTrack_type m_eflowTrack
Definition: eflowObject.h:226
eflowObject::phicorr
double phicorr(double a)
Definition: eflowObject.h:244
eflowObject::setPi0MVA
void setPi0MVA(double Pi0MVA)
Definition: eflowObject.h:162
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
eflowObject::m_muonElementLink
ElementLink< Analysis::MuonContainer > m_muonElementLink
Definition: eflowObject.h:238
Navigable.h
NavigableVector.h
eflowObject::getIsSubtracted
bool getIsSubtracted() const
Definition: eflowObject.h:179
a
TList * a
Definition: liststreamerinfos.cxx:10
eflowObject::muonLink
const ElementLink< Analysis::MuonContainer > & muonLink() const
Definition: eflowObject.cxx:365
eflowObject::getCenterMag
double getCenterMag() const
Definition: eflowObject.h:188
P4EEtaPhiM::setM
virtual void setM(double theM)
set mass data member
Definition: P4EEtaPhiM.h:123
eflowObject::charge
int charge() const
Definition: eflowObject.h:154
eflowObject::getPassEOverPCheck
bool getPassEOverPCheck() const
Definition: eflowObject.h:176
Trk::VxCandidate
Definition: VxCandidate.h:27
INavigable4Momentum
Definition: INavigable4Momentum.h:21
eflowObject::track_begin
eflowTrack_iterator track_begin() const
Definition: eflowObject.h:98
Electron
Class describing an electron.
eflowObject::m_eflowType
int m_eflowType
Definition: eflowObject.h:233
eflowObject::trackLink
const ElementLink< Rec::TrackParticleContainer > trackLink(size_t i) const
Definition: eflowObject.h:102
eflowObject::m_nClus
int m_nClus
Definition: eflowObject.h:234
P4EEtaPhiM::setE
virtual void setE(double theE)
set energy data member
Definition: P4EEtaPhiM.h:114
Muon.h
eflowObject::isValid
bool isValid() const
Definition: eflowObject.h:157
NavigableVector::linkAt
const data_type & linkAt(size_t i) const
Definition: NavigableVector.h:92
eflowObject::numTrack
int numTrack() const
Definition: eflowObject.h:121
eflowObject::m_z0
double m_z0
Definition: eflowObject.h:231
merge.status
status
Definition: merge.py:17
eflowObject::navigateTrackParticles
bool navigateTrackParticles(INavigationToken &aToken, double weight) const
Definition: eflowObject.cxx:256
eflowObject::m_charge
int m_charge
Definition: eflowObject.h:233
eflowObject::m_convElementLink
ElementLink< VxContainer > m_convElementLink
Definition: eflowObject.h:239
eflowObject::setParticleType
void setParticleType(ParticleType particleType)
Definition: eflowObject.h:190
eflowObject::cluster_iterator
cluster_type::const_iterator cluster_iterator
Definition: eflowObject.h:91
eflowObject::navigateClusters
void navigateClusters(const cluster_type &theClusters, INavigationToken &aToken, double weight) const
Definition: eflowObject.cxx:197
ParticleType
ParticleType
Definition: TruthClasses.h:8
eflowObject::firstClusContainer
std::vector< CaloClusterContainer * >::iterator firstClusContainer()
Definition: eflowObject.h:172
eflowObject::checkParticleType
bool checkParticleType(ParticleType particleType) const
Definition: eflowObject.cxx:101
eflowObject::clus
const CaloCluster * clus(size_t i) const
Definition: eflowObject.h:112
CaloRecoStatus
reconstruction status indicator
Definition: CaloRecoStatus.h:12
eflowObject::set_valid
void set_valid(bool flag=true)
Definition: eflowObject.h:159
eflowObject::m_eflowClus
eflowClus_type m_eflowClus
Definition: eflowObject.h:223
eflowObject::fillToken
virtual void fillToken(INavigationToken &thisToken) const
Definition: eflowObject.h:165
eflowObject::addMuon
void addMuon(const ElementLink< Analysis::MuonContainer > &muonElementLink)
Definition: eflowObject.h:126
TrackParticleContainer.h
eflowObject::getIsDuplicated
bool getIsDuplicated() const
Definition: eflowObject.h:182