ATLAS Offline Software
TrigMuonEFTrack.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*****************************************************************************
6 Name : TrigMuonEFTrack.cxx
7 Package : offline/Trigger/TrigEvent/TrigMuonEvent
8 Author : Sergio Grancagnolo
9 Created : April 2008
10 Note : Simple Trigger AOD for EF Muon (TrigMuonEF)
11 
12 DESCRIPTION:
13 
14 Apr.2008: A simple AOD containing just track parameters for re-running
15  hypothesis with FEX off.
16  *****************************************************************************/
17 
18 // STL include(s):
19 #include <sstream>
20 #include <cmath>
21 
22 // Gaudi/Athena include(s):
23 #include "GaudiKernel/MsgStream.h"
24 
25 // Local include(s):
27 
28 // "Distance" used by the comparison operator(s):
29 static const double DELTA = 0.001;
30 // "Distance" used for 1/pT comparison (since we are in MeV)
31 static const double IDELTA = 0.00000001;
32 
34  P4IPtCotThPhiM( 0., 0., 0., 0. ),
35  m_charge (CHARGE_NA),
36  m_d0 (0),
37  m_z0 (0),
38  m_chi2 (0),
39  m_chi2prob (0),
40  m_posx (0),
41  m_posy (0),
42  m_posz (0),
43  m_nMdtHitsPhi (0),
44  m_nRpcHitsPhi (0),
45  m_nTgcHitsPhi (0),
46  m_nCscHitsPhi (0),
47  m_nMdtHitsEta (0),
48  m_nRpcHitsEta (0),
49  m_nTgcHitsEta (0),
50  m_nCscHitsEta (0),
51  m_nMdtHits (0)
52  {
53  }
54 
55 TrigMuonEFTrack::TrigMuonEFTrack(double theIPt, double theCotTh, double thePhi, double theM) :
56  P4IPtCotThPhiM(theIPt, theCotTh, thePhi ,theM ),
57  m_charge (CHARGE_NA),
58  m_d0 (0),
59  m_z0 (0),
60  m_chi2 (0),
61  m_chi2prob (0),
62  m_posx (0),
63  m_posy (0),
64  m_posz (0),
65  m_nMdtHitsPhi (0),
66  m_nRpcHitsPhi (0),
67  m_nTgcHitsPhi (0),
68  m_nCscHitsPhi (0),
69  m_nMdtHitsEta (0),
70  m_nRpcHitsEta (0),
71  m_nTgcHitsEta (0),
72  m_nCscHitsEta (0),
73  m_nMdtHits (0)
74  {
75  }
76 
78  I4Momentum(rhs),
79  P4IPtCotThPhiMBase( rhs ),
80  INavigable(rhs),
83  P4IPtCotThPhiM( rhs ),
85  m_charge( rhs.m_charge ),
86  m_d0 (rhs.m_d0),
87  m_z0 (rhs.m_z0),
88  m_chi2 (rhs.m_chi2),
89  m_chi2prob (rhs.m_chi2prob),
90  m_posx (rhs.m_posx),
91  m_posy (rhs.m_posy),
92  m_posz (rhs.m_posz),
93  m_nMdtHitsPhi (rhs.m_nMdtHitsPhi),
94  m_nRpcHitsPhi (rhs.m_nRpcHitsPhi),
95  m_nTgcHitsPhi (rhs.m_nTgcHitsPhi),
96  m_nCscHitsPhi (rhs.m_nCscHitsPhi),
97  m_nMdtHitsEta (rhs.m_nMdtHitsEta),
98  m_nRpcHitsEta (rhs.m_nRpcHitsEta),
99  m_nTgcHitsEta (rhs.m_nTgcHitsEta),
100  m_nCscHitsEta (rhs.m_nCscHitsEta),
101  m_nMdtHits (0)
102  { }
103 
106 {
107  if ( this != &rhs ) {
108  P4IPtCotThPhiM::operator=( rhs );
109  m_charge = rhs.m_charge;
110  m_d0 = rhs.m_d0;
111  m_z0 = rhs.m_z0;
112  m_chi2 = rhs.m_chi2;
113  m_chi2prob = rhs.m_chi2prob;
114  m_posx = rhs.m_posx;
115  m_posy = rhs.m_posy;
116  m_posz = rhs.m_posz;
125  m_nMdtHits = rhs.m_nMdtHits;
126  }
127  return *this;
128 }
129 
131 void TrigMuonEFTrack::setPerigee(double iPt, double cotTh, double phi, double mass)
132 {
133  m_iPt = iPt;
134  m_cotTh = cotTh;
135  m_phi = phi;
136  m_m = mass;
137  return;
138 }
139 
142 
144 // helper operators
145 
146 std::string str ( const TrigMuonEFTrack& d ) {
147  std::stringstream ss;
148  ss << " inverse pt: " << d.iPt()
149  << "; cot(theta): " << d.cotTh()
150  << "; phi: " << d.phi()
151  << "; mass: " << d.m()
152  << "; charge: " << d.charge()
153  << "; NCscHitsPhi: " << d.NCscHitsPhi()
154  << "; NCscHitsEta: " << d.NCscHitsEta()
155  << "; NTgcHitsPhi: " << d.NTgcHitsPhi()
156  << "; NTgcHitsEta: " << d.NTgcHitsEta()
157  << "; NRpcHitsPhi: " << d.NRpcHitsPhi()
158  << "; NRpcHitsEta: " << d.NRpcHitsEta()
159  << "; NMdtHits: " << d.NMdtHits();
160 
161  return ss.str();
162 }
163 
164 MsgStream& operator<< ( MsgStream& m, const TrigMuonEFTrack& d ) {
165 
166  return ( m << str( d ) );
167 }
168 
170 
171  if( std::abs( a.charge() - b.charge() ) > DELTA )
172  return false;
173  if( std::abs( a.iPt() - b.iPt() ) > IDELTA )
174  return false;
175  if( std::abs( a.eta() - b.eta() ) > DELTA )
176  return false;
177  if( std::abs( a.phi() - b.phi() ) > DELTA )
178  return false;
179  if( std::abs( a.m() - b.m() ) > DELTA )
180  return false;
181  if( std::abs( a.d0() - b.d0() ) > DELTA )
182  return false;
183  if( std::abs( a.z0() - b.z0() ) > DELTA )
184  return false;
185  if( std::abs( a.chi2() - b.chi2() ) > DELTA )
186  return false;
187  if( std::abs( a.chi2prob() - b.chi2prob() ) > DELTA )
188  return false;
189  if( std::abs( a.posX() - b.posX() ) > DELTA )
190  return false;
191  if( std::abs( a.posY() - b.posY() ) > DELTA )
192  return false;
193  if( std::abs( a.posZ() - b.posZ() ) > DELTA )
194  return false;
195  if( a.NRpcHitsPhi() != b.NRpcHitsPhi() )
196  return false;
197  if( a.NTgcHitsPhi() != b.NTgcHitsPhi() )
198  return false;
199  if( a.NCscHitsPhi() != b.NCscHitsPhi() )
200  return false;
201  if( a.NRpcHitsEta() != b.NRpcHitsEta() )
202  return false;
203  if( a.NTgcHitsEta() != b.NTgcHitsEta() )
204  return false;
205  if( a.NCscHitsEta() != b.NCscHitsEta() )
206  return false;
207  if( a.NMdtHits() != b.NMdtHits() )
208  return false;
209 
210  return true;
211 }
212 
222 void diff( const TrigMuonEFTrack& a, const TrigMuonEFTrack& b,
223  std::map< std::string, double >& variableChange ) {
224 
225  if( std::abs( a.charge() - b.charge() ) > DELTA ) {
226  variableChange[ "Charge" ] = a.charge() - b.charge();
227  }
228  if( std::abs( a.iPt() - b.iPt() ) > IDELTA ) {
229  variableChange[ "iPt" ] = a.iPt() - b.iPt();
230  }
231  if( std::abs( a.eta() - b.eta() ) > DELTA ) {
232  variableChange[ "Eta" ] = a.eta() - b.eta();
233  }
234  if( std::abs( a.phi() - b.phi() ) > DELTA ) {
235  variableChange[ "Phi" ] = a.phi() - b.phi();
236  }
237  if( std::abs( a.m() - b.m() ) > DELTA ) {
238  variableChange[ "Mass" ] = a.m() - b.m();
239  }
240  if( std::abs( a.d0() - b.d0() ) > DELTA ) {
241  variableChange[ "d0" ] = a.d0() - b.d0();
242  }
243  if( std::abs( a.z0() - b.z0() ) > DELTA ) {
244  variableChange[ "z0" ] = a.z0() - b.z0();
245  }
246  if( std::abs( a.chi2() - b.chi2() ) > DELTA ) {
247  variableChange[ "chi2" ] = a.chi2() - b.chi2();
248  }
249  if( std::abs( a.chi2prob() - b.chi2prob() ) > DELTA ) {
250  variableChange[ "chi2prob" ] = a.chi2prob() - b.chi2prob();
251  }
252  if( std::abs( a.posX() - b.posX() ) > DELTA ) {
253  variableChange[ "posX" ] = a.posX() - b.posX();
254  }
255  if( std::abs( a.posY() - b.posY() ) > DELTA ) {
256  variableChange[ "posY" ] = a.posY() - b.posY();
257  }
258  if( std::abs( a.posZ() - b.posZ() ) > DELTA ) {
259  variableChange[ "posZ" ] = a.posZ() - b.posZ();
260  }
261  if( a.NRpcHitsPhi() != b.NRpcHitsPhi() ) {
262  variableChange[ "NRpcHitsPhi" ] = static_cast< double >( a.NRpcHitsPhi() -
263  b.NRpcHitsPhi() );
264  }
265  if( a.NTgcHitsPhi() != b.NTgcHitsPhi() ) {
266  variableChange[ "NTgcHitsPhi" ] = static_cast< double >( a.NTgcHitsPhi() -
267  b.NTgcHitsPhi() );
268  }
269  if( a.NCscHitsPhi() != b.NCscHitsPhi() ) {
270  variableChange[ "NCscHitsPhi" ] = static_cast< double >( a.NCscHitsPhi() -
271  b.NCscHitsPhi() );
272  }
273  if( a.NRpcHitsEta() != b.NRpcHitsEta() ) {
274  variableChange[ "NRpcHitsEta" ] = static_cast< double >( a.NRpcHitsEta() -
275  b.NRpcHitsEta() );
276  }
277  if( a.NTgcHitsEta() != b.NTgcHitsEta() ) {
278  variableChange[ "NTgcHitsEta" ] = static_cast< double >( a.NTgcHitsEta() -
279  b.NTgcHitsEta() );
280  }
281  if( a.NCscHitsEta() != b.NCscHitsEta() ) {
282  variableChange[ "NCscHitsEta" ] = static_cast< double >( a.NCscHitsEta() -
283  b.NCscHitsEta() );
284  }
285  if( a.NMdtHits() != b.NMdtHits() ) {
286  variableChange[ "NMdtHits" ] = static_cast< double >( a.NMdtHits() -
287  b.NMdtHits() );
288  }
289 
290  return;
291 }
TrigMuonEFTrack::~TrigMuonEFTrack
~TrigMuonEFTrack()
Destructor.
Definition: TrigMuonEFTrack.cxx:141
TrigMuonEFTrack::m_charge
double m_charge
Definition: TrigMuonEFTrack.h:202
TrigMuonEFTrack::m_posx
double m_posx
Definition: TrigMuonEFTrack.h:207
P4IPtCotThPhiMBase
Definition: P4IPtCotThPhiMBase.h:28
I4Momentum
Definition: I4Momentum.h:31
TrigMuonEFTrack::m_posz
double m_posz
Definition: TrigMuonEFTrack.h:209
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigMuonEFTrack::m_nRpcHitsPhi
unsigned short int m_nRpcHitsPhi
Definition: TrigMuonEFTrack.h:211
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
TrigMuonEFTrack
Definition: TrigMuonEFTrack.h:27
hist_file_dump.d
d
Definition: hist_file_dump.py:137
str
std::string str(const TrigMuonEFTrack &d)
Helper function for printing the object.
Definition: TrigMuonEFTrack.cxx:146
TrigMuonEFTrack::m_z0
double m_z0
Definition: TrigMuonEFTrack.h:204
P4IPtCotThPhiM::m_phi
double m_phi
Definition: P4IPtCotThPhiM.h:75
P4IPtCotThPhiM
Definition: P4IPtCotThPhiM.h:27
NavigableTerminalNode
Dummy type needed fro specialized implementation.
Definition: NavigableTerminalNode.h:19
P4IPtCotThPhiM::m_cotTh
double m_cotTh
Definition: P4IPtCotThPhiM.h:74
TrigMuonEFTrack::m_nCscHitsPhi
unsigned short int m_nCscHitsPhi
Definition: TrigMuonEFTrack.h:213
TrigMuonEFTrack.h
operator<<
MsgStream & operator<<(MsgStream &m, const TrigMuonEFTrack &d)
Helper operator for printing the object.
Definition: TrigMuonEFTrack.cxx:164
diff
void diff(const TrigMuonEFTrack &a, const TrigMuonEFTrack &b, std::map< std::string, double > &variableChange)
Function compares two objects and returns "semi verbose" output in the form of map where there are va...
Definition: TrigMuonEFTrack.cxx:222
TrigMuonEFTrack::m_nMdtHitsEta
unsigned short int m_nMdtHitsEta
Definition: TrigMuonEFTrack.h:214
TrigMuonEFTrack::m_nCscHitsEta
unsigned short int m_nCscHitsEta
Definition: TrigMuonEFTrack.h:217
TrigMuonEFTrack::operator=
TrigMuonEFTrack & operator=(const TrigMuonEFTrack &rhs)
Assignement operator.
Definition: TrigMuonEFTrack.cxx:105
P4IPtCotThPhiM::m_m
double m_m
Definition: P4IPtCotThPhiM.h:76
TrigMuonEFTrack::m_nTgcHitsEta
unsigned short int m_nTgcHitsEta
Definition: TrigMuonEFTrack.h:216
TrigMuonEFTrack::TrigMuonEFTrack
TrigMuonEFTrack()
Default constructor.
Definition: TrigMuonEFTrack.cxx:33
TrigMuonEFTrack::m_posy
double m_posy
Definition: TrigMuonEFTrack.h:208
P4IPtCotThPhiM::m_iPt
double m_iPt
Definition: P4IPtCotThPhiM.h:73
INavigable
Definition: INavigable.h:18
P4IPtCotThPhiM::phi
virtual double phi() const
get phi data member
Definition: P4IPtCotThPhiM.h:106
IAthenaBarCode
Definition: AthenaKernel/AthenaKernel/IAthenaBarCode.h:48
operator==
bool operator==(const TrigMuonEFTrack &a, const TrigMuonEFTrack &b)
Operator comparing two TrigMuonEFTrack objects for equality.
Definition: TrigMuonEFTrack.cxx:169
TrigMuonEFTrack::m_chi2prob
double m_chi2prob
Definition: TrigMuonEFTrack.h:206
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigMuonEFTrack::m_nRpcHitsEta
unsigned short int m_nRpcHitsEta
Definition: TrigMuonEFTrack.h:215
TrigMuonEFTrack::m_d0
double m_d0
Definition: TrigMuonEFTrack.h:203
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigMuonEFTrack::m_nTgcHitsPhi
unsigned short int m_nTgcHitsPhi
Definition: TrigMuonEFTrack.h:212
INavigable4Momentum
Definition: INavigable4Momentum.h:21
TrigMuonEFTrack::m_nMdtHitsPhi
unsigned short int m_nMdtHitsPhi
Definition: TrigMuonEFTrack.h:210
P4IPtCotThPhiM::iPt
virtual double iPt() const
get inverse pT data member
Definition: P4IPtCotThPhiM.h:100
TrigMuonEFTrack::m_nMdtHits
unsigned short int m_nMdtHits
Definition: TrigMuonEFTrack.h:218
TrigMuonEFTrack::m_chi2
double m_chi2
Definition: TrigMuonEFTrack.h:205
TrigMuonEFTrack::setPerigee
void setPerigee(double iPt, double cotTh, double phi, double mass)
set data member
Definition: TrigMuonEFTrack.cxx:131
P4IPtCotThPhiM::cotTh
virtual double cotTh() const
get cot(theta) data member
Definition: P4IPtCotThPhiM.h:103