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 > &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

CleaningResult runTimeConsistencyCuts (const xAOD::TrackParticle *track_particle) const
 
std::array< Hit, n_hgtd_layers > getValidHits (const xAOD::TrackParticle *track_particle) const
 
float calculateChi2 (const std::array< Hit, n_hgtd_layers > &hits) const
 Calculates the chi2 of the hit times given their resolution. More...
 
bool passesDeltaT (const std::array< Hit, n_hgtd_layers > &hits) const
 Checks two hits for time compatibility. More...
 
float meanTime (const std::array< Hit, n_hgtd_layers > &hits) const
 Calculates the arithmetic mean of the valid hit times;. More...
 
float trackTimeResolution (const std::array< Hit, n_hgtd_layers > &hits) const
 Calculates the combined resolution. More...
 
short findLayerWithBadChi2 (std::array< Hit, n_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, n_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, n_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 > &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

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
 
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 19 of file TrackTimeDefAndQualityAlg.cxx.

21  : 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, n_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 227 of file TrackTimeDefAndQualityAlg.cxx.

228  {
229 
230  float mean = meanTime(hits);
231 
232  float chi2 = 0.;
233  for (const auto& hit : hits) {
234  if (hit.m_isvalid) {
235  chi2 += (hit.m_time - mean) * (hit.m_time - mean) /
236  (hit.m_resolution * hit.m_resolution);
237  }
238  }
239  return chi2;
240 }

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
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 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< 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 > &  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 40 of file TrackTimeDefAndQualityAlg.cxx.

40  {
41 
42  SG::ReadHandle<xAOD::TrackParticleContainer> trk_ptkl_container_handle(
44  const xAOD::TrackParticleContainer* track_particles =
45  trk_ptkl_container_handle.cptr();
46  if (not track_particles) {
48  "[TrackTimeDefAndQualityAlg] TrackParticleContainer not found, "
49  "aborting execute!");
50  return StatusCode::FAILURE;
51  }
52 
54  m_time_dec_key, ctx);
56  m_time_res_dec_key, ctx);
61 
62  for (const auto* track_ptkl : *track_particles) {
63 
64  // runs the time consistency checks
65  // if no hits are found in HGTD, returns a default time
66  CleaningResult res = runTimeConsistencyCuts(track_ptkl);
67 
68  // check if the last hit on track was within the predefined area
69  if (lastHitIsOnLastSurface(*track_ptkl)) {
70  res.m_field |= (0b0000 << m_holes_ptrn_sft);
71  } else {
72  res.m_field |= (0b0001 << m_holes_ptrn_sft);
73  }
74 
75  // keep which of the hits associated in reco were primary hits (truth info!)
76  short prime_pattern = 0x0;
77  for (short i = 0; i < n_hgtd_layers; i++) {
78  if (res.m_hits.at(i).m_isprime) {
79  prime_pattern |= (1 << i);
80  }
81  }
82  res.m_field |= (prime_pattern << m_primes_ptrn_sft);
83 
84  // decorate the track again with this info
85  time_handle(*track_ptkl) = res.m_time;
86  timeres_handle(*track_ptkl) = res.m_resolution;
87  hasValidTime_handle(*track_ptkl) = res.m_hasValidTime;
88  summary_handle(*track_ptkl) = res.m_field;
89  }
90  return StatusCode::SUCCESS;
91 }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ findLayerWithBadChi2()

short HGTD::TrackTimeDefAndQualityAlg::findLayerWithBadChi2 ( std::array< Hit, n_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 293 of file TrackTimeDefAndQualityAlg.cxx.

294  {
295  short remove_layer = -1;
296  float local_min_chi2 = 999999;
297  for (auto& hit : hits) {
298  // "turn off" hits one after the other to test their impact on the chi2
299  bool validbuff = hit.m_isvalid;
300  hit.m_isvalid = false;
301  float local_chi2 = calculateChi2(hits);
302  hit.m_isvalid = validbuff;
303  if (local_chi2 < local_min_chi2) {
304  local_min_chi2 = local_chi2;
305  remove_layer = hit.m_layer;
306  }
307  }
308  return remove_layer;
309 }

◆ getLastHitOnTrack()

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

Definition at line 322 of file TrackTimeDefAndQualityAlg.cxx.

322  {
323 
324  const Trk::TrackStates* tsos =
325  track.trackStateOnSurfaces();
326  if (not tsos) {
327  ATH_MSG_ERROR("Failed to retrieve track state on surfaces");
328  return nullptr;
329  }
330  // loop over the associated hits in ITk in reverse order, since we want to
331  // select the one closest to HGTD to start the extrapolation
332  for (auto i = tsos->rbegin(); i != tsos->rend(); ++i) {
333  const auto* curr_last_tsos = *i;
334  if (not curr_last_tsos) {
335  continue;
336  }
337  if (curr_last_tsos->type(Trk::TrackStateOnSurface::Measurement) and
338  curr_last_tsos->trackParameters() and
339  curr_last_tsos->measurementOnTrack()) {
340  return curr_last_tsos->trackParameters();
341  }
342  }
343  return nullptr;
344 }

◆ getValidHits()

std::array< TrackTimeDefAndQualityAlg::Hit, n_hgtd_layers > HGTD::TrackTimeDefAndQualityAlg::getValidHits ( const xAOD::TrackParticle track_particle) const
private

Definition at line 183 of file TrackTimeDefAndQualityAlg.cxx.

184  {
185 
187  layerClusterTimeHandle(m_layerClusterTimeKey);
188  std::vector<float> times = layerClusterTimeHandle(*track_particle);
189 
191  layerHasExtensionHandle(m_layerHasExtensionKey);
192  std::vector<bool> has_clusters = layerHasExtensionHandle(*track_particle);
193 
195  layerClusterTruthClassHandle(m_layerClusterTruthClassKey);
196  std::vector<int> hit_classification =
197  layerClusterTruthClassHandle(*track_particle);
198 
199  std::array<Hit, n_hgtd_layers> valid_hits;
200 
201  for (size_t i = 0; i < n_hgtd_layers; i++) {
202  Hit newhit;
203  if (has_clusters.at(i)) {
204  newhit.m_time = times.at(i);
205  newhit.m_isprime = hit_classification.at(i) == 1;
206  newhit.m_isvalid = true;
207  }
208  newhit.m_layer = i;
209  valid_hits.at(i) = newhit;
210  }
211 
212  return valid_hits;
213 }

◆ getValidPattern()

short HGTD::TrackTimeDefAndQualityAlg::getValidPattern ( const std::array< Hit, n_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 215 of file TrackTimeDefAndQualityAlg.cxx.

217  {
218  short pattern = 0x0;
219  for (short i = 0; i < n_hgtd_layers; i++) {
220  if (hits.at(i).m_isvalid) {
221  pattern |= (1 << i);
222  }
223  }
224  return pattern;
225 }

◆ 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 AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ 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 346 of file TrackTimeDefAndQualityAlg.cxx.

347  {
348  const Trk::Track* track = track_particle.track();
349  const Trk::TrackParameters* last_hit_param = getLastHitOnTrack(*track);
350  float radius = std::hypot(last_hit_param->position().x(),
351  last_hit_param->position().y());
352  float abs_z = std::abs(last_hit_param->position().z());
353 
354  if (abs_z > 2700) {
355  return true;
356  }
357  if (radius < 350 and abs_z > 2400) {
358  return true;
359  }
360  // region 2
361  if (radius > 205 and radius < 350 and abs_z > 2100) {
362  return true;
363  }
364  // region 3
365  if (radius < 220 and abs_z > 2200) {
366  return true;
367  }
368 
369  if (radius < 140 and abs_z > 1890) {
370  return true;
371  }
372 
373  return false;
374 }

◆ meanTime()

float HGTD::TrackTimeDefAndQualityAlg::meanTime ( const std::array< Hit, n_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 265 of file TrackTimeDefAndQualityAlg.cxx.

267  {
268  float sum = 0.;
269  short n = 0;
270  for (const auto& hit : hits) {
271  if (hit.m_isvalid) {
272  sum += hit.m_time;
273  n++;
274  }
275  }
276  return n == 0 ? m_default_time.value() : sum / (float)n;
277 }

◆ 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, n_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 242 of file TrackTimeDefAndQualityAlg.cxx.

244  {
245  // don't trust the user here.
246  short n_valid = std::count_if(hits.begin(), hits.end(),
247  [](const Hit& hit) { return hit.m_isvalid; });
248  if (n_valid != 2) {
249  return false;
250  }
251  // FIXME this should be doable in a simpler manner...
252  std::vector<float> times;
253  std::vector<float> res;
254  for (const auto& hit : hits) {
255  if (hit.m_isvalid) {
256  times.push_back(hit.m_time);
257  res.push_back(hit.m_resolution);
258  }
259  }
260  // pass if the distance in units of the resolution passes the cut
261  return std::abs(times.at(0) - times.at(1)) <
262  m_deltat_cut * hypot(res.at(0), res.at(1));
263 }

◆ 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 xAOD::TrackParticle track_particle) const
private

Definition at line 97 of file TrackTimeDefAndQualityAlg.cxx.

98  {
99 
100  // get all available hits (see the struct Hit) in a first step
101  std::array<Hit, n_hgtd_layers> valid_hits = getValidHits(track_particle);
102 
103  CleaningResult result;
104  result.m_hits = valid_hits;
105  result.m_field = 0x0;
106  result.m_time = m_default_time;
107  result.m_resolution = m_default_time_res;
108  result.m_hasValidTime = 0;
109 
110  short recoed_pattern = getValidPattern(valid_hits);
111  // stored the pattern of hits as retrieved from the iterative extension
112  result.m_field |= (recoed_pattern << m_recoed_ptrn_sft);
113 
114  short nhits = std::count_if(valid_hits.begin(), valid_hits.end(),
115  [](const Hit& hit) { return hit.m_isvalid; });
116  if (nhits < 2) {
117  // fill the patern with the 1 hit (or none) and return
118  result.m_field |= (recoed_pattern << m_comp_ptrn_sft);
119  result.m_time = meanTime(valid_hits);
120  result.m_resolution = trackTimeResolution(valid_hits);
121  result.m_hasValidTime = recoed_pattern ? 1 : 0;
122  return result;
123  } else if (nhits == 2) {
124  // if the deltaT cut is passed, the pattern stays the same, otherwise set
125  // to 0 as no hit passes
126  // TODO: find better way to treat this!
127  if (passesDeltaT(valid_hits)) {
128  result.m_field |= (recoed_pattern << m_comp_ptrn_sft); // stays the same
129  result.m_time = meanTime(valid_hits);
130  result.m_resolution = trackTimeResolution(valid_hits);
131  result.m_hasValidTime = 1;
132  return result;
133  } else {
134  result.m_field |= (0b0000 << m_comp_ptrn_sft); // no hit passes
135  result.m_time = m_default_time; // TODO should I just use the mean?
136  result.m_resolution = m_default_time_res;
137  return result;
138  }
139 
140  } else {
141  // for 3 or 4 hits, remove hit(s) with worst chi2 if needed
142  float chi2 = calculateChi2(valid_hits);
143  // if the chi2 is below the threshold, keep all hits
144  bool searching = chi2 > m_chi2_threshold;
145  while (searching) {
146  short remove_layer = findLayerWithBadChi2(valid_hits);
147  setLayerAsInvalid(valid_hits, remove_layer);
148  float new_chi2 = calculateChi2(valid_hits);
149  nhits = std::count_if(valid_hits.begin(), valid_hits.end(),
150  [](const Hit& hit) { return hit.m_isvalid; });
151  if (new_chi2 <= m_chi2_threshold or nhits < 3) {
152  searching = false;
153  }
154  } // while loop ended
155 
156  short chi2_rej_pattern = getValidPattern(valid_hits);
157 
158  if (nhits == 2) {
159  if (passesDeltaT(valid_hits)) {
160  result.m_field |= (chi2_rej_pattern << m_comp_ptrn_sft);
161  result.m_time = meanTime(valid_hits);
162  result.m_resolution = trackTimeResolution(valid_hits);
163  result.m_hasValidTime = 1;
164  return result;
165  } else {
166  result.m_field |= (0b0000 << m_comp_ptrn_sft); // no hit passes
167  result.m_time = m_default_time; // TODO should I just use the mean?
168  result.m_resolution = m_default_time_res;
169  return result;
170  }
171  } else {
172  // 3 or 4 hits, chi2 passed
173  result.m_field |= (chi2_rej_pattern << m_comp_ptrn_sft);
174  result.m_time = meanTime(valid_hits);
175  result.m_resolution = trackTimeResolution(valid_hits);
176  result.m_hasValidTime = 1;
177  return result;
178  }
179  }
180 }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ setLayerAsInvalid()

void HGTD::TrackTimeDefAndQualityAlg::setLayerAsInvalid ( std::array< Hit, n_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 311 of file TrackTimeDefAndQualityAlg.cxx.

313  {
314  for (auto& hit : hits) {
315  if (hit.m_layer == layer) {
316  hit.m_isvalid = false;
317  }
318  }
319 }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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, n_hgtd_layers > &  hits) const
private

Calculates the combined resolution.

Definition at line 279 of file TrackTimeDefAndQualityAlg.cxx.

281  {
282 
283  float sum = 0.;
284  for (const auto& hit : hits) {
285  if (hit.m_isvalid) {
286  sum += 1. / (hit.m_resolution * hit.m_resolution);
287  }
288  }
289  return sum == 0. ? m_default_time_res.value()
290  : static_cast<float>(std::sqrt(1. / sum));
291 }

◆ 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 120 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 126 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 131 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 123 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_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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_hasValidTime_dec_key

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

Definition at line 95 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", "InDetTrackParticles.HGTD_cluster_time",
"deco with a handle for cluster time"}

Definition at line 81 of file TrackTimeDefAndQualityAlg.h.

◆ m_layerClusterTruthClassKey

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

Definition at line 85 of file TrackTimeDefAndQualityAlg.h.

◆ m_layerHasExtensionKey

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

Definition at line 78 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",
"InDetTrackParticles.HGTD_summaryinfo",
"Bitfield for working point definition"}

Definition at line 98 of file TrackTimeDefAndQualityAlg.h.

◆ m_time_dec_key

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

Definition at line 90 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", "InDetTrackParticles.timeResolution",
"Time resolution assigned to this track"}

Definition at line 92 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 74 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:
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
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::passesDeltaT
bool passesDeltaT(const std::array< Hit, n_hgtd_layers > &hits) const
Checks two hits for time compatibility.
Definition: TrackTimeDefAndQualityAlg.cxx:242
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
HGTD::TrackTimeDefAndQualityAlg::setLayerAsInvalid
void setLayerAsInvalid(std::array< Hit, n_hgtd_layers > &hits, short layer) const
Given a layer number, the hit sitting on this layer is flagged as invalid.
Definition: TrackTimeDefAndQualityAlg.cxx:311
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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:346
HGTD::TrackTimeDefAndQualityAlg::findLayerWithBadChi2
short findLayerWithBadChi2(std::array< Hit, n_hgtd_layers > hits) const
Identifies time outliers by finding the layer within which a hit contributes negatively to the overal...
Definition: TrackTimeDefAndQualityAlg.cxx:293
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
HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTruthClassKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTruthClassKey
Definition: TrackTimeDefAndQualityAlg.h:85
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:95
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
HGTD::TrackTimeDefAndQualityAlg::getLastHitOnTrack
const Trk::TrackParameters * getLastHitOnTrack(const Trk::Track &track) const
Definition: TrackTimeDefAndQualityAlg.cxx:322
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
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.
HGTD::TrackTimeDefAndQualityAlg::trackTimeResolution
float trackTimeResolution(const std::array< Hit, n_hgtd_layers > &hits) const
Calculates the combined resolution.
Definition: TrackTimeDefAndQualityAlg.cxx:279
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:98
HGTD::TrackTimeDefAndQualityAlg::getValidPattern
short getValidPattern(const std::array< Hit, n_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:215
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
HGTD::TrackTimeDefAndQualityAlg::getValidHits
std::array< Hit, n_hgtd_layers > getValidHits(const xAOD::TrackParticle *track_particle) const
Definition: TrackTimeDefAndQualityAlg.cxx:183
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:581
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
HGTD::TrackTimeDefAndQualityAlg::calculateChi2
float calculateChi2(const std::array< Hit, n_hgtd_layers > &hits) const
Calculates the chi2 of the hit times given their resolution.
Definition: TrackTimeDefAndQualityAlg.cxx:227
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
HGTD::TrackTimeDefAndQualityAlg::runTimeConsistencyCuts
CleaningResult runTimeConsistencyCuts(const xAOD::TrackParticle *track_particle) const
Definition: TrackTimeDefAndQualityAlg.cxx:97
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
HGTD::TrackTimeDefAndQualityAlg::meanTime
float meanTime(const std::array< Hit, n_hgtd_layers > &hits) const
Calculates the arithmetic mean of the valid hit times;.
Definition: TrackTimeDefAndQualityAlg.cxx:265
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:131
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HGTD::TrackTimeDefAndQualityAlg::m_deltat_cut
FloatProperty m_deltat_cut
Definition: TrackTimeDefAndQualityAlg.h:123
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
HGTD::TrackTimeDefAndQualityAlg::m_layerClusterTimeKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
Definition: TrackTimeDefAndQualityAlg.h:81
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:126
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
HGTD::TrackTimeDefAndQualityAlg::m_trackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
Definition: TrackTimeDefAndQualityAlg.h:74
HGTD::TrackTimeDefAndQualityAlg::m_time_dec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_time_dec_key
Definition: TrackTimeDefAndQualityAlg.h:90
a
TList * a
Definition: liststreamerinfos.cxx:10
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:92
HGTD::TrackTimeDefAndQualityAlg::m_primes_ptrn_sft
const short m_primes_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:65
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
HGTD::TrackTimeDefAndQualityAlg::m_layerHasExtensionKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey
Definition: TrackTimeDefAndQualityAlg.h:78
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
HGTD::TrackTimeDefAndQualityAlg::m_recoed_ptrn_sft
const short m_recoed_ptrn_sft
Definition: TrackTimeDefAndQualityAlg.h:61
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
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:805
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
readCCLHist.float
float
Definition: readCCLHist.py:83
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:120
plot_times.times
def times(fn)
Definition: plot_times.py:11
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >