ATLAS Offline Software
Loading...
Searching...
No Matches
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
43
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"
55
56#include "AthLinks/ElementLink.h"
57
60
63 virtual public INavigable4Momentum {
64
65 public:
66
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,
108
109 ~TrigElectron() = default;
110
112
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); }
130 const TrigInDetTrackCollection* trackColl() const { return (m_track.isValid() ? m_track.getStorableObjectPointer() : NULL); }
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 ?
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;
182
184 const TrigInDetTrack* track() const;
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
223
226 float m_cl_eta;
227 float m_cl_phi;
228
232
236
239
241 // float m_cl_energy; // removed
246
250
251};
252
253// comparison operators
254bool operator==( const TrigElectron& te1, const TrigElectron& te2 );
255inline bool operator!=( const TrigElectron& te1, const TrigElectron& te2 ) {
256 return !( te1 == te2 );
257}
258void diff( const TrigElectron& te1, const TrigElectron& te2, std::map<std::string, double>& v_diff );
259
260// print TrigElectron quantities
261MsgStream& operator<< ( MsgStream& msg, const TrigElectron& te );
262
263
264CLASS_DEF( TrigElectron , 144277868 , 1 )
265
266#endif // TRIG_ELECTRON
#define M_PI
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
MsgStream & operator<<(MsgStream &msg, const TrigElectron &te)
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,...
bool operator!=(const TrigElectron &te1, const TrigElectron &te2)
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...
P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
constructor with all data members
Definition P4PtEtaPhiM.h:29
virtual double pt() const
get pt data member
virtual double eta() const
get eta data member
virtual double phi() const
get phi data member
Class with calibrated variables for egamma clustering.
const ElementLink< TrigInDetTrackCollection > & trackLink() const
const ElementLink< TrigEMClusterContainer > & clusterLink() const
float m_tr_eta_at_calo
Track/Cluster matching quantities: eta and phi of track extrapolated to the calorimeter face.
bool isValid() const
accessor to get TrigElectron valid flag
TrigInDetTrack::AlgoId trackAlgo() const
accessors to return the tracking quantities
float m_cl_Eratio
Energy ratio in highest and 2nd highest strip pairs in 1st LAr sampling; Eratio = EmaxS1-E2ndS1 / Ema...
float m_cl_EThad
ET in first hadronic sampling: EThad=Ehad1/cosh(fabs(eta)
const TrigInDetTrack * track() const
accessor to get pointer to track (TrigInDetTrack)
float F0() const
accessors for calibrated energy fractions in each sampling - to reject noise
const TrigInDetTrackCollection * trackColl() const
int roiWord() const
OBSOLETE: should disappear in next iteration.
int m_tr_nr_trt_hits
number of TRT hits and high-threshold hits
float m_tr_Zvtx
Z of the track at closest approach (perigee) to the Z axis (maybe later to the beam?...
float caloEta() const
accessors to get cluster eta and phi (note baseclass eta and phi come from track)
float EtOverPt() const
accessor to ratio of cluster Et to track Pt
float Rcore() const
accessors for shower shape quantities
float m_cl_eta
Calorimeter quantities: Cluster eta and phi.
float trkPt() const
accessor to get pT of electron candidate track
float trkClusDeta() const
accessors to get eta and phi difference between cluster and track extrapolated the calorimeter face (...
TrigInDetTrack::AlgoId m_tr_Algo
Tracking quantities: ID of the tracking algorithm that produced the track in this electron.
unsigned int m_roiWord
roi word unique to L1 RoI (note: different from HLT RoI id)
float m_cl_Rcore
Energy ratio in 3x7 and 7x7 cells in 2nd LAr sampling; Rcore = e237/e277.
int trackIndx() const
accessor to return the track index in the collection and a reference to the TrigInDetTrackCollection ...
const TrigEMCluster * cluster() const
accessor to get pointer to cluster (TrigEMCluster)
ElementLink< TrigInDetTrackCollection > m_track
bool m_valid
To certify "good" TrigElectrons: used to be necessary for studies; now basically always true for elec...
int charge() const
accessor to return the track charge (sign of TrigInDetTrack pT)
ElementLink< TrigEMClusterContainer > m_cluster
ElementLinks to the track and calorimeter cluster in electron candidate.
float m_etoverpt
Ratio of cluster transverse energy to track transv.momentum.
float trkEtaAtCalo() const
accessor to get eta and phi of electron candidate track extrapolated the calorimeter
TrigElectron()
constructors; note: default constructor needed by POOL
float m_cl_e_frac_S0
Calibrated overall and per-sampling energy - to be used for cuts.
float err_Pt() const
accessors to get uncertainty in track parameters: Pt, eta, phi and Z of track perigee (Zvtx)
~TrigElectron()=default
represents a LVL2 ID track
MsgStream & msg
Definition testRead.cxx:32