 |
ATLAS Offline Software
|
Retrieves the Trk::TrackCollection
objects.
More...
#include <TrackRetriever.h>
|
| TrackRetriever (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard Constructor. More...
|
|
virtual StatusCode | retrieve (ToolHandle< IFormatTool > &FormatTool) |
| For each track collection retrieve all data. More...
|
|
const DataMap | getData (const TrackCollection *trackCollection, const std::string &collectionName) |
| Puts the variables into a DataMap. More...
|
|
virtual std::string | dataTypeName () const |
| Return the name of the data type that is generated by this retriever. More...
|
|
StatusCode | initialize () |
| Default AthAlgTool methods. 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, V, H > &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 |
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
const std::string | m_typeName = "Track" |
| The data type that is generated by this retriever. More...
|
|
SG::ReadHandleKeyArray< TrackCollection > | m_keys {this,"TrackCollections", {"CombinedInDetTracks","DisappearingTracks","ExtrapolatedStauTracks","ExtraPolatedMuonsLRTTracks","MSOnlyExtraPolatedMuonsLRTTrackParticlesTracks","ResolvedForwardTracks","CombinedMuonsLRTTracks","CombinedStauTracks","MuonSpectrometerTracks","MSOnlyExtrapolatedTracks","ExtrapolatedMuonTracks","CombinedMuonTracks","GSFTracks"}, "Name of the Trk TrackCollection containers that will be written out to the JiveXML file"} |
|
SG::ReadHandleKeyArray< TrackTruthCollection > | m_TrackTruthCollections {this,"TruthCollections", {"CombinedInDetTracksTruthCollection"}, "Name of the Truth Track containers that will be written out to the JiveXML file"} |
|
Gaudi::Property< bool > | m_doWriteResiduals {this,"DoWriteResiduals", true,"Whether to write TrackResiduals"} |
|
Gaudi::Property< bool > | m_doHitsSorting {this, "DoHitsSorting", false, "Whether to perform hits TrackStateOnSurfaces (TSoS) sorting"} |
|
Gaudi::Property< bool > | m_doHitsDetails {this, "DoHitsDetails", true, "Whether to write hits TrackStateOnSurfaces (TSoS) details"} |
|
Gaudi::Property< bool > | m_isMC {this, "isMC", false, "Whether file is MC"} |
|
ToolHandle< Trk::IResidualPullCalculator > | m_residualPullCalculator {this, "ResidualPullCalculator","Trk::ResidualPullCalculator/ResidualPullCalculator", "ToolHandle to ResidualPullCaclulator" } |
|
ToolHandle< Trk::ITrackSummaryTool > | m_trackSumTool {this, "TrackSummaryTool", "Trk::TrackSummaryTool/InDetTrackSummaryTool", "Track Summary Tool for number of Pix/SCT/TRT hits"} |
|
const AtlasDetectorID * | m_idHelper {} |
| Used to find out the corresponding sub-det from ROT->identify(). More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Retrieves the Trk::TrackCollection
objects.
- Properties
- TrackCollections
= [ ]
:
- DoWriteResiduals
= True
:
- ResidualPullCalculator
= PublicToolHandle('Trk::ResidualPullCalculator/ResidualPullCalculator')
:
- DoHitsSorting
= True
:
- DoHitsDetails
= True
:
- Retrieved Data
- id : internal track ID counter
- chi2 : \(\chi^2\) of track fit
- numDoF : number of degrees of freedom for the fit
- trackAuthor : track author as defined in TrkTrack/TrackInfo.h
- barcode : associated truth track barcode
- numHits : number of hits associated to that track
- covMatrix : entries of the covariance matrix
- pt : transverse momentum
- d0 : transverse impact parameter
- z0 : longitudinal impact parameter
- phi0 : initial phi direction at vertex
- cotTheta : initial \(\cos(\theta)\) at vertex
- numPolyline : number of polyline points
- polylineX, polylineY, polylineZ : polyline coordinates
- numTsos : number of associated hits (Track State on Surface)
- isOutlier : wether the hit is classified as outlier
- driftSign : the drift sign of the hit
- tsosDetType : detector type (one of 'PIX','SIL','TRT','MDT','CSC','RPC','TGC','unident')
- tsosResLoc1 : local first coordinate of residual
- tsosResLoc2 : local second coordinate of residual
- tsosPullLoc1 : local first coordinate of pull
- tsosPullLoc2 : local second coordinate of pull
Definition at line 60 of file TrackRetriever.h.
◆ StoreGateSvc_t
◆ TrackRetriever()
JiveXML::TrackRetriever::TrackRetriever |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard Constructor.
This is the standard AthAlgTool constructor.
- Parameters
-
type | AlgTool type name |
name | AlgTool instance name |
parent | AlgTools parent owning this tool |
Definition at line 335 of file TrackRetriever.cxx.
◆ dataTypeName()
virtual std::string JiveXML::TrackRetriever::dataTypeName |
( |
| ) |
const |
|
inlinevirtual |
◆ 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()
◆ 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
◆ getData()
Puts the variables into a DataMap.
General track fit info
Get truth Information
Get Perigee parameters (if available)
Get number of Pix/SCT/TRT hits
Get sorted list of track state on surfaces
Get polyline information
RIO association and outlier id
Definition at line 388 of file TrackRetriever.cxx.
393 if ( trackCollection->
empty()){
394 ATH_MSG_DEBUG(
"Empty track collection " << collectionName );
396 ATH_MSG_DEBUG(
"Retrieving data for track collection " << collectionName);
402 DataVect numDoF; numDoF.reserve(trackCollection->
size());
403 DataVect trackAuthor; trackAuthor.reserve(trackCollection->
size());
405 DataVect numHits; numHits.reserve(trackCollection->
size());
406 DataVect numPolyline; numPolyline.reserve(trackCollection->
size());
407 DataVect nBLayerHits; nBLayerHits.reserve(trackCollection->
size());
408 DataVect nPixHits; nPixHits.reserve(trackCollection->
size());
441 id.emplace_back(
id.
size());
442 chi2.emplace_back((*track)->fitQuality()->chiSquared());
443 numDoF.emplace_back((*track)->fitQuality()->numberDoF());
444 trackAuthor.emplace_back((*track)->info().trackFitter());
451 std::string matchingKey =
"";
453 if (
key->key().find(collectionName) != std::string::npos) {
454 matchingKey=
key->key();
458 if(!matchingKey.empty()){
460 if (truthCollection.isValid()) {
461 ATH_MSG_DEBUG(
"Found TrackTruthCollection for \"" << collectionName <<
"\": " << matchingKey);
464 ATH_MSG_WARNING(
"TrackTruthCollection \"" << matchingKey <<
"\" is not valid");
469 ATH_MSG_DEBUG(
"No matching TrackTruthCollection key found containing \"" << collectionName <<
"\"");
486 std::unique_ptr<Trk::TrackSummary>
summary =
nullptr;
491 nBLayerHits.emplace_back(0);
492 nPixHits.emplace_back(0);
512 polylineX.reserve(polylineX.size()+TSoSVec.size());
513 polylineY.reserve(polylineY.size()+TSoSVec.size());
514 polylineZ.reserve(polylineZ.size()+TSoSVec.size());
523 isOutlier.reserve(isOutlier.size()+TSoSVec.size());
524 hits.reserve(
hits.size()+TSoSVec.size());
526 tsosResLoc1.reserve(tsosResLoc1.size()+TSoSVec.size());
527 tsosResLoc2.reserve(tsosResLoc2.size()+TSoSVec.size());
528 tsosPullLoc1.reserve(tsosPullLoc1.size()+TSoSVec.size());
529 tsosPullLoc2.reserve(tsosPullLoc2.size()+TSoSVec.size());
530 tsosDetType.reserve(tsosDetType.size()+TSoSVec.size());
533 std::vector< const Trk::TrackStateOnSurface* >::const_iterator TSoSItr = TSoSVec.begin();
537 for (; TSoSItr != TSoSVec.end(); ++TSoSItr){
544 ATH_MSG_VERBOSE(
"Could not obtain RIO for TSoS of type " << (*TSoSItr)->dumpType() );
558 numHits.emplace_back(nHits);
568 DataMap[
"trackAuthor"] = trackAuthor;
571 DataMap[
"nBLayerHits"] = nBLayerHits;
572 DataMap[
"nPixHits"] = nPixHits;
575 DataMap[
"numPolyline"] = numPolyline;
589 if ( !polylineX.empty()){
590 std::string numPolyPerTrack =
DataType(polylineX.size()/((
double)
id.size())).toString();
591 DataMap[
"polylineX multiple=\"" + numPolyPerTrack +
"\""] = polylineX;
592 DataMap[
"polylineY multiple=\"" + numPolyPerTrack +
"\""] = polylineY;
593 DataMap[
"polylineZ multiple=\"" + numPolyPerTrack +
"\""] = polylineZ;
597 std::string numHitsPerTrack =
DataType(
hits.size()/((
double)
id.size())).toString();
598 DataMap[
"hits multiple=\"" + numHitsPerTrack +
"\""] =
hits;
599 DataMap[
"isOutlier multiple=\""+numHitsPerTrack+
"\""] = isOutlier;
605 DataMap[
"tsosResLoc1 multiple=\""+numHitsPerTrack+
"\""] = tsosResLoc1;
606 DataMap[
"tsosResLoc2 multiple=\""+numHitsPerTrack+
"\""] = tsosResLoc2;
607 DataMap[
"tsosPullLoc1 multiple=\""+numHitsPerTrack+
"\""] = tsosPullLoc1;
608 DataMap[
"tsosPullLoc2 multiple=\""+numHitsPerTrack+
"\""] = tsosPullLoc2;
609 DataMap[
"tsosDetType multiple=\""+numHitsPerTrack+
"\""] = tsosDetType;
◆ initialize()
StatusCode JiveXML::TrackRetriever::initialize |
( |
| ) |
|
Default AthAlgTool methods.
Initialize before event loop.
- retrieve the residual-pull tool
- setup the ID helper
Definition at line 343 of file TrackRetriever.cxx.
355 return StatusCode::SUCCESS;
◆ 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.
◆ interfaceID()
const InterfaceID & JiveXML::IDataRetriever::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Return the interface identifier.
Definition at line 40 of file IDataRetriever.h.
40 {
return IID_IDataRetriever; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ renounce()
◆ renounceArray()
◆ retrieve()
StatusCode JiveXML::TrackRetriever::retrieve |
( |
ToolHandle< IFormatTool > & |
FormatTool | ) |
|
|
virtual |
For each track collection retrieve all data.
- loop over tracks in all collections
- for each track get basic parameters
- Parameters
-
FormatTool | the tool that will create formated output from the DataMap |
Implements JiveXML::IDataRetriever.
Definition at line 366 of file TrackRetriever.cxx.
373 if (cont.isValid()) {
385 return StatusCode::SUCCESS;
◆ 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()
◆ m_detStore
◆ m_doHitsDetails
Gaudi::Property<bool> JiveXML::TrackRetriever::m_doHitsDetails {this, "DoHitsDetails", true, "Whether to write hits TrackStateOnSurfaces (TSoS) details"} |
|
private |
◆ m_doHitsSorting
Gaudi::Property<bool> JiveXML::TrackRetriever::m_doHitsSorting {this, "DoHitsSorting", false, "Whether to perform hits TrackStateOnSurfaces (TSoS) sorting"} |
|
private |
◆ m_doWriteResiduals
Gaudi::Property<bool> JiveXML::TrackRetriever::m_doWriteResiduals {this,"DoWriteResiduals", true,"Whether to write TrackResiduals"} |
|
private |
◆ m_evtStore
◆ m_idHelper
◆ m_isMC
Gaudi::Property<bool> JiveXML::TrackRetriever::m_isMC {this, "isMC", false, "Whether file is MC"} |
|
private |
◆ m_keys
SG::ReadHandleKeyArray<TrackCollection> JiveXML::TrackRetriever::m_keys {this,"TrackCollections", {"CombinedInDetTracks","DisappearingTracks","ExtrapolatedStauTracks","ExtraPolatedMuonsLRTTracks","MSOnlyExtraPolatedMuonsLRTTrackParticlesTracks","ResolvedForwardTracks","CombinedMuonsLRTTracks","CombinedStauTracks","MuonSpectrometerTracks","MSOnlyExtrapolatedTracks","ExtrapolatedMuonTracks","CombinedMuonTracks","GSFTracks"}, "Name of the Trk TrackCollection containers that will be written out to the JiveXML file"} |
|
private |
◆ m_residualPullCalculator
◆ m_trackSumTool
◆ m_TrackTruthCollections
◆ m_typeName
const std::string JiveXML::TrackRetriever::m_typeName = "Track" |
|
private |
The data type that is generated by this retriever.
Definition at line 79 of file TrackRetriever.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
@ numberOfPixelHits
number of pixel layers on track with absence of hits
char data[hepevt_bytes_allocation_ATLAS]
Const iterator class for DataVector/DataList.
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Gaudi::Property< bool > m_doWriteResiduals
Gaudi::Property< bool > m_doHitsDetails
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
const Trk::Perigee * getPerigeeParameters(const Trk::Track *track, DataVect &pt, DataVect &d0, DataVect &z0, DataVect &phi0, DataVect &cotTheta, DataVect &covMatrix)
Obtain the perigee parameters for a given track, if available, and fill them in the corresponding dat...
SG::ReadHandleKeyArray< TrackCollection > m_keys
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const std::string m_typeName
The data type that is generated by this retriever.
const Trk::RIO_OnTrack * getBaseInfoFromHit(const Trk::TrackStateOnSurface *tsos, const AtlasDetectorID *idHelper, DataVect &isOutlier, DataVect &hits, DataVect &driftSign, DataVect &tsosDetType)
Retrieve all the basic hit information from the Trk::TrackStateOnSurface.
std::vector< const Trk::TrackStateOnSurface * > getTrackStateOnSurfaces(const Trk::Track *track, const Trk::Perigee *perigee, bool doHitsSorting)
Get a list of track-State on Surfaces for measurement and outlier hits, sorted using the perigee comp...
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each track collection retrieve all data.
#define ATH_MSG_VERBOSE(x)
std::map< std::string, DataVect > DataMap
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
void getResidualPullFromHit(const Trk::TrackStateOnSurface *tsos, const Trk::RIO_OnTrack *rot, const ToolHandle< Trk::IResidualPullCalculator > &residualPullCalculator, DataVect &tsosResLoc1, DataVect &tsosResLoc2, DataVect &tsosPullLoc1, DataVect &tsosPullLoc2)
Get the residual pull information from the Trk::TrackStateOnSurface hit.
virtual void setOwner(IDataHandleHolder *o)=0
int driftSign(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &uncalibHit, MsgStream &msg)
Calculates whether a segement line travereses the tube measurement on the left (-1) or right (1) side...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
float nSCTHits(const U &p)
const DataMap getData(const TrackCollection *trackCollection, const std::string &collectionName)
Puts the variables into a DataMap.
float nTRTHits(const U &p)
@ numberOfSCTHits
number of SCT holes
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
double chi2(TH1 *h0, TH1 *h1)
const AtlasDetectorID * m_idHelper
Used to find out the corresponding sub-det from ROT->identify().
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
@ numberOfTRTHits
number of TRT outliers
Gaudi::Property< bool > m_isMC
Gaudi::Property< bool > m_doHitsSorting
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void getTruthFromTrack(const Trk::Track *track, const TrackCollection *trackCollection, SG::ReadHandle< TrackTruthCollection > &truthCollection, DataVect &barcode)
Get the barcode of the associated truth track.
SG::ReadHandleKeyArray< TrackTruthCollection > m_TrackTruthCollections
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
void getPolylineFromHits(const std::vector< const Trk::TrackStateOnSurface * > &TSoSVec, DataVect &polylineX, DataVect &polylineY, DataVect &polylineZ, DataVect &numPolyline)
Get polyline hits if available.