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

#include <TrackSlimmingTool.h>

Inheritance diagram for Trk::TrackSlimmingTool:
Collaboration diagram for Trk::TrackSlimmingTool:

Public Member Functions

 TrackSlimmingTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~TrackSlimmingTool ()
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize () override
 standard Athena-Algorithm method More...
 
void slimTrack (Trk::Track &track) const override final
 Slim a non const Track. More...
 
void slimConstTrack (const Trk::Track &track) const override final
 Slim a const Track. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

void setHints (const Trk::Track &track) const
 This method just set persistification Hints. More...
 
void checkForValidMeas (const Trk::TrackStateOnSurface *tsos, bool &isIDmeas, bool &isMSmeas) const
 
void findLastValidTSoS (const Trk::TrackStates *oldTrackStates, const Trk::TrackStateOnSurface *&lastValidIDTSOS, const TrackStateOnSurface *&lastValidMSTSOS) const
 
bool keepParameters (const Trk::TrackStateOnSurface *TSoS, const TrackStateOnSurface *&firstValidIDTSOS, const TrackStateOnSurface *&lastValidIDTSOS, const TrackStateOnSurface *&firstValidMSTSOS, const TrackStateOnSurface *&lastValidMSTSOS) 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

bool m_keepCaloDeposit
 any CaloDeposit with its adjacent MEOT's will be kept on the slimmed track (combined muon property) More...
 
bool m_keepOutliers
 If true, Outliers will be kept on the slimmed track. More...
 
bool m_keepParameters
 If true, the first and last parameters of ID & MS subsystems will be kept on the slimmed track. More...
 
const AtlasDetectorIDm_detID
 atlas id helper 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

A tool to produce 'slimmed' Tracks from a reference track.

By default, this slimmed track will include all the measurements, and the Perigee parameters (currently these are assumed to exist)

Author
Edward Moyse <Edward.Moysecern.ch>
Christos Anastopoulos Athena MT modifications

Definition at line 34 of file TrackSlimmingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackSlimmingTool()

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

Definition at line 23 of file TrackSlimmingTool.cxx.

26  : AthAlgTool(t, n, p)
27  , m_keepCaloDeposit(true)
28  , m_keepOutliers(false)
29  , m_keepParameters(false)
30  , m_detID{}
31 {
32  declareInterface<ITrackSlimmingTool>(this);
33 
34  // template for property decalration
36  "KeepCaloDeposit",
38  "If this is set to true, any CaloDeposit with its adjacent MEOT's will be "
39  "kept on the slimmed track (combined muon property)");
40  declareProperty("KeepOutliers",
42  "If this is set to true, Outlier measurements will be kept "
43  "on the slimmed track");
44  declareProperty("KeepParameters",
46  "If this is set to true, the first and last parameters will "
47  "be kept on the slimmed track");
48 }

◆ ~TrackSlimmingTool()

Trk::TrackSlimmingTool::~TrackSlimmingTool ( )
virtualdefault

default destructor

Member Function Documentation

◆ checkForValidMeas()

void Trk::TrackSlimmingTool::checkForValidMeas ( const Trk::TrackStateOnSurface tsos,
bool &  isIDmeas,
bool &  isMSmeas 
) const
private

Definition at line 188 of file TrackSlimmingTool.cxx.

191 {
192  if (tsos->measurementOnTrack() != nullptr) {
193  bool isPseudo = (tsos->measurementOnTrack()->type(
195  // Handle cROTs
196  const Trk::CompetingRIOsOnTrack* cROT = nullptr;
197  if (tsos->measurementOnTrack()->type(
199  cROT = static_cast<const Trk::CompetingRIOsOnTrack*>(
200  tsos->measurementOnTrack());
201  }
202  Identifier id;
203  if (cROT) {
204  id = cROT->rioOnTrack(cROT->indexOfMaxAssignProb()).identify();
205  } else {
206  id = tsos->measurementOnTrack()
209  }
210  isIDmeas = !isPseudo && m_detID->is_indet(id);
211  isMSmeas = tsos->measurementOnTrack() != nullptr && !isPseudo &&
212  m_detID->is_muon(id);
213  }
214 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ finalize()

StatusCode Trk::TrackSlimmingTool::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 70 of file TrackSlimmingTool.cxx.

71 {
72  return StatusCode::SUCCESS;
73 }

◆ findLastValidTSoS()

void Trk::TrackSlimmingTool::findLastValidTSoS ( const Trk::TrackStates oldTrackStates,
const Trk::TrackStateOnSurface *&  lastValidIDTSOS,
const TrackStateOnSurface *&  lastValidMSTSOS 
) const
private

Definition at line 217 of file TrackSlimmingTool.cxx.

221 {
222 
224  oldTrackStates->rbegin();
225  rItTSoS != oldTrackStates->rend();
226  ++rItTSoS) {
227  if ((*rItTSoS)->type(TrackStateOnSurface::Measurement) &&
228  (*rItTSoS)->trackParameters() != nullptr &&
229  (*rItTSoS)->measurementOnTrack() != nullptr &&
230  !(*rItTSoS)->measurementOnTrack()->type(
232 
233  if (m_detID->is_indet((*rItTSoS)
234  ->trackParameters()
235  ->associatedSurface()
236  .associatedDetectorElementIdentifier())) {
237  lastValidIDTSOS = (*rItTSoS);
238  break;
239  }
240  if (m_detID->is_muon((*rItTSoS)
241  ->trackParameters()
242  ->associatedSurface()
243  .associatedDetectorElementIdentifier())) {
244  lastValidMSTSOS = (*rItTSoS);
245  break;
246  }
247  }
248  }
249 }

◆ initialize()

StatusCode Trk::TrackSlimmingTool::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 52 of file TrackSlimmingTool.cxx.

53 {
54 
56  if (sc.isFailure())
57  return sc;
58 
59  sc = detStore()->retrieve(m_detID, "AtlasID");
60  if (sc.isFailure()) {
61  ATH_MSG_FATAL("Could not get AtlasDetectorID ");
62  return sc;
63  }
64  ATH_MSG_DEBUG("Found AtlasDetectorID");
65 
66  return StatusCode::SUCCESS;
67 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ interfaceID()

const InterfaceID & Trk::ITrackSlimmingTool::interfaceID ( )
inlinestaticinherited

Definition at line 59 of file ITrackSlimmingTool.h.

60 {
61  return IID_ITrackSlimmingTool;
62 }

◆ keepParameters()

bool Trk::TrackSlimmingTool::keepParameters ( const Trk::TrackStateOnSurface TSoS,
const TrackStateOnSurface *&  firstValidIDTSOS,
const TrackStateOnSurface *&  lastValidIDTSOS,
const TrackStateOnSurface *&  firstValidMSTSOS,
const TrackStateOnSurface *&  lastValidMSTSOS 
) const
private

Definition at line 252 of file TrackSlimmingTool.cxx.

258 {
259 
260  if (TSoS->trackParameters() != nullptr &&
262  return true;
263  }
264  // Now do checks for first/last ID/MS measurement (isIDmeas and isMSmeas)
265  if (m_keepParameters) {
266  bool isIDmeas = false;
267  bool isMSmeas = false;
268  checkForValidMeas(TSoS, isIDmeas, isMSmeas);
269  // entering ID?
270  if (isIDmeas && !firstValidIDTSOS &&
272  firstValidIDTSOS = TSoS;
273  if (TSoS->trackParameters() != nullptr)
274  return true;
275  }
276  // entering MS?
277  if (isMSmeas && !firstValidMSTSOS) {
278  firstValidMSTSOS = TSoS;
279  if (TSoS->trackParameters() != nullptr)
280  return true;
281  }
282  // Is this the last TSOS on the track?
283  if (lastValidIDTSOS == TSoS || lastValidMSTSOS == TSoS) {
284  if (TSoS->trackParameters() != nullptr)
285  return true;
286  }
287  }
288  return false;
289 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setHints()

void Trk::TrackSlimmingTool::setHints ( const Trk::Track track) const
private

This method just set persistification Hints.

Definition at line 89 of file TrackSlimmingTool.cxx.

90 {
91  const Trk::TrackStates* oldTrackStates =
92  track.trackStateOnSurfaces();
93  if (oldTrackStates == nullptr) {
94  ATH_MSG_WARNING("Track has no TSOS vector! Skipping track, returning");
95  return;
96  }
97 
98  const TrackStateOnSurface* firstValidIDTSOS(nullptr);
99  const TrackStateOnSurface* lastValidIDTSOS(nullptr);
100  const TrackStateOnSurface* firstValidMSTSOS(nullptr);
101  const TrackStateOnSurface* lastValidMSTSOS(nullptr);
102  if (m_keepParameters) {
103  // search last valid TSOS first (as won't be found in later loop)
104  findLastValidTSoS(oldTrackStates, lastValidIDTSOS, lastValidMSTSOS);
105  }
106 
107  // If m_keepParameters is true, then we want to keep the first and last
108  // parameters of ID & MS.
109  const Trk::MeasurementBase* rot = nullptr;
110  const Trk::TrackParameters* parameters = nullptr;
111  bool keepParameter = false;
112  // looping over all TSOS
114  oldTrackStates->begin();
115  for (; itTSoS != oldTrackStates->end(); ++itTSoS) {
116 
117  // The hints we want to create for this tsos
118  std::bitset<Trk::TrackStateOnSurface::NumberOfPersistencyHints> hints{};
119  //
121  parameters = nullptr;
122  rot = nullptr;
123  // if requested: keep calorimeter TSOS with adjacent scatterers (on combined
124  // muons)
125  if (m_keepCaloDeposit &&
126  (**itTSoS).type(TrackStateOnSurface::CaloDeposit)) {
127  // preceding TSOS (if Scatterer)
128  if (itTSoS != oldTrackStates->begin()) {
129  --itTSoS;
130  if ((**itTSoS).type(TrackStateOnSurface::Scatterer)) {
132  }
133  ++itTSoS;
134  }
135  // copy removes CaloEnergy (just keep base EnergyLoss)
136  const MaterialEffectsOnTrack* meot =
137  dynamic_cast<const MaterialEffectsOnTrack*>(
138  (**itTSoS).materialEffectsOnTrack());
139  if (meot && meot->energyLoss()) {
142  }
143  // following TSOS (if Scatterer)
144  ++itTSoS;
145  if (itTSoS != oldTrackStates->end() &&
146  (**itTSoS).type(TrackStateOnSurface::Scatterer)) {
148  }
149  --itTSoS;
150  }
151 
152  // We only keep TSOS if they either contain a perigee, OR are a measurement
153  if ((*itTSoS)->measurementOnTrack() == nullptr &&
154  !(*itTSoS)->type(TrackStateOnSurface::Perigee)) {
155  // pass the hints to the tsos before we continue to the next
156  (*itTSoS)->setHints(hints.to_ulong());
157  continue;
158  }
159 
160  keepParameter = keepParameters((*itTSoS),
161  firstValidIDTSOS,
162  lastValidIDTSOS,
163  firstValidMSTSOS,
164  lastValidMSTSOS);
165 
166  if (keepParameter) {
167  parameters = (*itTSoS)->trackParameters();
168  }
169  if ((*itTSoS)->measurementOnTrack() != nullptr &&
170  ((*itTSoS)->type(TrackStateOnSurface::Measurement) ||
171  (m_keepOutliers && (*itTSoS)->type(TrackStateOnSurface::Outlier)))) {
172  rot = (*itTSoS)->measurementOnTrack();
173  }
174  if (rot != nullptr || parameters != nullptr) {
175  if (rot) {
177  }
178  if (parameters) {
180  }
181  }
182  // pass the hints to the tsos
183  (*itTSoS)->setHints(hints.to_ulong());
184  }
185 }

◆ slimConstTrack()

void Trk::TrackSlimmingTool::slimConstTrack ( const Trk::Track track) const
finaloverridevirtual

Slim a const Track.

Parameters
trackA const reference to the track to be slimmed.

The method sets persistification hints in the Track's TrackStateOnSurfaces So a slimmed version is written to disk

Same as the non-const version but does not set the SlimmedTrack property.

Implements Trk::ITrackSlimmingTool.

Definition at line 83 of file TrackSlimmingTool.cxx.

84 {
85  setHints(track);
86 }

◆ slimTrack()

void Trk::TrackSlimmingTool::slimTrack ( Trk::Track track) const
finaloverridevirtual

Slim a non const Track.

Parameters
trackA reference to the track to be slimmed.

The method sets persistification hints in the Track's TrackStateOnSurfaces So a slimmed version is written to disk

The properties are modified setTrackProperties(TrackInfo::SlimmedTrack);

Implements Trk::ITrackSlimmingTool.

Definition at line 76 of file TrackSlimmingTool.cxx.

77 {
78  setHints(track);
79  track.info().setTrackProperties(TrackInfo::SlimmedTrack);
80 }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_detID

const AtlasDetectorID* Trk::TrackSlimmingTool::m_detID
private

atlas id helper

Definition at line 89 of file TrackSlimmingTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_keepCaloDeposit

bool Trk::TrackSlimmingTool::m_keepCaloDeposit
private

any CaloDeposit with its adjacent MEOT's will be kept on the slimmed track (combined muon property)

Definition at line 79 of file TrackSlimmingTool.h.

◆ m_keepOutliers

bool Trk::TrackSlimmingTool::m_keepOutliers
private

If true, Outliers will be kept on the slimmed track.

Definition at line 82 of file TrackSlimmingTool.h.

◆ m_keepParameters

bool Trk::TrackSlimmingTool::m_keepParameters
private

If true, the first and last parameters of ID & MS subsystems will be kept on the slimmed track.

Definition at line 86 of file TrackSlimmingTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
Trk::TrackStateOnSurface::CaloDeposit
@ CaloDeposit
This TSOS contains a CaloEnergy object.
Definition: TrackStateOnSurface.h:135
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::TrackSlimmingTool::m_keepParameters
bool m_keepParameters
If true, the first and last parameters of ID & MS subsystems will be kept on the slimmed track.
Definition: TrackSlimmingTool.h:86
Trk::TrackSlimmingTool::m_keepCaloDeposit
bool m_keepCaloDeposit
any CaloDeposit with its adjacent MEOT's will be kept on the slimmed track (combined muon property)
Definition: TrackSlimmingTool.h:79
DataVector::rend
const_reverse_iterator rend() const noexcept
Return a const_reverse_iterator pointing at the beginning of the collection.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::TrackStateOnSurface::PersistifyTrackParameters
@ PersistifyTrackParameters
Mark track parameters for persisitification.
Definition: TrackStateOnSurface.h:167
initialize
void initialize()
Definition: run_EoverP.cxx:894
Trk::Surface::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
Trk::TrackSlimmingTool::checkForValidMeas
void checkForValidMeas(const Trk::TrackStateOnSurface *tsos, bool &isIDmeas, bool &isMSmeas) const
Definition: TrackSlimmingTool.cxx:188
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::identify
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
Trk::TrackStateOnSurface::measurementOnTrack
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
Trk::TrackStateOnSurface::PersistifyMeasurement
@ PersistifyMeasurement
Mark the measuremenet for persistification.
Definition: TrackStateOnSurface.h:162
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::TrackSlimmingTool::m_detID
const AtlasDetectorID * m_detID
atlas id helper
Definition: TrackSlimmingTool.h:89
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Trk::TrackInfo::SlimmedTrack
@ SlimmedTrack
A slimmed track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:87
Trk::TrackStateOnSurface::type
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::MeasurementBaseType::CompetingRIOsOnTrack
@ CompetingRIOsOnTrack
Definition: MeasurementBase.h:50
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::TrackSlimmingTool::keepParameters
bool keepParameters(const Trk::TrackStateOnSurface *TSoS, const TrackStateOnSurface *&firstValidIDTSOS, const TrackStateOnSurface *&lastValidIDTSOS, const TrackStateOnSurface *&firstValidMSTSOS, const TrackStateOnSurface *&lastValidMSTSOS) const
Definition: TrackSlimmingTool.cxx:252
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
Trk::MeasurementBase::type
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::TrackStateOnSurface::PersistifySlimCaloDeposit
@ PersistifySlimCaloDeposit
Mark track parameters for persisitification.
Definition: TrackStateOnSurface.h:172
DataVector< const Trk::TrackStateOnSurface >
DataVector::rbegin
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::TrackSlimmingTool::m_keepOutliers
bool m_keepOutliers
If true, Outliers will be kept on the slimmed track.
Definition: TrackSlimmingTool.h:82
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
DataVector< const Trk::TrackStateOnSurface >::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Standard const_reverse_iterator.
Definition: DataVector.h:846
Trk::TrackSlimmingTool::setHints
void setHints(const Trk::Track &track) const
This method just set persistification Hints.
Definition: TrackSlimmingTool.cxx:89
Trk::TrackSlimmingTool::findLastValidTSoS
void findLastValidTSoS(const Trk::TrackStates *oldTrackStates, const Trk::TrackStateOnSurface *&lastValidIDTSOS, const TrackStateOnSurface *&lastValidMSTSOS) const
Definition: TrackSlimmingTool.cxx:217
AtlasDetectorID::is_indet
bool is_indet(Identifier id) const
Definition: AtlasDetectorID.h:683
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
AtlasDetectorID::is_muon
bool is_muon(Identifier id) const
Definition: AtlasDetectorID.h:701
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::TrackStateOnSurface::Scatterer
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Definition: TrackStateOnSurface.h:113
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::MeasurementBaseType::PseudoMeasurementOnTrack
@ PseudoMeasurementOnTrack
Definition: MeasurementBase.h:51
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TrackStateOnSurface::PartialPersistification
@ PartialPersistification
Definition: TrackStateOnSurface.h:158
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14