ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HGTD::TrackTimeDefAndQualityAlg Class Reference

#include <TrackTimeDefAndQualityAlg.h>

Inheritance diagram for HGTD::TrackTimeDefAndQualityAlg:
Collaboration diagram for HGTD::TrackTimeDefAndQualityAlg:

Classes

struct  CleaningResult
 
struct  Hit
 

Public Member Functions

 TrackTimeDefAndQualityAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TrackTimeDefAndQualityAlg ()
 
virtual StatusCode initialize () override final
 
virtual StatusCode execute (const EventContext &ctx) const override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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 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, V, H > &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
 

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

std::pair< float, float > getRadiusAndZ (const xAOD::TrackParticle &track_particle) const
 
CleaningResult runTimeConsistencyCuts (const std::vector< float > &times, const std::vector< bool > &has_clusters, const std::vector< int > &hit_classification) const
 
std::array< Hit, s_hgtd_layers > getValidHits (const std::vector< float > &times, const std::vector< bool > &has_clusters, const std::vector< int > &hit_classification) const
 
float calculateChi2 (const std::array< Hit, s_hgtd_layers > &hits) const
 Calculates the chi2 of the hit times given their resolution. More...
 
bool passesDeltaT (const std::array< Hit, s_hgtd_layers > &hits) const
 Checks two hits for time compatibility. More...
 
float meanTime (const std::array< Hit, s_hgtd_layers > &hits) const
 Calculates the arithmetic mean of the valid hit times;. More...
 
float trackTimeResolution (const std::array< Hit, s_hgtd_layers > &hits) const
 Calculates the combined resolution. More...
 
short findLayerWithBadChi2 (std::array< Hit, s_hgtd_layers > hits) const
 Identifies time outliers by finding the layer within which a hit contributes negatively to the overall chi2 value and returns the layer number. More...
 
void setLayerAsInvalid (std::array< Hit, s_hgtd_layers > &hits, short layer) const
 Given a layer number, the hit sitting on this layer is flagged as invalid. More...
 
short getValidPattern (const std::array< Hit, s_hgtd_layers > &hits) const
 Returns the pattern of valid hits in HGTD as a 4-bit bitfield, where a 1 encodes that a valid hit was found, while a 0 means no valid hit found. More...
 
bool lastHitIsOnLastSurface (const xAOD::TrackParticle &track_particle) const
 Checks if the last hit on track was found on a pre-specified set of Pixel and Strip layers close to the HGTD surfaces. More...
 
const Trk::TrackParametersgetLastHitOnTrack (const Trk::Track &track) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const short m_recoed_ptrn_sft = 0
 
const short m_comp_ptrn_sft = 8
 
const short m_holes_ptrn_sft = 12
 
const short m_primes_ptrn_sft = 16
 
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackParticleContainerKey
 
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerHasExtensionKey
 
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterTimeKey
 
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterTruthClassKey
 
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_time_dec_key
 
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_time_res_dec_key
 
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_hasValidTime_dec_key
 
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_summarypattern_dec_key
 
Gaudi::Property< bool > m_doActs {this, "doActs", false}
 
FloatProperty m_chi2_threshold
 
FloatProperty m_deltat_cut
 
FloatProperty m_default_time
 
FloatProperty m_default_time_res
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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 57 of file TrackTimeDefAndQualityAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackTimeDefAndQualityAlg()

HGTD::TrackTimeDefAndQualityAlg::TrackTimeDefAndQualityAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 26 of file TrackTimeDefAndQualityAlg.cxx.

28  : AthReentrantAlgorithm(name, pSvcLocator) {}

◆ ~TrackTimeDefAndQualityAlg()

virtual HGTD::TrackTimeDefAndQualityAlg::~TrackTimeDefAndQualityAlg ( )
inlinevirtual

Definition at line 69 of file TrackTimeDefAndQualityAlg.h.

69 {}

Member Function Documentation

◆ calculateChi2()

float HGTD::TrackTimeDefAndQualityAlg::calculateChi2 ( const std::array< Hit, s_hgtd_layers > &  hits) const
private

Calculates the chi2 of the hit times given their resolution.

Parameters
[in]hitsArray of hits.
Returns
Chi2 value.

Definition at line 241 of file TrackTimeDefAndQualityAlg.cxx.

242  {
243 
244  float mean = meanTime(hits);
245 
246  float chi2 = 0.;
247  for (const auto& hit : hits) {
248  if (hit.m_isvalid) {
249  chi2 += (hit.m_time - mean) * (hit.m_time - mean) /
250  (hit.m_resolution * hit.m_resolution);
251  }
252  }
253  return chi2;
254 }

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::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  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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; }

◆ execute()

StatusCode HGTD::TrackTimeDefAndQualityAlg::execute ( const EventContext &  ctx) const
finaloverridevirtual

Definition at line 47 of file TrackTimeDefAndQualityAlg.cxx.

47  {
48 
49  SG::ReadHandle<xAOD::TrackParticleContainer> trk_ptkl_container_handle(
51  ATH_CHECK( trk_ptkl_container_handle.isValid() );
52  const xAOD::TrackParticleContainer* track_particles =
53  trk_ptkl_container_handle.cptr();
54  if (not track_particles) {
56  "[TrackTimeDefAndQualityAlg] TrackParticleContainer not found, "
57  "aborting execute!");
58  return StatusCode::FAILURE;
59  }
60 
62  m_time_dec_key, ctx);
64  m_time_res_dec_key, ctx);
69 
71  layerClusterTimeHandle(m_layerClusterTimeKey, ctx);
72  ATH_CHECK(layerClusterTimeHandle.isValid());
73 
75  layerHasExtensionHandle(m_layerHasExtensionKey, ctx);
76  ATH_CHECK(layerHasExtensionHandle.isValid());
77 
79  layerClusterTruthClassHandle(m_layerClusterTruthClassKey, ctx);
80  ATH_CHECK(layerClusterTruthClassHandle.isValid());
81 
82 
83  for (const auto* track_ptkl : *track_particles) {
84  // runs the time consistency checks
85  // if no hits are found in HGTD, returns a default time
86  const std::vector<float>& times = layerClusterTimeHandle(*track_ptkl);
87  const std::vector<bool>& has_clusters = layerHasExtensionHandle(*track_ptkl);
88  const std::vector<int>& hit_classification = layerClusterTruthClassHandle(*track_ptkl);
89 
90  CleaningResult res = runTimeConsistencyCuts(times,
91  has_clusters,
92  hit_classification);
93 
94  // check if the last hit on track was within the predefined area
95  if (lastHitIsOnLastSurface(*track_ptkl)) {
96  res.m_field |= (0b0000 << m_holes_ptrn_sft);
97  } else {
98  res.m_field |= (0b0001 << m_holes_ptrn_sft);
99  }
100 
101  // keep which of the hits associated in reco were primary hits (truth info!)
102  short prime_pattern = 0x0;
103  for (short i = 0; i < s_hgtd_layers; i++) {
104  if (res.m_hits.at(i).m_isprime) {
105  prime_pattern |= (1 << i);
106  }
107  }
108  res.m_field |= (prime_pattern << m_primes_ptrn_sft);
109 
110  // decorate the track again with this info
111  time_handle(*track_ptkl) = res.m_time;
112  timeres_handle(*track_ptkl) = res.m_resolution;
113  hasValidTime_handle(*track_ptkl) = res.m_hasValidTime;
114  summary_handle(*track_ptkl) = res.m_field;
115  }
116  return StatusCode::SUCCESS;
117 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ findLayerWithBadChi2()

short HGTD::TrackTimeDefAndQualityAlg::findLayerWithBadChi2 ( std::array< Hit, s_hgtd_layers >  hits) const
private

Identifies time outliers by finding the layer within which a hit contributes negatively to the overall chi2 value and returns the layer number.

Copies the hits, since they have to be invalidated one by one.

Parameters
[in]hitsArray of hits.
Returns
Layer with outlier time, value between 0 and 3.

Definition at line 307 of file TrackTimeDefAndQualityAlg.cxx.

308  {
309  short remove_layer = -1;
310  float local_min_chi2 = 999999;
311  for (auto& hit : hits) {
312  // "turn off" hits one after the other to test their impact on the chi2
313  bool validbuff = hit.m_isvalid;
314  hit.m_isvalid = false;
315  float local_chi2 = calculateChi2(hits);
316  hit.m_isvalid = validbuff;
317  if (local_chi2 < local_min_chi2) {
318  local_min_chi2 = local_chi2;
319  remove_layer = hit.m_layer;
320  }
321  }
322  return remove_layer;
323 }

◆ getLastHitOnTrack()

const Trk::TrackParameters * HGTD::TrackTimeDefAndQualityAlg::getLastHitOnTrack ( const Trk::Track track) const
private

Definition at line 336 of file TrackTimeDefAndQualityAlg.cxx.

336  {
337 
338  const Trk::TrackStates* tsos =
339  track.trackStateOnSurfaces();
340  if (not tsos) {
341  ATH_MSG_ERROR("Failed to retrieve track state on surfaces");
342  return nullptr;
343  }
344  // loop over the associated hits in ITk in reverse order, since we want to
345  // select the one closest to HGTD to start the extrapolation
346  for (auto i = tsos->rbegin(); i != tsos->rend(); ++i) {
347  const auto* curr_last_tsos = *i;
348  if (not curr_last_tsos) {
349  continue;
350  }
351 
352  if (curr_last_tsos->type(Trk::TrackStateOnSurface::Measurement) and
353  curr_last_tsos->trackParameters() and
354  curr_last_tsos->measurementOnTrack()) {
355  return curr_last_tsos->trackParameters();
356  }
357  }
358 
359  return nullptr;
360 }

◆ getRadiusAndZ()

std::pair< float, float > HGTD::TrackTimeDefAndQualityAlg::getRadiusAndZ ( const xAOD::TrackParticle track_particle) const
private

Definition at line 362 of file TrackTimeDefAndQualityAlg.cxx.

363 {
364  float radius = 0.f;
365  float abs_z = 0.f;
366 
367  if (not m_doActs) {
368  const Trk::Track* track = track_particle.track();
369  if (not track) throw std::runtime_error("Cannot retrieve Trk track from Track Particle");
370  const Trk::TrackParameters* last_hit_param = getLastHitOnTrack(*track);
371  if (not last_hit_param) throw std::runtime_error("Cannot retrieve Trk track parameters from Trk track");
372 
373  radius = std::hypot(last_hit_param->position().x(),
374  last_hit_param->position().y());
375  abs_z = std::abs(last_hit_param->position().z());
376  } else {
377  // ACTS
378  static const SG::ConstAccessor< ElementLink<ActsTrk::TrackContainer> > actsTrackLink("actsTrack");
379  if (not actsTrackLink.isAvailable(track_particle)) throw std::runtime_error("Track particle does not have link to acts track");
380 
381  ElementLink<ActsTrk::TrackContainer> link_to_track = actsTrackLink(track_particle);
382  if (not link_to_track.isValid()) throw std::runtime_error("Element link to acts track is not valid");
383 
384  std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track = *link_to_track;
385  if (not optional_track.has_value()) throw std::runtime_error("Link to acts track has no value");
386 
387  const ActsTrk::TrackContainer::ConstTrackProxy& track = optional_track.value();
388  const auto lastMeasurementState = Acts::findLastMeasurementState(track);
389  const auto state = lastMeasurementState.value();
390 
391  auto sl = state.getUncalibratedSourceLink().template get<ActsTrk::ATLASUncalibSourceLink>();
392  assert( sl != nullptr);
394  xAOD::UncalibMeasType clusterType = cluster.type();
395 
396  switch (clusterType) {
398  {
399  auto glob = static_cast<const xAOD::PixelCluster*>(&cluster)->globalPosition();
400  radius = std::sqrt( glob(0, 0) * glob(0, 0) + glob(1, 0) * glob(1, 0) );
401  abs_z = std::abs( glob(2, 0) );
402  }
403  break;
405  {
406  auto glob = static_cast<const xAOD::StripCluster*>(&cluster)->globalPosition();
407  radius = std::sqrt( glob(0, 0) * glob(0, 0) + glob(1, 0) * glob(1, 0) );
408  abs_z = std::abs( glob(2, 0) );
409  }
410  break;
412  // return some default numbers
413  return std::make_pair(700, 3000);
414  default:
415  return std::make_pair(radius, abs_z);
416  }; // switch
417  } // acts
418 
419  return std::make_pair(radius, abs_z);
420 }

◆ getValidHits()

std::array< TrackTimeDefAndQualityAlg::Hit, s_hgtd_layers > HGTD::TrackTimeDefAndQualityAlg::getValidHits ( const std::vector< float > &  times,
const std::vector< bool > &  has_clusters,
const std::vector< int > &  hit_classification 
) const
private

Definition at line 211 of file TrackTimeDefAndQualityAlg.cxx.

213  {
214  std::array<Hit, s_hgtd_layers> valid_hits {};
215 
216  for (size_t i = 0; i < s_hgtd_layers; i++) {
217  Hit& newhit = valid_hits[i];
218  if (has_clusters.at(i)) {
219  newhit.m_time = times.at(i);
220  newhit.m_isprime = hit_classification.at(i) == 1;
221  newhit.m_isvalid = true;
222  }
223  newhit.m_layer = i;
224  }
225 
226  return valid_hits;
227 }

◆ getValidPattern()

short HGTD::TrackTimeDefAndQualityAlg::getValidPattern ( const std::array< Hit, s_hgtd_layers > &  hits) const
private

Returns the pattern of valid hits in HGTD as a 4-bit bitfield, where a 1 encodes that a valid hit was found, while a 0 means no valid hit found.

The LSB carries the hit information for the layer closest to the IP.

Parameters
[in]hitsArray of hits.
Returns
Bit pattern encoding valid hits in layers.

Definition at line 229 of file TrackTimeDefAndQualityAlg.cxx.

231  {
232  short pattern = 0x0;
233  for (short i = 0; i < s_hgtd_layers; i++) {
234  if (hits.at(i).m_isvalid) {
235  pattern |= (1 << i);
236  }
237  }
238  return pattern;
239 }

◆ initialize()

StatusCode HGTD::TrackTimeDefAndQualityAlg::initialize ( )
finaloverridevirtual

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ lastHitIsOnLastSurface()

bool HGTD::TrackTimeDefAndQualityAlg::lastHitIsOnLastSurface ( const xAOD::TrackParticle track_particle) const
private

Checks if the last hit on track was found on a pre-specified set of Pixel and Strip layers close to the HGTD surfaces.

FIXME: should not be hardcoded. To be exchanged by a hole search at a later point.

Parameters
[in]track_particleTrack reconstructed in ITk.
Returns
True if the last hit on track was within the specified volume.

Definition at line 422 of file TrackTimeDefAndQualityAlg.cxx.

423  {
424  auto [radius, abs_z] = getRadiusAndZ(track_particle);
425 
426  if (abs_z > 2700) {
427  return true;
428  }
429  if (radius < 350 and abs_z > 2400) {
430  return true;
431  }
432  // region 2
433  if (radius > 205 and radius < 350 and abs_z > 2100) {
434  return true;
435  }
436  // region 3
437  if (radius < 220 and abs_z > 2200) {
438  return true;
439  }
440 
441  if (radius < 140 and abs_z > 1890) {
442  return true;
443  }
444 
445  return false;
446 }

◆ meanTime()

float HGTD::TrackTimeDefAndQualityAlg::meanTime ( const std::array< Hit, s_hgtd_layers > &  hits) const
private

Calculates the arithmetic mean of the valid hit times;.

Parameters
[in]hitsArray of hits.
Returns
Returns true if the times were in agreement.

Definition at line 279 of file TrackTimeDefAndQualityAlg.cxx.

281  {
282  float sum = 0.;
283  short n = 0;
284  for (const auto& hit : hits) {
285  if (hit.m_isvalid) {
286  sum += hit.m_time;
287  n++;
288  }
289  }
290  return n == 0 ? m_default_time.value() : sum / (float)n;
291 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ passesDeltaT()

bool HGTD::TrackTimeDefAndQualityAlg::passesDeltaT ( const std::array< Hit, s_hgtd_layers > &  hits) const
private

Checks two hits for time compatibility.

Parameters
[in]hitsArray of hits.
Returns
Returns true if the times were in agreement.

Definition at line 256 of file TrackTimeDefAndQualityAlg.cxx.

258  {
259  // don't trust the user here.
260  short n_valid = std::count_if(hits.begin(), hits.end(),
261  [](const Hit& hit) { return hit.m_isvalid; });
262  if (n_valid != 2) {
263  return false;
264  }
265  // FIXME this should be doable in a simpler manner...
266  std::vector<float> times;
267  std::vector<float> res;
268  for (const auto& hit : hits) {
269  if (hit.m_isvalid) {
270  times.push_back(hit.m_time);
271  res.push_back(hit.m_resolution);
272  }
273  }
274  // pass if the distance in units of the resolution passes the cut
275  return std::abs(times.at(0) - times.at(1)) <
276  m_deltat_cut * hypot(res.at(0), res.at(1));
277 }

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ runTimeConsistencyCuts()

TrackTimeDefAndQualityAlg::CleaningResult HGTD::TrackTimeDefAndQualityAlg::runTimeConsistencyCuts ( const std::vector< float > &  times,
const std::vector< bool > &  has_clusters,
const std::vector< int > &  hit_classification 
) const
private

Definition at line 123 of file TrackTimeDefAndQualityAlg.cxx.

125  {
126  // get all available hits (see the struct Hit) in a first step
127  std::array<Hit, s_hgtd_layers> valid_hits = getValidHits(times,
128  has_clusters,
129  hit_classification);
130 
131  CleaningResult result;
132  result.m_hits = valid_hits;
133  result.m_field = 0x0;
134  result.m_time = m_default_time;
135  result.m_resolution = m_default_time_res;
136  result.m_hasValidTime = 0;
137 
138  short recoed_pattern = getValidPattern(valid_hits);
139  // stored the pattern of hits as retrieved from the iterative extension
140  result.m_field |= (recoed_pattern << m_recoed_ptrn_sft);
141 
142  short nhits = std::count_if(valid_hits.begin(), valid_hits.end(),
143  [](const Hit& hit) { return hit.m_isvalid; });
144  if (nhits < 2) {
145  // fill the patern with the 1 hit (or none) and return
146  result.m_field |= (recoed_pattern << m_comp_ptrn_sft);
147  result.m_time = meanTime(valid_hits);
148  result.m_resolution = trackTimeResolution(valid_hits);
149  result.m_hasValidTime = recoed_pattern ? 1 : 0;
150  return result;
151  } else if (nhits == 2) {
152  // if the deltaT cut is passed, the pattern stays the same, otherwise set
153  // to 0 as no hit passes
154  // TODO: find better way to treat this!
155  if (passesDeltaT(valid_hits)) {
156  result.m_field |= (recoed_pattern << m_comp_ptrn_sft); // stays the same
157  result.m_time = meanTime(valid_hits);
158  result.m_resolution = trackTimeResolution(valid_hits);
159  result.m_hasValidTime = 1;
160  return result;
161  } else {
162  result.m_field |= (0b0000 << m_comp_ptrn_sft); // no hit passes
163  result.m_time = m_default_time; // TODO should I just use the mean?
164  result.m_resolution = m_default_time_res;
165  return result;
166  }
167 
168  } else {
169  // for 3 or 4 hits, remove hit(s) with worst chi2 if needed
170  float chi2 = calculateChi2(valid_hits);
171  // if the chi2 is below the threshold, keep all hits
172  bool searching = chi2 > m_chi2_threshold;
173  while (searching) {
174  short remove_layer = findLayerWithBadChi2(valid_hits);
175  setLayerAsInvalid(valid_hits, remove_layer);
176  float new_chi2 = calculateChi2(valid_hits);
177  nhits = std::count_if(valid_hits.begin(), valid_hits.end(),
178  [](const Hit& hit) { return hit.m_isvalid; });
179  if (new_chi2 <= m_chi2_threshold or nhits < 3) {
180  searching = false;
181  }
182  } // while loop ended
183 
184  short chi2_rej_pattern = getValidPattern(valid_hits);
185 
186  if (nhits == 2) {
187  if (passesDeltaT(valid_hits)) {
188  result.m_field |= (chi2_rej_pattern << m_comp_ptrn_sft);
189  result.m_time = meanTime(valid_hits);
190  result.m_resolution = trackTimeResolution(valid_hits);
191  result.m_hasValidTime = 1;
192  return result;
193  } else {
194  result.m_field |= (0b0000 << m_comp_ptrn_sft); // no hit passes
195  result.m_time = m_default_time; // TODO should I just use the mean?
196  result.m_resolution = m_default_time_res;
197  return result;
198  }
199  } else {
200  // 3 or 4 hits, chi2 passed
201  result.m_field |= (chi2_rej_pattern << m_comp_ptrn_sft);
202  result.m_time = meanTime(valid_hits);
203  result.m_resolution = trackTimeResolution(valid_hits);
204  result.m_hasValidTime = 1;
205  return result;
206  }
207  }
208 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ setLayerAsInvalid()

void HGTD::TrackTimeDefAndQualityAlg::setLayerAsInvalid ( std::array< Hit, s_hgtd_layers > &  hits,
short  layer 
) const
private

Given a layer number, the hit sitting on this layer is flagged as invalid.

Used for outlier removal.

Parameters
[in]hitsArray of hits.
[in]layerThe layer that should be masked.

Definition at line 325 of file TrackTimeDefAndQualityAlg.cxx.

327  {
328  for (auto& hit : hits) {
329  if (hit.m_layer == layer) {
330  hit.m_isvalid = false;
331  }
332  }
333 }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ trackTimeResolution()

float HGTD::TrackTimeDefAndQualityAlg::trackTimeResolution ( const std::array< Hit, s_hgtd_layers > &  hits) const
private

Calculates the combined resolution.

Definition at line 293 of file TrackTimeDefAndQualityAlg.cxx.

295  {
296 
297  float sum = 0.;
298  for (const auto& hit : hits) {
299  if (hit.m_isvalid) {
300  sum += 1. / (hit.m_resolution * hit.m_resolution);
301  }
302  }
303  return sum == 0. ? m_default_time_res.value()
304  : static_cast<float>(std::sqrt(1. / sum));
305 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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_chi2_threshold

FloatProperty HGTD::TrackTimeDefAndQualityAlg::m_chi2_threshold
private
Initial value:
{
this, "Chi2Threshold", 1.5,
"Quality cut for decision to keep hits compatible in time"}

Definition at line 125 of file TrackTimeDefAndQualityAlg.h.

◆ m_comp_ptrn_sft

const short HGTD::TrackTimeDefAndQualityAlg::m_comp_ptrn_sft = 8
private

Definition at line 63 of file TrackTimeDefAndQualityAlg.h.

◆ m_default_time

FloatProperty HGTD::TrackTimeDefAndQualityAlg::m_default_time
private
Initial value:
{
this, "DefaultTime", 0.0,
"Default time used for tracks without HGTD timing info"}

Definition at line 131 of file TrackTimeDefAndQualityAlg.h.

◆ m_default_time_res

FloatProperty HGTD::TrackTimeDefAndQualityAlg::m_default_time_res
private
Initial value:
{
this, "DefaultTimeRes", 50. / std::sqrt(12.),
"Default time resolution used for tracks without HGTD timing info"}

Definition at line 136 of file TrackTimeDefAndQualityAlg.h.

◆ m_deltat_cut

FloatProperty HGTD::TrackTimeDefAndQualityAlg::m_deltat_cut
private
Initial value:
{this, "DeltaTCut", 2.0,
"Upper limit for a cluster delta t cut"}

Definition at line 128 of file TrackTimeDefAndQualityAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doActs

Gaudi::Property<bool> HGTD::TrackTimeDefAndQualityAlg::m_doActs {this, "doActs", false}
private

Definition at line 105 of file TrackTimeDefAndQualityAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_hasValidTime_dec_key

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_hasValidTime_dec_key
private
Initial value:
{
this, "hasValidTime", m_trackParticleContainerKey, "hasValidTime", "Time assigned to this track is valid"}

Definition at line 98 of file TrackTimeDefAndQualityAlg.h.

◆ m_holes_ptrn_sft

const short HGTD::TrackTimeDefAndQualityAlg::m_holes_ptrn_sft = 12
private

Definition at line 64 of file TrackTimeDefAndQualityAlg.h.

◆ m_layerClusterTimeKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTimeKey
private
Initial value:
{
this, "HGTD_cluster_time", m_trackParticleContainerKey, "HGTD_cluster_time",
"deco with a handle for cluster time"}

Definition at line 84 of file TrackTimeDefAndQualityAlg.h.

◆ m_layerClusterTruthClassKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTruthClassKey
private
Initial value:
{
this, "HGTD_cluster_truth_class", m_trackParticleContainerKey,
"HGTD_cluster_truth_class",
"deco with a handle for a truth time"}

Definition at line 88 of file TrackTimeDefAndQualityAlg.h.

◆ m_layerHasExtensionKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_layerHasExtensionKey
private
Initial value:
{
this, "HGTD_has_extension", m_trackParticleContainerKey, "HGTD_has_extension",
"deco with a handle for an extension"}

Definition at line 81 of file TrackTimeDefAndQualityAlg.h.

◆ m_primes_ptrn_sft

const short HGTD::TrackTimeDefAndQualityAlg::m_primes_ptrn_sft = 16
private

Definition at line 65 of file TrackTimeDefAndQualityAlg.h.

◆ m_recoed_ptrn_sft

const short HGTD::TrackTimeDefAndQualityAlg::m_recoed_ptrn_sft = 0
private

Definition at line 61 of file TrackTimeDefAndQualityAlg.h.

◆ m_summarypattern_dec_key

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_summarypattern_dec_key
private
Initial value:
{this, "HGTD_summaryinfo", m_trackParticleContainerKey,
"HGTD_summaryinfo",
"Bitfield for working point definition"}

Definition at line 101 of file TrackTimeDefAndQualityAlg.h.

◆ m_time_dec_key

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_time_dec_key
private
Initial value:
{
this, "time", m_trackParticleContainerKey, "time", "Time assigned to this track"}

Definition at line 93 of file TrackTimeDefAndQualityAlg.h.

◆ m_time_res_dec_key

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_time_res_dec_key
private
Initial value:
{
this, "timeResolution", m_trackParticleContainerKey, "timeResolution",
"Time resolution assigned to this track"}

Definition at line 95 of file TrackTimeDefAndQualityAlg.h.

◆ m_trackParticleContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> HGTD::TrackTimeDefAndQualityAlg::m_trackParticleContainerKey
private
Initial value:
{
this, "TrackParticleContainerName", "InDetTrackParticles",
"Name of the TrackParticle container"}

Definition at line 77 of file TrackTimeDefAndQualityAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
HGTD::TrackTimeDefAndQualityAlg::getValidHits
std::array< Hit, s_hgtd_layers > getValidHits(const std::vector< float > &times, const std::vector< bool > &has_clusters, const std::vector< int > &hit_classification) const
Definition: TrackTimeDefAndQualityAlg.cxx:211
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
xAOD::UncalibMeasType::HGTDClusterType
@ HGTDClusterType
HGTD::TrackTimeDefAndQualityAlg::setLayerAsInvalid
void setLayerAsInvalid(std::array< Hit, s_hgtd_layers > &hits, short layer) const
Given a layer number, the hit sitting on this layer is flagged as invalid.
Definition: TrackTimeDefAndQualityAlg.cxx:325
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
HGTD::TrackTimeDefAndQualityAlg::meanTime
float meanTime(const std::array< Hit, s_hgtd_layers > &hits) const
Calculates the arithmetic mean of the valid hit times;.
Definition: TrackTimeDefAndQualityAlg.cxx:279
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
HGTD::TrackTimeDefAndQualityAlg::lastHitIsOnLastSurface
bool lastHitIsOnLastSurface(const xAOD::TrackParticle &track_particle) const
Checks if the last hit on track was found on a pre-specified set of Pixel and Strip layers close to t...
Definition: TrackTimeDefAndQualityAlg.cxx:422
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTruthClassKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTruthClassKey
Definition: TrackTimeDefAndQualityAlg.h:88
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HGTD::TrackTimeDefAndQualityAlg::m_hasValidTime_dec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_hasValidTime_dec_key
Definition: TrackTimeDefAndQualityAlg.h:98
HGTD::TrackTimeDefAndQualityAlg::trackTimeResolution
float trackTimeResolution(const std::array< Hit, s_hgtd_layers > &hits) const
Calculates the combined resolution.
Definition: TrackTimeDefAndQualityAlg.cxx:293
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
HGTD::TrackTimeDefAndQualityAlg::getLastHitOnTrack
const Trk::TrackParameters * getLastHitOnTrack(const Trk::Track &track) const
Definition: TrackTimeDefAndQualityAlg.cxx:336
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
HGTD::TrackTimeDefAndQualityAlg::m_summarypattern_dec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_summarypattern_dec_key
Definition: TrackTimeDefAndQualityAlg.h:101
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
HGTD::TrackTimeDefAndQualityAlg::runTimeConsistencyCuts
CleaningResult runTimeConsistencyCuts(const std::vector< float > &times, const std::vector< bool > &has_clusters, const std::vector< int > &hit_classification) const
Definition: TrackTimeDefAndQualityAlg.cxx:123
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
HGTD::TrackTimeDefAndQualityAlg::calculateChi2
float calculateChi2(const std::array< Hit, s_hgtd_layers > &hits) const
Calculates the chi2 of the hit times given their resolution.
Definition: TrackTimeDefAndQualityAlg.cxx:241
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
HGTD::TrackTimeDefAndQualityAlg::m_default_time_res
FloatProperty m_default_time_res
Definition: TrackTimeDefAndQualityAlg.h:136
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
HGTD::TrackTimeDefAndQualityAlg::m_doActs
Gaudi::Property< bool > m_doActs
Definition: TrackTimeDefAndQualityAlg.h:105
HGTD::TrackTimeDefAndQualityAlg::m_deltat_cut
FloatProperty m_deltat_cut
Definition: TrackTimeDefAndQualityAlg.h:128
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:26
HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTimeKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
Definition: TrackTimeDefAndQualityAlg.h:84
HGTD::TrackTimeDefAndQualityAlg::m_comp_ptrn_sft
const short m_comp_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:63
HGTD::TrackTimeDefAndQualityAlg::m_default_time
FloatProperty m_default_time
Definition: TrackTimeDefAndQualityAlg.h:131
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
HGTD::TrackTimeDefAndQualityAlg::m_trackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
Definition: TrackTimeDefAndQualityAlg.h:77
HGTD::TrackTimeDefAndQualityAlg::getRadiusAndZ
std::pair< float, float > getRadiusAndZ(const xAOD::TrackParticle &track_particle) const
Definition: TrackTimeDefAndQualityAlg.cxx:362
HGTD::TrackTimeDefAndQualityAlg::m_time_dec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_time_dec_key
Definition: TrackTimeDefAndQualityAlg.h:93
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
HGTD::TrackTimeDefAndQualityAlg::m_holes_ptrn_sft
const short m_holes_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:64
HGTD::TrackTimeDefAndQualityAlg::m_time_res_dec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_time_res_dec_key
Definition: TrackTimeDefAndQualityAlg.h:95
HGTD::TrackTimeDefAndQualityAlg::m_primes_ptrn_sft
const short m_primes_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:65
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
HGTD::TrackTimeDefAndQualityAlg::m_layerHasExtensionKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey
Definition: TrackTimeDefAndQualityAlg.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
HGTD::TrackTimeDefAndQualityAlg::m_recoed_ptrn_sft
const short m_recoed_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:61
HGTD::TrackTimeDefAndQualityAlg::passesDeltaT
bool passesDeltaT(const std::array< Hit, s_hgtd_layers > &hits) const
Checks two hits for time compatibility.
Definition: TrackTimeDefAndQualityAlg.cxx:256
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::TrackParticle_v1::track
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Definition: TrackParticle_v1.cxx:806
HGTD::TrackTimeDefAndQualityAlg::getValidPattern
short getValidPattern(const std::array< Hit, s_hgtd_layers > &hits) const
Returns the pattern of valid hits in HGTD as a 4-bit bitfield, where a 1 encodes that a valid hit was...
Definition: TrackTimeDefAndQualityAlg.cxx:229
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
HGTD::TrackTimeDefAndQualityAlg::m_chi2_threshold
FloatProperty m_chi2_threshold
Definition: TrackTimeDefAndQualityAlg.h:125
plot_times.times
def times(fn)
Definition: plot_times.py:10
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
fitman.k
k
Definition: fitman.py:528
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
ServiceHandle< ICondSvc >
HGTD::TrackTimeDefAndQualityAlg::findLayerWithBadChi2
short findLayerWithBadChi2(std::array< Hit, s_hgtd_layers > hits) const
Identifies time outliers by finding the layer within which a hit contributes negatively to the overal...
Definition: TrackTimeDefAndQualityAlg.cxx:307