ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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. 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
 

Static Public Member Functions

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

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

Private Attributes

const std::string m_typeName = "Track"
 The data type that is generated by this retriever. More...
 
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(). 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
 

Detailed Description

Retrieves the Trk::TrackCollection objects.

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  :

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

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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; }

◆ 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

◆ 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;
424  DataVect hits;
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 
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 
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
551  if (m_doWriteResiduals){
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 
602  if (m_doWriteResiduals){
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  }

◆ 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
348  if (m_doWriteResiduals){
350  }
351 
352  ATH_CHECK(m_trackSumTool.retrieve());
353  ATH_CHECK(m_keys.initialize());
354  ATH_CHECK(m_TrackTruthCollections.initialize());
355  return StatusCode::SUCCESS;
356  }

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

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

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

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.

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

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

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

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

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

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

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

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

◆ 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:
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
Trk::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:53
JiveXML::TrackRetriever::m_doWriteResiduals
Gaudi::Property< bool > m_doWriteResiduals
Definition: TrackRetriever.h:84
JiveXML::TrackRetriever::m_doHitsDetails
Gaudi::Property< bool > m_doHitsDetails
Definition: TrackRetriever.h:86
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
JiveXML::TrackRetrieverHelpers::getPerigeeParameters
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...
Definition: TrackRetriever.cxx:48
JiveXML::TrackRetriever::m_keys
SG::ReadHandleKeyArray< TrackCollection > m_keys
Definition: TrackRetriever.h:81
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
test_pyathena.pt
pt
Definition: test_pyathena.py:11
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
JiveXML::TrackRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition: TrackRetriever.h:79
JiveXML::TrackRetrieverHelpers::getBaseInfoFromHit
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.
Definition: TrackRetriever.cxx:181
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
JiveXML::TrackRetrieverHelpers::getTrackStateOnSurfaces
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...
Definition: TrackRetriever.cxx:118
JiveXML::TrackRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each track collection retrieve all data.
Definition: TrackRetriever.cxx:366
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
JiveXML::TrackRetriever::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: TrackRetriever.h:89
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
JiveXML::TrackRetrieverHelpers::getResidualPullFromHit
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.
Definition: TrackRetriever.cxx:250
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
MuonR4::SegmentFitHelpers::driftSign
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...
Definition: SegmentFitHelperFunctions.cxx:239
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
IDTPM::nSCTHits
float nSCTHits(const U &p)
Definition: TrackParametersHelper.h:393
JiveXML::TrackRetriever::getData
const DataMap getData(const TrackCollection *trackCollection, const std::string &collectionName)
Puts the variables into a DataMap.
Definition: TrackRetriever.cxx:388
IDTPM::nTRTHits
float nTRTHits(const U &p)
Definition: TrackParametersHelper.h:446
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
JiveXML::TrackRetriever::m_idHelper
const AtlasDetectorID * m_idHelper
Used to find out the corresponding sub-det from ROT->identify().
Definition: TrackRetriever.h:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
JiveXML::TrackRetriever::m_isMC
Gaudi::Property< bool > m_isMC
Definition: TrackRetriever.h:87
JiveXML::TrackRetriever::m_doHitsSorting
Gaudi::Property< bool > m_doHitsSorting
Definition: TrackRetriever.h:85
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
JiveXML::TrackRetriever::m_trackSumTool
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
Definition: TrackRetriever.h:90
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
TRT::Track::cotTheta
@ cotTheta
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:65
JiveXML::TrackRetrieverHelpers::getTruthFromTrack
void getTruthFromTrack(const Trk::Track *track, const TrackCollection *trackCollection, SG::ReadHandle< TrackTruthCollection > &truthCollection, DataVect &barcode)
Get the barcode of the associated truth track.
Definition: TrackRetriever.cxx:299
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
JiveXML::TrackRetriever::m_TrackTruthCollections
SG::ReadHandleKeyArray< TrackTruthCollection > m_TrackTruthCollections
Definition: TrackRetriever.h:82
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
JiveXML::TrackRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
Definition: TrackRetriever.h:72
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
JiveXML::TrackRetrieverHelpers::getPolylineFromHits
void getPolylineFromHits(const std::vector< const Trk::TrackStateOnSurface * > &TSoSVec, DataVect &polylineX, DataVect &polylineY, DataVect &polylineZ, DataVect &numPolyline)
Get polyline hits if available.
Definition: TrackRetriever.cxx:155
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65