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

#include <InDetJetFitterVxFinder.h>

Inheritance diagram for InDet::InDetJetFitterVxFinder:
Collaboration diagram for InDet::InDetJetFitterVxFinder:

Public Member Functions

virtual StatusCode initialize () override
 
 InDetJetFitterVxFinder (const std::string &t, const std::string &n, const IInterface *p)
 
 ~InDetJetFitterVxFinder ()
 
virtual Trk::VxSecVertexInfofindSecVertex (const xAOD::Vertex &, const TLorentzVector &, const std::vector< const xAOD::IParticle * > &) const override
 
const Trk::VxSecVertexInfofindSecVertex (const Trk::RecVertex &primaryVertex, const TLorentzVector &jetMomentum, const std::vector< const Trk::TrackParticleBase * > &inputTracks) const
 
const Trk::VxSecVertexInfofindSecVertex (const Trk::RecVertex &primaryVertex, const TLorentzVector &jetMomentum, const std::vector< const Trk::TrackParticleBase * > &firstInputTracks, const std::vector< const Trk::TrackParticleBase * > &secondInputTracks, const Amg::Vector3D &vtxSeedDirection) 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 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
 
virtual std::vector< std::string > trackDecorationNames () const
 Return a list of the names of track decorations created by this tool, in order to allow them to be locked when the calling algorithm completes. More...
 

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 doTheFit (Trk::VxJetCandidate *myJetCandidate, bool performClustering=true) 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

ToolHandle< Trk::JetFitterInitializationHelperm_initializationHelper {this,"JetFitterInitializationHelper","Trk::JetFitterInitializationHelper",""}
 
ToolHandle< Trk::JetFitterHelperm_helper {this,"JetFitterHelper","Trk::JetFitterHelper",""}
 
ToolHandle< Trk::JetFitterRoutinesm_routines {this,"JetFitterRoutines","Trk::JetFitterRoutines",""}
 
ToolHandle< Trk::ITrackSelectorToolm_trkFilter {this,"TrackSelector","InDet::InDetDetailedTrackSelectorTool",""}
 
Gaudi::Property< int > m_maxNumDeleteIterations {this,"MaxNumDeleteIterations",30,""}
 
Gaudi::Property< float > m_vertexProbCut {this,"VertexProbCut",0.01,""}
 
Gaudi::Property< int > m_maxClusteringIterations {this,"MaxClusteringIterations",30,""}
 
Gaudi::Property< float > m_vertexClusteringProbabilityCut {this,"VertexClusteringProbabilityCut",0.01,""}
 
Gaudi::Property< bool > m_useFastClustering {this,"UseFastClustering",false,""}
 
Gaudi::Property< int > m_maxTracksToFitAtOnce {this,"MaxTracksToFitAtOnce",15,""}
 
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 53 of file InDetJetFitterVxFinder.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

◆ InDetJetFitterVxFinder()

InDet::InDetJetFitterVxFinder::InDetJetFitterVxFinder ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 78 of file InDetJetFitterVxFinder.cxx.

◆ ~InDetJetFitterVxFinder()

InDet::InDetJetFitterVxFinder::~InDetJetFitterVxFinder ( )
default

Member Function Documentation

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

◆ doTheFit()

void InDet::InDetJetFitterVxFinder::doTheFit ( Trk::VxJetCandidate myJetCandidate,
bool  performClustering = true 
) const
private

Definition at line 284 of file InDetJetFitterVxFinder.cxx.

296  {
297  if (*verticesIter==nullptr) {
298  if (msgLvl(MSG::WARNING)) msg() << "One vertex is empy. Problem when trying to delete incompatible vertices. No further vertices deleted." << endmsg;
299  } else {
300  const Trk::FitQuality & fitQuality=(*verticesIter)->fitQuality();
301  if (TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5))<max_prob) {
302  max_prob=TMath::Prob(fitQuality.chiSquared(),(int)std::floor(fitQuality.numberDoF()+0.5));
303  worseVertex=*verticesIter;
304  }
305  }
306  }
307  if (max_prob<m_vertexProbCut) {
308  if (msgLvl(MSG::DEBUG)) msg() << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob << endmsg;
309  // std::cout << "Deleted vertex " << worseVertex->getNumVertex() << " with probability " << max_prob << std::endl;
310  if (worseVertex==myJetCandidate->getPrimaryVertex()) {
311  if (msgLvl(MSG::INFO)) msg() << " The most incompatible vertex is the primary vertex. Please check..." << endmsg;
312  }
313 
314  m_routines->deleteVertexFromJetCandidate(worseVertex,myJetCandidate);
315 
316  } else {
317  noMoreTracksToDelete=true;
318  if (msgLvl(MSG::VERBOSE)) msg() << "No tracks to delete: maximum probability is " << max_prob << endmsg;
319  }
320 
321  numLoops+=1;
322  } while (numLoops<m_maxNumDeleteIterations&&!(noMoreTracksToDelete));
323 
324  if (!performClustering) break;
325 
326  if (!m_useFastClustering) {
327  m_routines->fillTableWithFullProbOfMerging(myJetCandidate,5,false,10,0.01);
328  } else {
329  m_routines->fillTableWithFastProbOfMerging(myJetCandidate);
330  }
331  const Trk::VxClusteringTable* clusteringTablePtr(myJetCandidate->getClusteringTable());
332 
333 
334 
335 
336  if (clusteringTablePtr==nullptr) {
337  if (msgLvl(MSG::WARNING)) msg() << " No Clustering Table while it should have been calculated... no more clustering performed during vertexing " << endmsg;
338  noMoreVerticesToCluster=true;
339  } else {
340 
341  if (msgLvl(MSG::VERBOSE)) msg() << " clustering table is " << *clusteringTablePtr << endmsg;
342 
343  //now iterate over the full map and decide wether you want to do the clustering OR not...
344  float probVertex(0.);
345  Trk::PairOfVxVertexOnJetAxis pairOfVxVertexOnJetAxis=clusteringTablePtr->getMostCompatibleVertices(probVertex);
346  //a PairOfVxVertexOnJetAxis is a std::pair<VxVertexOnJetAxis*,VxVertexOnJetAxis*>
347 
348  if (probVertex>0.&&probVertex>m_vertexClusteringProbabilityCut) {
349  if (msgLvl(MSG::VERBOSE)) msg() << " merging vtx number " << (*pairOfVxVertexOnJetAxis.first).getNumVertex() <<
350  " and " << (*pairOfVxVertexOnJetAxis.second).getNumVertex() << endmsg;
351  // const Trk::VxVertexOnJetAxis & mergedVertex=
352  m_helper->mergeVerticesInJetCandidate(*pairOfVxVertexOnJetAxis.first,
353  *pairOfVxVertexOnJetAxis.second,
354  *myJetCandidate);
355  //now you need to update the numbering scheme
356  m_initializationHelper->updateTrackNumbering(myJetCandidate);//maybe this should be moved to a lower level...
357 
358  } else {
359  noMoreVerticesToCluster=true;
360  }
361  }
362  numClusteringLoops+=1;
363  } while (numClusteringLoops<m_maxClusteringIterations&&!(noMoreVerticesToCluster));
364 
365  //now a section should follow where the "complicate" VxJetCandidate is transformed in a conventional "VxCandidate"
366  //so that it can be used also by the normal B-Tagging algorithms...
367  //TO BE COMPLETED
368 
369  //return myJetCandidate;
370 
371  }
372 
373 
374 }//end namespace Rec

◆ 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

◆ findSecVertex() [1/3]

const Trk::VxSecVertexInfo * InDet::InDetJetFitterVxFinder::findSecVertex ( const Trk::RecVertex primaryVertex,
const TLorentzVector &  jetMomentum,
const std::vector< const Trk::TrackParticleBase * > &  firstInputTracks,
const std::vector< const Trk::TrackParticleBase * > &  secondInputTracks,
const Amg::Vector3D vtxSeedDirection 
) const

Definition at line 187 of file InDetJetFitterVxFinder.cxx.

188  {
189  if (msgLvl(MSG::VERBOSE)) msg() << " adding track to fit " << endmsg;
190  tracksToAdd.push_back(*tracks2Iter);
191  }
192 
193  bunchesOfTracks.push_back(tracksToAdd);
194  tracksToAdd.clear();
195 
196  std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3Begin=secondInputTracks.begin();
197  std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3End=secondInputTracks.end();
198  for (std::vector<const Trk::TrackParticleBase*>::const_iterator tracks3Iter=tracks3Begin;
199  tracks3Iter!=tracks3End;++tracks3Iter) {
200  if (msgLvl(MSG::VERBOSE)) msg() << " adding track to fit " << endmsg;
201  tracksToAdd.push_back(*tracks3Iter);
202  }
203 
204  if (!tracksToAdd.empty())
205  {
206  bunchesOfTracks.push_back(tracksToAdd);
207  }
208  tracksToAdd.clear();
209 
210 
211  //now it just uses these bunches...
212  //now I have just to make sure that no clustering is done at first iteration
213  //while it needs to be done at second iteration (there will be only two iterations)
214 
215 
216  std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesBegin=bunchesOfTracks.begin();
217  std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesEnd=bunchesOfTracks.end();
218 
219  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddBegin;
220  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddEnd;
221  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddIter;
222 
223 
224  Trk::VxJetCandidate* myJetCandidate=nullptr;
225 
226  for (std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesIter=BunchesBegin;
227  BunchesIter!=BunchesEnd;++BunchesIter) {
228 
229  if (BunchesIter==BunchesBegin) {
230  if (msgLvl(MSG::VERBOSE)) msg() << " initial fit with " << (*BunchesIter).size() << " tracks " << endmsg;
231  myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection,&vtxSeedDirection);
232  m_routines->initializeToMinDistancesToJetAxis(myJetCandidate);
233  if (!(*BunchesIter).empty())
234  {
235  doTheFit(myJetCandidate,true);
236  }
237  } else {
238  if (msgLvl(MSG::VERBOSE)) msg() << " other fit with " << (*BunchesIter).size() << " tracks " << endmsg;
239  std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis();
240  std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex();
241  tracksToAddBegin=(*BunchesIter).begin();
242  tracksToAddEnd=(*BunchesIter).end();
243  for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) {
244  std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex;
246  link.setElement(*tracksToAddIter);
248  Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT);
249  temp_vector_tracksAtVertex.push_back(newVxTrack);
250  setOfTracks->push_back(newVxTrack);
251  setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex));
252  }
253  if (msgLvl(MSG::VERBOSE)) msg() << " new overall number of tracks to fit : " << setOfVertices.size() << endmsg;
254  myJetCandidate->setVerticesOnJetAxis(setOfVertices);
255  m_initializationHelper->updateTrackNumbering(myJetCandidate);
256  m_routines->initializeToMinDistancesToJetAxis(myJetCandidate);
257  doTheFit(myJetCandidate);
258  }
259  }
260 
261  std::vector<Trk::VxCandidate*> myCandidates;
262  myCandidates.push_back(myJetCandidate);
263 
264 // return new Trk::VxSecVertexInfo(myCandidates);//ownership of the single objects is taken over!
265  return nullptr;
266 
267  }
268 
270  bool performClustering) const {
271 
272 
273  int numClusteringLoops=0;
274  bool noMoreVerticesToCluster(false);
275 
276  do {//reguards clustering
277 
278  if (msgLvl(MSG::VERBOSE)) msg() << "InDetJetFitterVxFinder: ------>>>> new cycle of fit" << endmsg;
279 
280  int numLoops=0;
281  bool noMoreTracksToDelete(false);
282  do {//reguards eliminating incompatible tracks...

◆ findSecVertex() [2/3]

const Trk::VxSecVertexInfo * InDet::InDetJetFitterVxFinder::findSecVertex ( const Trk::RecVertex primaryVertex,
const TLorentzVector &  jetMomentum,
const std::vector< const Trk::TrackParticleBase * > &  inputTracks 
) const

Definition at line 100 of file InDetJetFitterVxFinder.cxx.

110  {
111  if (msgLvl(MSG::VERBOSE)) msg() << " track: " << (*tracks2Iter).first << " and : " << (*tracks2Iter).second << endmsg;
112 
113  tracksToAdd.push_back((*tracks2Iter).second);
114  if (tracksToAdd.size() % m_maxTracksToFitAtOnce == 0) {
115  if (msgLvl(MSG::VERBOSE)) msg() << " new bunch " << endmsg;
116  bunchesOfTracks.push_back(tracksToAdd);
117  tracksToAdd.clear();
118  }
119  }
120 
121  bunchesOfTracks.push_back(tracksToAdd);
122 
123  std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesBegin=bunchesOfTracks.begin();
124  std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesEnd=bunchesOfTracks.end();
125 
126  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddBegin;
127  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddEnd;
128  std::vector<const Trk::TrackParticleBase*>::const_iterator tracksToAddIter;
129 
130 
131  Trk::VxJetCandidate* myJetCandidate=nullptr;
132 
133  for (std::vector<std::vector<const Trk::TrackParticleBase*> >::const_iterator BunchesIter=BunchesBegin;
134  BunchesIter!=BunchesEnd;++BunchesIter) {
135 
136  if (BunchesIter==BunchesBegin) {
137  if (msgLvl(MSG::VERBOSE)) msg() << " initial fit with " << (*BunchesIter).size() << " tracks " << endmsg;
138  myJetCandidate=m_initializationHelper->initializeJetCandidate(*BunchesIter,&primaryVertex,&myDirection);
139  m_routines->initializeToMinDistancesToJetAxis(myJetCandidate);
140  doTheFit(myJetCandidate);
141  } else {
142  if (msgLvl(MSG::VERBOSE)) msg() << " other fit with " << (*BunchesIter).size() << " tracks " << endmsg;
143  std::vector<Trk::VxVertexOnJetAxis*> setOfVertices=myJetCandidate->getVerticesOnJetAxis();
144  std::vector<Trk::VxTrackAtVertex*>* setOfTracks=myJetCandidate->vxTrackAtVertex();
145  tracksToAddBegin=(*BunchesIter).begin();
146  tracksToAddEnd=(*BunchesIter).end();
147  for (tracksToAddIter=tracksToAddBegin;tracksToAddIter!=tracksToAddEnd;++tracksToAddIter) {
148  std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex;
150  link.setElement(*tracksToAddIter);
152  Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(linkTT);
153  temp_vector_tracksAtVertex.push_back(newVxTrack);
154  setOfTracks->push_back(newVxTrack);
155  setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex));
156  }
157  if (msgLvl(MSG::VERBOSE)) msg() << " new overall number of tracks to fit : " << setOfVertices.size() << endmsg;
158  myJetCandidate->setVerticesOnJetAxis(setOfVertices);
159  m_initializationHelper->updateTrackNumbering(myJetCandidate);
160  doTheFit(myJetCandidate);
161  }
162  }
163 
164  std::vector<Trk::VxCandidate*> myCandidates;
165  myCandidates.push_back(myJetCandidate);
166 
167 // return new Trk::VxSecVertexInfo(myCandidates);//ownership of the single objects is taken over!
168  return nullptr;
169 
170  }
171 
173  const TLorentzVector & jetMomentum,
174  const std::vector<const Trk::TrackParticleBase*> & firstInputTracks,
175  const std::vector<const Trk::TrackParticleBase*> & secondInputTracks,
176  const Amg::Vector3D & vtxSeedDirection) const
177  {
178 
179  Amg::Vector3D myDirection(jetMomentum.Vect().X(),jetMomentum.Vect().Y(),jetMomentum.Vect().Z());
180 
181  std::vector<std::vector<const Trk::TrackParticleBase*> > bunchesOfTracks;
182 
183  std::vector<const Trk::TrackParticleBase*> tracksToAdd;
184 
185  std::vector<const Trk::TrackParticleBase*>::const_iterator tracks2Begin=firstInputTracks.begin();

◆ findSecVertex() [3/3]

virtual Trk::VxSecVertexInfo* InDet::InDetJetFitterVxFinder::findSecVertex ( const xAOD::Vertex ,
const TLorentzVector &  ,
const std::vector< const xAOD::IParticle * > &   
) const
inlineoverridevirtual

Implements InDet::ISecVertexInJetFinder.

Definition at line 66 of file InDetJetFitterVxFinder.h.

69  {
70  /* not implemented */
71  return 0;
72  }

◆ initialize()

StatusCode InDet::InDetJetFitterVxFinder::initialize ( )
overridevirtual

Definition at line 88 of file InDetJetFitterVxFinder.cxx.

95  {
96  if (m_trkFilter->decision(**tracksIter,&primaryVertex)) {
97  tracks.emplace_back((*tracksIter)->perigee()->momentum().perp(),*tracksIter);

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ interfaceID()

static const InterfaceID& InDet::ISecVertexInJetFinder::interfaceID ( )
inlinestaticinherited

Definition at line 58 of file ISecVertexInJetFinder.h.

59  {
60  return IID_ISecVertexInJetFinder;
61  };

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ trackDecorationNames()

virtual std::vector<std::string> InDet::ISecVertexInJetFinder::trackDecorationNames ( ) const
inlinevirtualinherited

Return a list of the names of track decorations created by this tool, in order to allow them to be locked when the calling algorithm completes.

Return an empty list by default.

Reimplemented in InDet::InDetImprovedJetFitterVxFinder.

Definition at line 72 of file ISecVertexInJetFinder.h.

73  {
74  return std::vector<std::string>();
75  }

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

ToolHandle< Trk::JetFitterHelper > InDet::InDetJetFitterVxFinder::m_helper {this,"JetFitterHelper","Trk::JetFitterHelper",""}
private

Definition at line 90 of file InDetJetFitterVxFinder.h.

◆ m_initializationHelper

ToolHandle< Trk::JetFitterInitializationHelper > InDet::InDetJetFitterVxFinder::m_initializationHelper {this,"JetFitterInitializationHelper","Trk::JetFitterInitializationHelper",""}
private

Definition at line 89 of file InDetJetFitterVxFinder.h.

◆ m_maxClusteringIterations

Gaudi::Property< int > InDet::InDetJetFitterVxFinder::m_maxClusteringIterations {this,"MaxClusteringIterations",30,""}
private

Definition at line 97 of file InDetJetFitterVxFinder.h.

◆ m_maxNumDeleteIterations

Gaudi::Property< int > InDet::InDetJetFitterVxFinder::m_maxNumDeleteIterations {this,"MaxNumDeleteIterations",30,""}
private

Definition at line 95 of file InDetJetFitterVxFinder.h.

◆ m_maxTracksToFitAtOnce

Gaudi::Property< int > InDet::InDetJetFitterVxFinder::m_maxTracksToFitAtOnce {this,"MaxTracksToFitAtOnce",15,""}
private

Definition at line 101 of file InDetJetFitterVxFinder.h.

◆ m_routines

ToolHandle< Trk::JetFitterRoutines > InDet::InDetJetFitterVxFinder::m_routines {this,"JetFitterRoutines","Trk::JetFitterRoutines",""}
private

Definition at line 91 of file InDetJetFitterVxFinder.h.

◆ m_trkFilter

ToolHandle< Trk::ITrackSelectorTool > InDet::InDetJetFitterVxFinder::m_trkFilter {this,"TrackSelector","InDet::InDetDetailedTrackSelectorTool",""}
private

Definition at line 92 of file InDetJetFitterVxFinder.h.

◆ m_useFastClustering

Gaudi::Property< bool > InDet::InDetJetFitterVxFinder::m_useFastClustering {this,"UseFastClustering",false,""}
private

Definition at line 99 of file InDetJetFitterVxFinder.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexClusteringProbabilityCut

Gaudi::Property< float > InDet::InDetJetFitterVxFinder::m_vertexClusteringProbabilityCut {this,"VertexClusteringProbabilityCut",0.01,""}
private

Definition at line 98 of file InDetJetFitterVxFinder.h.

◆ m_vertexProbCut

Gaudi::Property< float > InDet::InDetJetFitterVxFinder::m_vertexProbCut {this,"VertexProbCut",0.01,""}
private

Definition at line 96 of file InDetJetFitterVxFinder.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:
InDet::InDetJetFitterVxFinder::m_routines
ToolHandle< Trk::JetFitterRoutines > m_routines
Definition: InDetJetFitterVxFinder.h:91
Trk::VxJetCandidate::getVerticesOnJetAxis
const std::vector< VxVertexOnJetAxis * > & getVerticesOnJetAxis(void) const
Definition: VxJetCandidate.cxx:543
InDet::InDetJetFitterVxFinder::m_maxNumDeleteIterations
Gaudi::Property< int > m_maxNumDeleteIterations
Definition: InDetJetFitterVxFinder.h:95
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::InDetJetFitterVxFinder::m_initializationHelper
ToolHandle< Trk::JetFitterInitializationHelper > m_initializationHelper
Definition: InDetJetFitterVxFinder.h:89
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
Trk::VxVertexOnJetAxis
VxVertexOnJetAxis inherits from Vertex.
Definition: VxVertexOnJetAxis.h:79
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::PairOfVxVertexOnJetAxis
Definition: PairOfVxVertexOnJetAxis.h:53
InDet::InDetJetFitterVxFinder::m_helper
ToolHandle< Trk::JetFitterHelper > m_helper
Definition: InDetJetFitterVxFinder.h:90
InDet::InDetJetFitterVxFinder::findSecVertex
virtual Trk::VxSecVertexInfo * findSecVertex(const xAOD::Vertex &, const TLorentzVector &, const std::vector< const xAOD::IParticle * > &) const override
Definition: InDetJetFitterVxFinder.h:66
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
InDet::InDetJetFitterVxFinder::m_maxTracksToFitAtOnce
Gaudi::Property< int > m_maxTracksToFitAtOnce
Definition: InDetJetFitterVxFinder.h:101
Trk::VxJetCandidate::getPrimaryVertex
const VxVertexOnJetAxis * getPrimaryVertex(void) const
Definition: VxJetCandidate.cxx:551
InDet::InDetJetFitterVxFinder::m_trkFilter
ToolHandle< Trk::ITrackSelectorTool > m_trkFilter
Definition: InDetJetFitterVxFinder.h:92
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::VxCandidate::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex(void)
Unconst pointer to the vector of tracks Required by some of the vertex fitters.
Definition: VxCandidate.h:144
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
Trk::VxClusteringTable
Definition: VxClusteringTable.h:71
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::FitQualityOnSurface::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
InDet::InDetJetFitterVxFinder::m_useFastClustering
Gaudi::Property< bool > m_useFastClustering
Definition: InDetJetFitterVxFinder.h:99
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::LinkToTrackParticleBase
Definition: LinkToTrackParticleBase.h:17
InDet::InDetJetFitterVxFinder::m_maxClusteringIterations
Gaudi::Property< int > m_maxClusteringIterations
Definition: InDetJetFitterVxFinder.h:97
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::VxSecVertexInfo
Definition: VxSecVertexInfo.h:63
Trk::VxJetCandidate
Definition: VxJetCandidate.h:72
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::GsfMeasurementUpdator::fitQuality
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
Definition: GsfMeasurementUpdator.cxx:845
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::VxJetCandidate::getClusteringTable
Trk::VxClusteringTable *& getClusteringTable(void)
Definition: VxJetCandidate.cxx:569
h
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetJetFitterVxFinder::doTheFit
void doTheFit(Trk::VxJetCandidate *myJetCandidate, bool performClustering=true) const
Definition: InDetJetFitterVxFinder.cxx:284
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Trk::VxJetCandidate::setVerticesOnJetAxis
void setVerticesOnJetAxis(const std::vector< VxVertexOnJetAxis * > &)
Definition: VxJetCandidate.cxx:547
InDet::InDetJetFitterVxFinder::m_vertexClusteringProbabilityCut
Gaudi::Property< float > m_vertexClusteringProbabilityCut
Definition: InDetJetFitterVxFinder.h:98
InDet::InDetJetFitterVxFinder::m_vertexProbCut
Gaudi::Property< float > m_vertexProbCut
Definition: InDetJetFitterVxFinder.h:96
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::FitQualityOnSurface::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
fitman.k
k
Definition: fitman.py:528