ATLAS Offline Software
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 
24 #include "TrigParticle/TrigTau.h"
25 
26 // default constructor
28  m_roiID(-1), m_Zvtx(0),
29  m_err_Zvtx(0),
30  m_etCalibCluster(0), m_simpleEtFlow(0), m_nMatchedTracks(0),
31  m_cluster(NULL), m_tracksInfo(NULL), m_tracks(NULL),
32  m_trkAvgDist(0), m_etOverPtLeadTrk(0)
33 {}
34 
35 // constructor
37  float eta, float phi, float zvtx, float pt,
38  float err_zvtx,
39  float etCalibClusterr, float etFlowr, int nMatchedTracks,
40  const TrigTauCluster* cluster, const TrigInDetTrackCollection* tracks,
41  const TrigTauTracksInfo * tracksInfo) :
43  m_roiID(roi), m_Zvtx(zvtx),
44  m_err_Zvtx(err_zvtx),
45  m_etCalibCluster(etCalibClusterr), m_simpleEtFlow(etFlowr), m_nMatchedTracks(nMatchedTracks),
46  m_cluster(cluster), m_tracksInfo(tracksInfo), m_tracks(tracks),
47  m_trkAvgDist(0), m_etOverPtLeadTrk(0)
48 {}
49 
50 
51 // constructor
53  float eta, float phi, float zvtx, float pt, float etCalibClusterr,
54  float etFLow, int nMatchedTracks,
55  const TrigTauCluster* cluster, const TrigInDetTrackCollection* tracks,
56  const TrigTauTracksInfo * tracksInfo) :
58  m_roiID(roi),
59  m_Zvtx(zvtx),
60  m_err_Zvtx(0),
61  m_etCalibCluster(etCalibClusterr), m_simpleEtFlow(etFLow),
62  m_nMatchedTracks(nMatchedTracks), m_cluster(cluster),
63  m_tracksInfo(tracksInfo), m_tracks(tracks),
64  m_trkAvgDist(0), m_etOverPtLeadTrk(0)
65 {}
66 
67 // destructor
69 
70 // accessor methods
71 int TrigTau::roiId() const { return m_roiID; }
72 
73 float TrigTau::Zvtx() const { return m_Zvtx; }
74 
75 float TrigTau::err_Zvtx() const { return m_err_Zvtx; }
76 
77 float TrigTau::etCalibCluster() const { return m_etCalibCluster; }
78 
79 float TrigTau::simpleEtFlow() const { return m_simpleEtFlow; }
80 
82 float TrigTau::trkAvgDist() const { return m_trkAvgDist; }
84 
85 const TrigTauCluster* TrigTau::tauCluster() const { return m_cluster; }
86 
89 
92 void TrigTau::setZvtx(float zvtx){m_Zvtx = zvtx;}
93 void TrigTau::setErr_Zvtx(float err_zvtx){m_err_Zvtx = err_zvtx;}
95 void TrigTau::setSimpleEtFlow(float etFlow){m_simpleEtFlow = etFlow; }
99 trackColl ;}
101 tracksInfo ;}
104 
105 
106 std::string str( const TrigTau& tau ) {
107 
108  std::stringstream stream;
109  stream << "RoI ID: " << tau.roiId()
110  << "; pt: " << tau.pt()
111  << "; eta: " << tau.eta()
112  << "; phi: " << tau.phi()
113  << "; etCalibCluster: " << tau.etCalibCluster()
114  << "; simpleEtFlow: " << tau.simpleEtFlow()
115  << "; nMatchedTracks: " << tau.nMatchedTracks();
116  // << "; Zvtx: " << tau.Zvtx()
117  // << "; err_Zvtx: " << tau.err_Zvtx();
118  stream << "; trkAvgDist: "<< tau.trkAvgDist()
119  << "; etOverPtLeadTrk: "<<tau.etOverPtLeadTrk();
120 
121  return stream.str();
122 }
123 
124 MsgStream& operator<< ( MsgStream& m, const TrigTau& tau ) {
125 
126  return ( m << str( tau ) );
127 
128 }
129 
130 bool operator== ( const TrigTau& left, const TrigTau& right ) {
131 
132  static const double DELTA = 0.001;
133  if( ( left.roiId() != right.roiId() ) ||
134  ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
135  ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
136  ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
137  ( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) ||
138  ( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) ||
139  ( left.nMatchedTracks() != right.nMatchedTracks() ) ||
140  ( std::abs( left.trkAvgDist() - right.trkAvgDist() ) > DELTA ) ||
141  ( std::abs( left.etOverPtLeadTrk() - right.etOverPtLeadTrk() ) > DELTA )
142  ) {
143 
144  return false;
145 
146  } else {
147 
148  return true;
149 
150  }
151 
152 }
153 
154 void diff( const TrigTau& left, const TrigTau& right,
155  std::map< std::string, double >& varChange ) {
156 
157  static const double DELTA = 0.001;
158  if( left.roiId() != right.roiId() ) {
159  varChange[ "roiId" ] = static_cast< double >( left.roiId() - right.roiId() );
160  }
161  if( std::abs( left.pt() - right.pt() ) > DELTA ) {
162  varChange[ "pt" ] = left.pt() - right.pt();
163  }
164  if( std::abs( left.eta() - right.eta() ) > DELTA ) {
165  varChange[ "eta" ] = left.eta() - right.eta();
166  }
167  if( std::abs( left.phi() - right.phi() ) > DELTA ) {
168  varChange[ "phi" ] = left.phi() - right.phi();
169  }
170 
171  if( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) {
172  varChange[ "etCalibCluster" ] = left.etCalibCluster() - right.etCalibCluster();
173  }
174  if( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) {
175  varChange[ "simpleEtFlow" ] = left.simpleEtFlow() - right.simpleEtFlow();
176  }
177  if( left.nMatchedTracks() != right.nMatchedTracks() ) {
178  varChange[ "nMatchedTracks" ] = left.nMatchedTracks() - right.nMatchedTracks();
179  }
180  if( left.trkAvgDist() != right.trkAvgDist() ) {
181  varChange[ "trkAvgDist" ] = left.trkAvgDist() - right.trkAvgDist();
182  }
183  if( left.etOverPtLeadTrk() != right.etOverPtLeadTrk() ) {
184  varChange[ "etOverPtLeadTrk" ] = left.etOverPtLeadTrk() - right.etOverPtLeadTrk();
185  }
186 
187  return;
188 }
TrigTau::tracksInfo
const TrigTauTracksInfo * tracksInfo() const
Definition: TrigTau.cxx:88
TrigTau::setTauCluster
void setTauCluster(const TrigTauCluster *tauCluster)
Definition: TrigTau.cxx:97
TrigTau::setSimpleEtFlow
void setSimpleEtFlow(float etFlow)
Definition: TrigTau.cxx:95
operator<<
MsgStream & operator<<(MsgStream &m, const TrigTau &tau)
Helper operator for printing the object.
Definition: TrigTau.cxx:124
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigTau::m_etOverPtLeadTrk
float m_etOverPtLeadTrk
ration of cluster energy to leading pt track
Definition: TrigTau.h:113
TrigTau::trackCollection
const TrigInDetTrackCollection * trackCollection() const
Definition: TrigTau.cxx:87
TrigInDetTrackCollection
Definition: TrigInDetTrackCollection.h:13
TrigTau::~TrigTau
~TrigTau()
Definition: TrigTau.cxx:68
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrigTau::trkAvgDist
float trkAvgDist() const
Definition: TrigTau.cxx:82
TrigTau::setRoiId
void setRoiId(int roiId)
set methods
Definition: TrigTau.cxx:91
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
test_pyathena.pt
pt
Definition: test_pyathena.py:11
NavigableTerminalNode
Dummy type needed fro specialized implementation.
Definition: NavigableTerminalNode.h:19
TrigTauCluster
Class with calibrated variables for tau clustering.
Definition: TrigTauCluster.h:33
TrigTau::setEtCalibCluster
void setEtCalibCluster(float etCalibCluster)
Definition: TrigTau.cxx:94
TrigTau::TrigTau
TrigTau()
File: TrigTau.cxx.
Definition: TrigTau.cxx:27
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
TrigTau::tauCluster
const TrigTauCluster * tauCluster() const
Definition: TrigTau.cxx:85
TrigTau::err_Zvtx
float err_Zvtx() const
Definition: TrigTau.cxx:75
TrigTau::m_err_Zvtx
float m_err_Zvtx
Error on z coordinate.
Definition: TrigTau.h:94
TrigTauTracksInfo
Definition: TrigTauTracksInfo.h:28
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
TrigTau::m_etCalibCluster
float m_etCalibCluster
Transverse energy of the calibrated tau cluster.
Definition: TrigTau.h:97
xAOD::TauJetParameters::trkAvgDist
@ trkAvgDist
Get calibrated EM transverse energy (DEPRECATED since r19)
Definition: TauDefs.h:214
TrigTau::nMatchedTracks
int nMatchedTracks() const
Definition: TrigTau.cxx:81
xAOD::roiId
setTeId setLumiBlock roiId
Definition: L2StandAloneMuon_v1.cxx:331
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
diff
void diff(const TrigTau &left, const TrigTau &right, std::map< std::string, double > &varChange)
Comparison with feedback.
Definition: TrigTau.cxx:154
TrigTau::setTrackCollection
void setTrackCollection(const TrigInDetTrackCollection *trackColl)
Definition: TrigTau.cxx:98
xAOD::TauJetParameters::etOverPtLeadTrk
@ etOverPtLeadTrk
Definition: TauDefs.h:158
TrigTau::setEtOverPtLeadTrk
void setEtOverPtLeadTrk(float etOverPtLeadTrk)
Definition: TrigTau.cxx:103
TrigTau::m_roiID
int m_roiID
Identifier of the RoI.
Definition: TrigTau.h:90
P4PtEtaPhiM::pt
virtual double pt() const
get pt data member
Definition: P4PtEtaPhiM.h:103
TrigTau::m_simpleEtFlow
float m_simpleEtFlow
EtFlow as calculated from 3 fastest tracks and cluster with energy of first 3 EM samplings.
Definition: TrigTau.h:99
TrigTau::roiId
int roiId() const
accessor methods
Definition: TrigTau.cxx:71
TrigTau::simpleEtFlow
float simpleEtFlow() const
Definition: TrigTau.cxx:79
TrigTau::setErr_Zvtx
void setErr_Zvtx(float err_zvtx)
Definition: TrigTau.cxx:93
TrigTau::m_nMatchedTracks
int m_nMatchedTracks
Number of tracks matched to the calorimeter cluster.
Definition: TrigTau.h:101
TrigTau::m_tracks
const TrigInDetTrackCollection * m_tracks
Collection of inner detector tracks.
Definition: TrigTau.h:107
TrigTau::setTrkAvgDist
void setTrkAvgDist(float trkAvgDist)
Definition: TrigTau.cxx:102
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
operator==
bool operator==(const TrigTau &left, const TrigTau &right)
Operator comparing two TrigTau objects for equality.
Definition: TrigTau.cxx:130
TrigTau::setNMatchedTracks
void setNMatchedTracks(int nmatchedTracks)
Definition: TrigTau.cxx:96
TrigTau::Zvtx
float Zvtx() const
Definition: TrigTau.cxx:73
TrigTau.h
TrigTau::setZvtx
void setZvtx(float zvtx)
Definition: TrigTau.cxx:92
TrigTau::m_tracksInfo
const TrigTauTracksInfo * m_tracksInfo
Collection of inner detector tracks.
Definition: TrigTau.h:105
TrigTau::m_trkAvgDist
float m_trkAvgDist
average distance of tracks to tau direction
Definition: TrigTau.h:111
TrigTau::m_Zvtx
float m_Zvtx
Z coordinate of the tau vertex.
Definition: TrigTau.h:92
TrigTau::etOverPtLeadTrk
float etOverPtLeadTrk() const
Definition: TrigTau.cxx:83
TrigTau
File: TrigTau.h.
Definition: TrigTau.h:37
TrigTau::setTracksInfo
void setTracksInfo(const TrigTauTracksInfo *trackInfo)
Definition: TrigTau.cxx:100
P4PtEtaPhiM
Definition: P4PtEtaPhiM.h:25
TrigTau::etCalibCluster
float etCalibCluster() const
Definition: TrigTau.cxx:77
TrigTau::m_cluster
const TrigTauCluster * m_cluster
Calorimeter tau cluster.
Definition: TrigTau.h:103
str
std::string str(const TrigTau &tau)
Helper function for printing the object.
Definition: TrigTau.cxx:106