ATLAS Offline Software
Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
44 #ifndef TRIG_ELECTRON
45 #define TRIG_ELECTRON
46 
47 #include <vector>
48 #include <iostream>
49 #include <string>
50 #include <cmath>
51 
52 #include "FourMom/P4PtEtaPhiM.h"
53 #include "Navigation/Navigable.h"
55 
56 #include "AthLinks/ElementLink.h"
57 
60 
61 class TrigElectron : public P4PtEtaPhiM,
62  public NavigableTerminalNode ,
63  virtual public INavigable4Momentum {
64 
65  public:
66 
68  TrigElectron();
69 
71  TrigElectron(unsigned int roi,
72  float trkEtaAtCalo, float trkPhiAtCalo, float EToverPT,
73  const TrigEMClusterContainer* cluster, unsigned int cl_index,
74  const TrigInDetTrackCollection* track, unsigned int tr_index);
75 
77  TrigElectron(float pt,
78  float eta,
79  float phi,
80 
81  // roi word
82  unsigned int roi,
83  bool valid,
84 
85  // track-cluster match variables
86  float trkEtaAtCalo,
87  float trkPhiAtCalo,
88  float EToverPT,
89 
90  // Cluster
92  float caloEta,
93  float caloPhi,
94  float Rcore,
95  float Eratio,
96  float EThad,
97  float F0,
98  float F1,
99  float F2,
100  float F3,
101 
102  // Track
105  float Zvtx,
106  int nTRTHits,
107  int nTRTHiThresholdHits) ;
108 
109  ~TrigElectron() = default;
110 
114  int roiId() const { return m_roiWord; }
115  int roiWord() const { return m_roiWord; }
116 
118  bool isValid() const { return m_valid; }
119 
122  float Zvtx() const { return m_tr_Zvtx; }
123  int nTRTHits() const { return m_tr_nr_trt_hits; }
125  float nTRTHiTHitsRatio() const { return (m_tr_nr_trt_hits>0 ? (float)m_tr_nr_trt_hithresh_hits/(float)m_tr_nr_trt_hits : -1); }
126 
129  int trackIndx() const { return (m_track.isValid() ? m_track.index() : 0); }
131 
133  float trkPt() const { return (m_track.isValid() ? fabs((*m_track)->param()->pT()) : 0 ); }
134 
136  int charge() const { return (m_track.isValid() ? (int)((*m_track)->param()->pT()/fabs((*m_track)->param()->pT())) : 0); }
137 
139  float err_Pt() const { return err_trkPt(); } // OBSOLETE: to be removed in next iteration
140  float err_trkPt() const { return (m_track.isValid() ? (*m_track)->param()->epT() : -1); }
141  float err_eta() const { return (m_track.isValid() ? (*m_track)->param()->eeta() : -1); }
142  float err_phi() const { return (m_track.isValid() ? (*m_track)->param()->ephi0() : -1); }
143  float err_Zvtx() const { return (m_track.isValid() ? (*m_track)->param()->ez0() : -1); }
144 
146  float trkEtaAtCalo() const { return m_tr_eta_at_calo; }
147  float trkPhiAtCalo() const { return m_tr_phi_at_calo; }
148 
151  float trkClusDeta() const { return (DeltaEta1()); } // old method name - RG 15/6/09
152  float trkClusDphi() const { return (DeltaPhi2()); } // old method name - RG 15/6/09
153  float DeltaEta1() const { return fabs(m_tr_eta_at_calo - m_cl_eta); }
154  float DeltaPhi2() const { return (fabs(m_tr_phi_at_calo-m_cl_phi)<M_PI ?
155  fabs(m_tr_phi_at_calo-m_cl_phi) :
156  2*M_PI - fabs(m_tr_phi_at_calo-m_cl_phi)); }
157 
159  float EtOverPt() const { return m_etoverpt; }
160 
162  float caloEta() const { return m_cl_eta; }
163  float caloPhi() const { return m_cl_phi; }
164 
166  float Rcore() const { return m_cl_Rcore; } // OBSOLETE name; to be removed in next iteration
167  float Reta() const { return m_cl_Rcore; }
168  float Eratio() const { return m_cl_Eratio; }
169  float EThad() const { return m_cl_EThad; } // OBSOLETE name; to be removed in next iteration
170  float Ethad1() const { return m_cl_EThad; }
171 
173  float F0() const { return m_cl_e_frac_S0; } // sampling 0
174  float F1() const { return m_cl_e_frac_S1; } // sampling 1
175  float F2() const { return m_cl_e_frac_S2; } // sampling 2
176  float F3() const { return m_cl_e_frac_S3; } // sampling 3
177 
179  const TrigEMCluster* cluster() const;
181  { return m_cluster; }
182 
184  const TrigInDetTrack* track() const;
186  { return m_track; }
187 
188  private:
189  // private data members
191  unsigned int m_roiWord;
192 
198  bool m_valid;
199 
205 
210  float m_tr_Zvtx;
211 
215 
220 
222  float m_etoverpt;
223 
226  float m_cl_eta;
227  float m_cl_phi;
228 
231  float m_cl_Rcore;
232 
235  float m_cl_Eratio;
236 
238  float m_cl_EThad;
239 
241  // float m_cl_energy; // removed
246 
250 
251 };
252 
253 // comparison operators
254 bool operator==( const TrigElectron& te1, const TrigElectron& te2 );
255 inline bool operator!=( const TrigElectron& te1, const TrigElectron& te2 ) {
256  return !( te1 == te2 );
257 }
258 void diff( const TrigElectron& te1, const TrigElectron& te2, std::map<std::string, double>& v_diff );
259 
260 // print TrigElectron quantities
261 MsgStream& operator<< ( MsgStream& msg, const TrigElectron& te );
262 
263 
264 CLASS_DEF( TrigElectron , 144277868 , 1 )
265 
266 #endif // TRIG_ELECTRON
TrigElectron::EtOverPt
float EtOverPt() const
accessor to ratio of cluster Et to track Pt
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:159
TrigElectron::trackAlgo
TrigInDetTrack::AlgoId trackAlgo() const
accessors to return the tracking quantities
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:121
TrigElectron::m_tr_nr_trt_hits
int m_tr_nr_trt_hits
number of TRT hits and high-threshold hits
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:213
TrigElectron::trkPt
float trkPt() const
accessor to get pT of electron candidate track
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:133
TrigElectron::~TrigElectron
~TrigElectron()=default
TrigElectron::m_cl_eta
float m_cl_eta
Calorimeter quantities: Cluster eta and phi
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:226
TrigElectron::F3
float F3() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:176
TrigElectron::trkPhiAtCalo
float trkPhiAtCalo() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:147
TrigElectron::m_valid
bool m_valid
To certify "good" TrigElectrons: used to be necessary for studies; now basically always true for elec...
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:198
operator==
bool operator==(const TrigElectron &te1, const TrigElectron &te2)
Two TrigElectron are the same if they have the same cluster and the same track (and if valid,...
Definition: TrigElectron.cxx:316
TrigElectron::Eratio
float Eratio() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:168
INavigable4Momentum.h
diff
void diff(const TrigElectron &te1, const TrigElectron &te2, std::map< std::string, double > &v_diff)
Function compares two objects and returns "semi verbose" output in the form of map v_diff where varai...
Definition: TrigElectron.cxx:327
TrigInDetTrackCollection
Definition: TrigInDetTrackCollection.h:13
TrigEMClusterContainer.h
TrigElectron::trackColl
const TrigInDetTrackCollection * trackColl() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:130
TrigElectron::roiId
int roiId() const
accessor methods:
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:114
TrigElectron::roiWord
int roiWord() const
OBSOLETE: should disappear in next iteration.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:115
NavigableTerminalNode
Dummy type needed fro specialized implementation.
Definition: NavigableTerminalNode.h:19
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigElectron::m_cl_e_frac_S0
float m_cl_e_frac_S0
Calibrated overall and per-sampling energy - to be used for cuts.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:242
TrigElectron::m_cl_e_frac_S2
float m_cl_e_frac_S2
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:244
TrigElectron::trkClusDeta
float trkClusDeta() const
accessors to get eta and phi difference between cluster and track extrapolated the calorimeter face (...
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:151
TrigElectron::m_tr_Zvtx
float m_tr_Zvtx
Z of the track at closest approach (perigee) to the Z axis (maybe later to the beam?...
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:210
TrigInDetTrackCollection.h
TrigElectron::err_Pt
float err_Pt() const
accessors to get uncertainty in track parameters: Pt, eta, phi and Z of track perigee (Zvtx)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:139
TrigElectron
File: TrigElectron.h.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:63
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
TrigElectron::F1
float F1() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:174
TrigElectron::Ethad1
float Ethad1() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:170
TrigEMClusterContainer
Container from TrigEMCluster type objects.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMClusterContainer.h:32
TrigInDetTrack::AlgoId
AlgoId
Definition: TrigInDetTrack.h:37
TrigElectron::TrigElectron
TrigElectron()
constructors; note: default constructor needed by POOL
Definition: TrigElectron.cxx:45
TrigElectron::m_roiWord
unsigned int m_roiWord
roi word unique to L1 RoI (note: different from HLT RoI id)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:191
TrigElectron::m_cl_Rcore
float m_cl_Rcore
Energy ratio in 3x7 and 7x7 cells in 2nd LAr sampling; Rcore = e237/e277.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:231
TrigElectron::m_cl_Eratio
float m_cl_Eratio
Energy ratio in highest and 2nd highest strip pairs in 1st LAr sampling; Eratio = EmaxS1-E2ndS1 / Ema...
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:235
TrigInDetTrack
Definition: TrigInDetTrack.h:34
TrigElectron::m_tr_Algo
TrigInDetTrack::AlgoId m_tr_Algo
Tracking quantities: ID of the tracking algorithm that produced the track in this electron.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:204
TrigElectron::caloEta
float caloEta() const
accessors to get cluster eta and phi (note baseclass eta and phi come from track)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:162
TrigElectron::err_trkPt
float err_trkPt() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:140
TrigElectron::m_tr_nr_trt_hithresh_hits
int m_tr_nr_trt_hithresh_hits
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:214
TrigElectron::trkEtaAtCalo
float trkEtaAtCalo() const
accessor to get eta and phi of electron candidate track extrapolated the calorimeter
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:146
calibdata.valid
list valid
Definition: calibdata.py:45
TrigElectron::Reta
float Reta() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:167
TrigElectron::cluster
const TrigEMCluster * cluster() const
accessor to get pointer to cluster (TrigEMCluster)
Definition: TrigElectron.cxx:292
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
TrigElectron::track
const TrigInDetTrack * track() const
accessor to get pointer to track (TrigInDetTrack)
Definition: TrigElectron.cxx:303
TrigElectron::m_tr_phi_at_calo
float m_tr_phi_at_calo
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:219
TrigElectron::EThad
float EThad() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:169
TrigElectron::err_Zvtx
float err_Zvtx() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:143
TrigElectron::nTRTHits
int nTRTHits() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:123
TrigElectron::caloPhi
float caloPhi() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:163
TrigElectron::F0
float F0() const
accessors for calibrated energy fractions in each sampling - to reject noise
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:173
P4PtEtaPhiM::pt
virtual double pt() const
get pt data member
Definition: P4PtEtaPhiM.h:103
TrigElectron::Zvtx
float Zvtx() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:122
operator<<
MsgStream & operator<<(MsgStream &msg, const TrigElectron &te)
Definition: TrigElectron.cxx:352
TrigElectron::Rcore
float Rcore() const
accessors for shower shape quantities
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:166
TrigElectron::m_cl_phi
float m_cl_phi
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:227
TrigElectron::nTRTHiThresholdHits
int nTRTHiThresholdHits() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:124
TrigElectron::m_cl_EThad
float m_cl_EThad
ET in first hadronic sampling: EThad=Ehad1/cosh(fabs(eta)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:238
TrigElectron::err_eta
float err_eta() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:141
TrigElectron::isValid
bool isValid() const
accessor to get TrigElectron valid flag
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:118
TrigElectron::trackIndx
int trackIndx() const
accessor to return the track index in the collection and a reference to the TrigInDetTrackCollection ...
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:129
TrigElectron::m_etoverpt
float m_etoverpt
Ratio of cluster transverse energy to track transv.momentum.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:222
TrigElectron::F2
float F2() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:175
TrigElectron::DeltaPhi2
float DeltaPhi2() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:154
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
TrigElectron::trkClusDphi
float trkClusDphi() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:152
Navigable.h
TrigElectron::m_cl_e_frac_S3
float m_cl_e_frac_S3
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:245
TrigElectron::DeltaEta1
float DeltaEta1() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:153
P4PtEtaPhiM.h
INavigable4Momentum
Definition: INavigable4Momentum.h:21
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
TrigElectron::err_phi
float err_phi() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:142
TrigElectron::trackLink
const ElementLink< TrigInDetTrackCollection > & trackLink() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:185
TrigElectron::m_tr_eta_at_calo
float m_tr_eta_at_calo
Track/Cluster matching quantities: eta and phi of track extrapolated to the calorimeter face.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:218
TrigElectron::charge
int charge() const
accessor to return the track charge (sign of TrigInDetTrack pT)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:136
TrigElectron::m_cluster
ElementLink< TrigEMClusterContainer > m_cluster
ElementLinks to the track and calorimeter cluster in electron candidate.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:248
P4PtEtaPhiM
Definition: P4PtEtaPhiM.h:25
TrigElectron::nTRTHiTHitsRatio
float nTRTHiTHitsRatio() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:125
TrigElectron::m_track
ElementLink< TrigInDetTrackCollection > m_track
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:249
operator!=
bool operator!=(const TrigElectron &te1, const TrigElectron &te2)
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:255
TrigElectron::clusterLink
const ElementLink< TrigEMClusterContainer > & clusterLink() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:180
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigElectron::m_cl_e_frac_S1
float m_cl_e_frac_S1
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:243