ATLAS Offline Software
Loading...
Searching...
No Matches
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
9NAME: eflowObject.h
10PACKAGE: offline/Reconstruction/eflowRec
11
12AUTHORS: D.R. Tovey
13CREATED: 22nd November, 2001
14
15UPDATED: 14th March 2003 (P Loch) implement navigation system
16
17PURPOSE: 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
34
35#include "muonEvent/Muon.h"
37
39
40#include "FourMom/P4EEtaPhiM.h"
41
44
46
47#include <vector>
48
50// temporary for navigation !!
51#include <any>
52
53class VxCandidate;
54
55// class eflowObject
56//
57// Navigation requires eflowObject to implement INavigable interface!
58
59class eflowObject : public P4EEtaPhiM, virtual public INavigable4Momentum
60{
61
62 public:
63
64// constructor
66
67 //copy constructors
68
69 eflowObject(eflowObject* eflowObj);
70 eflowObject(eflowObject* eflowObj, bool useClus);
71
72// destructor
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
98 eflowTrack_iterator track_begin() const { return m_eflowTrack.begin(); }
99 eflowTrack_iterator track_end() const { return m_eflowTrack.end(); }
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
109 eflowClus_iterator clus_begin() const { return m_eflowClus.begin(); }
110 eflowClus_iterator clus_end() const { return m_eflowClus.end(); }
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
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
172 std::vector<CaloClusterContainer*>::iterator firstClusContainer() { return m_eflowClusContainers.begin(); }
173 std::vector<CaloClusterContainer*>::iterator lastClusContainer() { return m_eflowClusContainers.end(); }
174
175 void setPassEOverPCheck(bool check) { m_passedEOverPCheck = check;}
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
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
244inline 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
#define M_PI
static Double_t a
ParticleType
Definition TruthClasses.h:8
The ATLAS Muon object - see doxygen, physics workbookd and the Muon Combined Performance WG's pages f...
Principal data class for CaloCell clusters.
reconstruction status indicator
NavigableVectorIterator< typename Rec::TrackParticleContainer::base_value_type, store_type > const_iterator
virtual void setM(double theM)
set mass data member
Definition P4EEtaPhiM.h:123
virtual double e() const
get energy data member
Definition P4EEtaPhiM.h:102
virtual void setEta(double theEta)
set eta data member
Definition P4EEtaPhiM.h:117
P4EEtaPhiM(const double e, const double eta, const double phi, const double m)
constructor with all data members
Definition P4EEtaPhiM.cxx:7
virtual void setE(double theE)
set energy data member
Definition P4EEtaPhiM.h:114
virtual void setPhi(double thePhi)
set phi data member
Definition P4EEtaPhiM.h:120
ElementLink< Analysis::MuonContainer > m_muonElementLink
bool m_isSubtracted
cluster_type::const_iterator cluster_iterator
Definition eflowObject.h:91
void set_eta(double ceta)
void setIsDuplicated(bool isDuplicated)
void setCaloRecoStatus(CaloRecoStatus status)
const ElementLink< Rec::TrackParticleContainer > trackLink(size_t i) const
void addMuon(const ElementLink< Analysis::MuonContainer > &muonElementLink)
int numClus() const
CaloRecoStatus m_recoStatus
bool m_isDuplicated
void set_notValid()
int numTrack() const
eflowClus_iterator clus_begin() const
const ElementLink< CaloClusterContainer > clusLink(size_t i) const
double d0() const
void set_phi(double cphi)
void set_charge(int ccharge)
CaloRecoStatus getCaloRecoStatus() const
int eflowType() const
bool navigateConversions(INavigationToken &aToken, double weight) const
std::vector< CaloClusterContainer * > m_eflowClusContainers
eflowTrack_iterator track_end() const
Definition eflowObject.h:99
NavigableVector< Rec::TrackParticleContainer > eflowTrack_type
Definition eflowObject.h:82
eflowTrack_type m_eflowTrack
void navigateClusters(const cluster_type &theClusters, INavigationToken &aToken, double weight) const
bool navigateTrackParticles(INavigationToken &aToken, double weight) const
const Trk::VxCandidate * conversion() const
void setCenterMag(double centerMag)
eflowClus_iterator clus_end() const
void setPi0MVA(double Pi0MVA)
void addTrack(const ElementLink< Rec::TrackParticleContainer > &trackElementLink)
double energy() const
virtual void fillToken(INavigationToken &thisToken) const
void addConversion(const ElementLink< VxContainer > &convElementLink)
void set_type(int ctype)
const ElementLink< Analysis::MuonContainer > & muonLink() const
double m_pi0MVA
bool navigateMuons(INavigationToken &aToken, double weight) const
std::vector< CaloClusterContainer * >::iterator firstClusContainer()
std::vector< CaloClusterContainer * >::iterator lastClusContainer()
void setPassEOverPCheck(bool check)
const ElementLink< VxContainer > & conversionLink() const
bool m_passedEOverPCheck
void setParticleType(ParticleType particleType)
bool getIsDuplicated() const
bool getIsSubtracted() const
double phicorr(double a)
void set_z0(double cz0)
void set_d0(double cd0)
void addClus(const ElementLink< CaloClusterContainer > &clusElementLink)
double z0() const
ParticleType m_eflowObjectType
void set_m(double cm)
ElementLink< VxContainer > m_convElementLink
bool checkParticleType(ParticleType particleType) const
const CaloCluster * clus(size_t i) const
double m_centerMag
double getPi0MVA() const
double getCenterMag() const
const Rec::TrackParticle * track(size_t i) const
void setIsSubtracted(bool isSubtracted)
const Analysis::Muon * muon() const
bool getPassEOverPCheck() const
eflowTrack_type::const_iterator eflowTrack_iterator
Definition eflowObject.h:84
void toToken(const CONT &theClusters, TOKEN *aToken, double weight) const
NavigableVector< CaloClusterContainer > cluster_type
Definition eflowObject.h:90
cluster_iterator eflowClus_iterator
Definition eflowObject.h:94
eflowClus_type m_eflowClus
int charge() const
void set_energy(double cenergy)
bool isValid() const
eflowTrack_iterator track_begin() const
Definition eflowObject.h:98
cluster_type eflowClus_type
Definition eflowObject.h:93
void set_valid(bool flag=true)
void initialize()