ATLAS Offline Software
Loading...
Searching...
No Matches
JiveXML::TrackRetriever Class Reference

Retrieves the Trk::TrackCollection objects. More...

#include <TrackRetriever.h>

Inheritance diagram for JiveXML::TrackRetriever:
Collaboration diagram for JiveXML::TrackRetriever:

Public Member Functions

 TrackRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor.
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 For each track collection retrieve all data.
const DataMap getData (const TrackCollection *trackCollection, const std::string &collectionName)
 Puts the variables into a DataMap.
virtual std::string dataTypeName () const
 Return the name of the data type that is generated by this retriever.
StatusCode initialize ()
 Default AthAlgTool methods.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const std::string m_typeName = "Track"
 The data type that is generated by this retriever.
SG::ReadHandleKeyArray< TrackCollectionm_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< TrackTruthCollectionm_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::IResidualPullCalculatorm_residualPullCalculator {this, "ResidualPullCalculator","Trk::ResidualPullCalculator/ResidualPullCalculator", "ToolHandle to ResidualPullCaclulator" }
ToolHandle< Trk::ITrackSummaryToolm_trackSumTool {this, "TrackSummaryTool", "Trk::TrackSummaryTool/InDetTrackSummaryTool", "Track Summary Tool for number of Pix/SCT/TRT hits"}
const AtlasDetectorIDm_idHelper {}
 Used to find out the corresponding sub-det from ROT->identify().
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Retrieves the Trk::TrackCollection objects.

  • Properties
    • TrackCollections = [ ] :
  • DoWriteResiduals = True :
  • 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.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackRetriever()

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

Standard Constructor.

This is the standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 335 of file TrackRetriever.cxx.

335 :
336 AthAlgTool(type,name,parent){}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::TrackRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type that is generated by this retriever.

Implements JiveXML::IDataRetriever.

Definition at line 72 of file TrackRetriever.h.

72{ return m_typeName; };
const std::string m_typeName
The data type that is generated by this retriever.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

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

◆ evtStore()

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.

◆ 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

◆ getData()

const DataMap JiveXML::TrackRetriever::getData ( const TrackCollection * trackCollection,
const std::string & collectionName )

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.

388 {
389
390 ATH_MSG_DEBUG("in getData()");
391
392 //Some sanity checks
393 if ( trackCollection->empty()){
394 ATH_MSG_DEBUG( "Empty track collection " << collectionName );
395 } else {
396 ATH_MSG_DEBUG( "Retrieving data for track collection " << collectionName);
397 }
398
399 // Make a list of track-wise entries and reserve enough space
400 DataVect id; id.reserve(trackCollection->size());
401 DataVect chi2; chi2.reserve(trackCollection->size());
402 DataVect numDoF; numDoF.reserve(trackCollection->size());
403 DataVect trackAuthor; trackAuthor.reserve(trackCollection->size());
404 DataVect barcode; barcode.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());
409 DataVect nSCTHits; nSCTHits.reserve(trackCollection->size());
410 DataVect nTRTHits; nTRTHits.reserve(trackCollection->size());
411
412 // vectors with measurement- or TrackStateOnSurface-wise entries
413 // reserve space later on
414 DataVect polylineX;
415 DataVect polylineY;
416 DataVect polylineZ;
417 DataVect tsosResLoc1;
418 DataVect tsosResLoc2;
419 DataVect tsosPullLoc1;
420 DataVect tsosPullLoc2;
421 DataVect tsosDetType;
422 DataVect isOutlier;
423 DataVect driftSign;
425
426 //Store wether this collection has perigee parameters
427 DataVect pt; pt.reserve(trackCollection->size());
428 DataVect d0; d0.reserve(trackCollection->size());
429 DataVect z0; z0.reserve(trackCollection->size());
430 DataVect phi0; phi0.reserve(trackCollection->size());
431 DataVect cotTheta; cotTheta.reserve(trackCollection->size());
432 //Covariance matrix has 15 entries per track
433 DataVect covMatrix; covMatrix.reserve(trackCollection->size() * 15 );
434
435 // Now loop over all tracks in the collection
437 for (track=trackCollection->begin(); track!=trackCollection->end(); ++track) {
441 id.emplace_back(id.size()); //<! simple counter starting from 0
442 chi2.emplace_back((*track)->fitQuality()->chiSquared());
443 numDoF.emplace_back((*track)->fitQuality()->numberDoF());
444 trackAuthor.emplace_back((*track)->info().trackFitter());
445
449
450 if(m_isMC){
451 std::string matchingKey = "";
452 for (const auto& key : m_TrackTruthCollections.keys()) {
453 if (key->key().find(collectionName) != std::string::npos) {
454 matchingKey=key->key();
455 break;
456 }
457 }
458 if(!matchingKey.empty()){
459 SG::ReadHandle<TrackTruthCollection>truthCollection(matchingKey);
460 if (truthCollection.isValid()) {
461 ATH_MSG_DEBUG("Found TrackTruthCollection for \"" << collectionName << "\": " << matchingKey);
462 TrackRetrieverHelpers::getTruthFromTrack(*track,trackCollection,truthCollection,barcode);
463 } else {
464 ATH_MSG_WARNING("TrackTruthCollection \"" << matchingKey << "\" is not valid");
465 //Fill with zero if none found
466 barcode.emplace_back(0);
467 }
468 } else {
469 ATH_MSG_DEBUG("No matching TrackTruthCollection key found containing \"" << collectionName << "\"");
470 barcode.emplace_back(0);
471 }
472 }
473 else{
474 ATH_MSG_DEBUG("Not MC so no truth tracks, fill with 0s");
475 barcode.emplace_back(0);
476 }
477
481 const Trk::Perigee* perigee = TrackRetrieverHelpers::getPerigeeParameters(*track, pt, d0, z0, phi0, cotTheta, covMatrix);
482
486 std::unique_ptr<Trk::TrackSummary> summary = nullptr;
487 summary = m_trackSumTool->summary(Gaudi::Hive::currentContext(), **track);
488
489 if(not summary){
490 ATH_MSG_DEBUG( "Track summary is NULL " );
491 nBLayerHits.emplace_back(0);
492 nPixHits.emplace_back(0);
493 nSCTHits.emplace_back(0);
494 nTRTHits.emplace_back(0);
495 }else{
496 nBLayerHits.emplace_back(summary->get(Trk::numberOfInnermostPixelLayerHits));
497 nPixHits.emplace_back(summary->get(Trk::numberOfPixelHits));
498 nSCTHits.emplace_back(summary->get(Trk::numberOfSCTHits));
499 nTRTHits.emplace_back(summary->get(Trk::numberOfTRTHits));
500 }
501
505 // Vector of interesting TrackStateOnSurfaces
506 std::vector<const Trk::TrackStateOnSurface*> TSoSVec = TrackRetrieverHelpers::getTrackStateOnSurfaces(*track,perigee,m_doHitsSorting);
507
511 // Reserving some space for polyline hits
512 polylineX.reserve(polylineX.size()+TSoSVec.size());
513 polylineY.reserve(polylineY.size()+TSoSVec.size());
514 polylineZ.reserve(polylineZ.size()+TSoSVec.size());
515
516 //And fill them
517 TrackRetrieverHelpers::getPolylineFromHits(TSoSVec,polylineX,polylineY,polylineZ,numPolyline);
518
522 //Reserve some space for resPull and other hit info
523 isOutlier.reserve(isOutlier.size()+TSoSVec.size());
524 hits.reserve(hits.size()+TSoSVec.size());
525 driftSign.reserve(driftSign.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());
531
532 //Now loop over tracks and fill them
533 std::vector< const Trk::TrackStateOnSurface* >::const_iterator TSoSItr = TSoSVec.begin();
534 //Count number of hits stored in this loop
535 long nHits = 0;
536 if (m_doHitsDetails){ // disable only for HeavyIons !
537 for (; TSoSItr != TSoSVec.end(); ++TSoSItr){
538 // This produces the full long debug dump for TSoS:
539 ATH_MSG_VERBOSE( (**TSoSItr) );
540 //Get the basic hit information
541 const Trk::RIO_OnTrack* rot = TrackRetrieverHelpers::getBaseInfoFromHit(*TSoSItr, m_idHelper, isOutlier, hits, driftSign, tsosDetType );
542 //tell if this didn't work out
543 if (!rot){
544 ATH_MSG_VERBOSE( "Could not obtain RIO for TSoS of type " << (*TSoSItr)->dumpType() );
545 continue ;
546 }
547 //count this as a hit
548 ++nHits;
549
550 //if we shell retrieve residuals, also get those
552 TrackRetrieverHelpers::getResidualPullFromHit( *TSoSItr, rot, m_residualPullCalculator, tsosResLoc1, tsosResLoc2, tsosPullLoc1, tsosPullLoc2);
553 }
554 }
555 } // end hits details
556
557 //Store number of retrieved hits for which we have retrieved information
558 numHits.emplace_back(nHits);
559
560 } // end loop over tracks in collection
561
562 //Now fill everything in a datamap
564 // Start with mandatory entries
565 DataMap["id"] = id;
566 DataMap["chi2"] = chi2;
567 DataMap["numDoF"] = numDoF;
568 DataMap["trackAuthor"] = trackAuthor;
569 DataMap["barcode"] = barcode;
570 DataMap["numHits"] = numHits;
571 DataMap["nBLayerHits"] = nBLayerHits;
572 DataMap["nPixHits"] = nPixHits;
573 DataMap["nSCTHits"] = nSCTHits;
574 DataMap["nTRTHits"] = nTRTHits;
575 DataMap["numPolyline"] = numPolyline;
576
577 // if perigee parameters are not available, leave the corresponding subtags empty.
578 // This way atlantis knows that such tracks can only be displayed as polylines.
579 if (!pt.empty()){
580 DataMap["pt"] = pt;
581 DataMap["d0"] = d0;
582 DataMap["z0"] = z0;
583 DataMap["phi0"] = phi0;
584 DataMap["cotTheta"] = cotTheta;
585 DataMap["covMatrix multiple=\"15\""] = covMatrix;
586 }
587
588 // vectors with measurement- or TrackStateOnSurface-wise entries
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;
594 }
595
596 if ( !hits.empty()){
597 std::string numHitsPerTrack = DataType(hits.size()/((double)id.size())).toString();
598 DataMap["hits multiple=\"" + numHitsPerTrack + "\""] = hits;
599 DataMap["isOutlier multiple=\""+numHitsPerTrack+"\""] = isOutlier;
600 DataMap["driftSign multiple=\""+numHitsPerTrack+"\""] = driftSign;
601
603 // hits counter in principle not needed anymore:
604 DataMap["numTsos"] = numHits;
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;
610 }
611 }
612
613 ATH_MSG_DEBUG(dataTypeName() << " collection " << collectionName << " retrieved with " << id.size() << " entries");
614
615 return DataMap;
616 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
static const uint32_t nHits
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
SG::ReadHandleKeyArray< TrackTruthCollection > m_TrackTruthCollections
const AtlasDetectorID * m_idHelper
Used to find out the corresponding sub-det from ROT->identify().
Gaudi::Property< bool > m_doHitsDetails
Gaudi::Property< bool > m_doWriteResiduals
Gaudi::Property< bool > m_doHitsSorting
Gaudi::Property< bool > m_isMC
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
double chi2(TH1 *h0, TH1 *h1)
int barcode(const T *p)
Definition Barcode.h:16
float nSCTHits(const U &p)
float nTRTHits(const U &p)
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.
void getPolylineFromHits(const std::vector< const Trk::TrackStateOnSurface * > &TSoSVec, DataVect &polylineX, DataVect &polylineY, DataVect &polylineZ, DataVect &numPolyline)
Get polyline hits if available.
void getTruthFromTrack(const Trk::Track *track, const TrackCollection *trackCollection, SG::ReadHandle< TrackTruthCollection > &truthCollection, DataVect &barcode)
Get the barcode of the associated truth track.
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...
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.
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...
std::map< std::string, DataVect > DataMap
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer

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

343 {
344 //Set up ATLAS ID helper to be able to identify the RIO's det-subsystem.
345 ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
346
347 // try to retrieve residual-pull calculation only if requested
350 }
351
352 ATH_CHECK(m_trackSumTool.retrieve());
353 ATH_CHECK(m_keys.initialize());
355 return StatusCode::SUCCESS;
356 }
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each track collection retrieve all data.
SG::ReadHandleKeyArray< TrackCollection > m_keys

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40{ return IID_IDataRetriever; }
static const InterfaceID IID_IDataRetriever("JiveXML::IDataRetriever", 3, 0)

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

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

◆ 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
    FormatToolthe tool that will create formated output from the DataMap

Implements JiveXML::IDataRetriever.

Definition at line 366 of file TrackRetriever.cxx.

366 {
367
368 ATH_MSG_DEBUG("In retrieve()");
369
370 // Loop through the keys and retrieve the corresponding data
371 for (const auto& key : m_keys) {
372 SG::ReadHandle<TrackCollection> cont(key);
373 if (cont.isValid()) {
374 DataMap data = getData(&(*cont),key.key());
375 if (FormatTool->AddToEvent(dataTypeName(), key.key(), &data).isFailure()) {
376 ATH_MSG_WARNING("Failed to add collection " << key.key());
377 } else {
378 ATH_MSG_DEBUG(" (" << key.key() << ") retrieved");
379 }
380 } else {
381 ATH_MSG_WARNING("Collection " << key.key() << " not found in SG");
382 }
383 }
384
385 return StatusCode::SUCCESS;
386 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const DataMap getData(const TrackCollection *trackCollection, const std::string &collectionName)
Puts the variables into a DataMap.

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doHitsDetails

Gaudi::Property<bool> JiveXML::TrackRetriever::m_doHitsDetails {this, "DoHitsDetails", true, "Whether to write hits TrackStateOnSurfaces (TSoS) details"}
private

Definition at line 86 of file TrackRetriever.h.

86{this, "DoHitsDetails", true, "Whether to write hits TrackStateOnSurfaces (TSoS) details"};

◆ m_doHitsSorting

Gaudi::Property<bool> JiveXML::TrackRetriever::m_doHitsSorting {this, "DoHitsSorting", false, "Whether to perform hits TrackStateOnSurfaces (TSoS) sorting"}
private

Definition at line 85 of file TrackRetriever.h.

85{this, "DoHitsSorting", false, "Whether to perform hits TrackStateOnSurfaces (TSoS) sorting"};

◆ m_doWriteResiduals

Gaudi::Property<bool> JiveXML::TrackRetriever::m_doWriteResiduals {this,"DoWriteResiduals", true,"Whether to write TrackResiduals"}
private

Definition at line 84 of file TrackRetriever.h.

84{this,"DoWriteResiduals", true,"Whether to write TrackResiduals"};

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

const AtlasDetectorID* JiveXML::TrackRetriever::m_idHelper {}
private

Used to find out the corresponding sub-det from ROT->identify().

Definition at line 93 of file TrackRetriever.h.

93{};

◆ m_isMC

Gaudi::Property<bool> JiveXML::TrackRetriever::m_isMC {this, "isMC", false, "Whether file is MC"}
private

Definition at line 87 of file TrackRetriever.h.

87{this, "isMC", false, "Whether file is MC"};

◆ 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

Definition at line 81 of file TrackRetriever.h.

81{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"};

◆ m_residualPullCalculator

ToolHandle<Trk::IResidualPullCalculator> JiveXML::TrackRetriever::m_residualPullCalculator {this, "ResidualPullCalculator","Trk::ResidualPullCalculator/ResidualPullCalculator", "ToolHandle to ResidualPullCaclulator" }
private

Definition at line 89 of file TrackRetriever.h.

89{this, "ResidualPullCalculator","Trk::ResidualPullCalculator/ResidualPullCalculator", "ToolHandle to ResidualPullCaclulator" };

◆ m_trackSumTool

ToolHandle< Trk::ITrackSummaryTool > JiveXML::TrackRetriever::m_trackSumTool {this, "TrackSummaryTool", "Trk::TrackSummaryTool/InDetTrackSummaryTool", "Track Summary Tool for number of Pix/SCT/TRT hits"}
private

Definition at line 90 of file TrackRetriever.h.

90{this, "TrackSummaryTool", "Trk::TrackSummaryTool/InDetTrackSummaryTool", "Track Summary Tool for number of Pix/SCT/TRT hits"};

◆ m_TrackTruthCollections

SG::ReadHandleKeyArray<TrackTruthCollection> JiveXML::TrackRetriever::m_TrackTruthCollections {this,"TruthCollections", {"CombinedInDetTracksTruthCollection"}, "Name of the Truth Track containers that will be written out to the JiveXML file"}
private

Definition at line 82 of file TrackRetriever.h.

82{this,"TruthCollections", {"CombinedInDetTracksTruthCollection"}, "Name of the Truth Track containers that will be written out to the JiveXML file"};

◆ 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

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: