Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrackRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/IToolSvc.h"
7 #include "GaudiKernel/TypeNameString.h"
8 
9 #include "TrkTrack/Track.h"
10 #include "TrkTrack/TrackInfo.h"
13 
14 
21 #include "AthLinks/ElementLink.h"
23 
26 
28 
29 // for residuals
32 
33 // for detector id
35 
36 #include "GaudiKernel/SystemOfUnits.h"
37 
38 namespace JiveXML {
40  namespace TrackRetrieverHelpers {
41 
51 
57  const Trk::Perigee *perigee = track->perigeeParameters();
58 
59  //return immediately if there is no perigee information
60  if (!perigee) return nullptr;
61 
62  //write out p_T
63  if ((perigee->parameters())[Trk::qOverP]==0) pt.emplace_back(9999.);
64  else pt.push_back( (perigee->charge() > 0) ? DataType(perigee->pT()/Gaudi::Units::GeV) : DataType((-perigee->pT())/Gaudi::Units::GeV));
65 
66  d0.emplace_back((perigee->parameters())[Trk::d0]/Gaudi::Units::cm);
67  z0.emplace_back(perigee->parameters()[Trk::z0]/Gaudi::Units::cm);
68  phi0.emplace_back(perigee->parameters()[Trk::phi0]);
69 
70  if (perigee->parameters()[Trk::theta] == 0.) cotTheta.emplace_back(9999.);
71  else cotTheta.emplace_back(1./tan(perigee->parameters()[Trk::theta]));
72 
73  // CLHEP->Eigen migration. jpt Dec'13
74  // https://twiki.cern.ch/twiki/bin/viewauth/Atlas/MigrationCLHEPtoEigen
75  // https://twiki.cern.ch/twiki/bin/viewauth/Atlas/MigrationToUpdatedEDM#Changes_to_TrkParameters
76 
78  AmgSymMatrix(5) covVert;
79 
80  const AmgSymMatrix(5)* covariance = perigee->covariance(); //perigee cannot be null here
81  if (perigee && covariance) {
82  // do trafo to old format
83  double measuredTheta = perigee->parameters()[Trk::theta];
84  double measuredQoverp = perigee->parameters()[Trk::qOverP];
85  const Trk::JacobianThetaPToCotThetaPt theJac( measuredTheta, measuredQoverp );
86  covVert = covariance->similarity(theJac);
87  }else{
88  for ( int ii=0; ii<20; ii++){ // placeholder. Do this nicer.
89  covVert(ii) = 0.;
90  }
91  }
92  //Scale covariance matrix values to get good resolution with fixed
93  //precision in JiveXML data
94 
95  const long scale = 10000;
96  const double thisScale(scale/100.);
97  // Migration: Now only has diagonal elements from covariance matrix ?
98  covMatrix.emplace_back(covVert(0)*thisScale); // 5 elements
99  covMatrix.emplace_back(covVert(1)*thisScale);
100  covMatrix.emplace_back(covVert(2)*thisScale);
101  covMatrix.emplace_back(covVert(3)*thisScale);
102  covMatrix.emplace_back(covVert(4)*thisScale);
103 
104  // Used to be 15 elements before migration, so need to put 10 placeholders
105  for ( int i=0; i<10; i++){
106  covMatrix.emplace_back( 0. );
107  }
108 
109  //All for perigee, return object for use by other functions
110  return perigee;
111  }
112 
118  std::vector<const Trk::TrackStateOnSurface*> getTrackStateOnSurfaces( const Trk::Track* track, const Trk::Perigee* perigee, bool doHitsSorting){
119  // vector for the return object
120  std::vector<const Trk::TrackStateOnSurface*> TSoSVec;
121 
122  // loop over TrackStateOnSurfaces to extract interesting ones
123  Trk::TrackStates::const_iterator tsos = track->trackStateOnSurfaces()->begin();
124  for (; tsos!=track->trackStateOnSurfaces()->end(); ++tsos) {
125  // include measurements AND outliers:
126  if ((*tsos)->type(Trk::TrackStateOnSurface::Measurement) || (*tsos)->type(Trk::TrackStateOnSurface::Outlier) ) {
127  // add to temp vector
128  TSoSVec.push_back(*tsos);
129  } // end if TSoS is measurement or outlier
130  } // end loop over TSoS
131 
132  // sort the selected TSoS, if not already sorted using a comparison functor
133 
134  if (perigee) {
135  //Get hold of the comparison functor
137  = new Trk::TrackStateOnSurfaceComparisonFunction(perigee->position(), perigee->momentum());
138  if (compFunc){
139  if (doHitsSorting) {
140  //Sort track state on surface if needed
141  if (TSoSVec.size() > 2 && !is_sorted(TSoSVec.begin(), TSoSVec.end(), *compFunc))
142  std::sort(TSoSVec.begin(), TSoSVec.end(), *compFunc);
143  }
144  }
145  delete compFunc;
146  } // end if compFunc
147 
148  //Now return that vector
149  return TSoSVec;
150  }
151 
155  void getPolylineFromHits( const std::vector<const Trk::TrackStateOnSurface*>& TSoSVec,
156  DataVect& polylineX, DataVect& polylineY, DataVect& polylineZ, DataVect& numPolyline){
157  int numPoly = 0 ;
158  if (TSoSVec.size() > 1) {
159  //Loop over track state on surfaces
160  std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsosIter;
161  const double onetenth(0.1);
162  for (tsosIter=TSoSVec.begin(); tsosIter!=TSoSVec.end(); ++tsosIter) {
163  // get global track position
164  if (!(*tsosIter)->trackParameters()) continue ;
165  const Amg::Vector3D& pos = (*tsosIter)->trackParameters()->position();
166  polylineX.emplace_back(pos.x()*onetenth);
167  polylineY.emplace_back(pos.y()*onetenth);
168  polylineZ.emplace_back(pos.z()*onetenth);
169  ++numPoly;
170  }
171  }
172  //Store counter as well
173  numPolyline.emplace_back(numPoly);
174  }
175 
176 
182  DataVect& isOutlier, DataVect& hits, DataVect& driftSign, DataVect& tsosDetType){
183 
184  //Get corresponding measurement
185  const Trk::MeasurementBase *measurement = tsos->measurementOnTrack();
186 
187  //If measurement is invalid, return imediately
188  if (!measurement) return nullptr;
189 
190  // get RIO_OnTrack
191  const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(measurement);
192 
193  // check for competing RIO_OnTracks
194  if (!rot) {
195  // try to get identifier by CompetingROT:
196  const Trk::CompetingRIOsOnTrack* comprot = dynamic_cast<const Trk::CompetingRIOsOnTrack*>(measurement);
197  //Get the input object with highest probability
198  if (comprot) rot = &(comprot->rioOnTrack(comprot->indexOfMaxAssignProb()));
199  }
200 
201  //If there is still no RIO_onTrack, return Null
202  if (!rot) return nullptr;
203 
204  // Now start writing out values:
205  // Check if this is an outlier hit
206  isOutlier.emplace_back(tsos->type(Trk::TrackStateOnSurface::Outlier));
207 
208  //Now try to get the identifier, create an empty invalid one if no rot
209  Identifier hitId (rot->identify());
210  //Check if it is valid, othwerise store 0
211  hits.push_back( hitId.is_valid()?DataType( hitId.get_compact() ):DataType(0) );
212 
213  // get sign of drift radius for TRT measurements
214  int theDriftSign = 0;
215  if (idHelper->is_trt(hitId)) {
216  // get local parameters
217  theDriftSign = measurement->localParameters()[Trk::driftRadius] > 0. ? 1 : -1;
218  }
219  driftSign.emplace_back(theDriftSign);
220 
221  //Now get the detector type of the hit
222  if ( !hitId.is_valid() ){
223  tsosDetType.emplace_back("unident");
224  } else if (idHelper->is_pixel(hitId) ) {
225  tsosDetType.emplace_back("PIX"); // is PIX in Atlantis
226  } else if (idHelper->is_sct(hitId)) {
227  tsosDetType.emplace_back("SIL"); // is SIL in Atlantis
228  } else if (idHelper->is_trt(hitId)) {
229  tsosDetType.emplace_back("TRT");
230  } else if (idHelper->is_mdt(hitId)) {
231  tsosDetType.emplace_back("MDT");
232  } else if (idHelper->is_csc(hitId)) {
233  tsosDetType.emplace_back("CSC");
234  } else if (idHelper->is_rpc(hitId)) {
235  tsosDetType.emplace_back("RPC");
236  } else if (idHelper->is_tgc(hitId)) {
237  tsosDetType.emplace_back("TGC");
238  } else {
239  tsosDetType.emplace_back("unident");
240  }
241 
242  //Return the reco input object
243  return rot;
244  }
245 
246 
251  const ToolHandle<Trk::IResidualPullCalculator> & residualPullCalculator,
252  DataVect& tsosResLoc1, DataVect& tsosResLoc2, DataVect& tsosPullLoc1, DataVect& tsosPullLoc2 ){
253 
254  //Define default return values for invalid states
255  double ResLoc1 = -99.;
256  double ResLoc2 = -99.;
257  double PullLoc1 = -99.;
258  double PullLoc2 = -99.;
259 
260  // get TrackParameters on the surface to calculate residual
261  const Trk::TrackParameters* tsosParameters = tsos->trackParameters();
262 
263  //Check we got the parameters
264  if (tsosParameters){
265 
271  //Get the residualPull object
272  std::optional<Trk::ResidualPull> residualPull = residualPullCalculator->residualPull(rot, tsosParameters,Trk::ResidualPull::Biased);
273 
274  if (residualPull) {
275  //Get the first residual
276  ResLoc1 = residualPull->residual()[Trk::loc1];
277  //Get the second residual for more than 1 dimension
278  if (residualPull->dimension() >= 2) ResLoc2 = residualPull->residual()[Trk::loc2];
279 
280  if ((residualPull->isPullValid()) ) {
281  //Get the first residual
282  PullLoc1 = residualPull->pull()[Trk::loc1];
283  //Get the second residual for more than 1 dimension
284  if (residualPull->dimension() >= 2) PullLoc2 = residualPull->pull()[Trk::loc2];
285  }
286  } // end if residualPull
287  } // end if tsosParameters
288 
289  //Finally store the values
290  tsosResLoc1.emplace_back(ResLoc1 );
291  tsosResLoc2.emplace_back(ResLoc2 );
292  tsosPullLoc1.emplace_back(PullLoc1 );
293  tsosPullLoc2.emplace_back(PullLoc2 );
294  }
295 
299  void getTruthFromTrack( const Trk::Track* track, const TrackCollection* trackCollection,
301 
302  if (!truthCollection.isValid()) {
303  //Fill with zero if none found
304  barcode.emplace_back(0);
305  return;
306  }
307 
308  //Get the element link to this track collection
310  tracklink.setElement(track);
311  tracklink.setStorableObject(*trackCollection);
312 
313  //try to find it in the truth collection
314  std::map<Trk::TrackTruthKey,TrackTruth>::const_iterator tempTrackTruthItr = truthCollection->find(tracklink);
315 
316  //Fill with zero if none found
317  if (tempTrackTruthItr == truthCollection->end()){
318  //Fill with zero if none found
319  barcode.emplace_back(0);
320  return;
321  }
322 
323  //if found, Store the barcode
324  barcode.emplace_back((*tempTrackTruthItr).second.particleLink().barcode());
325  }
326 
327  } //namespace TrackRetrieverHelpers
328 
335  TrackRetriever::TrackRetriever(const std::string& type,const std::string& name,const IInterface* parent):
337 
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 
354  return StatusCode::SUCCESS;
355  }
356 
357 
358 
365  StatusCode TrackRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
366 
367  ATH_MSG_DEBUG("In retrieve()");
368 
369  std::vector<std::string> keys = getKeys();
370 
371  if(keys.empty()){
372  ATH_MSG_WARNING("No StoreGate keys found");
373  return StatusCode::SUCCESS;
374  }
375 
376  // Loop through the keys and retrieve the corresponding data
377  for (const std::string& key : keys) {
379  if (cont.isValid()) {
380  DataMap data = getData(&(*cont),key);
381  if (FormatTool->AddToEvent(dataTypeName(), key, &data).isFailure()) {
382  ATH_MSG_WARNING("Failed to retrieve Collection " << key);
383  } else {
384  ATH_MSG_DEBUG(" (" << key << ") retrieved");
385  }
386  } else {
387  ATH_MSG_WARNING("Collection " << key << " not found in SG");
388  }
389  }
390  return StatusCode::SUCCESS;
391  }
392 
393  const DataMap TrackRetriever::getData(const TrackCollection* trackCollection, const std::string &collectionName) {
394 
395  ATH_MSG_DEBUG("in getData()");
396 
397  //Some sanity checks
398  if ( trackCollection->empty()){
399  ATH_MSG_DEBUG( "Empty track collection " << collectionName );
400  } else {
401  ATH_MSG_DEBUG( "Retrieving data for track collection " << collectionName);
402  }
403 
410  SG::ReadHandle<TrackTruthCollection> truthCollection;
411 
412  // Check for given truth collection
413  if (collectionName == m_priorityKey) {
415  if (truthCollection.isValid()) {
416  ATH_MSG_DEBUG("Found TrackTruthCollection with key " << m_TrackTruthCollection);
417  }
418  }else {
419  truthCollection = SG::ReadHandle<TrackTruthCollection>(collectionName + "TruthCollection");
420  if (truthCollection.isValid()) {
421  ATH_MSG_DEBUG("Found TrackTruthCollection with key " << collectionName << "TruthCollection");
422  } else {
423  truthCollection = SG::ReadHandle<TrackTruthCollection>(collectionName + "Truth");
424  if (truthCollection.isValid()) {
425  ATH_MSG_DEBUG("Found TrackTruthCollection with key " << collectionName << "Truth");
426  } else {
427  ATH_MSG_DEBUG("Could not find matching TrackTruthCollection for " << collectionName);
428  }
429  }
430  }
431 
432  // Make a list of track-wise entries and reserve enough space
433  DataVect id; id.reserve(trackCollection->size());
434  DataVect chi2; chi2.reserve(trackCollection->size());
435  DataVect numDoF; numDoF.reserve(trackCollection->size());
436  DataVect trackAuthor; trackAuthor.reserve(trackCollection->size());
437  DataVect barcode; barcode.reserve(trackCollection->size());
438  DataVect numHits; numHits.reserve(trackCollection->size());
439  DataVect numPolyline; numPolyline.reserve(trackCollection->size());
440  DataVect nBLayerHits; nBLayerHits.reserve(trackCollection->size());
441  DataVect nPixHits; nPixHits.reserve(trackCollection->size());
442  DataVect nSCTHits; nSCTHits.reserve(trackCollection->size());
443  DataVect nTRTHits; nTRTHits.reserve(trackCollection->size());
444 
445  // vectors with measurement- or TrackStateOnSurface-wise entries
446  // reserve space later on
447  DataVect polylineX;
448  DataVect polylineY;
449  DataVect polylineZ;
450  DataVect tsosResLoc1;
451  DataVect tsosResLoc2;
452  DataVect tsosPullLoc1;
453  DataVect tsosPullLoc2;
454  DataVect tsosDetType;
455  DataVect isOutlier;
457  DataVect hits;
458 
459  //Store wether this collection has perigee parameters
460  DataVect pt; pt.reserve(trackCollection->size());
461  DataVect d0; d0.reserve(trackCollection->size());
462  DataVect z0; z0.reserve(trackCollection->size());
463  DataVect phi0; phi0.reserve(trackCollection->size());
464  DataVect cotTheta; cotTheta.reserve(trackCollection->size());
465  //Covariance matrix has 15 entries per track
466  DataVect covMatrix; covMatrix.reserve(trackCollection->size() * 15 );
467 
468  // Now loop over all tracks in the collection
470  for (track=trackCollection->begin(); track!=trackCollection->end(); ++track) {
474  id.emplace_back(id.size()); //<! simple counter starting from 0
475  chi2.emplace_back((*track)->fitQuality()->chiSquared());
476  numDoF.emplace_back((*track)->fitQuality()->numberDoF());
477  trackAuthor.emplace_back((*track)->info().trackFitter());
478 
482  TrackRetrieverHelpers::getTruthFromTrack(*track,trackCollection,truthCollection,barcode);
483 
488 
492  std::unique_ptr<Trk::TrackSummary> summary = nullptr;
493  summary = m_trackSumTool->summary(Gaudi::Hive::currentContext(), **track);
494 
495  if(not summary){
496  ATH_MSG_DEBUG( "Track summary is NULL " );
497  nBLayerHits.emplace_back(0);
498  nPixHits.emplace_back(0);
499  nSCTHits.emplace_back(0);
500  nTRTHits.emplace_back(0);
501  }else{
502  nBLayerHits.emplace_back(summary->get(Trk::numberOfInnermostPixelLayerHits));
503  nPixHits.emplace_back(summary->get(Trk::numberOfPixelHits));
504  nSCTHits.emplace_back(summary->get(Trk::numberOfSCTHits));
505  nTRTHits.emplace_back(summary->get(Trk::numberOfTRTHits));
506  }
507 
511  // Vector of interesting TrackStateOnSurfaces
512  std::vector<const Trk::TrackStateOnSurface*> TSoSVec = TrackRetrieverHelpers::getTrackStateOnSurfaces(*track,perigee,m_doHitsSorting);
513 
517  // Reserving some space for polyline hits
518  polylineX.reserve(polylineX.size()+TSoSVec.size());
519  polylineY.reserve(polylineY.size()+TSoSVec.size());
520  polylineZ.reserve(polylineZ.size()+TSoSVec.size());
521 
522  //And fill them
523  TrackRetrieverHelpers::getPolylineFromHits(TSoSVec,polylineX,polylineY,polylineZ,numPolyline);
524 
528  //Reserve some space for resPull and other hit info
529  isOutlier.reserve(isOutlier.size()+TSoSVec.size());
530  hits.reserve(hits.size()+TSoSVec.size());
531  driftSign.reserve(driftSign.size()+TSoSVec.size());
532  tsosResLoc1.reserve(tsosResLoc1.size()+TSoSVec.size());
533  tsosResLoc2.reserve(tsosResLoc2.size()+TSoSVec.size());
534  tsosPullLoc1.reserve(tsosPullLoc1.size()+TSoSVec.size());
535  tsosPullLoc2.reserve(tsosPullLoc2.size()+TSoSVec.size());
536  tsosDetType.reserve(tsosDetType.size()+TSoSVec.size());
537 
538  //Now loop over tracks and fill them
539  std::vector< const Trk::TrackStateOnSurface* >::const_iterator TSoSItr = TSoSVec.begin();
540  //Count number of hits stored in this loop
541  long nHits = 0;
542  if (m_doHitsDetails){ // disable only for HeavyIons !
543  for (; TSoSItr != TSoSVec.end(); ++TSoSItr){
544  // This produces the full long debug dump for TSoS:
545  ATH_MSG_VERBOSE( (**TSoSItr) );
546  //Get the basic hit information
547  const Trk::RIO_OnTrack* rot = TrackRetrieverHelpers::getBaseInfoFromHit(*TSoSItr, m_idHelper, isOutlier, hits, driftSign, tsosDetType );
548  //tell if this didn't work out
549  if (!rot){
550  ATH_MSG_VERBOSE( "Could not obtain RIO for TSoS of type " << (*TSoSItr)->dumpType() );
551  continue ;
552  }
553  //count this as a hit
554  ++nHits;
555 
556  //if we shell retrieve residuals, also get those
557  if (m_doWriteResiduals){
558  TrackRetrieverHelpers::getResidualPullFromHit( *TSoSItr, rot, m_residualPullCalculator, tsosResLoc1, tsosResLoc2, tsosPullLoc1, tsosPullLoc2);
559  }
560  }
561  } // end hits details
562 
563  //Store number of retrieved hits for which we have retrieved information
564  numHits.emplace_back(nHits);
565 
566  } // end loop over tracks in collection
567 
568  //Now fill everything in a datamap
570  // Start with mandatory entries
571  DataMap["id"] = id;
572  DataMap["chi2"] = chi2;
573  DataMap["numDoF"] = numDoF;
574  DataMap["trackAuthor"] = trackAuthor;
575  DataMap["barcode"] = barcode;
576  DataMap["numHits"] = numHits;
577  DataMap["nBLayerHits"] = nBLayerHits;
578  DataMap["nPixHits"] = nPixHits;
579  DataMap["nSCTHits"] = nSCTHits;
580  DataMap["nTRTHits"] = nTRTHits;
581  DataMap["numPolyline"] = numPolyline;
582 
583  // if perigee parameters are not available, leave the corresponding subtags empty.
584  // This way atlantis knows that such tracks can only be displayed as polylines.
585  if (!pt.empty()){
586  DataMap["pt"] = pt;
587  DataMap["d0"] = d0;
588  DataMap["z0"] = z0;
589  DataMap["phi0"] = phi0;
590  DataMap["cotTheta"] = cotTheta;
591  DataMap["covMatrix multiple=\"15\""] = covMatrix;
592  }
593 
594  // vectors with measurement- or TrackStateOnSurface-wise entries
595  if ( !polylineX.empty()){
596  std::string numPolyPerTrack = DataType(polylineX.size()/((double)id.size())).toString();
597  DataMap["polylineX multiple=\"" + numPolyPerTrack + "\""] = polylineX;
598  DataMap["polylineY multiple=\"" + numPolyPerTrack + "\""] = polylineY;
599  DataMap["polylineZ multiple=\"" + numPolyPerTrack + "\""] = polylineZ;
600  }
601 
602  if ( !hits.empty()){
603  std::string numHitsPerTrack = DataType(hits.size()/((double)id.size())).toString();
604  DataMap["hits multiple=\"" + numHitsPerTrack + "\""] = hits;
605  DataMap["isOutlier multiple=\""+numHitsPerTrack+"\""] = isOutlier;
606  DataMap["driftSign multiple=\""+numHitsPerTrack+"\""] = driftSign;
607 
608  if (m_doWriteResiduals){
609  // hits counter in principle not needed anymore:
610  DataMap["numTsos"] = numHits;
611  DataMap["tsosResLoc1 multiple=\""+numHitsPerTrack+"\""] = tsosResLoc1;
612  DataMap["tsosResLoc2 multiple=\""+numHitsPerTrack+"\""] = tsosResLoc2;
613  DataMap["tsosPullLoc1 multiple=\""+numHitsPerTrack+"\""] = tsosPullLoc1;
614  DataMap["tsosPullLoc2 multiple=\""+numHitsPerTrack+"\""] = tsosPullLoc2;
615  DataMap["tsosDetType multiple=\""+numHitsPerTrack+"\""] = tsosDetType;
616  }
617  }
618 
619  ATH_MSG_DEBUG(dataTypeName() << " collection " << collectionName << " retrieved with " << id.size() << " entries");
620 
621  return DataMap;
622  }
623 
624 
625 
626  const std::vector<std::string> TrackRetriever::getKeys() {
627 
628  ATH_MSG_DEBUG("in getKeys()");
629 
630  // Initialize keys with the priority key first and then the other requested keys
631  std::vector<std::string> keys = {m_priorityKey};
632 
633  if (!m_otherKeys.empty() && !m_doWriteAllCollections) {
634  keys.insert(keys.end(), m_otherKeys.begin(), m_otherKeys.end());
635  }
636  else {
637  // If all collections are requested, obtain all available keys from StoreGate
638  std::vector<std::string> allKeys;
639  //if(m_doWriteAllCollections){
640  evtStore()->keys<TrackCollection>(allKeys);
641  //}
642 
643  // Add keys that are not the priority key and do not add containers with "HLT" in their name if requested, ignore TRTSeed and MuonSlimmedTrackCollections
644  for (const std::string& key : allKeys) {
645  if (key != m_priorityKey && (key.find("HLT") == std::string::npos || m_doWriteHLT) && (key!="TRTSeeds") && (key !="MuonSlimmedTrackCollection")) {
646  keys.emplace_back(key);
647  ATH_MSG_DEBUG("key: " << key);
648  }
649  }
650  }
651  return keys;
652  }
653 
654 } //namespace JiveXML
JiveXML::TrackRetriever::getKeys
const std::vector< std::string > getKeys()
Gets the StoreGate keys for the desired containers.
Definition: TrackRetriever.cxx:626
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ITrackSummaryTool.h
AtlasDetectorID::is_rpc
bool is_rpc(Identifier id) const
Definition: AtlasDetectorID.h:875
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
JiveXML::TrackRetriever::m_priorityKey
Gaudi::Property< std::string > m_priorityKey
Definition: TrackRetriever.h:86
JiveXML::TrackRetriever::initialize
StatusCode initialize()
Default AthAlgTool methods.
Definition: TrackRetriever.cxx:343
JiveXML::TrackRetriever::m_TrackTruthCollection
Gaudi::Property< std::string > m_TrackTruthCollection
Definition: TrackRetriever.h:90
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
TrackParameters.h
MeasurementBase.h
AtlasDetectorID::is_csc
bool is_csc(Identifier id) const
Definition: AtlasDetectorID.h:891
CompetingRIOsOnTrack.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
JiveXML::TrackRetriever::m_doWriteResiduals
Gaudi::Property< bool > m_doWriteResiduals
Definition: TrackRetriever.h:91
JiveXML::TrackRetriever::m_doHitsDetails
Gaudi::Property< bool > m_doHitsDetails
Definition: TrackRetriever.h:93
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
TrackStateDefs.h
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
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
compFunc
bool(*)(const xAOD::Jet *, const xAOD::Jet *) compFunc
Definition: JetSorter.cxx:12
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrackRetriever.h
Identifier::get_compact
value_type get_compact() const
Get the compact id.
JiveXML::TrackRetriever::m_otherKeys
Gaudi::Property< std::vector< std::string > > m_otherKeys
Definition: TrackRetriever.h:87
TrackStateOnSurfaceComparisonFunction.h
Trk::z0
@ z0
Definition: ParamDefs.h:64
Trk::TrackStateOnSurface::measurementOnTrack
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:35
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:365
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
JiveXML::TrackRetriever::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: TrackRetriever.h:95
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
TrackTruthKey.h
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
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
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
Track.h
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:235
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::TrackStateOnSurface::type
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Trk::TrackStateOnSurfaceComparisonFunction
Class providing comparison function, or relational definition, for sorting MeasurementBase objects.
Definition: TrackStateOnSurfaceComparisonFunction.h:37
ResidualPull.h
JiveXML::TrackRetriever::m_doWriteAllCollections
Gaudi::Property< bool > m_doWriteAllCollections
Definition: TrackRetriever.h:89
lumiFormat.i
int i
Definition: lumiFormat.py:85
JiveXML::DataType
Templated class to convert any object that is streamable in a ostringstream in a string.
Definition: DataType.h:21
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:393
AtlasDetectorID::is_tgc
bool is_tgc(Identifier id) const
Definition: AtlasDetectorID.h:902
IDTPM::nTRTHits
float nTRTHits(const U &p)
Definition: TrackParametersHelper.h:446
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
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:99
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
JiveXML::TrackRetriever::m_doWriteHLT
Gaudi::Property< bool > m_doWriteHLT
Definition: TrackRetriever.h:88
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
DataVector< Trk::Track >
JacobianThetaPToCotThetaPt.h
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:22
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Trk::d0
@ d0
Definition: ParamDefs.h:63
TrackInfo.h
RIO_OnTrack.h
JiveXML::TrackRetriever::TrackRetriever
TrackRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: TrackRetriever.cxx:335
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
JiveXML::TrackRetriever::m_doHitsSorting
Gaudi::Property< bool > m_doHitsSorting
Definition: TrackRetriever.h:92
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
IResidualPullCalculator.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
JiveXML::TrackRetriever::m_trackSumTool
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
Definition: TrackRetriever.h:96
Trk::ResidualPull::Biased
@ Biased
RP with track state including the hit.
Definition: ResidualPull.h:55
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
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:798
AthAlgTool
Definition: AthAlgTool.h:26
FitQuality.h
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
Trk::JacobianThetaPToCotThetaPt
Definition: JacobianThetaPToCotThetaPt.h:41
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.
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
JiveXML::TrackRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
Definition: TrackRetriever.h:77
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
AtlasDetectorID::is_mdt
bool is_mdt(Identifier id) const
Definition: AtlasDetectorID.h:859
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
Identifier
Definition: IdentifierFieldParser.cxx:14
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65