ATLAS Offline Software
IPTrackInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "GaudiKernel/MsgStream.h"
9 #include <iostream>
10 
11 namespace Analysis {
12 
15  m_trackGrade(),
16  m_isFromV0(false),
17  m_valD0wrtPV(0),
18  m_sigD0wrtPV(0),
19  m_valZ0wrtPV(0),
20  m_sigZ0wrtPV(0),
21  m_trackWeight2D(0),
22  m_trackWeight3D(0),
23  m_trackProbJP(0),
24  m_trackProbJPneg(0)
25 {
26 }
27 
29  const Rec::TrackParticle* trk,
30  const TrackGrade& grade,
31  bool isFromV0,
32  double d0val, double d0sig,
33  double z0val, double z0sig)
34  : m_trackWeight2D(0),
35  m_trackWeight3D(0),
36  m_trackProbJP(0),
37  m_trackProbJPneg(0)
38 {
40  if( link.toContainedElement(*coll, const_cast<Rec::TrackParticle*>(trk)) ) {
41  m_track = link;
42  }
43  m_trackGrade = grade;
45  m_valD0wrtPV = d0val;
46  m_sigD0wrtPV = d0sig;
47  m_valZ0wrtPV = z0val;
48  m_sigZ0wrtPV = z0sig;
49 }
50 
52  const TrackGrade& grade,
53  bool isFromV0,
54  double d0val, double d0sig,
55  double z0val, double z0sig)
56  : m_track (track),
57  m_trackGrade (grade),
58  m_isFromV0 (isFromV0),
59  m_valD0wrtPV (d0val),
60  m_sigD0wrtPV (d0sig),
61  m_valZ0wrtPV (z0val),
62  m_sigZ0wrtPV (z0sig),
63  m_trackWeight2D(0),
64  m_trackWeight3D(0),
65  m_trackProbJP(0),
66  m_trackProbJPneg(0)
67 {
68 }
69 
71  if( m_track.isValid() ) {
72  return *(m_track);
73  } else {
74  return 0;
75  }
76 }
77 
78 MsgStream& operator<<( MsgStream& out, const IPTrackInfo& info) {
79  const Rec::TrackParticle* tp = info.track();
80  double phi = 0.;
81  double d0 = 0.;
82  double pt = 0.;
83  double eta = 0.;
84  if(tp) {
85  phi = tp->measuredPerigee()->parameters()[Trk::phi];
86  d0 = tp->measuredPerigee()->parameters()[Trk::d0];
87  pt = tp->pt();
88  eta = tp->eta();
89  }
90  out << " -> IPTrackInfo "
91  << " grade= " << info.trackGrade().gradeString()
92  << " fromV0= " << info.isFromV0()
93  << " d0wrtPV= " << info.d0Value() << " S=" << info.d0Significance()
94  << " z0wrtPV= " << info.z0Value() << " S=" << info.z0Significance()
95  << " original pt,eta,phi,d0 = "<<pt<<" "<<eta<<" "<<phi<<" "<<d0
96  << " weight2D= " << info.trackWeight2D()
97  << " weight3D= " << info.trackWeight3D()
98  << " probJP= " << info.trackProbJP()
99  << " probJPneg= " << info.trackProbJPneg()
100  << endmsg;
101  return out;
102 }
103 
104 std::ostream& operator<<( std::ostream& out, const IPTrackInfo& info) {
105  const Rec::TrackParticle* tp = info.track();
106  double phi = 0.;
107  double d0 = 0.;
108  double pt = 0.;
109  double eta = 0.;
110  if(tp) {
111  phi = tp->measuredPerigee()->parameters()[Trk::phi];
112  d0 = tp->measuredPerigee()->parameters()[Trk::d0];
113  pt = tp->pt();
114  eta = tp->eta();
115  }
116  out << " -> IPTrackInfo "
117  << " grade= " << info.trackGrade().gradeString()
118  << " fromV0= " << info.isFromV0()
119  << " d0wrtPV= " << info.d0Value() << " S=" << info.d0Significance()
120  << " z0wrtPV= " << info.z0Value() << " S=" << info.z0Significance()
121  << " original pt,eta,phi,d0 = "<<pt<<" "<<eta<<" "<<phi<<" "<<d0
122  << " weight2D= " << info.trackWeight2D()
123  << " weight3D= " << info.trackWeight3D()
124  << " probJP= " << info.trackProbJP()
125  << " probJPneg= " << info.trackProbJPneg()
126  << std::endl;
127  return out;
128 }
129 
130 }
grepfile.info
info
Definition: grepfile.py:38
Analysis::IPTrackInfo::m_sigZ0wrtPV
double m_sigZ0wrtPV
Definition: IPTrackInfo.h:57
Analysis::TrackGrade
Definition: TrackGrade.h:11
TrackParticle.h
AthCUDAExamples::TrackParticleContainer
vecmem::edm::container< TrackParticleInterface, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float > > TrackParticleContainer
SoA, GPU friendly TrackParticleContainer.
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:46
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Analysis::IPTrackInfo::track
const Rec::TrackParticle * track() const
Definition: IPTrackInfo.cxx:70
Analysis::IPTrackInfo::m_isFromV0
bool m_isFromV0
Definition: IPTrackInfo.h:53
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Analysis::IPTrackInfo::m_trackGrade
TrackGrade m_trackGrade
Definition: IPTrackInfo.h:52
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
Analysis::IPTrackInfo::m_sigD0wrtPV
double m_sigD0wrtPV
Definition: IPTrackInfo.h:55
Analysis::IPTrackInfo::m_track
ElementLink< Rec::TrackParticleContainer > m_track
Definition: IPTrackInfo.h:51
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
IPTrackInfo.h
Trk::d0
@ d0
Definition: ParamDefs.h:63
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
Analysis::IPTrackInfo
Definition: IPTrackInfo.h:18
Analysis::IPTrackInfo::m_valD0wrtPV
double m_valD0wrtPV
Definition: IPTrackInfo.h:54
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
Analysis::IPTrackInfo::IPTrackInfo
IPTrackInfo()
Definition: IPTrackInfo.cxx:13
Analysis::operator<<
MsgStream & operator<<(MsgStream &out, const IPInfoBase &)
output.
Definition: IPInfoBase.cxx:47
Trk::phi
@ phi
Definition: ParamDefs.h:75
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Analysis::IPTrackInfo::m_valZ0wrtPV
double m_valZ0wrtPV
Definition: IPTrackInfo.h:56
Analysis::IPTrackInfo::isFromV0
bool isFromV0() const
Definition: IPTrackInfo.h:40
TrackParticleContainer.h