ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTau.cxx
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7
23
26
27// default constructor
35
36// constructor
38 float eta, float phi, float zvtx, float pt,
39 float err_zvtx,
40 float etCalibClusterr, float etFlowr, int nMatchedTracks,
41 const TrigTauCluster* cluster, const TrigInDetTrackCollection* tracks,
44 m_roiID(roi), m_Zvtx(zvtx),
45 m_err_Zvtx(err_zvtx),
47 m_cluster(cluster), m_tracksInfo(tracksInfo), m_tracks(tracks),
49{}
50
51
52// constructor
54 float eta, float phi, float zvtx, float pt, float etCalibClusterr,
55 float etFLow, int nMatchedTracks,
56 const TrigTauCluster* cluster, const TrigInDetTrackCollection* tracks,
59 m_roiID(roi),
60 m_Zvtx(zvtx),
61 m_err_Zvtx(0),
62 m_etCalibCluster(etCalibClusterr), m_simpleEtFlow(etFLow),
66{}
67
68// destructor
70
71// accessor methods
72int TrigTau::roiId() const { return m_roiID; }
73
74float TrigTau::Zvtx() const { return m_Zvtx; }
75
76float TrigTau::err_Zvtx() const { return m_err_Zvtx; }
77
79
80float TrigTau::simpleEtFlow() const { return m_simpleEtFlow; }
81
83float TrigTau::trkAvgDist() const { return m_trkAvgDist; }
85
87
90
93void TrigTau::setZvtx(float zvtx){m_Zvtx = zvtx;}
94void TrigTau::setErr_Zvtx(float err_zvtx){m_err_Zvtx = err_zvtx;}
96void TrigTau::setSimpleEtFlow(float etFlow){m_simpleEtFlow = etFlow; }
100trackColl ;}
105
106
107std::string str( const TrigTau& tau ) {
108
109 std::stringstream stream;
110 stream << "RoI ID: " << tau.roiId()
111 << "; pt: " << tau.pt()
112 << "; eta: " << tau.eta()
113 << "; phi: " << tau.phi()
114 << "; etCalibCluster: " << tau.etCalibCluster()
115 << "; simpleEtFlow: " << tau.simpleEtFlow()
116 << "; nMatchedTracks: " << tau.nMatchedTracks();
117 // << "; Zvtx: " << tau.Zvtx()
118 // << "; err_Zvtx: " << tau.err_Zvtx();
119 stream << "; trkAvgDist: "<< tau.trkAvgDist()
120 << "; etOverPtLeadTrk: "<<tau.etOverPtLeadTrk();
121
122 return stream.str();
123}
124
125MsgStream& operator<< ( MsgStream& m, const TrigTau& tau ) {
126
127 return ( m << str( tau ) );
128
129}
130
131bool operator== ( const TrigTau& left, const TrigTau& right ) {
132
133 static const double DELTA = 0.001;
134 if( ( left.roiId() != right.roiId() ) ||
135 ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
136 ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
137 ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
138 ( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) ||
139 ( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) ||
140 ( left.nMatchedTracks() != right.nMatchedTracks() ) ||
141 ( std::abs( left.trkAvgDist() - right.trkAvgDist() ) > DELTA ) ||
142 ( std::abs( left.etOverPtLeadTrk() - right.etOverPtLeadTrk() ) > DELTA )
143 ) {
144
145 return false;
146
147 } else {
148
149 return true;
150
151 }
152
153}
154
155void diff( const TrigTau& left, const TrigTau& right,
156 std::map< std::string, double >& varChange ) {
157
158 static const double DELTA = 0.001;
159 if( left.roiId() != right.roiId() ) {
160 varChange[ "roiId" ] = static_cast< double >( left.roiId() - right.roiId() );
161 }
162 if( std::abs( left.pt() - right.pt() ) > DELTA ) {
163 varChange[ "pt" ] = left.pt() - right.pt();
164 }
165 if( std::abs( left.eta() - right.eta() ) > DELTA ) {
166 varChange[ "eta" ] = left.eta() - right.eta();
167 }
168 if( std::abs( left.phi() - right.phi() ) > DELTA ) {
169 varChange[ "phi" ] = left.phi() - right.phi();
170 }
171
172 if( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) {
173 varChange[ "etCalibCluster" ] = left.etCalibCluster() - right.etCalibCluster();
174 }
175 if( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) {
176 varChange[ "simpleEtFlow" ] = left.simpleEtFlow() - right.simpleEtFlow();
177 }
178 if( left.nMatchedTracks() != right.nMatchedTracks() ) {
179 varChange[ "nMatchedTracks" ] = left.nMatchedTracks() - right.nMatchedTracks();
180 }
181 if( left.trkAvgDist() != right.trkAvgDist() ) {
182 varChange[ "trkAvgDist" ] = left.trkAvgDist() - right.trkAvgDist();
183 }
184 if( left.etOverPtLeadTrk() != right.etOverPtLeadTrk() ) {
185 varChange[ "etOverPtLeadTrk" ] = left.etOverPtLeadTrk() - right.etOverPtLeadTrk();
186 }
187
188 return;
189}
static const double DELTA
A number of constexpr particle constants to avoid hardcoding them directly in various places.
bool operator==(const TrigTau &left, const TrigTau &right)
Operator comparing two TrigTau objects for equality.
Definition TrigTau.cxx:131
void diff(const TrigTau &left, const TrigTau &right, std::map< std::string, double > &varChange)
Comparison with feedback.
Definition TrigTau.cxx:155
MsgStream & operator<<(MsgStream &m, const TrigTau &tau)
Helper operator for printing the object.
Definition TrigTau.cxx:125
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 tau clustering.
Contains basic information about trackc collection associated with Tau RoI.
File: TrigTau.h.
Definition TrigTau.h:37
int roiId() const
accessor methods
Definition TrigTau.cxx:72
float m_etOverPtLeadTrk
ration of cluster energy to leading pt track
Definition TrigTau.h:113
void setTracksInfo(const TrigTauTracksInfo *trackInfo)
Definition TrigTau.cxx:101
float m_err_Zvtx
Error on z coordinate.
Definition TrigTau.h:94
~TrigTau()
Definition TrigTau.cxx:69
const TrigTauCluster * tauCluster() const
Definition TrigTau.cxx:86
const TrigInDetTrackCollection * m_tracks
Collection of inner detector tracks.
Definition TrigTau.h:107
int m_nMatchedTracks
Number of tracks matched to the calorimeter cluster.
Definition TrigTau.h:101
const TrigTauTracksInfo * m_tracksInfo
Collection of inner detector tracks.
Definition TrigTau.h:105
void setErr_Zvtx(float err_zvtx)
Definition TrigTau.cxx:94
void setTauCluster(const TrigTauCluster *tauCluster)
Definition TrigTau.cxx:98
float err_Zvtx() const
Definition TrigTau.cxx:76
float Zvtx() const
Definition TrigTau.cxx:74
void setTrkAvgDist(float trkAvgDist)
Definition TrigTau.cxx:103
const TrigTauTracksInfo * tracksInfo() const
Definition TrigTau.cxx:89
int m_roiID
Identifier of the RoI.
Definition TrigTau.h:90
int nMatchedTracks() const
Definition TrigTau.cxx:82
float m_etCalibCluster
Transverse energy of the calibrated tau cluster.
Definition TrigTau.h:97
float simpleEtFlow() const
Definition TrigTau.cxx:80
float m_simpleEtFlow
EtFlow as calculated from 3 fastest tracks and cluster with energy of first 3 EM samplings.
Definition TrigTau.h:99
void setRoiId(int roiId)
set methods
Definition TrigTau.cxx:92
float etCalibCluster() const
Definition TrigTau.cxx:78
void setNMatchedTracks(int nmatchedTracks)
Definition TrigTau.cxx:97
void setEtCalibCluster(float etCalibCluster)
Definition TrigTau.cxx:95
const TrigInDetTrackCollection * trackCollection() const
Definition TrigTau.cxx:88
void setSimpleEtFlow(float etFlow)
Definition TrigTau.cxx:96
float m_trkAvgDist
average distance of tracks to tau direction
Definition TrigTau.h:111
const TrigTauCluster * m_cluster
Calorimeter tau cluster.
Definition TrigTau.h:103
float etOverPtLeadTrk() const
Definition TrigTau.cxx:84
float m_Zvtx
Z coordinate of the tau vertex.
Definition TrigTau.h:92
void setTrackCollection(const TrigInDetTrackCollection *trackColl)
Definition TrigTau.cxx:99
void setZvtx(float zvtx)
Definition TrigTau.cxx:93
void setEtOverPtLeadTrk(float etOverPtLeadTrk)
Definition TrigTau.cxx:104
TrigTau()
File: TrigTau.cxx.
Definition TrigTau.cxx:28
float trkAvgDist() const
Definition TrigTau.cxx:83