ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetCalibTools
TRT_CalibTools
src
FillAlignTrkInfo.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
8
********************************************************************/
9
10
//#include "GaudiKernel/MsgStream.h"
11
#include "
FillAlignTrkInfo.h
"
12
#include "
TRT_CalibData/TrackInfo.h
"
13
#include "
TrkTrack/Track.h
"
14
#include "
TrkEventPrimitives/FitQuality.h
"
15
#include "
TrkParameters/TrackParameters.h
"
16
#include "
TrkToolInterfaces/ITrackSummaryTool.h
"
17
#include "
TrkTrackSummary/TrackSummary.h
"
18
#include "GaudiKernel/TypeNameString.h"
19
20
#include <map>
21
22
FillAlignTrkInfo::FillAlignTrkInfo
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
23
AthAlgTool
(
type
, name, parent)
24
{}
25
26
StatusCode
FillAlignTrkInfo::initialize
()
27
{
28
msg
(MSG::INFO) <<
"initialize()"
<<
endmsg
;
29
if
(
m_TrackSummaryTool
.retrieve().isFailure()) {
30
msg
(MSG::FATAL) <<
"Cannot get TrackSummaryTool"
<<
endmsg
;
31
return
StatusCode::FAILURE;
32
}
33
msg
(MSG::INFO) <<
"finished initialize()"
<<
endmsg
;
34
return
StatusCode::SUCCESS ;
35
}
36
37
38
bool
FillAlignTrkInfo::fill
(
const
Trk::Track
* aTrack,
TRT::TrackInfo
* output,
const
xAOD::EventInfo
&
/* eventInfo */
,
39
const
xAOD::VertexContainer
&
/* vertices */
) {
40
41
// track parameters
42
const
Trk::Perigee
* mesp=(aTrack->
perigeeParameters
());
43
if
(mesp!=
nullptr
) {
44
(*output)[
TRT::Track::d0
]=mesp->parameters()[
Trk::d0
];
45
(*output)[
TRT::Track::z0
]=mesp->parameters()[
Trk::z0
];
46
(*output)[
TRT::Track::phi
]=mesp->parameters()[
Trk::phi
];
47
// transform back to cot(theta), q/pt representation for alignment ntuple
48
float
theta
= mesp->parameters()[
Trk::theta
];
49
if
(fabs(
theta
)==0)
theta
=1e-24;
50
(*output)[
TRT::Track::cotTheta
]=1/tan(
theta
);
51
(*output)[
TRT::Track::qOverPT
]=(mesp->parameters()[
Trk::qOverP
])/sin(
theta
);
52
(*output)[
TRT::Track::t0
] = 0.0 ;
53
}
else
{
54
msg
(MSG::FATAL) <<
" Could not get Trk::Perigee "
<<
endmsg
;
55
(*output)[
TRT::Track::d0
]=0.0;
56
(*output)[
TRT::Track::z0
]=0.0;
57
(*output)[
TRT::Track::phi
]=0.0;
58
(*output)[
TRT::Track::cotTheta
]=0.0;
59
(*output)[
TRT::Track::qOverPT
]=0.0;
60
(*output)[
TRT::Track::t0
] = 0.0 ;
61
}
62
(*output)[
TRT::Track::chiSquare
]=aTrack->
fitQuality
()->
chiSquared
();
63
(*output)[
TRT::Track::degreesOfFreedom
]=aTrack->
fitQuality
()->
numberDoF
();
64
65
// implicit memory allocation in createSummary, need to clean up later
66
std::unique_ptr<Trk::TrackSummary> summary =
m_TrackSummaryTool
->summary(Gaudi::Hive::currentContext(), *aTrack);
67
(*output)[
TRT::Track::numberOfPixelHits
]=summary->get(
Trk::numberOfPixelHits
) ;
68
(*output)[
TRT::Track::numberOfSCTHits
]=summary->get(
Trk::numberOfSCTHits
) ;
69
(*output)[
TRT::Track::numberOfTRTHits
]=summary->get(
Trk::numberOfTRTHits
) ;
70
71
72
// All ok
73
if
(
msgLvl
(MSG::DEBUG))
msg
() <<
"Track info filled .... "
<<
endmsg
;
74
return
true
;
75
}
theta
Scalar theta() const
theta method
Definition
AmgMatrixBasePlugin.h:75
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
FillAlignTrkInfo.h
FitQuality.h
TrackInfo.h
TrackParameters.h
TrackSummary.h
Track.h
ITrackSummaryTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition
AthCommonMsg.h:30
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
FillAlignTrkInfo::m_TrackSummaryTool
ToolHandle< Trk::ITrackSummaryTool > m_TrackSummaryTool
Definition
FillAlignTrkInfo.h:40
FillAlignTrkInfo::initialize
virtual StatusCode initialize()
Definition
FillAlignTrkInfo.cxx:26
FillAlignTrkInfo::fill
virtual bool fill(const Trk::Track *aTrack, TRT::TrackInfo *output, const xAOD::EventInfo &eventInfo, const xAOD::VertexContainer &vertices)
Definition
FillAlignTrkInfo.cxx:38
FillAlignTrkInfo::FillAlignTrkInfo
FillAlignTrkInfo(const std::string &type, const std::string &name, const IInterface *parent)
Definition
FillAlignTrkInfo.cxx:22
TRT::TrackInfo
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:72
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition
FitQuality.h:60
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition
FitQuality.h:56
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition
Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
TRT::Track::t0
@ t0
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:35
TRT::Track::phi
@ phi
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:31
TRT::Track::d0
@ d0
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:29
TRT::Track::cotTheta
@ cotTheta
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:32
TRT::Track::qOverPT
@ qOverPT
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:33
TRT::Track::z0
@ z0
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:30
TRT::Track::chiSquare
@ chiSquare
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:34
TRT::Track::numberOfSCTHits
@ numberOfSCTHits
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:55
TRT::Track::numberOfTRTHits
@ numberOfTRTHits
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:56
TRT::Track::degreesOfFreedom
@ degreesOfFreedom
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:57
TRT::Track::numberOfPixelHits
@ numberOfPixelHits
Definition
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:54
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
Trk::theta
@ theta
Definition
ParamDefs.h:66
Trk::qOverP
@ qOverP
perigee
Definition
ParamDefs.h:67
Trk::phi
@ phi
Definition
ParamDefs.h:75
Trk::d0
@ d0
Definition
ParamDefs.h:63
Trk::z0
@ z0
Definition
ParamDefs.h:64
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition
VertexContainer.h:14
type
Generated on
for ATLAS Offline Software by
1.17.0