|
ATLAS Offline Software
|
Dual-use tool createing a track-to-vertex map from the vertex-to-track information.
More...
#include <BPhysTrackVertexMapTool.h>
|
| 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 std::string | wrapLines (const std::string &lines, const std::string &prefix) |
| convenience method to wrap output lines by a prefix More...
|
|
|
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...
|
|
|
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 |
|
Dual-use tool createing a track-to-vertex map from the vertex-to-track information.
Job options provided by this class:
- VertexContainerName – name of container for secondary vertices
- RefPVContainerName – name of container for refitted PVs
- PVContainerName – name of container for primary vertices
- TrackParticleContainerName – name of container for TrackParticles
- DebugTrkToVtxMaxEvents – Maximum number of events to produce detailed log output for the track-to-vertex association maps. Set to -1 for infinity.
- DumpPrefix – Line prefix for log dump lines.
- HypoName – Hypothesis name (for picking up inv. mass values) May be a set of hypo names to be tested, delimited by '|'.
- 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.
◆ StoreGateSvc_t
◆ TrackNameMap_t
◆ TrackToVertexMap_t
◆ VertexNameMap_t
◆ BPhysTrackVertexMapTool()
xAOD::BPhysTrackVertexMapTool::BPhysTrackVertexMapTool |
( |
const std::string & |
name = "BPhysTrackVertexMapTool" | ) |
|
Declare the correct constructor for Athena.
Regular AsgTool constructor
Definition at line 37 of file BPhysTrackVertexMapTool.cxx.
45 declareInterface< IBPhysTrackVertexMapTool >(
this );
46 #endif // ASGTOOL_ATHENA
◆ addVertexToTrackVertexMap()
◆ cacheEvent()
StatusCode xAOD::BPhysTrackVertexMapTool::cacheEvent |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ doLog()
bool xAOD::BPhysTrackVertexMapTool::doLog |
( |
| ) |
const |
|
overridevirtual |
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 |
◆ getFloat()
◆ getKey()
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
-
ptr | The 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.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
-
ptr | The 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.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ 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 629 of file BPhysTrackVertexMapTool.cxx.
632 std::vector<std::string>
tokens;
633 boost::char_separator<char>
sep(seperators.c_str());
634 typedef boost::tokenizer<boost::char_separator<char> > Tokenizer_t;
636 for (
auto& token : tokenizer) {
◆ idTrackName()
◆ idTracksToString()
◆ idTrackToString()
◆ initialize()
StatusCode xAOD::BPhysTrackVertexMapTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initTrackVertexMaps()
Definition at line 263 of file BPhysTrackVertexMapTool.cxx.
280 vtxItr != pvc->
end(); ++vtxItr) {
291 vtxItr != rpvc->
end(); ++vtxItr) {
303 vtxItr !=
svc->end(); ++vtxItr) {
314 trkItr != tpc->
end(); ++trkItr) {
◆ inputHandles()
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 |
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ msgLvl()
◆ outputHandles()
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 |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ pvName()
◆ pvsForIDTrack()
◆ pvsToString()
◆ pvToString()
Implements xAOD::IBPhysTrackVertexMapTool.
Definition at line 434 of file BPhysTrackVertexMapTool.cxx.
438 std::string sind(
indent,
' ');
439 std::string
str =
std::format(
"{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4d} VT {}",
440 sind,
pvName(vtx),
static_cast<const void*
>(vtx), vtx->
x(), vtx->
y(), vtx->
z(),
◆ refPVName()
◆ refPVsForIDTrack()
◆ refPVsToString()
◆ refPVToString()
Implements xAOD::IBPhysTrackVertexMapTool.
Definition at line 456 of file BPhysTrackVertexMapTool.cxx.
460 std::string sind(
indent,
' ');
461 std::string
str =
std::format(
"{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4d} VT {}",
462 sind,
refPVName(vtx),
static_cast<const void*
>(vtx), vtx->
x(), vtx->
y(), vtx->
z(),
◆ renounce()
◆ renounceArray()
◆ summaryToString()
std::string xAOD::BPhysTrackVertexMapTool::summaryToString |
( |
std::string |
prefix | ) |
|
|
overrideprotectedvirtual |
◆ svName()
◆ svsForIDTrack()
◆ svsToString()
◆ svToString()
Implements xAOD::IBPhysTrackVertexMapTool.
Definition at line 476 of file BPhysTrackVertexMapTool.cxx.
481 std::string sind(
indent,
' ');
482 std::string
str =
std::format(
"{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4} VT {}",
483 sind,
svName(vtx),
static_cast<const void*
>(vtx), vtx->
x(), vtx->
y(), vtx->
z(),
485 if ( withMasses &&
m_hypoName !=
"__NONE__" ) {
488 for (
const std::string& hypoName : hypoNames ) {
489 BPhysHypoHelper bhh(hypoName, vtx);
490 float bMass = bhh.mass();
491 float bMassErr = bhh.massErr();
492 float bMucMass =
getFloat(hypoName+
"_MUCALC_mass", vtx);
493 float bMucMassErr =
getFloat(hypoName+
"_MUCALC_massErr", vtx);
494 if ( bMass > 0. || bMassErr > 0.
495 || bMucMass > 0. || bMucMassErr > 0. ) {
496 str +=
std::format(
"\n{} {:<10} : mass : ({:15.4f} +/- {:15.4f}) MeV",
497 sind, hypoName, bMass, bMassErr);
498 str +=
std::format(
"\n{} {:<10} : m(MUCALC): ({:15.4f} +/- {:15.4f}) MeV",
499 sind, hypoName, bMucMass, bMucMassErr);
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ 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 22 of file BPhysTrackVertexMapTool.cxx.
29 if ( !ostr.empty() ) ostr +=
"\n";
◆ m_cachedEvent
int xAOD::BPhysTrackVertexMapTool::m_cachedEvent |
|
protected |
◆ m_cachedRun
int xAOD::BPhysTrackVertexMapTool::m_cachedRun |
|
protected |
◆ m_debugTrkToVtxMaxEvents
int xAOD::BPhysTrackVertexMapTool::m_debugTrkToVtxMaxEvents |
|
protected |
◆ m_detStore
◆ m_dumpPrefix
std::string xAOD::BPhysTrackVertexMapTool::m_dumpPrefix |
|
protected |
◆ m_evtStore
◆ m_hypoName
std::string xAOD::BPhysTrackVertexMapTool::m_hypoName |
|
protected |
◆ m_idTrackNameMap
◆ m_idTrackToPVMap
◆ m_idTrackToRefPVMap
◆ m_idTrackToSVMap
◆ m_nEvtsSeen
unsigned int xAOD::BPhysTrackVertexMapTool::m_nEvtsSeen |
|
protected |
◆ m_pvContainerName
std::string xAOD::BPhysTrackVertexMapTool::m_pvContainerName |
|
protected |
◆ m_pvNameMap
◆ m_pvtxContainer
◆ m_refPVAuxContainer
◆ m_refPVContainer
◆ m_refPVContainerName
std::string xAOD::BPhysTrackVertexMapTool::m_refPVContainerName |
|
protected |
◆ m_refPVNameMap
◆ m_svNameMap
◆ m_svtxAuxContainer
◆ m_svtxContainer
◆ m_trackParticleContainerName
std::string xAOD::BPhysTrackVertexMapTool::m_trackParticleContainerName |
|
protected |
◆ m_tracks
◆ m_tracksAux
◆ m_varHandleArraysDeclared
◆ m_vertexContainerName
std::string xAOD::BPhysTrackVertexMapTool::m_vertexContainerName |
|
protected |
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
float x() const
Returns the x position.
Const iterator class for DataVector/DataList.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
uint64_t eventNumber() const
The current event's event number.
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
VxType::VertexType vertexType() const
The type of the vertex.
uint32_t runNumber() const
The current event's run number.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::pair< std::vector< unsigned int >, bool > res
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
float z() const
Returns the z position.
AthROOTErrorHandlerSvc * svc
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string to_string(const DetectorType &type)
Class describing the basic event information.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Class describing a Vertex.
float y() const
Returns the y position.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Class describing a TrackParticle.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.