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

#include <AlignTrackPreProcessor.h>

Inheritance diagram for Trk::AlignTrackPreProcessor:
Collaboration diagram for Trk::AlignTrackPreProcessor:

Public Member Functions

 AlignTrackPreProcessor (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~AlignTrackPreProcessor ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
DataVector< Track > * processTrackCollection (const DataVector< Track > *trks)
 creates AlignTrack containing all TSOS on track More...
 
virtual void setLogStream (std::ostream *os)
 sets the output stream for the logfile More...
 
virtual void setNtuple (TFile *)
 Sets output ntuple file, to be implemented if needed for detector-specific implementation. More...
 
virtual StatusCode fillNtuple ()
 writes tree and histogrms to ntuple More...
 
virtual void accumulateVTX (AlignTrack *)
 methods added for the full VTX fit: More...
 
virtual void solveVTX ()
 
virtual void printSummary ()
 Print processing summary to logfile. 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...
 

Protected Attributes

std::ostream * m_logStream
 logfile output stream More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

TrackperformSiliconHitSelection (const Track *, const ToolHandle< Trk::IGlobalTrackFitter > &)
 select silicon hits by quality. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< IGlobalTrackFitterm_trackFitterTool
 
ToolHandle< IGlobalTrackFitterm_SLTrackFitterTool
 
ToolHandle< InDet::IInDetTrackSelectionToolm_trackSelectorTool
 
ToolHandle< IInDetAlignHitQualSelToolm_hitQualityTool
 
bool m_refitTracks
 
bool m_storeFitMatricesAfterRefit
 

flag to refit tracks

More...
 
bool m_runOutlierRemoval
 

flag to store derivative and covariance matrices after refit

More...
 
int m_particleHypothesis
 

run outlier removal in track refit

More...
 
bool m_useSingleFitter
 

particle hypothesis in track refit

More...
 
bool m_selectTracks
 do the track selection More...
 
bool m_selectHits
 perform the hit InnerDetector selection More...
 
bool m_fixMomentum
 Fix the momentum of the track so it is not refitted. 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 37 of file AlignTrackPreProcessor.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

◆ AlignTrackPreProcessor()

AlignTrackPreProcessor::AlignTrackPreProcessor ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 30 of file AlignTrackPreProcessor.cxx.

34  , m_trackFitterTool("Trk::GlobalChi2Fitter/InDetTrackFitter")
37  , m_runOutlierRemoval(false)
39  , m_useSingleFitter(false)
40  , m_selectHits(false)
41  , m_fixMomentum(false)
42  {
43  declareInterface<IAlignTrackPreProcessor>(this);
44 
45  declareProperty("RefitTracks", m_refitTracks = true);
46 
47  declareProperty("TrackFitterTool", m_trackFitterTool);
48  declareProperty("SLTrackFitterTool", m_SLTrackFitterTool);
49  declareProperty("UseSingleFitter", m_useSingleFitter = false);
50 
51  declareProperty("StoreFitMatricesAfterRefit", m_storeFitMatricesAfterRefit = true);
52 
53  declareProperty("TrackSelectorTool", m_trackSelectorTool);
54  declareProperty("SelectTracks", m_selectTracks = false);
55 
56  declareProperty("ParticleHypothesis", m_particleHypothesis);
57  declareProperty("RunOutlierRemoval", m_runOutlierRemoval = false);
58 
59  declareProperty("HitQualityTool", m_hitQualityTool);
60  declareProperty("SelectHits", m_selectHits);
61  declareProperty("FixMomentum", m_fixMomentum);
62 
63  m_logStream = nullptr;
64  }

◆ ~AlignTrackPreProcessor()

AlignTrackPreProcessor::~AlignTrackPreProcessor ( )
virtualdefault

Member Function Documentation

◆ accumulateVTX()

virtual void Trk::IAlignTrackPreProcessor::accumulateVTX ( AlignTrack )
inlinevirtualinherited

methods added for the full VTX fit:

Reimplemented in Trk::BeamspotVertexPreProcessor.

Definition at line 57 of file IAlignTrackPreProcessor.h.

57 {}

◆ 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

◆ fillNtuple()

virtual StatusCode Trk::IAlignTrackPreProcessor::fillNtuple ( )
inlinevirtualinherited

writes tree and histogrms to ntuple

Definition at line 54 of file IAlignTrackPreProcessor.h.

54 { return StatusCode::SUCCESS; }

◆ finalize()

StatusCode AlignTrackPreProcessor::finalize ( )

Definition at line 121 of file AlignTrackPreProcessor.cxx.

122  {
123  return StatusCode::SUCCESS;
124  }

◆ initialize()

StatusCode AlignTrackPreProcessor::initialize ( )

Definition at line 71 of file AlignTrackPreProcessor.cxx.

72  {
73  // get track fitter tools
74  if (m_trackFitterTool.retrieve().isSuccess())
75  ATH_MSG_INFO("Retrieved " << m_trackFitterTool);
76  else{
77  msg(MSG::FATAL) << "Could not get " << m_trackFitterTool << endmsg;
78  return StatusCode::FAILURE;
79  }
80 
81  if (m_useSingleFitter) {
82 
83  if (m_SLTrackFitterTool.retrieve().isSuccess())
84  ATH_MSG_INFO("Retrieved " << m_SLTrackFitterTool);
85  else {
86  msg(MSG::FATAL) << "Could not get " << m_SLTrackFitterTool << endmsg;
87  return StatusCode::FAILURE;
88  }
89  }
90 
91  if(m_selectTracks) {
92  if(m_trackSelectorTool.empty()) {
93  msg(MSG::FATAL) << "TrackSelectorTool not specified : " << m_trackSelectorTool << endmsg;
94  return StatusCode::FAILURE;
95  }
96  else if(m_trackSelectorTool.retrieve().isFailure())
97  {
98  msg(MSG::FATAL) << "Could not get " << m_trackSelectorTool << endmsg;
99  return StatusCode::FAILURE;
100  }
101  ATH_MSG_INFO("Retrieved " << m_trackSelectorTool);
102  }
103 
104  if (m_selectHits) {
105  if(m_hitQualityTool.empty()) {
106  msg(MSG::FATAL) << "HitQualityTool not specified : " << m_hitQualityTool << endmsg;
107  return StatusCode::FAILURE;
108  }
109  else if(m_hitQualityTool.retrieve().isFailure())
110  {
111  msg(MSG::FATAL) << "Could not get " << m_trackSelectorTool << endmsg;
112  return StatusCode::FAILURE;
113  }
114  ATH_MSG_INFO("Retrieved " << m_hitQualityTool);
115  }
116 
117  return StatusCode::SUCCESS;
118  }

◆ 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 & IAlignTrackPreProcessor::interfaceID ( )
inlinestaticinherited

Definition at line 70 of file IAlignTrackPreProcessor.h.

71  {
72  return IID_Trk_IAlignTrackPreProcessor;
73  }

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

◆ performSiliconHitSelection()

Track * AlignTrackPreProcessor::performSiliconHitSelection ( const Track inputTrack,
const ToolHandle< Trk::IGlobalTrackFitter > &  fitter 
)
private

select silicon hits by quality.

keep all the rest

select silicon hits by quality. keep all the rest

Definition at line 239 of file AlignTrackPreProcessor.cxx.

240  {
242  ATH_MSG_DEBUG(" -- performSiliconHitSelection -- before removing bad Silicon hits, this track has "<< inputTrack->trackStateOnSurfaces()->size()<< " tsos");
243  Track * newTrack;
244 
245  std::vector<const Trk::MeasurementBase*> selectedMeasurementSet;
246 
247  // loop on track hits
248  int nhits = 0;
249  for (const Trk::TrackStateOnSurface* tsos : *inputTrack->trackStateOnSurfaces())
250  {
251  nhits++;
252  if (m_hitQualityTool->isGoodSiHit(tsos)) {
253  selectedMeasurementSet.push_back( tsos->measurementOnTrack() );
254  }
255  else {
256  ATH_MSG_DEBUG(" -- performSiliconHitSelection -- hit # "<< nhits << " status = BAD HIT ");
257  }
258  }
259  ATH_MSG_DEBUG(" -- performSiliconHitSelection -- after removing bad Silicon hits, the selected measurement collection has "<< selectedMeasurementSet.size()<< " elements");
260 
261  newTrack = (fitter->fit(Gaudi::Hive::currentContext(),
262  selectedMeasurementSet,
263  *inputTrack->perigeeParameters(),
265 
266  return newTrack;
267  }

◆ printSummary()

virtual void Trk::IAlignTrackPreProcessor::printSummary ( )
inlinevirtualinherited

Print processing summary to logfile.

Reimplemented in Trk::BeamspotVertexPreProcessor.

Definition at line 62 of file IAlignTrackPreProcessor.h.

62 {}

◆ processTrackCollection()

DataVector< Track > * AlignTrackPreProcessor::processTrackCollection ( const DataVector< Track > *  trks)
virtual

creates AlignTrack containing all TSOS on track

select silicon hits by quality. keep all the rest

Implements Trk::IAlignTrackPreProcessor.

Definition at line 127 of file AlignTrackPreProcessor.cxx.

128  {
129  ATH_MSG_DEBUG("AlignTrackPreProcessor::processTrackCollection()");
130 
131  if (!tracks || tracks->empty())
132  return nullptr;
133 
134  // the output collection of AlignTracks
135  // we define it as collection of Tracks but fill AlignTracks inside
136  DataVector<Track> * newTracks = new DataVector<Track>;
137 
138  int itrk(0);
139  // loop over tracks and create AlignTracks
140  TrackCollection::const_iterator it = tracks->begin();
141  TrackCollection::const_iterator it_end = tracks->end();
142 
143  for ( ; it != it_end ; ++it, ++itrk) {
144 
145  ATH_MSG_DEBUG(" ** processTrackCollection ** Processing track "<<itrk);
146  const Track * origTrack = *it;
147  const Track * newTrack = *it;
148  AlignTrack* at;
149 
150  // check whether the original track passes selection
151  if (m_selectTracks) {
152  if(!m_trackSelectorTool->accept(*origTrack)) {
153  ATH_MSG_VERBOSE(" ** processTrackCollection ** Original track did not pass the selection."<<itrk);
154  continue;
155  }
156 
157  ToolHandle<Trk::IGlobalTrackFitter> fitter=m_trackFitterTool;
158  if (!m_useSingleFitter && AlignTrack::isSLTrack(origTrack) )
160 
161  if (m_selectHits) {
163  ATH_MSG_DEBUG(" ** processTrackCollection ** entering the silicon hit selection ");
164  newTrack = performSiliconHitSelection(origTrack, fitter);
165 
166  if (!newTrack) {
167  ATH_MSG_DEBUG(" ** processTrackCollection ** Track refit yielded no track. Skipping the track.");
168  continue;
169  }
170 
171  // check whether the track passes selection
172  if(!m_trackSelectorTool->accept(*newTrack)) {
173  ATH_MSG_DEBUG(" ** processTrackCollection ** Track did not pass the selection.");
174  delete newTrack;
175  continue;
176  }
177  }
178 
179  IGlobalTrackFitter::AlignmentCache alignCache;
180  // refit track
181  if (m_refitTracks &!m_selectHits) {
182 
183  newTrack=fitter->alignmentFit(alignCache,*origTrack,m_runOutlierRemoval,ParticleHypothesis(m_particleHypothesis));
184  if (!newTrack) {
185  ATH_MSG_DEBUG("Track refit yielded no track. Skipping the track.");
186  continue;
187  }
188  // check that the refitted track satisfies the aligntrack selection
189  if(!m_trackSelectorTool->accept(*newTrack)) {
190  ATH_MSG_DEBUG("New track did not pass the selection.");
191  delete newTrack;
192  continue;
193  }
194  }
195 
196  at = new AlignTrack(*newTrack);
197 
198  if (msgLvl(MSG::DEBUG) && !msgLvl(MSG::VERBOSE)) {
199  msg(MSG::DEBUG)<<"before refit: "<<endmsg;
201  msg(MSG::DEBUG)<<"after refit: "<<endmsg;
204  }
205 
206  // store fit matrices
208  at->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix);
209  at->setDerivativeMatrix(alignCache.m_derivMatrix);
210  }
211  if (m_fixMomentum)
212  {
213  at->AlignTrack::setRefitQovP(false);
214  }
215  // delete newTrack since it's copied in AlignTrack
216  delete newTrack;
217  }
218  else { // in case no selection is performed, keep all tracks
219  at=new AlignTrack(*newTrack);
220  }
221  if (m_fixMomentum)
222  {
223  at->AlignTrack::setRefitQovP(false);
224  }
225 
226  newTracks->push_back(at);
227  }
228 
229 
230  if (newTracks->empty()) {
231  delete newTracks;
232  return nullptr;
233  }
234 
235  return newTracks;
236  }

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

◆ setLogStream()

virtual void Trk::IAlignTrackPreProcessor::setLogStream ( std::ostream *  os)
inlinevirtualinherited

sets the output stream for the logfile

Definition at line 48 of file IAlignTrackPreProcessor.h.

48 { m_logStream = os; }

◆ setNtuple()

virtual void Trk::IAlignTrackPreProcessor::setNtuple ( TFile *  )
inlinevirtualinherited

Sets output ntuple file, to be implemented if needed for detector-specific implementation.

Definition at line 51 of file IAlignTrackPreProcessor.h.

51 {}

◆ solveVTX()

virtual void Trk::IAlignTrackPreProcessor::solveVTX ( )
inlinevirtualinherited

Reimplemented in Trk::BeamspotVertexPreProcessor.

Definition at line 59 of file IAlignTrackPreProcessor.h.

59 {}

◆ 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_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_fixMomentum

bool Trk::AlignTrackPreProcessor::m_fixMomentum
private

Fix the momentum of the track so it is not refitted.

Definition at line 72 of file AlignTrackPreProcessor.h.

◆ m_hitQualityTool

ToolHandle<IInDetAlignHitQualSelTool> Trk::AlignTrackPreProcessor::m_hitQualityTool
private

Definition at line 57 of file AlignTrackPreProcessor.h.

◆ m_logStream

std::ostream* Trk::IAlignTrackPreProcessor::m_logStream
protectedinherited

logfile output stream

Definition at line 66 of file IAlignTrackPreProcessor.h.

◆ m_particleHypothesis

int Trk::AlignTrackPreProcessor::m_particleHypothesis
private

run outlier removal in track refit

Definition at line 66 of file AlignTrackPreProcessor.h.

◆ m_refitTracks

bool Trk::AlignTrackPreProcessor::m_refitTracks
private

Definition at line 62 of file AlignTrackPreProcessor.h.

◆ m_runOutlierRemoval

bool Trk::AlignTrackPreProcessor::m_runOutlierRemoval
private

flag to store derivative and covariance matrices after refit

Definition at line 65 of file AlignTrackPreProcessor.h.

◆ m_selectHits

bool Trk::AlignTrackPreProcessor::m_selectHits
private

perform the hit InnerDetector selection

Definition at line 71 of file AlignTrackPreProcessor.h.

◆ m_selectTracks

bool Trk::AlignTrackPreProcessor::m_selectTracks
private

do the track selection

Definition at line 70 of file AlignTrackPreProcessor.h.

◆ m_SLTrackFitterTool

ToolHandle<IGlobalTrackFitter> Trk::AlignTrackPreProcessor::m_SLTrackFitterTool
private

Definition at line 53 of file AlignTrackPreProcessor.h.

◆ m_storeFitMatricesAfterRefit

bool Trk::AlignTrackPreProcessor::m_storeFitMatricesAfterRefit
private

flag to refit tracks

Definition at line 63 of file AlignTrackPreProcessor.h.

◆ m_trackFitterTool

ToolHandle<IGlobalTrackFitter> Trk::AlignTrackPreProcessor::m_trackFitterTool
private

Definition at line 52 of file AlignTrackPreProcessor.h.

◆ m_trackSelectorTool

ToolHandle<InDet::IInDetTrackSelectionTool> Trk::AlignTrackPreProcessor::m_trackSelectorTool
private

Definition at line 56 of file AlignTrackPreProcessor.h.

◆ m_useSingleFitter

bool Trk::AlignTrackPreProcessor::m_useSingleFitter
private

particle hypothesis in track refit

only use 1 fitter for refitting track

Definition at line 68 of file AlignTrackPreProcessor.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:
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
Trk::AlignTrackPreProcessor::m_selectTracks
bool m_selectTracks
do the track selection
Definition: AlignTrackPreProcessor.h:70
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::AlignTrackPreProcessor::m_useSingleFitter
bool m_useSingleFitter
particle hypothesis in track refit
Definition: AlignTrackPreProcessor.h:68
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::IAlignTrackPreProcessor::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IAlignTrackPreProcessor.h:66
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::AlignTrack::isSLTrack
bool isSLTrack() const
method to determine whether a straight line track or not
Definition: AlignTrack.cxx:263
LArSamples::ShapeFitter::fit
bool fit(const LArSamples::AbsShape &data, const AbsShape &reference, double &k, double &deltaT, double &chi2, const ScaledErrorData *sed=0) const
Definition: ShapeFitter.cxx:32
Trk::AlignTrackPreProcessor::m_runOutlierRemoval
bool m_runOutlierRemoval
flag to store derivative and covariance matrices after refit
Definition: AlignTrackPreProcessor.h:65
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::AlignTrackPreProcessor::m_particleHypothesis
int m_particleHypothesis
run outlier removal in track refit
Definition: AlignTrackPreProcessor.h:66
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
Trk::AlignTrackPreProcessor::performSiliconHitSelection
Track * performSiliconHitSelection(const Track *, const ToolHandle< Trk::IGlobalTrackFitter > &)
select silicon hits by quality.
Definition: AlignTrackPreProcessor.cxx:239
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::AlignTrackPreProcessor::m_storeFitMatricesAfterRefit
bool m_storeFitMatricesAfterRefit
flag to refit tracks
Definition: AlignTrackPreProcessor.h:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::AlignTrackPreProcessor::m_trackSelectorTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelectorTool
Definition: AlignTrackPreProcessor.h:56
Trk::AlignTrackPreProcessor::m_trackFitterTool
ToolHandle< IGlobalTrackFitter > m_trackFitterTool
Definition: AlignTrackPreProcessor.h:52
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::AlignTrackPreProcessor::m_refitTracks
bool m_refitTracks
Definition: AlignTrackPreProcessor.h:62
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Trk::AlignTrackPreProcessor::m_selectHits
bool m_selectHits
perform the hit InnerDetector selection
Definition: AlignTrackPreProcessor.h:71
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::AlignTrackPreProcessor::m_hitQualityTool
ToolHandle< IInDetAlignHitQualSelTool > m_hitQualityTool
Definition: AlignTrackPreProcessor.h:57
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Trk::AlignTrackPreProcessor::m_SLTrackFitterTool
ToolHandle< IGlobalTrackFitter > m_SLTrackFitterTool
Definition: AlignTrackPreProcessor.h:53
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::AlignTrack::dumpLessTrackInfo
static void dumpLessTrackInfo(const Track &track, MsgStream &msg)
dump less track information
Definition: AlignTrack.cxx:276
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
fitman.k
k
Definition: fitman.py:528
AlignTrack
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
Trk::AlignTrackPreProcessor::m_fixMomentum
bool m_fixMomentum
Fix the momentum of the track so it is not refitted.
Definition: AlignTrackPreProcessor.h:72