ATLAS Offline Software
Loading...
Searching...
No Matches
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/*****************************************************************************
6Name : TrigMuonEFTrack.cxx
7Package : offline/Trigger/TrigEvent/TrigMuonEvent
8Author : Sergio Grancagnolo
9Created : April 2008
10Note : Simple Trigger AOD for EF Muon (TrigMuonEF)
11
12DESCRIPTION:
13
14Apr.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):
29static const double DELTA = 0.001;
30// "Distance" used for 1/pT comparison (since we are in MeV)
31static const double IDELTA = 0.00000001;
32
34 P4IPtCotThPhiM( 0., 0., 0., 0. ),
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
55TrigMuonEFTrack::TrigMuonEFTrack(double theIPt, double theCotTh, double thePhi, double theM) :
56 P4IPtCotThPhiM(theIPt, theCotTh, thePhi ,theM ),
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
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;
114 m_posx = rhs.m_posx;
115 m_posy = rhs.m_posy;
116 m_posz = rhs.m_posz;
126 }
127 return *this;
128}
129
131void 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
146std::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
164MsgStream& 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
222void 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}
static const double DELTA
static Double_t a
static Double_t ss
static const double IDELTA
MsgStream & operator<<(MsgStream &m, const TrigMuonEFTrack &d)
Helper operator for printing the object.
bool operator==(const TrigMuonEFTrack &a, const TrigMuonEFTrack &b)
Operator comparing two TrigMuonEFTrack objects for equality.
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...
I4Momentum is an abstract base class providing 4-momentum behavior.
Definition I4Momentum.h:31
P4IPtCotThPhiMBase is a base class for classes with 4-momentum behavior, for which 1/Pt,...
P4IPtCotThPhiM(const double iPt, const double cotTh, const double phi, const double m)
constructor with all data members
virtual double cotTh() const
get cot(theta) data member
virtual double phi() const
get phi data member
virtual double iPt() const
get inverse pT data member
unsigned short int m_nMdtHitsEta
unsigned short int m_nRpcHitsPhi
unsigned short int m_nCscHitsEta
unsigned short int m_nMdtHitsPhi
TrigMuonEFTrack()
Default constructor.
void setPerigee(double iPt, double cotTh, double phi, double mass)
set data member
unsigned short int m_nMdtHits
TrigMuonEFTrack & operator=(const TrigMuonEFTrack &rhs)
Assignement operator.
unsigned short int m_nRpcHitsEta
~TrigMuonEFTrack()
Destructor.
unsigned short int m_nTgcHitsEta
static const int CHARGE_NA
unsigned short int m_nCscHitsPhi
unsigned short int m_nTgcHitsPhi