ATLAS Offline Software
TRT_DriftCircleOnTrackNoDriftTimeTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class TRT_DriftCircleOnTrackNoDriftTimeTool
8 // (c) ATLAS Detector software
10 // AlgTool used for TRT_DriftCircleOnTrack object production
12 // Version 1.0 21/04/2004 I.Gavrilenko
14 
17 
18 
19 
21 // Constructor
23 
25 (const std::string& ty,const std::string& na,const IInterface* pa)
26  : AthAlgTool(ty,na,pa)
27 {
28  declareInterface<IRIO_OnTrackCreator>(this);
29 }
30 
32 // Destructor
34 
36 
38 // Initialisation
40 
42 {
43  StatusCode sc = AlgTool::initialize(); return sc;
44 }
45 
47 // Finalize
49 
51 {
52  StatusCode sc = AlgTool::finalize(); return sc;
53 }
54 
56 // Trk::TRT_DriftCircleOnTrack production
58 
60 (const Trk::PrepRawData& rio,const Trk::TrackParameters& TP, const EventContext& /*ctx*/) const
61 {
62  const InDet::TRT_DriftCircle* DC = dynamic_cast<const InDet::TRT_DriftCircle*>(&rio);
63  if(!DC) return nullptr;
64 
65  // Straw identification
66  //
67  const InDetDD::TRT_BaseElement* pE = DC->detectorElement(); if(!pE) return nullptr;
68 
69  // Identifier iD = DC->identify();
70  // IdentifierHash iH = trt_id->straw_layer_hash(trt_id->layer_id(iD));
71  IdentifierHash iH = pE->identifyHash();
72 
73 
74  // Global direction of the track parameters
75  //
76  const Amg::VectorX& P = TP.parameters();
77  double se = sin(P[3]);
78  Amg::Vector3D dir(cos(P[2])*se,sin(P[2])*se,cos(P[3]));
79 
80  double predictedLocZ=P[1];
81 
82 
83  // only create objects within the active area
84  //
85  double sl = pE->strawLength()*.5;
86 
87  if (predictedLocZ > sl) predictedLocZ = sl;
88  else if(predictedLocZ <-sl) predictedLocZ =-sl;
89 
90  // TRT_DriftCircleOnTrack production
91  //
94  Amg::MatrixX cov(1,1);
95  cov(0,0)=1.33333;
96  return new InDet::TRT_DriftCircleOnTrack(DC, std::move(lp), std::move(cov),
97  iH, predictedLocZ, dir,
99 }
100 
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::finalize
virtual StatusCode finalize() override
Definition: TRT_DriftCircleOnTrackNoDriftTimeTool.cxx:50
Trk::LocalParameters
Definition: LocalParameters.h:98
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
InDetDD::TRT_BaseElement::strawLength
virtual const double & strawLength() const =0
Active straw length.
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::locX
@ locX
Definition: ParamDefs.h:37
DMTest::P
P_v1 P
Definition: P.h:23
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDet::TRT_DriftCircle::detectorElement
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
return the detector element corresponding to this PRD
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
TRT_DriftCircleOnTrackNoDriftTimeTool.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::correct
virtual InDet::TRT_DriftCircleOnTrack * correct(const Trk::PrepRawData &, const Trk::TrackParameters &, const EventContext &) const override
abstract base method for the creation of RIO_OnTrack it takes a RIO (PrepRawData) and the given Track...
Definition: TRT_DriftCircleOnTrackNoDriftTimeTool.cxx:60
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::TRT_DriftCircleOnTrackNoDriftTimeTool
TRT_DriftCircleOnTrackNoDriftTimeTool(const std::string &, const std::string &, const IInterface *)
Definition: TRT_DriftCircleOnTrackNoDriftTimeTool.cxx:25
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::~TRT_DriftCircleOnTrackNoDriftTimeTool
virtual ~TRT_DriftCircleOnTrackNoDriftTimeTool()
Trk::NODRIFTTIME
@ NODRIFTTIME
drift time was not used - drift radius is 0.
Definition: DriftCircleStatus.h:24
Trk::ParametersBase
Definition: ParametersBase.h:55
InDetDD::TRT_BaseElement::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::PrepRawData
Definition: PrepRawData.h:62
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
LocalParameters.h
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::initialize
virtual StatusCode initialize() override
Definition: TRT_DriftCircleOnTrackNoDriftTimeTool.cxx:41
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57