ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonEFCbTrack.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*****************************************************************************
6Name : TrigMuonEFCbTrack.cxx
7Package : offline/Trigger/TrigEvent/TrigMuonEvent
8Author : Sergio Grancagnolo
9Created : November 2008
10Note : Simple Trigger AOD for EF Muon (TrigMuonEF)
11
12DESCRIPTION:
13
14Nov.2008: A TrigMuonEFTrack overloading that contains the match chi2.
15*****************************************************************************/
16
17// STL include(s):
18#include <sstream>
19#include <cmath>
20
21// Gaudi/Athena include(s):
22#include "GaudiKernel/MsgStream.h"
25
26// Local include(s):
28
29// "Distance" used by the comparison operator(s):
30static const double DELTA = 0.001;
31
33 TrigMuonEFTrack( 0., 0., 0., 0. ),
34 m_matchChi2(-999.),
35 m_nIdSctHits (0),
37 m_nTrtHits(0),
39{
40}
41
42TrigMuonEFCbTrack::TrigMuonEFCbTrack(double theIPt, double theCotTh, double thePhi, double theM) :
43 TrigMuonEFTrack(theIPt, theCotTh, thePhi ,theM ),
44 m_matchChi2(-999.),
45 m_nIdSctHits (0),
47 m_nTrtHits(0),
49{
50}
51
65
79
81void TrigMuonEFCbTrack::setMatchChi2(double theMatchChi2){
82 m_matchChi2 = theMatchChi2;
83}
84
87
92 if(!m_idTrackLink.isValid()) return 0; //possible since old data has no link
93 return *(m_idTrackLink);
94}
95
103void TrigMuonEFCbTrack::setIDTrack(const Rec::TrackParticleContainer* cont, unsigned int itrk) {
104 m_idTrackLink.toIndexedElement(*cont, itrk);
105}
106
115
117// helper operators
118
123std::string str( const TrigMuonEFCbTrack& d ) {
124 std::stringstream ss;
126 << "; chi2 match: " << d.matchChi2();
127
128 return ss.str();
129}
130
131MsgStream& operator<< ( MsgStream& m, const TrigMuonEFCbTrack& d ) {
132
133 return ( m << str( d ) );
134}
135
141
142 if( static_cast<const TrigMuonEFTrack&>(a) != static_cast<const TrigMuonEFTrack&>(b) )
143 return false;
144 if( std::abs( a.matchChi2() - b.matchChi2() ) > DELTA )
145 return false;
146
147 return true;
148}
149
160 std::map< std::string, double >& variableChange ) {
161
162 // Call the function operating on the base class:
163 diff( static_cast<const TrigMuonEFTrack&>(a), static_cast<const TrigMuonEFTrack&>(b), variableChange );
164
165 if( std::abs( a.matchChi2() - b.matchChi2() ) > DELTA ) {
166 variableChange[ "MatchChi2" ] = a.matchChi2() - b.matchChi2();
167 }
168
169 return;
170}
static const double DELTA
static Double_t a
static Double_t ss
MsgStream & operator<<(MsgStream &m, const TrigMuonEFCbTrack &d)
Helper operator for printing the object.
void diff(const TrigMuonEFCbTrack &a, const TrigMuonEFCbTrack &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...
bool operator==(const TrigMuonEFCbTrack &a, const TrigMuonEFCbTrack &b)
This operator uses the operator operator==(TrigMuonEFTrack&,TrigMuonEFTrack&) to compare the "base cl...
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,...
ElementLink< Rec::TrackParticleContainer > m_idTrackLink
Link to the associated ID track.
unsigned short int m_nIdPixelHits
unsigned short int m_nTrtHits
void setIDTrackElementLink(const ElementLink< Rec::TrackParticleContainer > &link)
Set associated ID track.
void setMatchChi2(double theMatchChi2)
set data member
unsigned short int m_nIdSctHits
~TrigMuonEFCbTrack()
Destructor.
const Rec::TrackParticle * getIDTrackParticle() const
Get associated ID track.
TrigMuonEFCbTrack()
Default constructor.
void setIDTrack(const Rec::TrackParticleContainer *cont, unsigned int itrk)
Set associated ID track.
TrigMuonEFTrack()
Default constructor.