ATLAS Offline Software
Loading...
Searching...
No Matches
PanTauSeed.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef PANTAUALGS_PANTAUSEED_H
6#define PANTAUALGS_PANTAUSEED_H
7
8
9#include <vector>
10#include <string>
11
12#include "xAODBase/IParticle.h"
13
16
17
18#include "xAODTau/TauJet.h"
19
20namespace PanTau {
21
22
23
24 class PanTauSeed : public xAOD::IParticle {
25 // IParticle implementation as in
26 // http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODEgamma/xAODEgamma/versions/Egamma_v1.h
27 // http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODEgamma/Root/Egamma_v1.cxx
28
29 public:
30
31 //enumeration to describe technical status of the seed
32 // i.e. numTrack ok? pT ok? etc...
34 t_NoValidInputTau, //use this when there's no substructure info available
35 t_NoConstituentsAtAll, //use when no constituent was found
36 t_NoSelectedConstituents, //use when no constituent passes the cuts (all below pT, none in cone...)
37 t_BadPtValue, //for cases when pT is not in the range of any BDT PT bin
40 };
41
42 // enumeration to describe extended PanTau decay mode (number of tracks, pi0 tagged neutrals and other neutrals)
55 t_ExtMode11shots = 12 // for taus which have been classified as 1p1n but have >2 shots
56 };
57
58 static int getDecayMode(int nCharged, int nNeutral);
59 static std::string getDecayModeName(int decayMode);
60
61 PanTauSeed();
63 PanTauSeed(const PanTauSeed& seed);
64 PanTauSeed& operator=(const PanTauSeed& seed);
65
66
70
72 virtual double pt() const;
73
75 virtual double eta() const;
76
78 virtual double phi() const;
79
81 virtual double m() const;
82
84 virtual double e() const;
85
87 virtual double rapidity() const;
88
90 typedef IParticle::FourMom_t FourMom_t;
91
93 virtual FourMom_t p4() const;
94
96 virtual xAOD::Type::ObjectType type() const;
97
98
100 void setP4(float pt, float eta, float phi, float m);
101
103 void setPt(float pt);
104
106 void setEta(float eta);
107
109 void setPhi(float phi);
110
112 void setM(float m);
113
114
115
117 PanTauSeed( xAOD::TauJet* tauJet,
118 const std::vector<PanTau::TauConstituent*>& tauConstituents,
119 const std::vector<PanTau::TauConstituent*>& tauConstituentsWithUnselected,
120 const std::vector<int>& pantauSeed_TechnicalQuality
121 );
122
123
125 PanTauSeed( xAOD::TauJet* tauJet,
126 const std::vector<int>& pantauSeed_TechnicalQuality
127 );
128
129 const xAOD::TauJet* getTauJet() const;
131 const PanTau::TauFeature* getFeatures() const;
133 TLorentzVector getProtoMomentumCore() const;
134
135 bool getIsValidSeed() const;
136 const std::vector<int>& getTechnicalQuality() const;
137 bool isOfTechnicalQuality(int pantauSeed_TechnicalQuality) const;
138 const std::vector< std::vector<PanTau::TauConstituent*> >& getConstituents() const;
139 const std::vector<PanTau::TauConstituent*>& getConstituentsAsList_Core() const;
140 const std::vector<PanTau::TauConstituent*>& getConstituentsAsList_All() const;
141
142 std::vector<PanTau::TauConstituent*> getConstituentsOfType(int tauConstituent_Type, bool& foundit);
143 int getNumberOfConstituentsOfType(int tauConstituent_Type);
144 TLorentzVector getSubsystemHLV(int tauConstituent_Type, bool& foundit);
145
146 TLorentzVector getFinalMomentum() const;
147 int getDecayModeBySubAlg() const;
148 int getDecayModeByPanTau() const;
149
150 void setFinalMomentum(TLorentzVector finalMom);
151 void setDecayModeByPanTau(int decayModePanTau);
152
155
156
157
158 private:
159
162
163 protected:
164
165 //flag that tells whether the seed is valid
167
168 std::vector<int> m_TechnicalQuality;
169
170 //pointer to the TauJet this PanTauSeed was build from (pointer not owned by PanTauSeed)
172
173 //for each type of tauConstituent, a list of constituents (of that type)
174 // the TauConstituent objects are owned by PanTauSeed (this class), so they need to be deleted in the destructor
175 std::vector< std::vector<PanTau::TauConstituent*> > m_Constituents;
176
177 //the momentum as calculated by using only core constituents
178 TLorentzVector m_ProtoMomentum_Core;
179
180 //the momentum as calculated by using info about decay mode
181 TLorentzVector m_FinalMomentum;
182
183 //a list of hlvs for the different subsystems (charged, neutral, pi0Neut...)
184 std::vector< TLorentzVector > m_TypeHLVs;
185
186 //also store constituents as flat list for easier access later on
187 std::vector<PanTau::TauConstituent*> m_ConstituentsList_Core; //only objects in core region
188 std::vector<PanTau::TauConstituent*> m_ConstituentsList_AllSelected; //all selected objects for this seed
189
190 //for memory reasons:
191 // pass list of selected AND unselected pfos to seed, which will take ownership
192 std::vector<PanTau::TauConstituent*> m_ConstituentsList_All; //all objects for this seed, selected and unselected
193
194 //the decay mode
197
201
202 //the features of this pantauseed
204
205
206 };
207
208
209 static void SetP4EEtaPhiM(TLorentzVector& hlv, double e, double eta, double phi, double m );
210
211
212} //end name space pantau
213
214
220inline const std::vector< std::vector<PanTau::TauConstituent*> >& PanTau::PanTauSeed::getConstituents() const {return m_Constituents;}
221inline const std::vector<PanTau::TauConstituent*>& PanTau::PanTauSeed::getConstituentsAsList_Core() const {return m_ConstituentsList_Core;}
222inline const std::vector<PanTau::TauConstituent*>& PanTau::PanTauSeed::getConstituentsAsList_All() const {return m_ConstituentsList_All;}
223inline TLorentzVector PanTau::PanTauSeed::getFinalMomentum() const {return m_FinalMomentum;}
227inline const std::vector<int>& PanTau::PanTauSeed::getTechnicalQuality() const {return m_TechnicalQuality;}
228
229inline void PanTau::PanTauSeed::setFinalMomentum(TLorentzVector finalMom) {m_FinalMomentum = finalMom;}
230inline void PanTau::PanTauSeed::setDecayModeByPanTau(int decayModePanTau) {m_DecayMode_ByPanTau = decayModePanTau;}
231
232
233inline static void PanTau::SetP4EEtaPhiM(TLorentzVector& hlv, double e, double eta, double phi, double m ){
234 // FIXME: what is wrong with eta=0?
235 if( eta == 0. ) return;
236 double pt = std::sqrt( e*e - m*m) / std::cosh( eta ); // not really safe.
237 hlv.SetPtEtaPhiE(pt, eta, phi, e);
238 return;
239}
240
241
242#endif // PANTAUALGS_PANTAUSEED_H
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
int getDecayModeByPanTau() const
Definition PanTauSeed.h:225
virtual double eta() const
The pseudorapidity ( ) of the particle.
bool m_decayModeHack_CellBasedShots
Definition PanTauSeed.h:198
std::vector< PanTau::TauConstituent * > m_ConstituentsList_AllSelected
Definition PanTauSeed.h:188
void setDecayModeByPanTau(int decayModePanTau)
Definition PanTauSeed.h:230
virtual FourMom_t p4() const
The full 4-momentum of the particle as a TLoretzVector.
static std::string getDecayModeName(int decayMode)
void setEta(float eta)
set the eta
const std::vector< int > & getTechnicalQuality() const
Definition PanTauSeed.h:227
std::vector< PanTau::TauConstituent * > getConstituentsOfType(int tauConstituent_Type, bool &foundit)
void setPhi(float phi)
set the phi
void setPt(float pt)
set the Pt
virtual xAOD::Type::ObjectType type() const
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
std::vector< PanTau::TauConstituent * > m_ConstituentsList_Core
Definition PanTauSeed.h:187
std::vector< PanTau::TauConstituent * > m_ConstituentsList_All
Definition PanTauSeed.h:192
const std::vector< std::vector< PanTau::TauConstituent * > > & getConstituents() const
Definition PanTauSeed.h:220
TLorentzVector getProtoMomentumCore() const
Definition PanTauSeed.h:219
TLorentzVector m_ProtoMomentum_Core
Definition PanTauSeed.h:178
PanTau::TauFeature * m_Features
flag to indicate whether the decay mode by cellbased was
Definition PanTauSeed.h:203
virtual double m() const
The invariant mass of the particle.
PanTauSeed & operator=(const PanTauSeed &seed)
FourMom_t m_p4
4-momentum object
Definition PanTauSeed.h:161
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition PanTauSeed.h:90
const std::vector< PanTau::TauConstituent * > & getConstituentsAsList_Core() const
Definition PanTauSeed.h:221
int getNumberOfConstituentsOfType(int tauConstituent_Type)
virtual double pt() const
The transverse momentum ( ) of the particle.
std::vector< TLorentzVector > m_TypeHLVs
Definition PanTauSeed.h:184
void setFinalMomentum(TLorentzVector finalMom)
Definition PanTauSeed.h:229
void setP4(float pt, float eta, float phi, float m)
set the 4-vec
std::vector< std::vector< PanTau::TauConstituent * > > m_Constituents
Definition PanTauSeed.h:175
bool isOfTechnicalQuality(int pantauSeed_TechnicalQuality) const
TLorentzVector m_FinalMomentum
Definition PanTauSeed.h:181
const xAOD::TauJet * getTauJet() const
Definition PanTauSeed.h:215
int getDecayModeBySubAlg() const
Definition PanTauSeed.h:224
const std::vector< PanTau::TauConstituent * > & getConstituentsAsList_All() const
Definition PanTauSeed.h:222
bool getModeHackedByCellBased()
Definition PanTauSeed.h:154
virtual double e() const
The total energy of the particle.
static int getDecayMode(int nCharged, int nNeutral)
virtual double rapidity() const
The true rapidity (y) of the particle.
TLorentzVector getFinalMomentum() const
Definition PanTauSeed.h:223
virtual double phi() const
The azimuthal angle ( ) of the particle.
TLorentzVector getSubsystemHLV(int tauConstituent_Type, bool &foundit)
bool getIsValidSeed() const
Definition PanTauSeed.h:226
void setM(float m)
set the Mass
xAOD::TauJet * m_TauJet
Definition PanTauSeed.h:171
void setModeHackedByCellBased(bool f)
Definition PanTauSeed.h:153
std::vector< int > m_TechnicalQuality
Definition PanTauSeed.h:168
const PanTau::TauFeature * getFeatures() const
Definition PanTauSeed.h:217
Class containing features of a tau seed.
Definition TauFeature.h:19
Class providing the definition of the 4-vector interface.
static void SetP4EEtaPhiM(TLorentzVector &hlv, double e, double eta, double phi, double m)
Definition PanTauSeed.h:233
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
TauJet_v3 TauJet
Definition of the current "tau version".