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
xAOD::BPhysTrackVertexMapTool Class Reference

Dual-use tool createing a track-to-vertex map from the vertex-to-track information. More...

#include <BPhysTrackVertexMapTool.h>

Inheritance diagram for xAOD::BPhysTrackVertexMapTool:
Collaboration diagram for xAOD::BPhysTrackVertexMapTool:

Public Member Functions

 BPhysTrackVertexMapTool (const std::string &name="BPhysTrackVertexMapTool")
 Declare the correct constructor for Athena. More...
 
virtual StatusCode initialize () override
 Function initialising the tool. More...
 
virtual StatusCode logEvent () override
 Function being excuted for each event. More...
 
virtual StatusCode finalize () override
 Function finalizing the tool. More...
 
virtual bool doLog () const override
 Function indicating whether log counter allows logging of current event. More...
 
virtual void print () const
 Print the state of the tool. 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 std::string wrapLines (const std::string &lines, const std::string &prefix)
 convenience method to wrap output lines by a prefix More...
 

Protected Member Functions

virtual float getFloat (std::string name, const xAOD::Vertex *b)
 
virtual std::vector< std::string > getTokens (std::string input, std::string seperators)
 
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...
 
Functions to be called by user classes

fill cache for current event

virtual StatusCode cacheEvent () override
 
virtual std::vector< const xAOD::Vertex * > pvsForIDTrack (const xAOD::TrackParticle *track) const override
 obtain primary vertices for a given ID track (may return empty vector) More...
 
virtual std::vector< const xAOD::Vertex * > refPVsForIDTrack (const xAOD::TrackParticle *track) const override
 obtain refitted primary vertices for a given ID track (may return empty vector) More...
 
virtual std::vector< const xAOD::Vertex * > svsForIDTrack (const xAOD::TrackParticle *track) const override
 obtain secondary vertices for a given ID track (may return empty vector) More...
 
virtual std::string idTrackToString (const xAOD::TrackParticle *track, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
 
virtual std::string pvToString (const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
 
virtual std::string refPVToString (const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
 
virtual std::string svToString (const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
 
virtual std::string idTracksToString (const xAOD::TrackParticleContainer *tpc, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
 
virtual std::string pvsToString (const xAOD::VertexContainer *pvc, unsigned int indent=0, bool withTracks=false) override
 
virtual std::string refPVsToString (const xAOD::VertexContainer *rpvc, unsigned int indent=0, bool withTracks=false) override
 
virtual std::string svsToString (const xAOD::VertexContainer *svc, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
 
virtual std::string summaryToString (std::string prefix) override
 

Protected Attributes

std::string m_vertexContainerName
 
std::string m_refPVContainerName
 
std::string m_pvContainerName
 
std::string m_trackParticleContainerName
 
int m_debugTrkToVtxMaxEvents
 
std::string m_dumpPrefix
 
std::string m_hypoName
 
const xAOD::TrackParticleContainerm_tracks
 
const xAOD::TrackParticleAuxContainerm_tracksAux
 
const xAOD::VertexContainerm_pvtxContainer
 
const xAOD::VertexContainerm_svtxContainer
 
const xAOD::VertexAuxContainerm_svtxAuxContainer
 
const xAOD::VertexContainerm_refPVContainer
 
const xAOD::VertexAuxContainerm_refPVAuxContainer
 
unsigned int m_nEvtsSeen
 
int m_cachedRun
 
int m_cachedEvent
 

Private Types

typedef std::map< const xAOD::TrackParticle *, std::vector< const xAOD::Vertex * > > TrackToVertexMap_t
 
typedef std::map< const xAOD::Vertex *, std::string > VertexNameMap_t
 
typedef std::map< const xAOD::TrackParticle *, std::string > TrackNameMap_t
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual void initTrackVertexMaps (const xAOD::TrackParticleContainer *tpc, const xAOD::VertexContainer *pvc, const xAOD::VertexContainer *rpvc, const xAOD::VertexContainer *svc)
 
virtual void addVertexToTrackVertexMap (TrackToVertexMap_t &map, const xAOD::TrackParticle *track, const xAOD::Vertex *vtx)
 
virtual std::string pvName (const xAOD::Vertex *vtx)
 
virtual std::string refPVName (const xAOD::Vertex *vtx)
 
virtual std::string svName (const xAOD::Vertex *vtx)
 
virtual std::string idTrackName (const xAOD::TrackParticle *vtx)
 
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

VertexNameMap_t m_pvNameMap
 
VertexNameMap_t m_refPVNameMap
 
VertexNameMap_t m_svNameMap
 
TrackNameMap_t m_idTrackNameMap
 
TrackToVertexMap_t m_idTrackToPVMap
 
TrackToVertexMap_t m_idTrackToRefPVMap
 
TrackToVertexMap_t m_idTrackToSVMap
 
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

Dual-use tool createing a track-to-vertex map from the vertex-to-track information.

Job options provided by this class:

Author
Wolfgang Walkowiak Wolfg.nosp@m.ang..nosp@m.Walko.nosp@m.wiak.nosp@m.@cern.nosp@m..ch

$Revision:$

Date

Definition at line 47 of file BPhysTrackVertexMapTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TrackNameMap_t

Definition at line 185 of file BPhysTrackVertexMapTool.h.

◆ TrackToVertexMap_t

Definition at line 140 of file BPhysTrackVertexMapTool.h.

◆ VertexNameMap_t

typedef std::map<const xAOD::Vertex*, std::string> xAOD::BPhysTrackVertexMapTool::VertexNameMap_t
private

Definition at line 180 of file BPhysTrackVertexMapTool.h.

Constructor & Destructor Documentation

◆ BPhysTrackVertexMapTool()

xAOD::BPhysTrackVertexMapTool::BPhysTrackVertexMapTool ( const std::string &  name = "BPhysTrackVertexMapTool")

Declare the correct constructor for Athena.

Regular AsgTool constructor

Definition at line 38 of file BPhysTrackVertexMapTool.cxx.

39  : asg::AsgTool( name ),
40  m_tracks(NULL), m_tracksAux(NULL), m_pvtxContainer(NULL),
42  m_refPVAuxContainer(NULL),
43  m_nEvtsSeen (0), m_cachedRun(-1), m_cachedEvent(-1) {
44 
45 #ifdef ASGTOOL_ATHENA
46  declareInterface< IBPhysTrackVertexMapTool >( this );
47 #endif // ASGTOOL_ATHENA
48 
49  // Necessary containers
50  declareProperty("VertexContainerName", m_vertexContainerName);
51  declareProperty("TrackParticleContainerName",
52  m_trackParticleContainerName="InDetTrackParticles");
53  declareProperty("PVContainerName", m_pvContainerName = "PrimaryVertices");
54  declareProperty("RefPVContainerName", m_refPVContainerName);
55 
56  // Maximum number of events to dump maps to log file for
57  declareProperty("DebugTrkToVtxMaxEvents", m_debugTrkToVtxMaxEvents = 0);
58 
59  // Prefix for log dump lines
60  declareProperty("DumpPrefix", m_dumpPrefix="TTV> ");
61 
62  // Hypothesis name (for mass value pickup)
63  declareProperty("HypoName", m_hypoName="__NONE__");
64  }

Member Function Documentation

◆ addVertexToTrackVertexMap()

void xAOD::BPhysTrackVertexMapTool::addVertexToTrackVertexMap ( TrackToVertexMap_t map,
const xAOD::TrackParticle track,
const xAOD::Vertex vtx 
)
privatevirtual

Definition at line 325 of file BPhysTrackVertexMapTool.cxx.

328  {
329 
330  TrackToVertexMap_t::const_iterator it = map.find(track);
331 
332  if ( it == map.end() ) {
333  map[track] = std::vector<const xAOD::Vertex*>();
334  }
335  map[track].push_back(vtx);
336  }

◆ cacheEvent()

StatusCode xAOD::BPhysTrackVertexMapTool::cacheEvent ( )
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 141 of file BPhysTrackVertexMapTool.cxx.

141  {
142 
143  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent -- begin");
144 
145  const xAOD::EventInfo* eventInfo = NULL;
146  ATH_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
147 
148  if ( m_cachedRun != (int)eventInfo->runNumber() ||
149  m_cachedEvent != (int)eventInfo->eventNumber() ) {
150 
151  // note update
152  m_cachedRun = eventInfo->runNumber();
153  m_cachedEvent = eventInfo->eventNumber();
154 
155  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent: caching now: "
156  << "run " << m_cachedRun << " event " << m_cachedEvent);
157 
158  // retrieve primary vertices container
159  m_pvtxContainer = NULL;
161  ATH_MSG_DEBUG("Found PV collection with key " << m_pvContainerName);
162 
163  // retrieve ID track container
164  m_tracks = NULL;
165  m_tracksAux = NULL;
167  if (evtStore()->contains<xAOD::
171  } else {
172  ATH_MSG_DEBUG("No aux track collection with key "
173  << m_trackParticleContainerName+"Aux.");
174  }
175  ATH_MSG_DEBUG("Found track collection with key "
177 
178  // vertex container and its auxilliary store
179  m_svtxContainer = NULL;
180  m_svtxAuxContainer = NULL;
183  m_vertexContainerName+"Aux."));
184  ATH_MSG_DEBUG("Found SV collection with key " << m_vertexContainerName);
185 
186  // refitted primary vertex container and its auxilliary store
187  m_refPVContainer = NULL;
188  m_refPVAuxContainer = NULL;
191  m_refPVContainerName+"Aux."));
192  ATH_MSG_DEBUG("Found refitted PV collection with key "
194 
195  // initialize track, PV and refPV maps
198  } // if new run/event
199 
200  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent -- end");
201 
202  // Return gracefully:
203  return StatusCode::SUCCESS;
204  }

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

◆ doLog()

bool xAOD::BPhysTrackVertexMapTool::doLog ( ) const
overridevirtual

Function indicating whether log counter allows logging of current event.

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 128 of file BPhysTrackVertexMapTool.cxx.

128  {
129 
130  return ( m_debugTrkToVtxMaxEvents < 0 ||
132  }

◆ 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 xAOD::BPhysTrackVertexMapTool::finalize ( )
overridevirtual

Function finalizing the tool.

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 97 of file BPhysTrackVertexMapTool.cxx.

97  {
98 
99  ATH_MSG_DEBUG( "Finalizing xAOD::BPhysTrackVertexMapTool" );
100 
101  // Return gracefully:
102  return StatusCode::SUCCESS;
103  }

◆ getFloat()

float xAOD::BPhysTrackVertexMapTool::getFloat ( std::string  name,
const xAOD::Vertex b 
)
protectedvirtual

Definition at line 642 of file BPhysTrackVertexMapTool.cxx.

643  {
644 
645  float res = -999999.;
646 
648  if ( floatAcc.isAvailable(*b) ) res = floatAcc(*b);
649 
650  return res;
651  }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ getTokens()

std::vector< std::string > xAOD::BPhysTrackVertexMapTool::getTokens ( std::string  input,
std::string  seperators 
)
protectedvirtual

Definition at line 655 of file BPhysTrackVertexMapTool.cxx.

656  {
657 
658  std::vector<std::string> tokens;
659  boost::char_separator<char> sep(seperators.c_str());
660  typedef boost::tokenizer<boost::char_separator<char> > Tokenizer_t;
661  Tokenizer_t tokenizer(input, sep);
662  for (auto& token : tokenizer) {
663  tokens.push_back(token);
664  }
665  return tokens;
666  }

◆ idTrackName()

std::string xAOD::BPhysTrackVertexMapTool::idTrackName ( const xAOD::TrackParticle vtx)
privatevirtual

Definition at line 380 of file BPhysTrackVertexMapTool.cxx.

380  {
381 
382  if ( m_idTrackNameMap.find(track) == m_idTrackNameMap.end() ) {
383  boost::format f("T%04d");
384  // cppcheck-suppress ignoredReturnValue
385  f % m_idTrackNameMap.size();
386  m_idTrackNameMap[track] = f.str();
387  }
388  return m_idTrackNameMap[track];
389  }

◆ idTracksToString()

std::string xAOD::BPhysTrackVertexMapTool::idTracksToString ( const xAOD::TrackParticleContainer tpc,
unsigned int  indent = 0,
bool  withPV = false,
bool  withRefPV = false,
bool  withSV = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 540 of file BPhysTrackVertexMapTool.cxx.

545  {
546 
547  std::string str;
548  std::string sind(indent, ' ');
549  str += sind + "ID tracks: (" + std::to_string(tpc->size()) + ")\n";
550  str += sind + std::string(80-indent, '-');
551  // loop over ID tracks
553  trkItr != tpc->end(); ++trkItr) {
554  const xAOD::TrackParticle* track = *trkItr;
555  str += "\n"
556  + idTrackToString(track, indent+2, withPV, withRefPV, withSV);
557  }
558  return str;
559  }

◆ idTrackToString()

std::string xAOD::BPhysTrackVertexMapTool::idTrackToString ( const xAOD::TrackParticle track,
unsigned int  indent = 0,
bool  withPV = false,
bool  withRefPV = false,
bool  withSV = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 394 of file BPhysTrackVertexMapTool.cxx.

397  {
398 
399  std::string sind(indent, ' ');
400  boost::format f1("%s %-5s %p (%10.4f, %10.4f, %10.4f) VL %p");
401  f1 % sind % idTrackName(track) % track
402  % track->pt() % track->eta() % track->phi(); //% track->vertex(); REMOVE IN MIGRATION TO MAKER
403  std::string str = f1.str();
404  if ( withPV ) {
406  if ( it != m_idTrackToPVMap.end() ) {
407  for ( auto vtx : it->second ) {
408  str += "\n" + pvToString(vtx, indent+2, false);
409  }
410  } else {
411  boost::format f2("\n%s %s");
412  f2 % sind % "NOPV";
413  str += f2.str();
414 
415  }
416  }
417  if ( withRefPV ) {
419  if ( it != m_idTrackToRefPVMap.end() ) {
420  for ( auto vtx : it->second ) {
421  str += "\n" + refPVToString(vtx, indent+2, false);
422  }
423  } else {
424  boost::format f2("\n%s %s");
425  f2 % sind % "NORV";
426  str += f2.str();
427  }
428  }
429  if ( withSV ) {
431  if ( it != m_idTrackToSVMap.end() ) {
432  for ( auto vtx : it->second ) {
433  str += "\n" + svToString(vtx, indent+2, false);
434  }
435  } else {
436  boost::format f2("\n%s %s");
437  f2 % sind % "NOSV";
438  str += f2.str();
439  }
440  }
441  return str;
442  }

◆ initialize()

StatusCode xAOD::BPhysTrackVertexMapTool::initialize ( )
overridevirtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 66 of file BPhysTrackVertexMapTool.cxx.

66  {
67 
68  // Greet the user:
69  ATH_MSG_DEBUG( "Initializing xAOD::BPhysTrackVertexMapTool" );
70 
71  if ( m_vertexContainerName == "" ) {
72  ATH_MSG_ERROR("No vertex container name provided!");
73  }
74  if ( m_refPVContainerName == "" ) {
75  ATH_MSG_ERROR("No refitted PV container name provided!");
76  }
77  if ( m_trackParticleContainerName == "" ) {
78  ATH_MSG_ERROR("No track particle container name provided!");
79  }
80  if ( m_pvContainerName == "" ) {
81  ATH_MSG_ERROR("No PV container name provided!");
82  }
83  // some info for the job log
84  ATH_MSG_INFO("VertexContainerName : " << m_vertexContainerName);
85  ATH_MSG_INFO("PVContainerName : " << m_pvContainerName);
86  ATH_MSG_INFO("RefPVContainerName : " << m_refPVContainerName);
87  ATH_MSG_INFO("TrackParticleContainerName : "
89  ATH_MSG_INFO("DebugTrkToVtxMaxEvents : " << m_debugTrkToVtxMaxEvents);
90  ATH_MSG_INFO("DumpPrefix : " << m_dumpPrefix);
91  ATH_MSG_INFO("HypoName : " << m_hypoName);
92 
93  // Return gracefully:
94  return StatusCode::SUCCESS;
95  }

◆ initTrackVertexMaps()

void xAOD::BPhysTrackVertexMapTool::initTrackVertexMaps ( const xAOD::TrackParticleContainer tpc,
const xAOD::VertexContainer pvc,
const xAOD::VertexContainer rpvc,
const xAOD::VertexContainer svc 
)
privatevirtual

Definition at line 264 of file BPhysTrackVertexMapTool.cxx.

268  {
269 
270  // clear previous entries
271  m_pvNameMap.clear();
272  m_refPVNameMap.clear();
273  m_svNameMap.clear();
274  m_idTrackNameMap.clear();
275  m_idTrackToPVMap.clear();
276  m_idTrackToRefPVMap.clear();
277  m_idTrackToSVMap.clear();
278 
279  // initialize maps for PVs
280  for (xAOD::VertexContainer::const_iterator vtxItr = pvc->begin();
281  vtxItr != pvc->end(); ++vtxItr) {
282  const xAOD::Vertex* vtx = *vtxItr;
283  pvName(vtx);
284  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
285  const xAOD::TrackParticle* track = vtx->trackParticle(i);
286  // m_idTrackToPVMap[track] = vtx;
288  }
289  }
290  // initialize maps for refitted PVs
291  for (xAOD::VertexContainer::const_iterator vtxItr = rpvc->begin();
292  vtxItr != rpvc->end(); ++vtxItr) {
293  const xAOD::Vertex* vtx = *vtxItr;
294  refPVName(vtx);
295  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
296  const xAOD::TrackParticle* track = vtx->trackParticle(i);
297  // m_idTrackToRefPVMap[track] = vtx;
299  }
300  }
301 
302  // initialize maps for SVs
303  for (xAOD::VertexContainer::const_iterator vtxItr = svc->begin();
304  vtxItr != svc->end(); ++vtxItr) {
305  const xAOD::Vertex* vtx = *vtxItr;
306  svName(vtx);
307  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
308  const xAOD::TrackParticle* track = vtx->trackParticle(i);
309  // m_idTrackToSVMap[track] = vtx;
311  }
312  }
313  // initialize maps for ID tracks
315  trkItr != tpc->end(); ++trkItr) {
316  const xAOD::TrackParticle* track = *trkItr;
318  }
319  }

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

◆ logEvent()

StatusCode xAOD::BPhysTrackVertexMapTool::logEvent ( )
overridevirtual

Function being excuted for each event.

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 105 of file BPhysTrackVertexMapTool.cxx.

105  {
106 
107  ATH_MSG_DEBUG( "logEvent in xAOD::BPhysTrackVertexMapTool" );
108 
109  // read info into maps cache
111 
112  // dump info from maps if requested
113  if ( doLog() ) {
114 
115  ATH_MSG_INFO("Track-to-vertex association map:");
116 
117  std::cout << summaryToString(m_dumpPrefix) << std::endl;
118 
119  } // if requested
120 
121  // increment counter
122  m_nEvtsSeen++;
123 
124  // Return gracefully:
125  return StatusCode::SUCCESS;
126  }

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

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

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ pvName()

std::string xAOD::BPhysTrackVertexMapTool::pvName ( const xAOD::Vertex vtx)
privatevirtual

Definition at line 340 of file BPhysTrackVertexMapTool.cxx.

340  {
341 
342  if ( m_pvNameMap.find(vtx) == m_pvNameMap.end() ) {
343  boost::format f("PV%03d");
344  // cppcheck-suppress ignoredReturnValue
345  f % m_pvNameMap.size();
346  m_pvNameMap[vtx] = f.str();
347  }
348  return m_pvNameMap[vtx];
349  }

◆ pvsForIDTrack()

std::vector< const xAOD::Vertex * > xAOD::BPhysTrackVertexMapTool::pvsForIDTrack ( const xAOD::TrackParticle track) const
overrideprotectedvirtual

obtain primary vertices for a given ID track (may return empty vector)

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 211 of file BPhysTrackVertexMapTool.cxx.

212  {
213 
214  TrackToVertexMap_t::const_iterator it = m_idTrackToPVMap.find(track);
215 
216  if ( it != m_idTrackToPVMap.end() ) {
217  return it->second;
218  } else {
219  std::vector<const xAOD::Vertex*> dummy;
220  return dummy;
221  }
222  }

◆ pvsToString()

std::string xAOD::BPhysTrackVertexMapTool::pvsToString ( const xAOD::VertexContainer pvc,
unsigned int  indent = 0,
bool  withTracks = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 564 of file BPhysTrackVertexMapTool.cxx.

566  {
567 
568  std::string str;
569  std::string sind(indent, ' ');
570  str += sind + "Primary vertices: (" + std::to_string(pvc->size()) + ")\n";
571  str += sind + std::string(80-indent, '-');
572  for (xAOD::VertexContainer::const_iterator vtxItr = pvc->begin();
573  vtxItr != pvc->end(); ++vtxItr) {
574  const xAOD::Vertex* vtx = *vtxItr;
575  str += "\n" + pvToString(vtx, indent+2, withTracks);
576  } // for
577 
578  return str;
579  }

◆ pvToString()

std::string xAOD::BPhysTrackVertexMapTool::pvToString ( const xAOD::Vertex vtx,
unsigned int  indent = 0,
bool  withTracks = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 447 of file BPhysTrackVertexMapTool.cxx.

449  {
450 
451  std::string sind(indent, ' ');
452  boost::format f1("%s %-5s %p (%10.4f, %10.4f, %10.4f) NT %4d VT %d");
453  f1 % sind % pvName(vtx) % vtx % vtx->x() % vtx->y() % vtx->z()
454  % vtx->nTrackParticles() % vtx->vertexType();
455  std::string str = f1.str();
456  if ( withTracks ) {
457  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
458  boost::format f2("\n%s %4d %s");
459  f2 % sind % i
460  % idTrackToString(vtx->trackParticle(i), 0, false, false);
461  str += f2.str();
462  } // for
463  }
464 
465  return str;
466  }

◆ refPVName()

std::string xAOD::BPhysTrackVertexMapTool::refPVName ( const xAOD::Vertex vtx)
privatevirtual

Definition at line 353 of file BPhysTrackVertexMapTool.cxx.

353  {
354 
355  if ( m_refPVNameMap.find(vtx) == m_refPVNameMap.end() ) {
356  boost::format f("RV%03d");
357  // cppcheck-suppress ignoredReturnValue
358  f % m_refPVNameMap.size();
359  m_refPVNameMap[vtx] = f.str();
360  }
361  return m_refPVNameMap[vtx];
362  }

◆ refPVsForIDTrack()

std::vector< const xAOD::Vertex * > xAOD::BPhysTrackVertexMapTool::refPVsForIDTrack ( const xAOD::TrackParticle track) const
overrideprotectedvirtual

obtain refitted primary vertices for a given ID track (may return empty vector)

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 229 of file BPhysTrackVertexMapTool.cxx.

230  {
231 
232  TrackToVertexMap_t::const_iterator it = m_idTrackToRefPVMap.find(track);
233 
234  if ( it != m_idTrackToRefPVMap.end() ) {
235  return it->second;
236  } else {
237  std::vector<const xAOD::Vertex*> dummy;
238  return dummy;
239  }
240  }

◆ refPVsToString()

std::string xAOD::BPhysTrackVertexMapTool::refPVsToString ( const xAOD::VertexContainer rpvc,
unsigned int  indent = 0,
bool  withTracks = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 585 of file BPhysTrackVertexMapTool.cxx.

587  {
588 
589  std::string str;
590  std::string sind(indent, ' ');
591  str += sind + "Refitted primary vertices: (" + std::to_string(rpvc->size()) + ")\n";
592  str += sind + std::string(80-indent, '-');
593  for (xAOD::VertexContainer::const_iterator vtxItr = rpvc->begin();
594  vtxItr != rpvc->end(); ++vtxItr) {
595  const xAOD::Vertex* vtx = *vtxItr;
596  str += "\n" + refPVToString(vtx, indent+2, withTracks);
597  } // for
598 
599  return str;
600  }

◆ refPVToString()

std::string xAOD::BPhysTrackVertexMapTool::refPVToString ( const xAOD::Vertex vtx,
unsigned int  indent = 0,
bool  withTracks = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 471 of file BPhysTrackVertexMapTool.cxx.

473  {
474 
475  std::string sind(indent, ' ');
476  boost::format f1("%s %-5s %p (%10.4f, %10.4f, %10.4f) NT %4d VT %d");
477  f1 % sind % refPVName(vtx) % vtx % vtx->x() % vtx->y() % vtx->z()
478  % vtx->nTrackParticles() % vtx->vertexType();
479  std::string str = f1.str();
480  if ( withTracks ) {
481  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
482  boost::format f2("\n%s %4d %s");
483  f2 % sind % i
484  % idTrackToString(vtx->trackParticle(i), 0, false, false);
485  str += f2.str();
486  } // for
487  }
488 
489  return str;
490  }

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

◆ summaryToString()

std::string xAOD::BPhysTrackVertexMapTool::summaryToString ( std::string  prefix)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 625 of file BPhysTrackVertexMapTool.cxx.

625  {
626 
627  boost::format form("%s\n\nRun: %d Event: %d\n\n");
628  form % name() % m_cachedRun % m_cachedEvent;
629  std::string dstr =
630  wrapLines("\n"+form.str() +
631  pvsToString(m_pvtxContainer, 0, true) + "\n\n" +
632  refPVsToString(m_refPVContainer, 0, true) + "\n\n" +
633  svsToString(m_svtxContainer, 0, true, true) + "\n\n" +
634  idTracksToString(m_tracks, 0, true, true, true) + "\n",
635  prefix);
636 
637  return dstr;
638  }

◆ svName()

std::string xAOD::BPhysTrackVertexMapTool::svName ( const xAOD::Vertex vtx)
privatevirtual

Definition at line 366 of file BPhysTrackVertexMapTool.cxx.

366  {
367 
368  if ( m_svNameMap.find(vtx) == m_svNameMap.end() ) {
369  boost::format f("SV%03d");
370  // cppcheck-suppress ignoredReturnValue
371  f % m_svNameMap.size();
372  m_svNameMap[vtx] = f.str();
373  }
374  return m_svNameMap[vtx];
375  }

◆ svsForIDTrack()

std::vector< const xAOD::Vertex * > xAOD::BPhysTrackVertexMapTool::svsForIDTrack ( const xAOD::TrackParticle track) const
overrideprotectedvirtual

obtain secondary vertices for a given ID track (may return empty vector)

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 247 of file BPhysTrackVertexMapTool.cxx.

248  {
249 
250  TrackToVertexMap_t::const_iterator it = m_idTrackToSVMap.find(track);
251 
252  if ( it != m_idTrackToSVMap.end() ) {
253  return it->second;
254  } else {
255  std::vector<const xAOD::Vertex*> dummy;
256  return dummy;
257  }
258  }

◆ svsToString()

std::string xAOD::BPhysTrackVertexMapTool::svsToString ( const xAOD::VertexContainer svc,
unsigned int  indent = 0,
bool  withTracks = false,
bool  withMasses = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 605 of file BPhysTrackVertexMapTool.cxx.

608  {
609 
610  std::string str;
611  std::string sind(indent, ' ');
612  str += sind + "Secondary vertices: (" + std::to_string(svc->size()) + ")\n";
613  str += sind + std::string(80-indent, '-');
614  for (xAOD::VertexContainer::const_iterator vtxItr = svc->begin();
615  vtxItr != svc->end(); ++vtxItr) {
616  const xAOD::Vertex* vtx = *vtxItr;
617  str += "\n" + svToString(vtx, indent+2, withTracks, withMasses);
618  } // for
619 
620  return str;
621  }

◆ svToString()

std::string xAOD::BPhysTrackVertexMapTool::svToString ( const xAOD::Vertex vtx,
unsigned int  indent = 0,
bool  withTracks = false,
bool  withMasses = false 
)
overrideprotectedvirtual

Implements xAOD::IBPhysTrackVertexMapTool.

Definition at line 495 of file BPhysTrackVertexMapTool.cxx.

498  {
499 
500  std::string sind(indent, ' ');
501  boost::format f1("%s %-5s %p (%10.4f, %10.4f, %10.4f) NT %4d VT %d");
502  f1 % sind % svName(vtx) % vtx % vtx->x() % vtx->y() % vtx->z()
503  % vtx->nTrackParticles() % vtx->vertexType();
504  std::string str = f1.str();
505  if ( withMasses && m_hypoName != "__NONE__" ) {
506  // vector of possible hypo names
507  std::vector<std::string> hypoNames = getTokens(m_hypoName, "|;/");
508  for ( auto hypoName : hypoNames ) {
509  BPhysHypoHelper bhh(hypoName, vtx);
510  float bMass = bhh.mass();
511  float bMassErr = bhh.massErr();
512  float bMucMass = getFloat(hypoName+"_MUCALC_mass", vtx);
513  float bMucMassErr = getFloat(hypoName+"_MUCALC_massErr", vtx);
514  if ( bMass > 0. || bMassErr > 0.
515  || bMucMass > 0. || bMucMassErr > 0. ) {
516  boost::format f3("\n%s %-10s : mass : (%15.4f +/- %15.4f) MeV");
517 
518  boost::format f4("\n%s %-10s : m(MUCALC): (%15.4f +/- %15.4f) MeV");
519  f3 % sind % hypoName % bMass % bMassErr;
520  f4 % sind % hypoName % bMucMass % bMucMassErr;
521  str += f3.str() + f4.str();
522  } // if one > 0.
523  } // for hypoNames
524  } // if withMasses
525  if ( withTracks ) {
526  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
527  boost::format f2("\n%s %4d %s");
528  f2 % sind % i
529  % idTrackToString(vtx->trackParticle(i), 0, false, false);
530  str += f2.str();
531  } // for
532  }
533  return str;
534  }

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

◆ wrapLines()

std::string xAOD::BPhysTrackVertexMapTool::wrapLines ( const std::string &  lines,
const std::string &  prefix 
)
static

convenience method to wrap output lines by a prefix

Definition at line 23 of file BPhysTrackVertexMapTool.cxx.

24  {
25 
26  std::string ostr;
27  std::istringstream stream(lines);
28  std::string line;
29  while ( std::getline(stream, line) ) {
30  if ( !ostr.empty() ) ostr += "\n";
31  ostr += prefix + line;
32  }
33  return ostr;
34  }

Member Data Documentation

◆ m_cachedEvent

int xAOD::BPhysTrackVertexMapTool::m_cachedEvent
protected

Definition at line 176 of file BPhysTrackVertexMapTool.h.

◆ m_cachedRun

int xAOD::BPhysTrackVertexMapTool::m_cachedRun
protected

Definition at line 175 of file BPhysTrackVertexMapTool.h.

◆ m_debugTrkToVtxMaxEvents

int xAOD::BPhysTrackVertexMapTool::m_debugTrkToVtxMaxEvents
protected

Definition at line 160 of file BPhysTrackVertexMapTool.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_dumpPrefix

std::string xAOD::BPhysTrackVertexMapTool::m_dumpPrefix
protected

Definition at line 161 of file BPhysTrackVertexMapTool.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_hypoName

std::string xAOD::BPhysTrackVertexMapTool::m_hypoName
protected

Definition at line 162 of file BPhysTrackVertexMapTool.h.

◆ m_idTrackNameMap

TrackNameMap_t xAOD::BPhysTrackVertexMapTool::m_idTrackNameMap
private

Definition at line 186 of file BPhysTrackVertexMapTool.h.

◆ m_idTrackToPVMap

TrackToVertexMap_t xAOD::BPhysTrackVertexMapTool::m_idTrackToPVMap
private

Definition at line 188 of file BPhysTrackVertexMapTool.h.

◆ m_idTrackToRefPVMap

TrackToVertexMap_t xAOD::BPhysTrackVertexMapTool::m_idTrackToRefPVMap
private

Definition at line 189 of file BPhysTrackVertexMapTool.h.

◆ m_idTrackToSVMap

TrackToVertexMap_t xAOD::BPhysTrackVertexMapTool::m_idTrackToSVMap
private

Definition at line 190 of file BPhysTrackVertexMapTool.h.

◆ m_nEvtsSeen

unsigned int xAOD::BPhysTrackVertexMapTool::m_nEvtsSeen
protected

Definition at line 173 of file BPhysTrackVertexMapTool.h.

◆ m_pvContainerName

std::string xAOD::BPhysTrackVertexMapTool::m_pvContainerName
protected

Definition at line 158 of file BPhysTrackVertexMapTool.h.

◆ m_pvNameMap

VertexNameMap_t xAOD::BPhysTrackVertexMapTool::m_pvNameMap
private

Definition at line 181 of file BPhysTrackVertexMapTool.h.

◆ m_pvtxContainer

const xAOD::VertexContainer* xAOD::BPhysTrackVertexMapTool::m_pvtxContainer
protected

Definition at line 167 of file BPhysTrackVertexMapTool.h.

◆ m_refPVAuxContainer

const xAOD::VertexAuxContainer* xAOD::BPhysTrackVertexMapTool::m_refPVAuxContainer
protected

Definition at line 171 of file BPhysTrackVertexMapTool.h.

◆ m_refPVContainer

const xAOD::VertexContainer* xAOD::BPhysTrackVertexMapTool::m_refPVContainer
protected

Definition at line 170 of file BPhysTrackVertexMapTool.h.

◆ m_refPVContainerName

std::string xAOD::BPhysTrackVertexMapTool::m_refPVContainerName
protected

Definition at line 157 of file BPhysTrackVertexMapTool.h.

◆ m_refPVNameMap

VertexNameMap_t xAOD::BPhysTrackVertexMapTool::m_refPVNameMap
private

Definition at line 182 of file BPhysTrackVertexMapTool.h.

◆ m_svNameMap

VertexNameMap_t xAOD::BPhysTrackVertexMapTool::m_svNameMap
private

Definition at line 183 of file BPhysTrackVertexMapTool.h.

◆ m_svtxAuxContainer

const xAOD::VertexAuxContainer* xAOD::BPhysTrackVertexMapTool::m_svtxAuxContainer
protected

Definition at line 169 of file BPhysTrackVertexMapTool.h.

◆ m_svtxContainer

const xAOD::VertexContainer* xAOD::BPhysTrackVertexMapTool::m_svtxContainer
protected

Definition at line 168 of file BPhysTrackVertexMapTool.h.

◆ m_trackParticleContainerName

std::string xAOD::BPhysTrackVertexMapTool::m_trackParticleContainerName
protected

Definition at line 159 of file BPhysTrackVertexMapTool.h.

◆ m_tracks

const xAOD::TrackParticleContainer* xAOD::BPhysTrackVertexMapTool::m_tracks
protected

Definition at line 165 of file BPhysTrackVertexMapTool.h.

◆ m_tracksAux

const xAOD::TrackParticleAuxContainer* xAOD::BPhysTrackVertexMapTool::m_tracksAux
protected

Definition at line 166 of file BPhysTrackVertexMapTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainerName

std::string xAOD::BPhysTrackVertexMapTool::m_vertexContainerName
protected

Definition at line 156 of file BPhysTrackVertexMapTool.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::BPhysTrackVertexMapTool::refPVToString
virtual std::string refPVToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:471
xAOD::BPhysTrackVertexMapTool::m_dumpPrefix
std::string m_dumpPrefix
Definition: BPhysTrackVertexMapTool.h:161
xAOD::BPhysTrackVertexMapTool::m_debugTrkToVtxMaxEvents
int m_debugTrkToVtxMaxEvents
Definition: BPhysTrackVertexMapTool.h:160
xAOD::Vertex_v1::x
float x() const
Returns the x position.
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
xAOD::BPhysTrackVertexMapTool::m_hypoName
std::string m_hypoName
Definition: BPhysTrackVertexMapTool.h:162
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
checkFileSG.line
line
Definition: checkFileSG.py:75
beamspotPlotBcids.k
k
Definition: beamspotPlotBcids.py:524
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAOD::BPhysTrackVertexMapTool::m_tracks
const xAOD::TrackParticleContainer * m_tracks
Definition: BPhysTrackVertexMapTool.h:165
xAOD::BPhysTrackVertexMapTool::pvToString
virtual std::string pvToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:447
xAOD::BPhysTrackVertexMapTool::m_tracksAux
const xAOD::TrackParticleAuxContainer * m_tracksAux
Definition: BPhysTrackVertexMapTool.h:166
xAOD::BPhysTrackVertexMapTool::refPVsToString
virtual std::string refPVsToString(const xAOD::VertexContainer *rpvc, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:585
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
xAOD::BPhysTrackVertexMapTool::wrapLines
static std::string wrapLines(const std::string &lines, const std::string &prefix)
convenience method to wrap output lines by a prefix
Definition: BPhysTrackVertexMapTool.cxx:23
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::BPhysTrackVertexMapTool::m_svNameMap
VertexNameMap_t m_svNameMap
Definition: BPhysTrackVertexMapTool.h:183
xAOD::BPhysTrackVertexMapTool::m_cachedEvent
int m_cachedEvent
Definition: BPhysTrackVertexMapTool.h:176
xAOD::TrackParticleAuxContainer
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
Definition: TrackParticleAuxContainer.h:19
skel.it
it
Definition: skel.GENtoEVGEN.py:424
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
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::BPhysTrackVertexMapTool::pvsToString
virtual std::string pvsToString(const xAOD::VertexContainer *pvc, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:564
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
xAOD::BPhysTrackVertexMapTool::m_refPVContainerName
std::string m_refPVContainerName
Definition: BPhysTrackVertexMapTool.h:157
xAOD::BPhysTrackVertexMapTool::m_idTrackNameMap
TrackNameMap_t m_idTrackNameMap
Definition: BPhysTrackVertexMapTool.h:186
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::BPhysTrackVertexMapTool::m_cachedRun
int m_cachedRun
Definition: BPhysTrackVertexMapTool.h:175
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
xAOD::EgammaParameters::f3
@ f3
fraction of energy reconstructed in 3rd sampling
Definition: EgammaEnums.h:54
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::BPhysTrackVertexMapTool::m_nEvtsSeen
unsigned int m_nEvtsSeen
Definition: BPhysTrackVertexMapTool.h:173
xAOD::BPhysTrackVertexMapTool::m_idTrackToSVMap
TrackToVertexMap_t m_idTrackToSVMap
Definition: BPhysTrackVertexMapTool.h:190
AthCommonDataStore
Definition: AthCommonDataStore.h:52
xAOD::BPhysTrackVertexMapTool::summaryToString
virtual std::string summaryToString(std::string prefix) override
Definition: BPhysTrackVertexMapTool.cxx:625
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCondBlobAlgs_fillNoiseFromASCII.lines
lines
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:104
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
xAOD::BPhysTrackVertexMapTool::m_refPVContainer
const xAOD::VertexContainer * m_refPVContainer
Definition: BPhysTrackVertexMapTool.h:170
xAOD::BPhysTrackVertexMapTool::m_vertexContainerName
std::string m_vertexContainerName
Definition: BPhysTrackVertexMapTool.h:156
xAOD::BPhysTrackVertexMapTool::idTrackToString
virtual std::string idTrackToString(const xAOD::TrackParticle *track, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
Definition: BPhysTrackVertexMapTool.cxx:394
xAOD::BPhysTrackVertexMapTool::refPVName
virtual std::string refPVName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:353
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::BPhysTrackVertexMapTool::doLog
virtual bool doLog() const override
Function indicating whether log counter allows logging of current event.
Definition: BPhysTrackVertexMapTool.cxx:128
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::BPhysTrackVertexMapTool::m_refPVAuxContainer
const xAOD::VertexAuxContainer * m_refPVAuxContainer
Definition: BPhysTrackVertexMapTool.h:171
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
xAOD::BPhysTrackVertexMapTool::initTrackVertexMaps
virtual void initTrackVertexMaps(const xAOD::TrackParticleContainer *tpc, const xAOD::VertexContainer *pvc, const xAOD::VertexContainer *rpvc, const xAOD::VertexContainer *svc)
Definition: BPhysTrackVertexMapTool.cxx:265
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::Vertex_v1::z
float z() const
Returns the z position.
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
xAOD::BPhysTrackVertexMapTool::getFloat
virtual float getFloat(std::string name, const xAOD::Vertex *b)
Definition: BPhysTrackVertexMapTool.cxx:642
xAOD::BPhysTrackVertexMapTool::m_svtxAuxContainer
const xAOD::VertexAuxContainer * m_svtxAuxContainer
Definition: BPhysTrackVertexMapTool.h:169
xAOD::str
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
Definition: TrigT2MbtsBits_v1.cxx:37
xAOD::BPhysTrackVertexMapTool::getTokens
virtual std::vector< std::string > getTokens(std::string input, std::string seperators)
Definition: BPhysTrackVertexMapTool.cxx:656
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
xAOD::BPhysTrackVertexMapTool::m_svtxContainer
const xAOD::VertexContainer * m_svtxContainer
Definition: BPhysTrackVertexMapTool.h:168
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
grepfile.sep
sep
Definition: grepfile.py:38
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
xAOD::BPhysTrackVertexMapTool::m_idTrackToPVMap
TrackToVertexMap_t m_idTrackToPVMap
Definition: BPhysTrackVertexMapTool.h:188
xAOD::BPhysTrackVertexMapTool::m_idTrackToRefPVMap
TrackToVertexMap_t m_idTrackToRefPVMap
Definition: BPhysTrackVertexMapTool.h:189
xAOD::BPhysTrackVertexMapTool::m_pvtxContainer
const xAOD::VertexContainer * m_pvtxContainer
Definition: BPhysTrackVertexMapTool.h:167
xAOD::BPhysTrackVertexMapTool::svToString
virtual std::string svToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
Definition: BPhysTrackVertexMapTool.cxx:495
xAOD::BPhysTrackVertexMapTool::svName
virtual std::string svName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:366
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::BPhysTrackVertexMapTool::pvName
virtual std::string pvName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:340
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::BPhysTrackVertexMapTool::svsToString
virtual std::string svsToString(const xAOD::VertexContainer *svc, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
Definition: BPhysTrackVertexMapTool.cxx:605
xAOD::BPhysTrackVertexMapTool::cacheEvent
virtual StatusCode cacheEvent() override
Definition: BPhysTrackVertexMapTool.cxx:141
xAOD::Vertex_v1::y
float y() const
Returns the y position.
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
xAOD::BPhysTrackVertexMapTool::m_refPVNameMap
VertexNameMap_t m_refPVNameMap
Definition: BPhysTrackVertexMapTool.h:182
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::BPhysTrackVertexMapTool::m_pvContainerName
std::string m_pvContainerName
Definition: BPhysTrackVertexMapTool.h:158
SG::DataProxy
Definition: DataProxy.h:44
xAOD::BPhysTrackVertexMapTool::idTracksToString
virtual std::string idTracksToString(const xAOD::TrackParticleContainer *tpc, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
Definition: BPhysTrackVertexMapTool.cxx:540
xAOD::BPhysTrackVertexMapTool::idTrackName
virtual std::string idTrackName(const xAOD::TrackParticle *vtx)
Definition: BPhysTrackVertexMapTool.cxx:380
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::BPhysTrackVertexMapTool::m_trackParticleContainerName
std::string m_trackParticleContainerName
Definition: BPhysTrackVertexMapTool.h:159
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4
xAOD::BPhysTrackVertexMapTool::addVertexToTrackVertexMap
virtual void addVertexToTrackVertexMap(TrackToVertexMap_t &map, const xAOD::TrackParticle *track, const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:326
xAOD::BPhysTrackVertexMapTool::m_pvNameMap
VertexNameMap_t m_pvNameMap
Definition: BPhysTrackVertexMapTool.h:181