ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::TRT_TrackExtensionTool_xk Class Reference

InDet::TRT_TrackExtensionTool_xk is algorithm which produce track extension to TRT. More...

#include <TRT_TrackExtensionTool_xk.h>

Inheritance diagram for InDet::TRT_TrackExtensionTool_xk:
Collaboration diagram for InDet::TRT_TrackExtensionTool_xk:

Classes

class  EventData

Public Member Functions

 TRT_TrackExtensionTool_xk (const std::string &, const std::string &, const IInterface *)
virtual ~TRT_TrackExtensionTool_xk ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual std::vector< const Trk::MeasurementBase * > & extendTrack (const EventContext &ctx, const Trk::Track &, InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
virtual std::vector< const Trk::MeasurementBase * > & extendTrack (const EventContext &ctx, const Trk::TrackParameters *, InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
virtual Trk::TrackSegmentfindSegment (const EventContext &ctx, const Trk::TrackParameters *, InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
virtual Trk::TracknewTrack (const EventContext &ctx, const Trk::Track &, InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
virtual std::unique_ptr< InDet::ITRT_TrackExtensionTool::IEventDatanewEvent (const EventContext &ctx) const override
virtual MsgStream & dump (MsgStream &out) const override
virtual std::ostream & dump (std::ostream &out) const override
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

std::vector< const Trk::MeasurementBase * > & extendTrackFromParameters (const EventContext &ctx, const Trk::TrackParameters *, InDet::TRT_TrackExtensionTool_xk::EventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const
void magneticFieldInit ()
StatusCode magneticFieldInit (IOVSVC_CALLBACK_ARGS)
bool isGoodExtension (const EventContext &ctx, const Trk::TrackParameters *, InDet::TRT_TrackExtensionTool_xk::EventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const
bool numberPIXandSCTclustersCut (const Trk::Track &) const
MsgStream & dumpConditions (MsgStream &out) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

const TRT_IDm_trtid {}
ToolHandle< ITRT_DetElementsRoadMakerm_roadtool {this, "RoadTool", "InDet::TRT_DetElementsRoadMaker_xk"}
PublicToolHandle< Trk::IPatternParametersPropagatorm_proptool {this, "PropagatorTool", "Trk::RungeKuttaPropagator"}
PublicToolHandle< Trk::IPatternParametersUpdatorm_updatortool {this, "UpdatorTool", "Trk::KalmanUpdator_xk"}
ToolHandle< ITrtDriftCircleCutToolm_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
ToolHandle< Trk::IRIO_OnTrackCreatorm_riontrackD {this, "RIOonTrackToolYesDr", "InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool"}
ToolHandle< Trk::IRIO_OnTrackCreatorm_riontrackN {this, "RIOonTrackToolNoDr", "InDet::TRT_DriftCircleOnTrackNoDriftTimeTool/TRT_DriftCircleOnTrackNoDriftTimeTool"}
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
int m_outputlevel {}
IntegerProperty m_segmentFindMode
IntegerProperty m_minNumberDCs
IntegerProperty m_minNumberSCT
IntegerProperty m_minNumberPIX
DoubleProperty m_roadwidth
DoubleProperty m_maxslope {this, "Maxslope", .00005}
DoubleProperty m_zVertexWidth
DoubleProperty m_impact
BooleanProperty m_usedriftrad
BooleanProperty m_parameterization
DoubleProperty m_scale_error
StringProperty m_fieldmode
Trk::MagneticFieldProperties m_fieldprop
SG::ReadHandleKey< TRT_DriftCircleContainer > m_trtname {this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve TRT_DriftCircleContainer"}
DoubleProperty m_minTRTSegmentpT

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

InDet::TRT_TrackExtensionTool_xk is algorithm which produce track extension to TRT.

Author
Igor..nosp@m.Gavr.nosp@m.ilenk.nosp@m.o@ce.nosp@m.rn.ch

Definition at line 50 of file TRT_TrackExtensionTool_xk.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TRT_TrackExtensionTool_xk()

InDet::TRT_TrackExtensionTool_xk::TRT_TrackExtensionTool_xk ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 44 of file TRT_TrackExtensionTool_xk.cxx.

46 : AthAlgTool(t,n,p)
47{
48 declareInterface<ITRT_TrackExtensionTool>(this);
49}
AthAlgTool()
Default constructor:

◆ ~TRT_TrackExtensionTool_xk()

InDet::TRT_TrackExtensionTool_xk::~TRT_TrackExtensionTool_xk ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dump() [1/2]

MsgStream & InDet::TRT_TrackExtensionTool_xk::dump ( MsgStream & out) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 129 of file TRT_TrackExtensionTool_xk.cxx.

130{
131 out<<std::endl;
132 return dumpConditions(out);
133}
MsgStream & dumpConditions(MsgStream &out) const

◆ dump() [2/2]

std::ostream & InDet::TRT_TrackExtensionTool_xk::dump ( std::ostream & out) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 180 of file TRT_TrackExtensionTool_xk.cxx.

181{
182 return out;
183}

◆ dumpConditions()

MsgStream & InDet::TRT_TrackExtensionTool_xk::dumpConditions ( MsgStream & out) const
protected

Definition at line 140 of file TRT_TrackExtensionTool_xk.cxx.

141{
142 auto pad = [](const std::string & s)->std::string{
143 std::string s1(s.size(),' ');
144 s1+="|";
145 return s + s1 +"\n";
146 };
147 const std::array<std::string,9> fieldmode{"NoField" ,"ConstantField","SolenoidalField",
148 "ToroidalField" ,"Grid3DField" ,"RealisticField" ,
149 "UndefinedField","AthenaField" , "?????" };
150 int mode = m_fieldprop.magneticFieldMode();
151 if(mode<0 || mode>8 ) mode = 8;
152 std::string lineSeparator(90,'-');
153 lineSeparator = "|" + lineSeparator + "|\n";
154 const auto & w12 = std::setw(12);
155 const auto & sp5 = std::setprecision(5);
156 const std::string spaces = " |\n";
157 out<< lineSeparator;
158 out<<"| TRT container | "<< pad(m_trtname.key());
159 out<<"| Tool for propagation | "<< pad(m_proptool.type());
160 out<<"| Tool for updator | "<< pad(m_updatortool.type());
161 out<<"| Tool for rio on trackD | "<< pad(m_riontrackD.type());
162 out<<"| Tool for rio on trackN | "<< pad(m_riontrackN.type());
163 out<<"| Tool for road builder | "<< pad(m_roadtool.type());
164 out<<"| Magnetic field mode | "<< pad(fieldmode[mode]);
165 out<<"| Segments find mode | "<< w12 << m_segmentFindMode << spaces;
166 out<<"| TRT road half width (mm)| "<< w12 << sp5<< m_roadwidth << spaces;
167 out<<"| Min number DriftCircles | "<< w12 << m_minNumberDCs << spaces;
168 out<<"| Use drift time ? | "<< w12 << m_usedriftrad << spaces;
169 out<<"| Z vertex half width | "<< w12 << m_zVertexWidth << spaces;
170 out<<"| Scalefactor hit error | "<< w12 << m_scale_error <<spaces;
171 out<<"| Max impact parameter | "<< w12 << m_impact <<spaces;
172 out<< lineSeparator;
173 return out;
174}
ToolHandle< ITRT_DetElementsRoadMaker > m_roadtool
PublicToolHandle< Trk::IPatternParametersPropagator > m_proptool
SG::ReadHandleKey< TRT_DriftCircleContainer > m_trtname
PublicToolHandle< Trk::IPatternParametersUpdator > m_updatortool
ToolHandle< Trk::IRIO_OnTrackCreator > m_riontrackD
ToolHandle< Trk::IRIO_OnTrackCreator > m_riontrackN
Trk::MagneticFieldProperties m_fieldprop

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extendTrack() [1/2]

std::vector< const Trk::MeasurementBase * > & InDet::TRT_TrackExtensionTool_xk::extendTrack ( const EventContext & ctx,
const Trk::Track & Tr,
InDet::ITRT_TrackExtensionTool::IEventData & virt_event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 256 of file TRT_TrackExtensionTool_xk.cxx.

260{
261 InDet::TRT_TrackExtensionTool_xk::EventData &
263 event_data.m_measurement.clear();
264 const Trk::TrackStates* tsos = Tr.trackStateOnSurfaces();
265 const Trk::TrackParameters* par = tsos->back()->trackParameters(); //tsos owns this
266 if(!par ) return event_data.m_measurement;
267 const Trk::TrackParameters* parb = tsos->front()->trackParameters(); //tsos owns this
268 if(parb && par!=parb) {
269 const Amg::Vector3D& g1 = par ->position();
270 const Amg::Vector3D& g2 = parb->position();
271 if((g2.x()*g2.x()+g2.y()*g2.y()) > (g1.x()*g1.x()+g1.y()*g1.y())) par=parb;
272 }
273 return extendTrackFromParameters(ctx, par, event_data,used);
274}
const T * back() const
Access the last element in the collection as an rvalue.
const T * front() const
Access the first element in the collection as an rvalue.
std::vector< const Trk::MeasurementBase * > m_measurement
std::vector< const Trk::MeasurementBase * > & extendTrackFromParameters(const EventContext &ctx, const Trk::TrackParameters *, InDet::TRT_TrackExtensionTool_xk::EventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const
static EventData & getPrivateEventData(InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data)
const Amg::Vector3D & position() const
Access method for the position.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Eigen::Matrix< double, 3, 1 > Vector3D
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ extendTrack() [2/2]

std::vector< const Trk::MeasurementBase * > & InDet::TRT_TrackExtensionTool_xk::extendTrack ( const EventContext & ctx,
const Trk::TrackParameters * par,
InDet::ITRT_TrackExtensionTool::IEventData & virt_event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 281 of file TRT_TrackExtensionTool_xk.cxx.

285{
286 InDet::TRT_TrackExtensionTool_xk::EventData &
288 return extendTrackFromParameters(ctx, par, event_data, used);
289}

◆ extendTrackFromParameters()

std::vector< const Trk::MeasurementBase * > & InDet::TRT_TrackExtensionTool_xk::extendTrackFromParameters ( const EventContext & ctx,
const Trk::TrackParameters * par,
InDet::TRT_TrackExtensionTool_xk::EventData & event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
protected

Definition at line 293 of file TRT_TrackExtensionTool_xk.cxx.

297{
298 event_data.m_measurement.clear();
299 if(isGoodExtension(ctx, par,event_data,used)) event_data.m_trajectory.convert(event_data.m_measurement);
300 return event_data.m_measurement;
301}
bool isGoodExtension(const EventContext &ctx, const Trk::TrackParameters *, InDet::TRT_TrackExtensionTool_xk::EventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const
void convert(std::vector< const Trk::MeasurementBase * > &)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode InDet::TRT_TrackExtensionTool_xk::finalize ( )
overridevirtual

Definition at line 120 of file TRT_TrackExtensionTool_xk.cxx.

121{
122 return StatusCode::SUCCESS;
123}

◆ findSegment()

Trk::TrackSegment * InDet::TRT_TrackExtensionTool_xk::findSegment ( const EventContext & ctx,
const Trk::TrackParameters * par,
InDet::ITRT_TrackExtensionTool::IEventData & virt_event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 308 of file TRT_TrackExtensionTool_xk.cxx.

312{
313 InDet::TRT_TrackExtensionTool_xk::EventData &
315
316 int nCut = m_minNumberDCs;
317 if(m_parameterization) {nCut = m_selectortool->minNumberDCs(par);
318 if(nCut<m_minNumberDCs) nCut=m_minNumberDCs;}
319
320 // Get AtlasFieldCache
321 MagField::AtlasFieldCache fieldCache;
322
323 SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCondObjInputKey, ctx};
324 const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
325 if (fieldCondObj == nullptr) {
326 ATH_MSG_ERROR("InDet::TRT_TrackExtensionTool_xk::findSegment: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
327 return nullptr;
328 }
329 fieldCondObj->getInitializedCache (fieldCache);
330
331 // TRT detector elements road builder
332 //
333 const std::vector<const InDetDD::TRT_BaseElement*>& detectorElements =
334 m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum,
335 used);
336
337 if(int(detectorElements.size())< nCut) return nullptr;
338
339 // Array pointers to surface preparation
340 //
341 auto surfaces =vectorOfSurfacesFromVectorOfElements(detectorElements);
342
343 // Global position on surfaces production
344 //
345 Trk::PatternTrackParameters Tp;
346 if(!Tp.production(par)) return nullptr;
347 std::vector< std::pair<Amg::Vector3D,double> > gpos;
348 m_proptool->globalPositions(ctx, Tp, surfaces, gpos, m_fieldprop);
349
350 // Initiate trajectory
351 //
352 event_data.m_trajectory.initiateForTRTSeed(gpos,detectorElements,event_data.m_trtcontainer,Tp);
353 if(event_data.m_trajectory.naElements() < nCut) return nullptr;
354 event_data.m_maxslope = .0002 ;
355 if(event_data.m_trajectory.isFirstElementBarrel()) {
357 else event_data.m_trajectory.trackFindingWithoutDriftTime(event_data.m_maxslope);
358 if(!event_data.m_trajectory.searchStartStop()) {return nullptr;}
359 } else {
361 if(!event_data.m_trajectory.searchStartStop()) { return nullptr;}
362 event_data.m_trajectory.radiusCorrection();
364 else event_data.m_trajectory.trackFindingWithoutDriftTimeBL(event_data.m_maxslope);
365 if(!event_data.m_trajectory.searchStartStop()) { return nullptr;}
366 }
367
368 // Track associate with clusters and holes
369 //
371 event_data.m_maxslope = m_maxslope;
372
373 // Trajectory quality test
374 //
375 int nc = event_data.m_trajectory.nclusters();
376 int nh = event_data.m_trajectory.nholes ();
377 if( nc < nCut || (1000*nc) < (700*(nc+nh)) ) return nullptr;
378
379 if (m_segmentFindMode==0) {
381 return nullptr;
382 }
383 else if(m_segmentFindMode==1) {
385 return nullptr;
386 }
387 else if(m_segmentFindMode==2) {
389 return nullptr;
390 }
391 else {
392 if(!event_data.m_trajectory.fitter())
393 return nullptr;
394 }
395
396 if(event_data.m_trajectory.nclusters() < nCut) return nullptr;
397
398 // Trk::TrackSegment production
399 //
400 return event_data.m_trajectory.convert();
401}
#define ATH_MSG_ERROR(x)
static Double_t Tp(Double_t *t, Double_t *par)
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
ToolHandle< ITrtDriftCircleCutTool > m_selectortool
const int & naElements() const
void trackFindingWithoutDriftTimeBL(double)
bool trackParametersEstimationForFirstPointWithVertexConstraint()
const int & nclusters() const
bool trackParametersEstimationForPerigeeWithVertexConstraint()
const int & nholes() const
void initiateForTRTSeed(std::vector< std::pair< Amg::Vector3D, double > > &, const std::vector< const InDetDD::TRT_BaseElement * > &, const TRT_DriftCircleContainer *&, const Trk::PatternTrackParameters &)
@ alongMomentum

◆ initialize()

StatusCode InDet::TRT_TrackExtensionTool_xk::initialize ( )
overridevirtual

Definition at line 62 of file TRT_TrackExtensionTool_xk.cxx.

63{
64
65 // Get magnetic field service
66 //
67 if(m_fieldmode != "NoField" ) {
68 ATH_CHECK( m_fieldCondObjInputKey.initialize());
69 }
70
71 if (m_fieldmode == "NoField" ) m_fieldprop = Trk::MagneticFieldProperties(Trk::NoField );
72 else if(m_fieldmode == "MapSolenoid") m_fieldprop = Trk::MagneticFieldProperties(Trk::FastField);
73 else m_fieldprop = Trk::MagneticFieldProperties(Trk::FullField);
74
75 // Get RIO_OnTrack creator with drift time information
76 //
77 ATH_CHECK(m_riontrackD.retrieve());
78 ATH_MSG_DEBUG("Retrieved tool " << m_riontrackD);
79
80 // Get RIO_OnTrack creator without drift time information
81 //
82 ATH_CHECK(m_riontrackN.retrieve());
83 ATH_MSG_DEBUG("Retrieved tool " << m_riontrackN ) ;
84
85 // Get detector elements road maker tool
86 //
87 ATH_CHECK(m_roadtool.retrieve());
88 ATH_MSG_DEBUG("Retrieved tool " << m_roadtool);
89
90 // Get propagator tool
91 //
92 ATH_CHECK(m_proptool.retrieve());
93 ATH_MSG_DEBUG("Retrieved tool " << m_proptool);
94
95 // Get updator tool
96 //
97 ATH_CHECK(m_updatortool.retrieve());
98 ATH_MSG_DEBUG("Retrieved tool " << m_updatortool);
99
100 // Get segment selector tool
101 //
102 ATH_CHECK(m_selectortool.retrieve(DisableTool { !m_parameterization } ));
103
104 // TRT
105 ATH_CHECK(detStore()->retrieve(m_trtid,"TRT_ID"));
106
107 //Initialize container
108 ATH_CHECK(m_trtname.initialize());
109
110 // Get output print level
111 //
112 m_outputlevel = msg().level()-MSG::DEBUG;
113 return StatusCode::SUCCESS;
114}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
MsgStream & msg() const
@ FastField
call the fast field access method of the FieldSvc
@ NoField
Field is set to 0., 0., 0.,.
@ FullField
Field is set to be realistic, but within a given Volume.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & InDet::ITRT_TrackExtensionTool::interfaceID ( )
inlinestaticinherited

Definition at line 116 of file ITRT_TrackExtensionTool.h.

117 {
119 }
static const InterfaceID IID_ITRT_TrackExtensionTool("InDet::ITRT_TrackExtensionTool", 1, 0)

◆ isGoodExtension()

bool InDet::TRT_TrackExtensionTool_xk::isGoodExtension ( const EventContext & ctx,
const Trk::TrackParameters * par,
InDet::TRT_TrackExtensionTool_xk::EventData & event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
protected

Definition at line 408 of file TRT_TrackExtensionTool_xk.cxx.

412{
413 // Get AtlasFieldCache
414 MagField::AtlasFieldCache fieldCache;
415
416 SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCondObjInputKey, ctx};
417 const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
418 if (fieldCondObj == nullptr) {
419 ATH_MSG_ERROR("InDet::TRT_TrackExtensionTool_xk::findSegment: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
420 return false;
421 }
422 fieldCondObj->getInitializedCache (fieldCache);
423 // TRT detector elements road builder
424 //
425 const std::vector<const InDetDD::TRT_BaseElement*>& detectorElements =
426 m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum, used);
427 if (int(detectorElements.size()) < m_minNumberDCs)
428 return false;
429 // Array pointers to surface preparation
430 //
431 auto surfaces = vectorOfSurfacesFromVectorOfElements(detectorElements);
432
433 // Global position on surfaces production
434 //
435 Trk::PatternTrackParameters Tp;
436 if(!Tp.production(par)) return false;
437 std::vector< std::pair<Amg::Vector3D,double> > gpos;
438 m_proptool->globalPositions(ctx, Tp,surfaces,gpos,m_fieldprop);
439
440 // Initiate trajectory
441 //
442
443 event_data.m_trajectory.initiateForPrecisionSeed(gpos,detectorElements,event_data.m_trtcontainer,Tp);
444 if(event_data.m_trajectory.naElements() < m_minNumberDCs) return false;
445
446 // Track finding
447 //
449 else event_data.m_trajectory.trackFindingWithoutDriftTime(event_data.m_maxslope);
450
451 // Track associate with clusters and holes
452 //
454
455 // Final test quality
456 //
457 return event_data.m_trajectory.nclusters() >= m_minNumberDCs;
458}
void initiateForPrecisionSeed(std::vector< std::pair< Amg::Vector3D, double > > &, const std::vector< const InDetDD::TRT_BaseElement * > &, const TRT_DriftCircleContainer *&, const Trk::PatternTrackParameters &)

◆ magneticFieldInit() [1/2]

void InDet::TRT_TrackExtensionTool_xk::magneticFieldInit ( )
protected

◆ magneticFieldInit() [2/2]

StatusCode InDet::TRT_TrackExtensionTool_xk::magneticFieldInit ( IOVSVC_CALLBACK_ARGS )
protected

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ newEvent()

std::unique_ptr< InDet::ITRT_TrackExtensionTool::IEventData > InDet::TRT_TrackExtensionTool_xk::newEvent ( const EventContext & ctx) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 210 of file TRT_TrackExtensionTool_xk.cxx.

211{
212 SG::ReadHandle<TRT_DriftCircleContainer> trtcontainer(m_trtname, ctx);
213
214 if((not trtcontainer.isValid()) && m_outputlevel<=0) {
215 std::stringstream msg;
216 msg << "Missing TRT_DriftCircleContainer " << m_trtname.key();
217 throw std::runtime_error( msg.str() );
218 }
219
220 // Get AtlasFieldCache
221 MagField::AtlasFieldCache fieldCache;
222
223 SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCondObjInputKey, ctx};
224 const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
225 if (fieldCondObj == nullptr) {
226 ATH_MSG_ERROR("InDet::TRT_TrackExtensionTool_xk::findSegment: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
227 return nullptr;
228 }
229 fieldCondObj->getInitializedCache (fieldCache);
230
231 Trk::MagneticFieldProperties fieldprop = ( fieldCache.solenoidOn()
233 : Trk::MagneticFieldProperties(Trk::NoField ));
234
235 auto event_data = std::make_unique<EventData>(EventData(trtcontainer.cptr(), m_maxslope));
236 event_data->m_trajectory.set(fieldprop, fieldCondObj);
237 event_data->m_trajectory.set (m_trtid,
238 m_proptool.get(),
239 m_updatortool.get(),
240 m_riontrackD.get(),
241 m_riontrackN.get(),
244 m_impact,
247 event_data->m_measurement.reserve(200);
248 return event_data;
249}
bool solenoidOn() const
status of the magnets

◆ newTrack()

Trk::Track * InDet::TRT_TrackExtensionTool_xk::newTrack ( const EventContext & ctx,
const Trk::Track & Tr,
InDet::ITRT_TrackExtensionTool::IEventData & virt_event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap & used ) const
overridevirtual

Implements InDet::ITRT_TrackExtensionTool.

Definition at line 466 of file TRT_TrackExtensionTool_xk.cxx.

470{
471 InDet::TRT_TrackExtensionTool_xk::EventData &
473
474 const Trk::TrackStates* tsos = Tr.trackStateOnSurfaces();
475
476 // Test conditions to start track extension to TRT
477 //
478 const Trk::TrackParameters* pe = tsos->back()->trackParameters();
479 if(!pe) return nullptr;
480 if(!pe->covariance()) return nullptr;
481 const Trk::TrackParameters* pb = tsos->front()->trackParameters();
482 if(!pb) return nullptr;
483 if(!pb->covariance()) return nullptr;
484
485 // Number PIX and SCT clusters cuts
486 //
487 if(!numberPIXandSCTclustersCut(Tr)) return nullptr;
488
489 // Test possibility extend track and new track production
490 //
491 if(isGoodExtension(ctx, pe,event_data,used)) return event_data.m_trajectory.convert(Tr);
492 return nullptr;
493}
bool numberPIXandSCTclustersCut(const Trk::Track &) const

◆ numberPIXandSCTclustersCut()

bool InDet::TRT_TrackExtensionTool_xk::numberPIXandSCTclustersCut ( const Trk::Track & Tr) const
protected

Definition at line 500 of file TRT_TrackExtensionTool_xk.cxx.

501{
502 if(m_minNumberSCT <=0 && m_minNumberPIX <=0) return true;
503 const Trk::TrackStates*tsos = Tr.trackStateOnSurfaces();
504 Trk::TrackStates::const_iterator s = tsos->begin(), se = tsos->end();
505 int npix = 0;
506 int nsct = 0;
507 for(; s!=se; ++s) {
509 const Trk::MeasurementBase* mb = (*s)->measurementOnTrack();
510 if(!mb) continue;
511 const Trk::RIO_OnTrack* ri = dynamic_cast<const Trk::RIO_OnTrack*>(mb);
512 if(!ri) continue;
513 const Trk::PrepRawData* rd = ri->prepRawData();
514 if(!rd) continue;
515 const InDet::SiCluster* si = dynamic_cast<const InDet::SiCluster*>(rd);
516 if(si) {
517 if(dynamic_cast<const InDet::SCT_Cluster*>(si)) ++nsct;
518 else ++npix;
519 }
520 else return false;
521 }
522 }
523 return npix >= m_minNumberPIX && nsct >= m_minNumberSCT;
524}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fieldCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> InDet::TRT_TrackExtensionTool_xk::m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
protected

Definition at line 146 of file TRT_TrackExtensionTool_xk.h.

146{this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};

◆ m_fieldmode

StringProperty InDet::TRT_TrackExtensionTool_xk::m_fieldmode
protected
Initial value:
{this, "MagneticFieldMode", "MapSolenoid",
"Mode of magnetic field"}

Definition at line 171 of file TRT_TrackExtensionTool_xk.h.

171 {this, "MagneticFieldMode", "MapSolenoid",
172 "Mode of magnetic field"};

◆ m_fieldprop

Trk::MagneticFieldProperties InDet::TRT_TrackExtensionTool_xk::m_fieldprop
protected

Definition at line 174 of file TRT_TrackExtensionTool_xk.h.

◆ m_impact

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_impact
protected
Initial value:
{this, "maxImpactParameter", 50,
"max impact parameter"}

Definition at line 163 of file TRT_TrackExtensionTool_xk.h.

163 {this, "maxImpactParameter", 50,
164 "max impact parameter"};

◆ m_maxslope

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_maxslope {this, "Maxslope", .00005}
protected

Definition at line 160 of file TRT_TrackExtensionTool_xk.h.

160{this, "Maxslope", .00005};

◆ m_minNumberDCs

IntegerProperty InDet::TRT_TrackExtensionTool_xk::m_minNumberDCs
protected
Initial value:
{this, "MinNumberDriftCircles", 9,
"Min. number of DriftCircles"}

Definition at line 152 of file TRT_TrackExtensionTool_xk.h.

152 {this, "MinNumberDriftCircles", 9,
153 "Min. number of DriftCircles"};

◆ m_minNumberPIX

IntegerProperty InDet::TRT_TrackExtensionTool_xk::m_minNumberPIX
protected
Initial value:
{this, "MinNumberPIXclusters", 2,
"Min. number pixel clusters for extension"}

Definition at line 156 of file TRT_TrackExtensionTool_xk.h.

156 {this, "MinNumberPIXclusters", 2,
157 "Min. number pixel clusters for extension"};

◆ m_minNumberSCT

IntegerProperty InDet::TRT_TrackExtensionTool_xk::m_minNumberSCT
protected
Initial value:
{this, "MinNumberSCTclusters", 5,
"Min. number SCT clusters for extension"}

Definition at line 154 of file TRT_TrackExtensionTool_xk.h.

154 {this, "MinNumberSCTclusters", 5,
155 "Min. number SCT clusters for extension"};

◆ m_minTRTSegmentpT

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_minTRTSegmentpT
protected
Initial value:
{this, "minTRTSegmentpT", 300.,
"Min pT cut required for TRT Segments"}

Definition at line 177 of file TRT_TrackExtensionTool_xk.h.

177 {this, "minTRTSegmentpT", 300.,
178 "Min pT cut required for TRT Segments"};

◆ m_outputlevel

int InDet::TRT_TrackExtensionTool_xk::m_outputlevel {}
protected

Definition at line 148 of file TRT_TrackExtensionTool_xk.h.

148{} ; // Print level

◆ m_parameterization

BooleanProperty InDet::TRT_TrackExtensionTool_xk::m_parameterization
protected
Initial value:
{this, "UseParameterization", true,
"Use table of min number DCs"}

Definition at line 167 of file TRT_TrackExtensionTool_xk.h.

167 {this, "UseParameterization", true,
168 "Use table of min number DCs"};

◆ m_proptool

PublicToolHandle<Trk::IPatternParametersPropagator> InDet::TRT_TrackExtensionTool_xk::m_proptool {this, "PropagatorTool", "Trk::RungeKuttaPropagator"}
protected

Definition at line 135 of file TRT_TrackExtensionTool_xk.h.

136{this, "PropagatorTool", "Trk::RungeKuttaPropagator"};

◆ m_riontrackD

ToolHandle<Trk::IRIO_OnTrackCreator> InDet::TRT_TrackExtensionTool_xk::m_riontrackD {this, "RIOonTrackToolYesDr", "InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool"}
protected

Definition at line 141 of file TRT_TrackExtensionTool_xk.h.

142{this, "RIOonTrackToolYesDr", "InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool"};

◆ m_riontrackN

ToolHandle<Trk::IRIO_OnTrackCreator> InDet::TRT_TrackExtensionTool_xk::m_riontrackN {this, "RIOonTrackToolNoDr", "InDet::TRT_DriftCircleOnTrackNoDriftTimeTool/TRT_DriftCircleOnTrackNoDriftTimeTool"}
protected

Definition at line 143 of file TRT_TrackExtensionTool_xk.h.

144{this, "RIOonTrackToolNoDr", "InDet::TRT_DriftCircleOnTrackNoDriftTimeTool/TRT_DriftCircleOnTrackNoDriftTimeTool"};

◆ m_roadtool

ToolHandle<ITRT_DetElementsRoadMaker> InDet::TRT_TrackExtensionTool_xk::m_roadtool {this, "RoadTool", "InDet::TRT_DetElementsRoadMaker_xk"}
protected

Definition at line 133 of file TRT_TrackExtensionTool_xk.h.

134{this, "RoadTool", "InDet::TRT_DetElementsRoadMaker_xk"}; // TRT road maker tool

◆ m_roadwidth

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_roadwidth
protected
Initial value:
{this, "RoadWidth", 10.,
"Max width of the road"}

Definition at line 158 of file TRT_TrackExtensionTool_xk.h.

158 {this, "RoadWidth", 10.,
159 "Max width of the road"};

◆ m_scale_error

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_scale_error
protected
Initial value:
{this, "ScaleHitUncertainty", 2.,
"Scalefactor for hit uncertainty"}

Definition at line 169 of file TRT_TrackExtensionTool_xk.h.

169 {this, "ScaleHitUncertainty", 2.,
170 "Scalefactor for hit uncertainty"};

◆ m_segmentFindMode

IntegerProperty InDet::TRT_TrackExtensionTool_xk::m_segmentFindMode
protected
Initial value:
{this, "SegmentFindMode", 3,
"Method of segment find"}

Definition at line 150 of file TRT_TrackExtensionTool_xk.h.

150 {this, "SegmentFindMode", 3,
151 "Method of segment find"};

◆ m_selectortool

ToolHandle<ITrtDriftCircleCutTool> InDet::TRT_TrackExtensionTool_xk::m_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
protected

Definition at line 139 of file TRT_TrackExtensionTool_xk.h.

140{this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"};// Segment selector tool

◆ m_trtid

const TRT_ID* InDet::TRT_TrackExtensionTool_xk::m_trtid {}
protected

Definition at line 132 of file TRT_TrackExtensionTool_xk.h.

132{};

◆ m_trtname

SG::ReadHandleKey<TRT_DriftCircleContainer> InDet::TRT_TrackExtensionTool_xk::m_trtname {this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve TRT_DriftCircleContainer"}
protected

Definition at line 175 of file TRT_TrackExtensionTool_xk.h.

175{this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve TRT_DriftCircleContainer"};

◆ m_updatortool

PublicToolHandle<Trk::IPatternParametersUpdator> InDet::TRT_TrackExtensionTool_xk::m_updatortool {this, "UpdatorTool", "Trk::KalmanUpdator_xk"}
protected

Definition at line 137 of file TRT_TrackExtensionTool_xk.h.

138{this, "UpdatorTool", "Trk::KalmanUpdator_xk"};

◆ m_usedriftrad

BooleanProperty InDet::TRT_TrackExtensionTool_xk::m_usedriftrad
protected
Initial value:
{this, "UseDriftRadius", true,
"Use drift time ?"}

Definition at line 165 of file TRT_TrackExtensionTool_xk.h.

165 {this, "UseDriftRadius", true,
166 "Use drift time ?"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zVertexWidth

DoubleProperty InDet::TRT_TrackExtensionTool_xk::m_zVertexWidth
protected
Initial value:
{this, "ZVertexHalfWidth", 150.,
"Z-vertex half width"}

Definition at line 161 of file TRT_TrackExtensionTool_xk.h.

161 {this, "ZVertexHalfWidth", 150.,
162 "Z-vertex half width"};

The documentation for this class was generated from the following files: