ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::TruthTrackBuilder Class Reference

#include <TruthTrackBuilder.h>

Inheritance diagram for Trk::TruthTrackBuilder:
Collaboration diagram for Trk::TruthTrackBuilder:

Public Member Functions

 TruthTrackBuilder (const std::string &t, const std::string &n, const IInterface *p)
 Constructor. More...
 
StatusCode initialize ()
 
StatusCode finalize ()
 
TrackcreateTrack (const PRD_TruthTrajectory &prdTraj, SegmentCollection *segs=0) const
 return a map of GenParticles to PRDs for further processing More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< ITrackFitterm_trackFitter {this, "TrackFitter", ""}
 fits the PRDs More...
 
ToolHandle< IExtrapolatorm_extrapolator {this, "ExtrapolationTool", ""}
 extrapolator More...
 
ToolHandle< IRIO_OnTrackCreatorm_rotcreator {this, "RotCreatorTool", ""}
 
ToolHandle< IRIO_OnTrackCreatorm_rotcreatorbroad {this, "BroadRotCreatorTool", ""}
 
const AtlasDetectorIDm_DetID
 
ServiceHandle< IPartPropSvc > m_particlePropSvc
 Pointer to the particle properties svc *‍/
More...
 
const HepPDT::ParticleDataTable * m_particleDataTable
 ParticleDataTable needed to get connection pdg_code <-> charge *‍/. More...
 
Gaudi::Property< size_t > m_minNdof {this, "MinDegreesOfFreedom", 6}
 checks min degrees of freedom if bigger -1 More...
 
Gaudi::Property< bool > m_onlyPrimaries {this, "OnlyPrimaries", false}
 restrict track creation to primaries More...
 
Gaudi::Property< unsigned int > m_minSiHits {this, "MinSiHits", 7}
 min number of Si hits for refit More...
 
Gaudi::Property< unsigned int > m_minSiHitsForward {this, "MinSiHitsForward", 7}
 min number of Si hits for refit in forward region (ITk specific) More...
 
Gaudi::Property< float > m_forwardBoundary {this, "ForwardBoundary", 2.5}
 Boundary eta value defining the forward region. More...
 
Gaudi::Property< int > m_matEffects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 41 of file TruthTrackBuilder.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

◆ TruthTrackBuilder()

Trk::TruthTrackBuilder::TruthTrackBuilder ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor.

Definition at line 29 of file TruthTrackBuilder.cxx.

29  :
30  AthAlgTool(t,n,p),
31  m_DetID(nullptr),
32  m_particlePropSvc("PartPropSvc",n),
33  m_particleDataTable(nullptr)
34 {
35  declareInterface<Trk::ITruthTrackBuilder>(this);
36 }

Member Function Documentation

◆ createTrack()

Trk::Track * Trk::TruthTrackBuilder::createTrack ( const PRD_TruthTrajectory prdTraj,
SegmentCollection segs = 0 
) const
virtual

return a map of GenParticles to PRDs for further processing

< get the charge via the particle table ...

<

Todo:
: if we need a dedicated electron fitter is has to go in here !

< Refit a second time to add TRT hits

Implements Trk::ITruthTrackBuilder.

Definition at line 96 of file TruthTrackBuilder.cxx.

97 {
98  const EventContext& ctx = Gaudi::Hive::currentContext();
99  if( segs != nullptr ){
100  ATH_MSG_WARNING("Requested to fill segment collection but mode not implemented");
101  }
102  ATH_MSG_VERBOSE("The PRD Truth trajectory contains " << prdTraj.prds.size() << " PRDs.");
103 
104  // get the associated GenParticle
105  auto genPart = prdTraj.genParticle;
106  if (!genPart) {
107  ATH_MSG_WARNING("No GenParticle associated to this PRD_TruthTrajectory. Ignoring track creation.");
108  return nullptr;
109  }
110  ATH_MSG_VERBOSE("Got PRD Truth trajectory with " << prdTraj.nDoF << " degrees of freedom.");
111  // check min degrees of freedom
112  if ( m_minNdof > 0 && prdTraj.nDoF < m_minNdof) return nullptr;
113  // get the startPosition : math library madness as usual
114  Amg::Vector3D startPos = genPart->production_vertex() ?
115  Amg::Vector3D(genPart->production_vertex()->position().x(),
116  genPart->production_vertex()->position().y(),
117  genPart->production_vertex()->position().z()) : Amg::Vector3D(0.,0.,0.);
118  Amg::Vector3D startMom(genPart->momentum().x(),
119  genPart->momentum().y(),
120  genPart->momentum().z());
122 
123  int pdgCode = genPart->pdg_id();
124  // get the charge: ap->charge() is used later, DOES NOT WORK RIGHT NOW
125  const HepPDT::ParticleData* ap = m_particleDataTable->particle(std::abs(pdgCode));
126  double charge = 1.;
127  if (ap) charge = ap->charge();
128  // since the PDT table only has abs(PID) values for the charge
129  charge *= (pdgCode > 0.) ? 1. : -1.;
130 
131  // ----------------------- get teh PRDS and start
132  const std::vector<const Trk::PrepRawData*> & clusters = prdTraj.prds;
133  // nominal 0,0,0 position for track fit seeding
134  Trk::PerigeeSurface persurf;
135  Trk::CurvilinearParameters startParams(startPos,startMom,charge);
136  //minimal conversion; ideally the extrapolator would return a unique_ptr
137  auto per = std::unique_ptr<Trk::TrackParameters>(
138  m_extrapolator->extrapolate(ctx,
139  startParams,
140  persurf,
142  false,
144  if (!per) {
145  ATH_MSG_DEBUG("Perigee creation for genParticle start position failed. "
146  "Skipping track creation.");
147  return nullptr;
148  }
149  // first TrackStateOnSurface is the Perigee
150  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
151  typePattern.set(Trk::TrackStateOnSurface::Perigee);
152 
153  const Trk::TrackStateOnSurface *pertsos=new Trk::TrackStateOnSurface(nullptr,std::move(per),nullptr,typePattern);
154  auto traj = std::make_unique<Trk::TrackStates>();
155  traj->push_back(pertsos);
156 
157 
158 
159  std::unique_ptr<const Trk::TrackParameters> prevpar(startParams.uniqueClone());
160  // First create a Trk::Track object 'traj' that will go into the fitter for refitting
161  int i=0;
162  for ( ;i<(int)clusters.size();i++){
163  if (m_DetID->is_trt(clusters[i]->identify())) break;
164  const Trk::Surface &surf=clusters[i]->detectorElement()->surface(clusters[i]->identify());
165  if (surf==prevpar->associatedSurface()) continue;
166  bool ispixel=false;
167  if (m_DetID->is_pixel(clusters[i]->identify())) ispixel=true;
168 
169  auto thispar = std::unique_ptr<const Trk::TrackParameters>(
170  m_extrapolator->extrapolate(ctx,
171  *prevpar,
172  surf,
174  false,
176  if (!thispar)
177  break;
178  if (!surf.insideBounds(thispar->localPosition(),20*Gaudi::Units::mm,50*Gaudi::Units::mm)) {
179  continue;
180  }
181  AmgVector(5) params=thispar->parameters();
182  params[Trk::loc1]=clusters[i]->localPosition().x();
183  if (ispixel) params[Trk::loc2]=clusters[i]->localPosition().y();
184  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
185  typePattern.set(Trk::TrackStateOnSurface::Measurement);
186  std::unique_ptr<Trk::RIO_OnTrack> rot{m_rotcreator->correct(*clusters[i],*thispar,ctx)};
187  if (!rot) {
188  continue;
189  }
190  // create the ROTs for the reference trajectory
191  const Trk::TrackStateOnSurface *tsos=new Trk::TrackStateOnSurface(std::move(rot),thispar->uniqueClone(),nullptr,typePattern);
192  traj->push_back(tsos);
193  prevpar=std::move(thispar);
194  }
195  // this is the reference trajectory to be refitted
197  Trk::Track track(info, std::move(traj), nullptr);
198  if (/* ndof<0 */ (track.measurementsOnTrack()->size() < m_minSiHits &&
199  std::abs(genPart->momentum().eta()) <= m_forwardBoundary) ||
200  (track.measurementsOnTrack()->size() < m_minSiHitsForward &&
201  std::abs(genPart->momentum().eta()) > m_forwardBoundary) ||
204  "Track does not fulfill requirements for refitting. Skipping it.");
205  return nullptr;
206  }
207  // choose the material effects
209 
210  // create the refitted track
211  //
212  //
213  //
215 
216  Trk::Track *refittedtrack=(m_trackFitter->fit(Gaudi::Hive::currentContext(),track,false,materialInteractions)).release();
217 
219  Trk::Track *refittedtrack2=nullptr;
220  if (refittedtrack && (int)clusters.size()-i>=9){
221 
222  //owner of measurements so they get cleaned up automatically if needs be
223  std::vector<std::unique_ptr<MeasurementBase>> meassetOwn;
224  //vector of plain ptr to the owned ones acts as a "view"
225  Trk::MeasurementSet measset;
226 
227  std::unique_ptr<const Trk::TrackParameters> prevpar(refittedtrack->trackParameters()->back()->uniqueClone());
228  for (;i<(int)clusters.size();i++) {
229  const Trk::Surface *surf=&clusters[i]->detectorElement()->surface(clusters[i]->identify());
230  std::unique_ptr<const Trk::TrackParameters> thispar(m_extrapolator->extrapolate(ctx,*prevpar,*surf,Trk::alongMomentum,false,Trk::nonInteracting));
231  if (!thispar) break;
232  Trk::RIO_OnTrack *rot=m_rotcreatorbroad->correct(*clusters[i],*thispar,ctx);
233 
234  if (rot) {
235  meassetOwn.emplace_back(rot);
236  measset.push_back(meassetOwn.back().get());
237  }
238  prevpar=std::move(thispar);
239  }
240 
241  refittedtrack2=(m_trackFitter->fit(Gaudi::Hive::currentContext(),*refittedtrack,measset,false,materialInteractions)).release();
242 
243  if (!refittedtrack2){
244  auto traj2 = std::make_unique<Trk::TrackStates>();
245  for (const Trk::TrackStateOnSurface *j : *refittedtrack->trackStateOnSurfaces()) traj2->push_back(new Trk::TrackStateOnSurface(*j));
246  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern2;
247  typePattern2.set(Trk::TrackStateOnSurface::Outlier);
248  //measset needs to be unique_ptr before progress further
249  for (auto & j : meassetOwn) {
250  traj2->push_back(new Trk::TrackStateOnSurface(
251  std::move(j),
252  nullptr,
253  nullptr,
254  typePattern2));
255  }
256  refittedtrack2 = new Trk::Track(refittedtrack->info(),
257  std::move(traj2),
258  refittedtrack->fitQuality()->uniqueClone());
259  }
260  } else if(!refittedtrack){
261  ATH_MSG_VERBOSE("Track fit of truth trajectory NOT successful, NO track created. ");
262  return nullptr;
263  }
264 
265  if (refittedtrack2) delete refittedtrack;
266  if (!refittedtrack2 && refittedtrack) refittedtrack2=refittedtrack;
267 
268  //
269  ATH_MSG_DEBUG("Track fit of truth trajectory successful, track created. ");
270  // return what you have
271  // Before returning, fix the creator
272  if (refittedtrack2){
274  }
275  return refittedtrack2;
276 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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 Trk::TruthTrackBuilder::finalize ( )

Definition at line 89 of file TruthTrackBuilder.cxx.

90 {
91  ATH_MSG_VERBOSE("Finalizing ...");
92  return StatusCode::SUCCESS;
93 }

◆ initialize()

StatusCode Trk::TruthTrackBuilder::initialize ( )

Definition at line 40 of file TruthTrackBuilder.cxx.

41 {
42  ATH_MSG_VERBOSE("Initializing ...");
43  if (m_rotcreator.retrieve().isFailure()) {
44  msg(MSG::FATAL) << "Could not get " << m_rotcreator.type() << endmsg;
45  return StatusCode::FAILURE;
46  }
47 
48  if (m_rotcreatorbroad.retrieve().isFailure()) {
49  msg(MSG::FATAL) << "Could not get " << m_rotcreatorbroad.type() << endmsg;
50  return StatusCode::FAILURE;
51  }
52 
53  // track fitter
54  if (m_trackFitter.retrieve().isFailure()){
55  ATH_MSG_ERROR("Could not retrieve " << m_trackFitter << ". Aborting ...");
56  return StatusCode::FAILURE;
57  }
58 
59  // extrapolator
60  if (m_extrapolator.retrieve().isFailure()){
61  ATH_MSG_ERROR("Could not retrieve " << m_extrapolator << ". Aborting ...");
62  return StatusCode::FAILURE;
63  }
64 
65  // particle property service
66  if (m_particlePropSvc.retrieve().isFailure())
67  {
68  ATH_MSG_ERROR("Can not retrieve " << m_particlePropSvc << " . Aborting ... " );
69  return StatusCode::FAILURE;
70  }
71 
72  // and the particle data table
74  if (m_particleDataTable==nullptr)
75  {
76  ATH_MSG_ERROR( "Could not get ParticleDataTable! Cannot associate pdg code with charge. Aborting. " );
77  return StatusCode::FAILURE;
78  }
79 
80  // need an Atlas id-helper to identify sub-detectors, take the one from detStore
81  if (detStore()->retrieve(m_DetID, "AtlasID").isFailure()) {
82  ATH_MSG_ERROR ("Could not get AtlasDetectorID helper" );
83  return StatusCode::FAILURE;
84  }
85  return StatusCode::SUCCESS;
86 }

◆ 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()

static const InterfaceID& Trk::ITruthTrackBuilder::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 39 of file ITruthTrackBuilder.h.

39 { return IID_ITruthTrackBuilder; }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_DetID

const AtlasDetectorID* Trk::TruthTrackBuilder::m_DetID
private

Definition at line 60 of file TruthTrackBuilder.h.

◆ 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_extrapolator

ToolHandle<IExtrapolator> Trk::TruthTrackBuilder::m_extrapolator {this, "ExtrapolationTool", ""}
private

extrapolator

Definition at line 56 of file TruthTrackBuilder.h.

◆ m_forwardBoundary

Gaudi::Property<float> Trk::TruthTrackBuilder::m_forwardBoundary {this, "ForwardBoundary", 2.5}
private

Boundary eta value defining the forward region.

Definition at line 68 of file TruthTrackBuilder.h.

◆ m_matEffects

Gaudi::Property<int> Trk::TruthTrackBuilder::m_matEffects
private
Initial value:
{this, "MatEffects", 3,
"Type of material interaction in extrapolation (Default Pion)"}

Definition at line 70 of file TruthTrackBuilder.h.

◆ m_minNdof

Gaudi::Property<size_t> Trk::TruthTrackBuilder::m_minNdof {this, "MinDegreesOfFreedom", 6}
private

checks min degrees of freedom if bigger -1

Definition at line 64 of file TruthTrackBuilder.h.

◆ m_minSiHits

Gaudi::Property<unsigned int> Trk::TruthTrackBuilder::m_minSiHits {this, "MinSiHits", 7}
private

min number of Si hits for refit

Definition at line 66 of file TruthTrackBuilder.h.

◆ m_minSiHitsForward

Gaudi::Property<unsigned int> Trk::TruthTrackBuilder::m_minSiHitsForward {this, "MinSiHitsForward", 7}
private

min number of Si hits for refit in forward region (ITk specific)

Definition at line 67 of file TruthTrackBuilder.h.

◆ m_onlyPrimaries

Gaudi::Property<bool> Trk::TruthTrackBuilder::m_onlyPrimaries {this, "OnlyPrimaries", false}
private

restrict track creation to primaries

Definition at line 65 of file TruthTrackBuilder.h.

◆ m_particleDataTable

const HepPDT::ParticleDataTable* Trk::TruthTrackBuilder::m_particleDataTable
private

ParticleDataTable needed to get connection pdg_code <-> charge *‍/.

Definition at line 62 of file TruthTrackBuilder.h.

◆ m_particlePropSvc

ServiceHandle<IPartPropSvc> Trk::TruthTrackBuilder::m_particlePropSvc
private

Pointer to the particle properties svc *‍/

Definition at line 61 of file TruthTrackBuilder.h.

◆ m_rotcreator

ToolHandle< IRIO_OnTrackCreator > Trk::TruthTrackBuilder::m_rotcreator {this, "RotCreatorTool", ""}
private

Definition at line 57 of file TruthTrackBuilder.h.

◆ m_rotcreatorbroad

ToolHandle< IRIO_OnTrackCreator > Trk::TruthTrackBuilder::m_rotcreatorbroad {this, "BroadRotCreatorTool", ""}
private

Definition at line 58 of file TruthTrackBuilder.h.

◆ m_trackFitter

ToolHandle<ITrackFitter> Trk::TruthTrackBuilder::m_trackFitter {this, "TrackFitter", ""}
private

fits the PRDs

Definition at line 55 of file TruthTrackBuilder.h.

◆ 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.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
Trk::y
@ y
Definition: ParamDefs.h:56
Trk::TruthTrackBuilder::m_minSiHits
Gaudi::Property< unsigned int > m_minSiHits
min number of Si hits for refit
Definition: TruthTrackBuilder.h:66
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
Trk::TrackInfo::Pseudotracking
@ Pseudotracking
Pseudo-tracking flag.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:265
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::TruthTrackBuilder::m_forwardBoundary
Gaudi::Property< float > m_forwardBoundary
Boundary eta value defining the forward region.
Definition: TruthTrackBuilder.h:68
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::identify
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:35
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
Trk::TruthTrackBuilder::m_onlyPrimaries
Gaudi::Property< bool > m_onlyPrimaries
restrict track creation to primaries
Definition: TruthTrackBuilder.h:65
Trk::Measurement
@ Measurement
Definition: AlignResidualType.h:33
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:342
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::TruthTrackBuilder::m_extrapolator
ToolHandle< IExtrapolator > m_extrapolator
extrapolator
Definition: TruthTrackBuilder.h:56
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::TruthTrackBuilder::m_particlePropSvc
ServiceHandle< IPartPropSvc > m_particlePropSvc
Pointer to the particle properties svc *‍/
Definition: TruthTrackBuilder.h:61
Trk::TruthTrackBuilder::m_minSiHitsForward
Gaudi::Property< unsigned int > m_minSiHitsForward
min number of Si hits for refit in forward region (ITk specific)
Definition: TruthTrackBuilder.h:67
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
Trk::TruthTrackBuilder::m_minNdof
Gaudi::Property< size_t > m_minNdof
checks min degrees of freedom if bigger -1
Definition: TruthTrackBuilder.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::FitQuality::uniqueClone
std::unique_ptr< FitQuality > uniqueClone() const
NVI uniqueClone.
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
charge
double charge(const T &p)
Definition: AtlasPID.h:538
Trk::TruthTrackBuilder::m_particleDataTable
const HepPDT::ParticleDataTable * m_particleDataTable
ParticleDataTable needed to get connection pdg_code <-> charge *‍/.
Definition: TruthTrackBuilder.h:62
Trk::Surface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::TruthTrackBuilder::m_DetID
const AtlasDetectorID * m_DetID
Definition: TruthTrackBuilder.h:60
h
Trk::TruthTrackBuilder::m_rotcreator
ToolHandle< IRIO_OnTrackCreator > m_rotcreator
Definition: TruthTrackBuilder.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::TrackInfo::setPatternRecognitionInfo
void setPatternRecognitionInfo(const TrackPatternRecoInfo &patternReco)
Method setting the pattern recognition algorithm.
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
Trk::x
@ x
Definition: ParamDefs.h:55
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::TruthTrackBuilder::m_trackFitter
ToolHandle< ITrackFitter > m_trackFitter
fits the PRDs
Definition: TruthTrackBuilder.h:55
Trk::TruthTrackBuilder::m_matEffects
Gaudi::Property< int > m_matEffects
Definition: TruthTrackBuilder.h:70
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TruthTrackBuilder::m_rotcreatorbroad
ToolHandle< IRIO_OnTrackCreator > m_rotcreatorbroad
Definition: TruthTrackBuilder.h:58
fitman.k
k
Definition: fitman.py:528