ATLAS Offline Software
Loading...
Searching...
No Matches
TrigInDetEvent/src/TrigTauTracksInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
16
18
20 P4PtEtaPhiM(0,0,0,0),
22 m_roiID(0),
25 m_nIsoTracks(0),
26 m_charge(0),
30 m_ptBalance(0),
31 m_tracks(0)
32{
33 m_3fastest.setPt(0);
34 m_3fastest.setEta(0);
35 m_3fastest.setPhi(0);
36 m_3fastest.setM(0);
37
38}
39
41
42
43void TrigTauTracksInfo::set3fastestPtEtaPhiM(float pt, float eta, float phi, float m)
44{
45 m_3fastest.setPt( pt);
46 m_3fastest.setEta( eta);
47 m_3fastest.setPhi( phi);
48 m_3fastest.setM( m);
49}
50void TrigTauTracksInfo::set3fastestPxPyPzE(float px, float py, float pz, float e)
51{
52 m_3fastest.set4Mom(P4PxPyPzE(px,py,pz, e));
53}
54
55
56std::string str( const TrigTauTracksInfo& tau ) {
57
58 std::stringstream stream;
59 stream << "RoI ID: " << tau.roiId()
60 << "; pt: " << tau.pt()
61 << "; eta: " << tau.eta()
62 << "; phi: " << tau.phi()
63 << "; nCoreTracks: " << tau.nCoreTracks()
64 << "; nSlowTracks: " << tau.nSlowTracks()
65 << "; nIsoTracks: " << tau.nIsoTracks()
66 << "; charge: " << tau.charge()
67 << "; leadingTrackPt: " << tau.leadingTrackPt()
68 << "; scalarPtSumCore: " << tau.scalarPtSumCore()
69 << "; scalarPtSumIso: " << tau.scalarPtSumIso()
70 << "; ptBalance: " << tau.ptBalance()
71 << "; threeFastestTracksPt: " << tau.threeFastestTracks().pt()
72 << "; threeFastestTracksEta: " << tau.threeFastestTracks().eta()
73 << "; threeFastestTracksPhi: " << tau.threeFastestTracks().phi();
74
75
76 return stream.str();
77}
78
79MsgStream& operator<< ( MsgStream& m, const TrigTauTracksInfo& tau ) {
80
81 return ( m << str( tau ) );
82
83}
84
85bool operator== ( const TrigTauTracksInfo& left, const TrigTauTracksInfo& right ) {
86
87 static const double DELTA = 0.001;
88 if( ( left.roiId() != right.roiId() ) ||
89 ( left.nCoreTracks() != right.nCoreTracks() ) ||
90 ( left.nSlowTracks() != right.nSlowTracks() ) ||
91 ( left.nIsoTracks() != right.nIsoTracks() ) ||
92
93 ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
94 ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
95 ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
96
97 ( std::abs( left.charge() - right.charge() ) > DELTA ) ||
98 ( std::abs( left.leadingTrackPt() - right.leadingTrackPt() ) > DELTA ) ||
99 ( std::abs( left.scalarPtSumCore() - right.scalarPtSumCore() ) > DELTA ) ||
100 ( std::abs( left.scalarPtSumIso() - right.scalarPtSumIso() ) > DELTA ) ||
101 ( std::abs( left.ptBalance() - right.ptBalance() ) > DELTA )
102 ) {
103
104 return false;
105
106 } else {
107
108 return true;
109
110 }
111
112}
113
114void diff( const TrigTauTracksInfo& left, const TrigTauTracksInfo& right,
115 std::map< std::string, double >& varChange ) {
116
117 static const double DELTA = 0.001;
118 if( left.roiId() != right.roiId() ) {
119 varChange[ "roiId" ] = static_cast< double >( left.roiId() - right.roiId() );
120 }
121 if( left.nCoreTracks() != right.nCoreTracks() ) {
122 varChange[ "nCoreTracks" ] = static_cast< double >( left.nCoreTracks() - right.nCoreTracks() );
123 }
124 if( left.nSlowTracks() != right.nSlowTracks() ) {
125 varChange[ "nSlowTracks" ] = static_cast< double >( left.nSlowTracks() - right.nSlowTracks() );
126 }
127 if( left.nIsoTracks() != right.nIsoTracks() ) {
128 varChange[ "nIsoTracks" ] = static_cast< double >( left.nIsoTracks() - right.nIsoTracks() );
129 }
130 if( std::abs( left.pt() - right.pt() ) > DELTA ) {
131 varChange[ "pt" ] = left.pt() - right.pt();
132 }
133 if( std::abs( left.eta() - right.eta() ) > DELTA ) {
134 varChange[ "eta" ] = left.eta() - right.eta();
135 }
136 if( std::abs( left.phi() - right.phi() ) > DELTA ) {
137 varChange[ "phi" ] = left.phi() - right.phi();
138 }
139
140 if( std::abs( left.charge() - right.charge() ) > DELTA ) {
141 varChange[ "charge" ] = left.charge() - right.charge();
142 }
143 if( std::abs( left.leadingTrackPt() - right.leadingTrackPt() ) > DELTA ) {
144 varChange[ "leadingTrackPt" ] = left.leadingTrackPt() - right.leadingTrackPt();
145 }
146 if( left.scalarPtSumCore() != right.scalarPtSumCore() ) {
147 varChange[ "scalarPtSumCore" ] = left.scalarPtSumCore() - right.scalarPtSumCore();
148 }
149 if( left.scalarPtSumIso() != right.scalarPtSumIso() ) {
150 varChange[ "scalarPtSumIso" ] = left.scalarPtSumIso() - right.scalarPtSumIso();
151 }
152 if( left.ptBalance() != right.ptBalance() ) {
153 varChange[ "ptBalance" ] = left.ptBalance() - right.ptBalance();
154 }
155
156 return;
157}
static const double DELTA
bool operator==(const TrigTauTracksInfo &left, const TrigTauTracksInfo &right)
Operator comparing two TrigTauTracksInfo objects for equality.
void diff(const TrigTauTracksInfo &left, const TrigTauTracksInfo &right, std::map< std::string, double > &varChange)
Comparison with feedback.
MsgStream & operator<<(MsgStream &m, const TrigTauTracksInfo &tau)
Helper operator for printing the object.
virtual double pz() const =0
z component of momentum
virtual double px() const =0
x component of momentum
virtual double e() const =0
energy
virtual double py() const =0
y component of momentum
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 m() const
get mass data member
virtual double phi() const
get phi data member
P4PxPyPzE is a class with 4-momentum behavior, for which Px, Py, Pz and M are data members.
Definition P4PxPyPzE.h:29
Contains basic information about trackc collection associated with Tau RoI.
float m_leadingTrackPt
leading track Pt
float scalarPtSumCore() const
const P4PtEtaPhiM & threeFastestTracks() const
int m_nIsoTracks
number of tracks in the isolation region
int roiId() const
getters
float m_ptBalance
variable determining a difference between slow and leading tracks
int m_nCoreTracks
number of tracks in the core region
int m_nSlowTracks
number of slow tracks in the core region
void set3fastestPtEtaPhiM(float pt, float eta, float phi, float m)
float ptBalance() const
void set3fastestPxPyPzE(float px, float py, float pz, float e)
float m_scalarPtSumIso
scalar sum of pts in isolation area
const TrigInDetTrackCollection * m_tracks
float leadingTrackPt() const
float m_charge
charge of tracks in the core region.
float scalarPtSumIso() const
float m_scalarPtSumCore
scalar sum of pts in core area