Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
FPGATrackSimSGToRawHitsTool Class Reference

Extract the raw hists from info in SG. More...

#include <FPGATrackSimSGToRawHitsTool.h>

Inheritance diagram for FPGATrackSimSGToRawHitsTool:
Collaboration diagram for FPGATrackSimSGToRawHitsTool:

Public Member Functions

 FPGATrackSimSGToRawHitsTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~FPGATrackSimSGToRawHitsTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode readData (FPGATrackSimEventInputHeader *header, const EventContext &eventContext) override
 This function get from the SG the inner detector raw hits and prepares them for FPGATrackSim simulation. More...
 

Private Types

typedef std::map< Identifier, int > HitIndexMap
 

Private Member Functions

StatusCode readRawSilicon (HitIndexMap &hitIndexMap, const EventContext &eventContext)
 
StatusCode readTruthTracks (std::vector< FPGATrackSimTruthTrack > &truth, const EventContext &eventContext)
 
StatusCode readOfflineTracks (std::vector< FPGATrackSimOfflineTrack > &Track, const EventContext &eventContext)
 
StatusCode readOfflineClusters (std::vector< FPGATrackSimCluster > &Clusters, const EventContext &eventContext)
 
StatusCode readPixelSimulation (HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
 
StatusCode readStripSimulation (HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
 
StatusCode dumpPixelClusters (HitIndexMap &pixelClusterIndexMap, const EventContext &eventContext)
 
const HepMcParticleLinkgetTruthInformation (InDetSimDataCollection::const_iterator &iter, FPGATrackSimInputUtils::ParentBitmask &parentMask)
 

Private Attributes

ToolHandle< Trk::ITruthToTrackm_truthToTrack {this, "TruthToTrackTool", "Trk::TruthToTrack/InDetTruthToTrack" }
 tool to create track parameters from a gen particle More...
 
ToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
 ToolHandle for Extrapolator. More...
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "EventInfo", "EventInfo" }
 
SG::ReadHandleKey< InDet::SiClusterContainerm_pixelClusterContainerKey { this, "pixelClustersName", "ITkPixelClusters" }
 
SG::ReadHandleKey< InDet::SiClusterContainerm_sctClusterContainerKey { this, "SCT_ClustersName", "SCT_Clusters" }
 
SG::ReadHandleKey< xAOD::TrackParticleContainerm_offlineTracksKey { this, "OfflineTracks", "InDetTrackParticles"}
 
SG::ReadHandleKey< McEventCollectionm_mcCollectionKey { this, "McTruth", "TruthEvent" }
 
SG::ReadHandleKey< InDetSimDataCollectionm_pixelSDOKey { this, "PixelSDO", "ITkPixelSDO_Map" }
 
SG::ReadHandleKey< InDetSimDataCollectionm_stripSDOKey { this, "StripSDO", "ITkStripSDO_Map" }
 
SG::ReadHandleKey< PixelRDO_Containerm_pixelRDOKey { this, "PixelRDO", "ITkPixelRDOs" }
 
SG::ReadHandleKey< SCT_RDO_Containerm_stripRDOKey { this, "StripRDO", "ITkStripRDOs" }
 
Gaudi::Property< std::string > m_tracksTruthName { this, "OfflineName", "InDetTrackParticles", "name of offline tracks collection" }
 
Gaudi::Property< bool > m_dumpHitsOnTracks { this, "dumpHitsOnTracks", false }
 
Gaudi::Property< bool > m_dumpTruthIntersections { this, "dumpTruthIntersections", false }
 
Gaudi::Property< bool > m_readOfflineClusters { this, "ReadOfflineClusters", true, "flag to enable the offline cluster save" }
 
Gaudi::Property< bool > m_readTruthTracks { this, "ReadTruthTracks", true, "flag to enable the truth tracking save" }
 
Gaudi::Property< bool > m_readOfflineTracks { this, "ReadOfflineTracks", true, "flag to enable the offline tracking save" }
 
Gaudi::Property< bool > m_UseNominalOrigin { this, "UseNominalOrigin", false, "if true truth values are always with respect to (0,0,0)" }
 
Gaudi::Property< double > m_maxEta { this, "maxEta", 5.0 }
 
Gaudi::Property< double > m_minPt { this, "minPt", .8*CLHEP::GeV }
 
const PixelIDm_pixelId = nullptr
 
const SCT_IDm_sctId = nullptr
 
const InDetDD::SiDetectorManagerm_PIX_mgr = nullptr
 
const InDetDD::SiDetectorManagerm_SCT_mgr = nullptr
 
const HepPDT::ParticleDataTable * m_particleDataTable = nullptr
 
FPGATrackSimEventInputHeaderm_eventHeader = nullptr
 

Detailed Description

Extract the raw hists from info in SG.

Definition at line 45 of file FPGATrackSimSGToRawHitsTool.h.

Member Typedef Documentation

◆ HitIndexMap

typedef std::map<Identifier, int> FPGATrackSimSGToRawHitsTool::HitIndexMap
private

Definition at line 94 of file FPGATrackSimSGToRawHitsTool.h.

Constructor & Destructor Documentation

◆ FPGATrackSimSGToRawHitsTool()

FPGATrackSimSGToRawHitsTool::FPGATrackSimSGToRawHitsTool ( const std::string &  algname,
const std::string &  name,
const IInterface *  ifc 
)

Definition at line 50 of file FPGATrackSimSGToRawHitsTool.cxx.

50  :
51  base_class(algname, name, ifc)
52 {}

◆ ~FPGATrackSimSGToRawHitsTool()

virtual FPGATrackSimSGToRawHitsTool::~FPGATrackSimSGToRawHitsTool ( )
inlinevirtual

Definition at line 49 of file FPGATrackSimSGToRawHitsTool.h.

49 { ; }

Member Function Documentation

◆ dumpPixelClusters()

StatusCode FPGATrackSimSGToRawHitsTool::dumpPixelClusters ( HitIndexMap pixelClusterIndexMap,
const EventContext &  eventContext 
)
private

Definition at line 502 of file FPGATrackSimSGToRawHitsTool.cxx.

502  {
503  unsigned int pixelClusterIndex = 0;
504  auto pixelSDOHandle = SG::makeHandle(m_pixelSDOKey, eventContext);
505  auto pixelClusterContainerHandle = SG::makeHandle(m_pixelClusterContainerKey, eventContext);
506  // Dump pixel clusters. They're in m_pixelContainer
507  for (const InDet::SiClusterCollection* pixelClusterCollection : *pixelClusterContainerHandle) {
508  if (pixelClusterCollection == nullptr) {
509  ATH_MSG_DEBUG("pixelClusterCollection not available!");
510  continue;
511  }
512 
513  for (const InDet::SiCluster* cluster : *pixelClusterCollection) {
514  Identifier theId = cluster->identify();
515  // if there is simulation truth available, try to retrieve the "most likely" barcode for this pixel cluster.
516  FPGATrackSimInputUtils::ParentBitmask parentMask; // FIXME set, but not used
517  if (!m_pixelSDOKey.empty()) {
518  for (const Identifier& rdoId : cluster->rdoList()) {
519  const InDetDD::SiDetectorElement* sielement = m_PIX_mgr->getDetectorElement(rdoId);
520  assert(sielement);
521  InDetDD::SiCellId cellID = sielement->cellIdFromIdentifier(rdoId);
522 
523  const int nCells = sielement->numberOfConnectedCells(cellID);
524  InDetSimDataCollection::const_iterator iter(pixelSDOHandle->find(rdoId));
525  // this might be the ganged pixel copy.
526  if (nCells > 1 && iter == pixelSDOHandle->end()) {
528  for (int ii = 0; ii < nCells && iter == pixelSDOHandle->end(); ++ii) {
529  iter = pixelSDOHandle->find(sielement->identifierFromCellId(sielement->design().connectedCell(SiRC, ii)));
530  }
531  } // end search for correct ganged pixel
532  // if SDO found for this pixel, associate the particle. otherwise leave unassociated.
533  if (iter != pixelSDOHandle->end()) { (void) getTruthInformation(iter, parentMask); } // FIXME not used??
534  } // if we have pixel sdo's available
535  }
536  pixelClusterIndexMap[theId] = pixelClusterIndex;
537  pixelClusterIndex++;
538  } // End loop over pixel clusters
539  } // End loop over pixel cluster collection
540 
541  return StatusCode::SUCCESS;
542 }

◆ finalize()

StatusCode FPGATrackSimSGToRawHitsTool::finalize ( )
overridevirtual

Definition at line 88 of file FPGATrackSimSGToRawHitsTool.cxx.

88  {
89  return StatusCode::SUCCESS;
90 }

◆ getTruthInformation()

const HepMcParticleLink * FPGATrackSimSGToRawHitsTool::getTruthInformation ( InDetSimDataCollection::const_iterator &  iter,
FPGATrackSimInputUtils::ParentBitmask parentMask 
)
private

Definition at line 835 of file FPGATrackSimSGToRawHitsTool.cxx.

836  {
837  const HepMcParticleLink* bestTruthLink{};
838  const InDetSimData& sdo(iter->second);
839  const std::vector<InDetSimData::Deposit>& deposits(sdo.getdeposits());
840  float bestPt{-999.f};
841  for (const InDetSimData::Deposit& dep : deposits) {
842 
843  const HepMcParticleLink& particleLink = dep.first;
844  // RDO's without SDO's are delta rays or detector noise.
845  if (!particleLink.isValid()) { continue; }
846  const float genEta = particleLink->momentum().pseudoRapidity();
847  const float genPt = particleLink->momentum().perp(); // MeV
848  // reject unstable particles
849  if (!MC::isStable(particleLink.cptr())) { continue; }
850  // reject secondaries and low pT (<400 MeV) pileup
851  if (HepMC::is_simulation_particle(particleLink.cptr()) || particleLink.barcode() == 0 /*HepMC::no_truth_link(particleLink)*/) { continue; } // FIXME
852  // reject far forward particles
853  if (std::fabs(genEta) > m_maxEta) { continue; }
854  // "bestTruthLink" links to the highest pt particle
855  if (bestPt < genPt) {
856  bestPt = genPt;
857  bestTruthLink = &particleLink;
858  }
859  #ifdef HEPMC3
860  parentMask |= FPGATrackSimInputUtils::construct_truth_bitmap(std::shared_ptr<const HepMC3::GenParticle>(particleLink.cptr()));
861  #else
862  parentMask |= FPGATrackSimInputUtils::construct_truth_bitmap(particleLink.cptr());
863  #endif
864  // check SDO
865  } // end for each contributing particle
866  return bestTruthLink;
867 }

◆ initialize()

StatusCode FPGATrackSimSGToRawHitsTool::initialize ( )
overridevirtual

Definition at line 54 of file FPGATrackSimSGToRawHitsTool.cxx.

54  {
55 
56  ATH_MSG_DEBUG("FPGATrackSimSGToRawHitsTool::initialize()");
57 
58  if(!m_truthToTrack.empty() ) ATH_CHECK(m_truthToTrack.retrieve());
59  if(!m_extrapolator.empty()) ATH_CHECK(m_extrapolator.retrieve());
61 
62  SmartIF<IPartPropSvc> partPropSvc{service("PartPropSvc")};
63  ATH_CHECK(partPropSvc.isValid());
64  m_particleDataTable = partPropSvc->PDT();
65 
66  ATH_CHECK(detStore()->retrieve(m_PIX_mgr, "ITkPixel"));
67  ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
68  ATH_CHECK(detStore()->retrieve(m_SCT_mgr, "ITkStrip"));
69  ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
70 
74 
76 
82 
83  ATH_MSG_DEBUG("Initialization complete");
84  return StatusCode::SUCCESS;
85 }

◆ readData()

StatusCode FPGATrackSimSGToRawHitsTool::readData ( FPGATrackSimEventInputHeader header,
const EventContext &  eventContext 
)
overridevirtual

This function get from the SG the inner detector raw hits and prepares them for FPGATrackSim simulation.

Definition at line 95 of file FPGATrackSimSGToRawHitsTool.cxx.

96 {
97  m_eventHeader = header; //take the external pointer
98  auto eventInfo = SG::makeHandle(m_eventInfoKey, eventContext);
99  //Filled to variable / start event
100  FPGATrackSimEventInfo event_info;
101  event_info.setRunNumber(eventInfo->runNumber());
102  event_info.setEventNumber(eventInfo->eventNumber());
103  event_info.setLB(eventInfo->lumiBlock());
104  event_info.setBCID(eventInfo->bcid());
105  event_info.setaverageInteractionsPerCrossing(eventInfo->averageInteractionsPerCrossing());
106  event_info.setactualInteractionsPerCrossing(eventInfo->actualInteractionsPerCrossing());
107  event_info.setextendedLevel1ID(eventInfo->extendedLevel1ID());
108  event_info.setlevel1TriggerType(eventInfo->level1TriggerType());
109  // event_info.setlevel1TriggerInfo(eventInfo->level1TriggerInfo ()); // unclear if needed, TODO come back to it
110  m_eventHeader->newEvent(event_info);//this also reset all variables
111  HitIndexMap hitIndexMap; // keep running index event-unique to each hit
112  HitIndexMap pixelClusterIndexMap;
113  // get pixel and sct cluster containers
114  // dump raw silicon data
115  ATH_MSG_DEBUG("Dump raw silicon data");
116  ATH_CHECK(readRawSilicon(hitIndexMap, eventContext));
118  if (m_readOfflineClusters) {
119  std::vector <FPGATrackSimCluster> clusters;
120  ATH_CHECK(readOfflineClusters(clusters, eventContext));
121  for (const auto& cluster : clusters) optional.addOfflineCluster(cluster);
122  ATH_MSG_DEBUG("Saved " << optional.nOfflineClusters() << " offline clusters");
123  ATH_CHECK(dumpPixelClusters(pixelClusterIndexMap, eventContext));
124  }
125  if (m_readTruthTracks) {
126  std::vector <FPGATrackSimTruthTrack> truth;
127  ATH_CHECK(readTruthTracks(truth, eventContext));
128  for (const FPGATrackSimTruthTrack& trk : truth) optional.addTruthTrack(trk);
129  ATH_MSG_DEBUG("Saved " << optional.nTruthTracks() << " truth tracks");
130  }
131  std::vector <FPGATrackSimOfflineTrack> offline;
132  if (m_readOfflineTracks) {
133  ATH_CHECK(readOfflineTracks(offline, eventContext));
134  for (const FPGATrackSimOfflineTrack& trk : offline) optional.addOfflineTrack(trk);
135  ATH_MSG_DEBUG("Saved " << optional.nOfflineTracks() << " offline tracks");
136  }
137  m_eventHeader->setOptional(optional);
139  ATH_MSG_DEBUG("End of execute()");
140  return StatusCode::SUCCESS;
141 }

◆ readOfflineClusters()

StatusCode FPGATrackSimSGToRawHitsTool::readOfflineClusters ( std::vector< FPGATrackSimCluster > &  Clusters,
const EventContext &  eventContext 
)
private

Definition at line 545 of file FPGATrackSimSGToRawHitsTool.cxx.

546 {
547 
548  //Lets do the Pixel clusters first
549  //Loopover the pixel clusters and convert them into a FPGATrackSimCluster for storage
550  // Dump pixel clusters. They're in m_pixelContainer
551  auto pixelSDOHandle = SG::makeHandle(m_pixelSDOKey, eventContext);
552  auto pixelClusterContainerHandler = SG::makeHandle(m_pixelClusterContainerKey, eventContext);
553  for (const InDet::SiClusterCollection* pixelClusterCollection : *pixelClusterContainerHandler) {
554  if (pixelClusterCollection == nullptr) {
555  ATH_MSG_DEBUG("pixelClusterCollection not available!");
556  continue;
557  }
558  const int size = pixelClusterCollection->size();
559  ATH_MSG_DEBUG("PixelClusterCollection found with " << size << " clusters");
560  for (const InDet::SiCluster* cluster : *pixelClusterCollection) {
561 
562  // if there is simulation truth available, try to retrieve the "most likely" barcode for this pixel cluster.
564  const HepMcParticleLink* bestTruthLink{};
565  if (!m_pixelSDOKey.empty()) {
566  for (const Identifier& rdoId : cluster->rdoList()) {
567  const InDetDD::SiDetectorElement* sielement = m_PIX_mgr->getDetectorElement(rdoId);
568  assert(sielement);
569  InDetDD::SiCellId cellID = sielement->cellIdFromIdentifier(rdoId);
570  const int nCells = sielement->numberOfConnectedCells(cellID);
571  InDetSimDataCollection::const_iterator iter(pixelSDOHandle->find(rdoId));
572  // this might be the ganged pixel copy.
573  if (nCells > 1 && iter == pixelSDOHandle->end()) {
575  for (int ii = 0; ii < nCells && iter == pixelSDOHandle->end(); ++ii) {
576  iter = pixelSDOHandle->find(sielement->identifierFromCellId(sielement->design().connectedCell(SiRC, ii)));
577  }
578  } // end search for correct ganged pixel
579  // if SDO found for this pixel, associate the particle. otherwise leave unassociated.
580  if (iter != pixelSDOHandle->end()) { bestTruthLink = getTruthInformation(iter, parentMask); }
581  } // if we have pixel sdo's available
582  }
583  HepMC::ConstGenParticlePtr bestParent = (bestTruthLink) ? bestTruthLink->cptr() : nullptr;
584 
585  Identifier theID = cluster->identify();
586  //cluster object to be written out
587  FPGATrackSimCluster clusterOut;
588  //Rawhit object to represent the cluster
589  FPGATrackSimHit clusterEquiv;
590  //Lets get the information of this pixel cluster
591  const InDetDD::SiDetectorElement* sielement = m_PIX_mgr->getDetectorElement(theID);
592  assert(sielement);
593  const InDetDD::SiLocalPosition localPos = sielement->rawLocalPositionOfCell(theID);
594  const Amg::Vector3D globalPos(sielement->globalPosition(localPos));
595  clusterEquiv.setHitType(HitType::clustered);
596  clusterEquiv.setX(globalPos.x());
597  clusterEquiv.setY(globalPos.y());
598  clusterEquiv.setZ(globalPos.z());
599  clusterEquiv.setDetType(SiliconTech::pixel);
600  clusterEquiv.setIdentifierHash(sielement->identifyHash());
601  clusterEquiv.setIdentifier(sielement->identify().get_identifier32().get_compact());
602 
603  int barrel_ec = m_pixelId->barrel_ec(theID);
604  if (barrel_ec == 0)
606  else if (barrel_ec == 2)
608  else if (barrel_ec == -2)
610 
611  clusterEquiv.setLayerDisk(m_pixelId->layer_disk(theID));
612  clusterEquiv.setPhiModule(m_pixelId->phi_module(theID));
613  clusterEquiv.setEtaModule(m_pixelId->eta_module(theID));
614  clusterEquiv.setPhiIndex(m_pixelId->phi_index(theID));
615  clusterEquiv.setEtaIndex(m_pixelId->eta_index(theID));
616  clusterEquiv.setPhiCoord(localPos.xPhi());
617  clusterEquiv.setEtaCoord(localPos.xEta());
618 
619  clusterEquiv.setPhiWidth(cluster->width().colRow()[1]);
620  clusterEquiv.setEtaWidth(cluster->width().colRow()[0]);
621  //Save the truth here as the MultiTruth object is only transient
622  if (bestParent) {
623  clusterEquiv.setEventIndex(bestTruthLink->eventIndex());
624  clusterEquiv.setBarcode(bestTruthLink->barcode()); // FIXME barcode-based
625  clusterEquiv.setUniqueID(bestTruthLink->id());
626  }
627  else {
631  }
632 
633  clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
634  clusterEquiv.setParentageMask(parentMask.to_ulong());
635  clusterOut.setClusterEquiv(clusterEquiv);
636  clusters.push_back(clusterOut);
637  }
638  }
639 
640  //Now lets do the strip clusters
641  //Loopover the pixel clusters and convert them into a FPGATrackSimCluster for storage
642  // Dump pixel clusters. They're in m_pixelContainer
643  auto stripSDOHandle = SG::makeHandle(m_stripSDOKey, eventContext);
644  ATH_MSG_DEBUG("Found SCT SDO Map");
645  auto stripRDOHandle = SG::makeHandle(m_stripRDOKey, eventContext);
646 
647  for (const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection : *stripRDOHandle) {
648  if (SCT_Collection == nullptr) { continue; }
649  for (const SCT_RDORawData* sctRawData : *SCT_Collection) {
650  const Identifier rdoId = sctRawData->identify();
651  // get the det element from the det element collection
652  const InDetDD::SiDetectorElement* sielement = m_SCT_mgr->getDetectorElement(rdoId);
653  const InDetDD::SiDetectorDesign& design = dynamic_cast<const InDetDD::SiDetectorDesign&>(sielement->design());
654  const InDetDD::SiLocalPosition localPos = design.localPositionOfCell(m_sctId->strip(rdoId));
655  const Amg::Vector3D gPos = sielement->globalPosition(localPos);
656  // if there is simulation truth available, try to retrieve the
657  // "most likely" barcode for this strip.
659  const HepMcParticleLink* bestTruthLink{};
660  if (!m_stripSDOKey.empty()) {
661  InDetSimDataCollection::const_iterator iter(stripSDOHandle->find(rdoId));
662  // if SDO found for this pixel, associate the particle
663  if (iter != stripSDOHandle->end()) { bestTruthLink = getTruthInformation(iter, parentMask); }
664  } // end if sct truth available
665  HepMC::ConstGenParticlePtr bestParent = (bestTruthLink) ? bestTruthLink->cptr() : nullptr;
666 
667  // push back the hit information to DataInput for HitList , copy from RawInput.cxx
668  FPGATrackSimCluster clusterOut;
669  FPGATrackSimHit clusterEquiv;
670  clusterEquiv.setHitType(HitType::clustered);
671  clusterEquiv.setX(gPos.x());
672  clusterEquiv.setY(gPos.y());
673  clusterEquiv.setZ(gPos.z());
674  clusterEquiv.setDetType(SiliconTech::strip);
675  clusterEquiv.setIdentifierHash(sielement->identifyHash());
676  clusterEquiv.setIdentifier(sielement->identify().get_identifier32().get_compact());
677 
678  int barrel_ec = m_sctId->barrel_ec(rdoId);
679  if (barrel_ec == 0)
681  else if (barrel_ec == 2)
683  else if (barrel_ec == -2)
685 
686  clusterEquiv.setLayerDisk(m_sctId->layer_disk(rdoId));
687  clusterEquiv.setPhiModule(m_sctId->phi_module(rdoId));
688  clusterEquiv.setEtaModule(m_sctId->eta_module(rdoId));
689  clusterEquiv.setPhiIndex(m_sctId->strip(rdoId));
690  clusterEquiv.setEtaIndex(m_sctId->row(rdoId));
691  clusterEquiv.setPhiCoord(localPos.xPhi());
692  clusterEquiv.setEtaCoord(localPos.xEta());
693  clusterEquiv.setSide(m_sctId->side(rdoId));
694  //I think this is the strip "cluster" width
695  clusterEquiv.setPhiWidth(sctRawData->getGroupSize());
696  //Save the truth here as the MultiTruth object is only transient
697  if (bestParent) {
698  clusterEquiv.setEventIndex(bestTruthLink->eventIndex());
699  clusterEquiv.setBarcode(bestTruthLink->barcode()); // FIXME barcode-based
700  clusterEquiv.setUniqueID(bestTruthLink->id());
701  }
702  else {
706  }
707 
708  clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
709  clusterEquiv.setParentageMask(parentMask.to_ulong());
710  clusterOut.setClusterEquiv(clusterEquiv);
711  clusters.push_back(clusterOut);
712  } // end for each RDO in the strip collection
713  } // end for each strip RDO collection
714  // dump all RDO's and SDO's for a given event, for debugging purposes
715 
716  return StatusCode::SUCCESS;
717 }

◆ readOfflineTracks()

StatusCode FPGATrackSimSGToRawHitsTool::readOfflineTracks ( std::vector< FPGATrackSimOfflineTrack > &  Track,
const EventContext &  eventContext 
)
private

Definition at line 144 of file FPGATrackSimSGToRawHitsTool.cxx.

145 {
146  auto offlineTracksHandle = SG::makeHandle(m_offlineTracksKey, eventContext);
147  ATH_MSG_DEBUG("read Offline tracks, size= " << offlineTracksHandle->size());
148 
149  int iTrk = -1;
150  for (const xAOD::TrackParticle* trackParticle : *offlineTracksHandle) {
151  iTrk++;
152  FPGATrackSimOfflineTrack tmpOfflineTrack;
153  tmpOfflineTrack.setQOverPt(trackParticle->pt() > 0 ? trackParticle->charge() / trackParticle->pt() : 0);
154  tmpOfflineTrack.setEta(trackParticle->eta());
155  tmpOfflineTrack.setPhi(trackParticle->phi());
156  tmpOfflineTrack.setD0(trackParticle->d0());
157  tmpOfflineTrack.setZ0(trackParticle->z0());
158 
159  const Trk::TrackStates* trackStates = trackParticle->track()->trackStateOnSurfaces();
160  if (trackStates == nullptr) {
161  ATH_MSG_ERROR("missing trackStatesOnSurface");
162  return StatusCode::FAILURE;
163  }
164  for (const Trk::TrackStateOnSurface* tsos : *trackStates) {
165  if (tsos == nullptr) continue;
166  if (tsos->type(Trk::TrackStateOnSurface::Measurement)) {
167  const Trk::MeasurementBase* measurement = tsos->measurementOnTrack();
168  if (tsos->trackParameters() != nullptr &&
169  tsos->trackParameters()->associatedSurface().associatedDetectorElement() != nullptr &&
170  tsos->trackParameters()->associatedSurface().associatedDetectorElement()->identify() != 0
171  ) {
172  const Trk::RIO_OnTrack* hit = dynamic_cast <const Trk::RIO_OnTrack*>(measurement);
173  const Identifier& hitId = hit->identify();
174  FPGATrackSimOfflineHit tmpOfflineHit;
175  if (m_pixelId->is_pixel(hitId)) {
176  tmpOfflineHit.setIsPixel(true);
177  tmpOfflineHit.setIsBarrel(m_pixelId->is_barrel(hitId));
178 
179  const InDetDD::SiDetectorElement* sielement = m_PIX_mgr->getDetectorElement(hitId);
180  tmpOfflineHit.setClusterID(sielement->identifyHash());
181  tmpOfflineHit.setTrackNumber(iTrk);
182  tmpOfflineHit.setLayer(m_pixelId->layer_disk(hitId));
183  tmpOfflineHit.setLocX((float)measurement->localParameters()[Trk::locX]);
184  tmpOfflineHit.setLocY((float)measurement->localParameters()[Trk::locY]);
185  }
186  else if (m_sctId->is_sct(hitId)) {
187  tmpOfflineHit.setIsPixel(false);
188  tmpOfflineHit.setIsBarrel(m_sctId->is_barrel(hitId));
189  const InDetDD::SiDetectorElement* sielement = m_SCT_mgr->getDetectorElement(hitId);
190  tmpOfflineHit.setClusterID(sielement->identifyHash());
191  tmpOfflineHit.setTrackNumber(iTrk);
192  tmpOfflineHit.setLayer(m_sctId->layer_disk(hitId));
193  tmpOfflineHit.setLocX(((float)measurement->localParameters()[Trk::locX]));
194  tmpOfflineHit.setLocY(-99999.9);
195  }
196  tmpOfflineTrack.addHit(tmpOfflineHit);
197  }
198  }
199  }
200  offline.push_back(tmpOfflineTrack);
201  }//end of loop over tracks
202 
203 
204  return StatusCode::SUCCESS;
205 }

◆ readPixelSimulation()

StatusCode FPGATrackSimSGToRawHitsTool::readPixelSimulation ( HitIndexMap hitIndexMap,
unsigned int &  hitIndex,
const EventContext &  eventContext 
)
private

Definition at line 224 of file FPGATrackSimSGToRawHitsTool.cxx.

224  {
225 
226  auto pixelSDOHandle = SG::makeHandle(m_pixelSDOKey, eventContext);
227  auto pixelRDOHandle = SG::makeHandle(m_pixelRDOKey, eventContext);
228 
229  ATH_MSG_DEBUG("Found Pixel SDO Map");
230 
231  for (const InDetRawDataCollection<PixelRDORawData>* pixel_rdoCollection : *pixelRDOHandle) {
232  if (pixel_rdoCollection == nullptr) { continue; }
233  // loop on all RDOs
234  for (const PixelRDORawData* pixelRawData : *pixel_rdoCollection) {
235  Identifier rdoId = pixelRawData->identify();
236  // get the det element from the det element collection
237  const InDetDD::SiDetectorElement* sielement = m_PIX_mgr->getDetectorElement(rdoId); assert(sielement);
238 
239  Amg::Vector2D localPos = sielement->rawLocalPositionOfCell(rdoId);
240  Amg::Vector3D globalPos = sielement->globalPosition(localPos);
241  InDetDD::SiCellId cellID = sielement->cellIdFromIdentifier(rdoId);
242 
243  // update map between pixel identifier and event-unique hit index.
244  // ganged pixels (nCells==2) get two entries.
245  hitIndexMap[rdoId] = hitIndex;
246  const int nCells = sielement->numberOfConnectedCells(cellID);
247  if (nCells == 2) {
248  const InDetDD::SiCellId tmpCell = sielement->connectedCell(cellID, 1);
249  const Identifier tmpId = sielement->identifierFromCellId(tmpCell);
250  hitIndexMap[tmpId] = hitIndex; // add second entry for ganged pixel ID
251  }
252  // if there is simulation truth available, try to retrieve the "most likely" barcode for this pixel.
254  const HepMcParticleLink* bestTruthLink{};
255  if (!m_pixelSDOKey.empty()) {
256  InDetSimDataCollection::const_iterator iter(pixelSDOHandle->find(rdoId));
257  if (nCells > 1 && iter == pixelSDOHandle->end()) {
259  for (int ii = 0; ii < nCells && iter == pixelSDOHandle->end(); ++ii) {
260  iter = pixelSDOHandle->find(sielement->identifierFromCellId(sielement->design().connectedCell(SiRC, ii)));
261  }
262  } // end search for correct ganged pixel
263  // if SDO found for this pixel, associate the particle. otherwise leave unassociated.
264  if (iter != pixelSDOHandle->end()) { bestTruthLink = getTruthInformation(iter, parentMask); }
265  } // end if pixel truth available
266  HepMC::ConstGenParticlePtr bestParent = (bestTruthLink) ? bestTruthLink->cptr() : nullptr;
267  ++hitIndex;
268 
269  // push back the hit information to DataInput for HitList
270  FPGATrackSimHit tmpSGhit;
271  tmpSGhit.setHitType(HitType::unmapped);
272  tmpSGhit.setDetType(SiliconTech::pixel);
273  tmpSGhit.setIdentifierHash(sielement->identifyHash());
274  tmpSGhit.setIdentifier(sielement->identify().get_identifier32().get_compact());
275 
276  int barrel_ec = m_pixelId->barrel_ec(rdoId);
277  if (barrel_ec == 0)
279  else if (barrel_ec == 2)
281  else if (barrel_ec == -2)
283 
284  tmpSGhit.setLayerDisk(m_pixelId->layer_disk(rdoId));
285  tmpSGhit.setPhiModule(m_pixelId->phi_module(rdoId));
286  tmpSGhit.setEtaModule(m_pixelId->eta_module(rdoId));
287  tmpSGhit.setPhiIndex(m_pixelId->phi_index(rdoId));
288  tmpSGhit.setEtaIndex(m_pixelId->eta_index(rdoId));
289  tmpSGhit.setPhiCoord(localPos[0]);
290  tmpSGhit.setEtaCoord(localPos[1]);
291  tmpSGhit.setEtaWidth(0);
292  tmpSGhit.setPhiWidth(0);
293  tmpSGhit.setX(globalPos[Amg::x]);
294  tmpSGhit.setY(globalPos[Amg::y]);
295  tmpSGhit.setZ(globalPos[Amg::z]);
296  tmpSGhit.setToT(pixelRawData->getToT());
297  tmpSGhit.setisValidForITkHit(true); // Pixel clusters are close enough right now that they all can be considered valid for ITK
298  if (bestParent) {
299  tmpSGhit.setEventIndex(bestTruthLink->eventIndex());
300  tmpSGhit.setBarcode(bestTruthLink->barcode()); // FIXME barcode-based
301  tmpSGhit.setUniqueID(bestTruthLink->id()); // May need fixing when uid will be used.
302  }
303  else {
307  }
308 
309  tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
310  tmpSGhit.setParentageMask(parentMask.to_ulong());
311 
312  // Add truth
314  FPGATrackSimMultiTruth::Barcode uniqueID(tmpSGhit.getEventIndex(), tmpSGhit.getBarcode()); // FIXME barcode-based
315  mt.maximize(uniqueID, tmpSGhit.getBarcodePt()); // FIXME barcode-based
316  tmpSGhit.setTruth(mt);
317 
318  m_eventHeader->addHit(tmpSGhit);
319  } // end for each RDO in the collection
320  } // for each pixel RDO collection
321 
322  return StatusCode::SUCCESS;
323 }

◆ readRawSilicon()

StatusCode FPGATrackSimSGToRawHitsTool::readRawSilicon ( HitIndexMap hitIndexMap,
const EventContext &  eventContext 
)
private

Definition at line 211 of file FPGATrackSimSGToRawHitsTool.cxx.

212 {
213  ATH_MSG_DEBUG("read silicon hits");
214  unsigned int hitIndex = 0u;
215 
216  ATH_CHECK(readPixelSimulation(hitIndexMap, hitIndex, eventContext));
217  ATH_CHECK(readStripSimulation(hitIndexMap, hitIndex, eventContext));
218 
219  return StatusCode::SUCCESS;
220 }

◆ readStripSimulation()

StatusCode FPGATrackSimSGToRawHitsTool::readStripSimulation ( HitIndexMap hitIndexMap,
unsigned int &  hitIndex,
const EventContext &  eventContext 
)
private

Definition at line 326 of file FPGATrackSimSGToRawHitsTool.cxx.

326  {
327 
328  constexpr int MaxChannelinStripRow = 128;
329 
330  auto stripSDOHandle = SG::makeHandle(m_stripSDOKey, eventContext);
331  ATH_MSG_DEBUG("Found SCT SDO Map");
332  auto stripRDOHandle = SG::makeHandle(m_stripRDOKey, eventContext);
333  for (const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection : *stripRDOHandle) {
334  if (SCT_Collection == nullptr) { continue; }
335 
336  std::map<int, bool> firedStrips;
337  std::map<int, const SCT_RDORawData*> firedStripsToRDO;
338  // Preprocess the SCT collection hits to get information for encoding strip in ITK format
339  // All strips fired read into a map to an overview of full module that should be used to encode
340  // the data into the ITk formatl
341  for (const SCT_RDORawData* sctRawData : *SCT_Collection)
342  {
343  const Identifier rdoId = sctRawData->identify();
344  const int baseLineStrip{m_sctId->strip(rdoId)};
345  for(int i = 0; i < sctRawData->getGroupSize(); i++) {
346  firedStrips[baseLineStrip+ i] = true;
347  firedStripsToRDO[baseLineStrip + i] = sctRawData;
348  }
349  }
350 
351  // Loop over the fired hits and encode them in the ITk strips hit map
352  // It find unique hits in the list that can be encoded and don't overlap
353  std::map<int, int> stripEncodingForITK;
354  std::map<int, const SCT_RDORawData* > stripEncodingForITKToRDO;
355  for(const auto& [stripID, fired]: firedStrips)
356  {
357  // Don't use the strip that has been set false.
358  // This will be the case where neighbouring strip will "used up in the cluster"
359  // And then we don't want to re use them
360  if(!fired) continue;
361 
362  // Check the next 3 hits if they are there and have a hit in them
363  std::bitset<3> hitMap;
364 
365 
366  // Get the current chip id of the strip
367  int currChipID = stripID / MaxChannelinStripRow;
368  // Compute the maximum stripID this chip can have
369  int maxStripIDForCurrChip = (currChipID + 1) * MaxChannelinStripRow;
370 
371  for(int i = 0; i < 3; i++)
372  {
373  // We don't want to "cluster" strips that are outside the range of this chip
374  if((stripID + 1 + i) >= maxStripIDForCurrChip) continue;
375 
376  if(firedStrips.find(stripID + 1 + i) != firedStrips.end())
377  {
378  if(firedStrips.at(stripID + 1 + i))
379  {
380  hitMap[2 - i] = 1;
381  firedStrips[stripID + 1 + i] = false;
382  }
383  else
384  {
385  hitMap[2 - i] = 0;
386  }
387  }
388  }
389 
390  // Encode the hit map into a int
391  stripEncodingForITK[stripID] = (int)(hitMap.to_ulong());
392  stripEncodingForITKToRDO[stripID] = firedStripsToRDO[stripID];
393  }
394 
395  // Actual creation of the FPGAHit objects
396  for(const auto& [stripID, fired]: firedStrips)
397  {
398  const SCT_RDORawData* sctRawData = firedStripsToRDO[stripID];
399  const Identifier rdoId = sctRawData->identify();
400  // get the det element from the det element collection
401  const InDetDD::SiDetectorElement* sielement = m_SCT_mgr->getDetectorElement(rdoId);
402  const InDetDD::SiDetectorDesign& design = dynamic_cast<const InDetDD::SiDetectorDesign&>(sielement->design());
403 
404  InDetDD::SiCellId frontId(stripID);
405  Amg::Vector2D localPos = design.localPositionOfCell(frontId);
406  std::pair<Amg::Vector3D, Amg::Vector3D> endsOfStrip = sielement->endsOfStrip(localPos);
407 
408  hitIndexMap[rdoId] = hitIndex;
409  ++hitIndex;
410  // if there is simulation truth available, try to retrieve the
411  // "most likely" barcode for this strip.
413  const HepMcParticleLink* bestTruthLink{};
414  if (!m_stripSDOKey.empty()) {
415  InDetSimDataCollection::const_iterator iter(stripSDOHandle->find(rdoId));
416  // if SDO found for this strip, associate the particle
417  if (iter != stripSDOHandle->end()) { bestTruthLink = getTruthInformation(iter, parentMask); }
418  } // end if sct truth available
419  HepMC::ConstGenParticlePtr bestParent = (bestTruthLink) ? bestTruthLink->cptr() : nullptr;
420  // push back the hit information to DataInput for HitList , copy from RawInput.cxx
421 
422  FPGATrackSimHit tmpSGhit;
423  tmpSGhit.setHitType(HitType::unmapped);
424  tmpSGhit.setDetType(SiliconTech::strip);
425  tmpSGhit.setIdentifierHash(sielement->identifyHash());
426  tmpSGhit.setIdentifier(sielement->identify().get_identifier32().get_compact());
427 
428  int barrel_ec = m_sctId->barrel_ec(rdoId);
429  if (barrel_ec == 0)
431  else if (barrel_ec == 2)
433  else if (barrel_ec == -2)
435 
436  tmpSGhit.setLayerDisk(m_sctId->layer_disk(rdoId));
437  tmpSGhit.setPhiModule(m_sctId->phi_module(rdoId));
438  tmpSGhit.setEtaModule(m_sctId->eta_module(rdoId));
439  tmpSGhit.setPhiIndex(stripID);
440  tmpSGhit.setEtaIndex(m_sctId->row(rdoId));
441  tmpSGhit.setPhiCoord(localPos[0]);
442  tmpSGhit.setEtaCoord(localPos[1]);
443  tmpSGhit.setSide(m_sctId->side(rdoId));
444  tmpSGhit.setEtaWidth(0);
445  tmpSGhit.setPhiWidth(1);
446  if (bestParent) {
447  tmpSGhit.setEventIndex(bestTruthLink->eventIndex());
448  tmpSGhit.setBarcode(bestTruthLink->barcode()); // FIXME barcode-based
449  tmpSGhit.setUniqueID(bestTruthLink->id());
450  }
451  else {
455  }
456 
457  // If the strip has been identified by the previous for loop as a valid hit that can be encoded into ITk Strip format
458  if(stripEncodingForITK.find(stripID) != stripEncodingForITK.end())
459  {
460  // Each ITK ABC chip reads 128 channels in one row, so we just need to divide the current strip with 128 to get the chip index
461  // for the Strip ID, it is the remainder left after dividing by 128
462  int chipID = stripID / MaxChannelinStripRow;
463  int ITkStripID = stripID % MaxChannelinStripRow;
464 
465  // for each ABC chip readout, each reads 256 channels actually. 0-127 corresponds to lower row and then 128-255 corresponds to the
466  // upper. This can be simulated in the code by using the eta module index. Even index are not offest, while odd index, the
467  // strip id is offest by 128
468  // One point to not is that for barrel, the eta module index start at 1, and not zero. Hence a shift of 1 is needed
469  int offset = m_sctId->eta_module(rdoId) % 2;
470  if(m_sctId->barrel_ec(rdoId) == 0) offset = (std::abs(m_sctId->eta_module(rdoId)) - 1) % 2;
471 
472  ITkStripID += offset * MaxChannelinStripRow;
473 
474  tmpSGhit.setisValidForITkHit(true);
475  tmpSGhit.setStripRowIDForITk(ITkStripID);
476  tmpSGhit.setStripChipIDForITk(chipID);
477  tmpSGhit.setStripHitMapForITk(stripEncodingForITK.at(stripID));
478  }
479 
480  tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
481  tmpSGhit.setParentageMask(parentMask.to_ulong());
482  tmpSGhit.setX(0.5 * (endsOfStrip.first.x() + endsOfStrip.second.x()));
483  tmpSGhit.setY(0.5 * (endsOfStrip.first.y() + endsOfStrip.second.y()));
484  tmpSGhit.setZ(0.5 * (endsOfStrip.first.z() + endsOfStrip.second.z()));
485 
486  // Add truth
488  FPGATrackSimMultiTruth::Barcode uniqueID(tmpSGhit.getEventIndex(), tmpSGhit.getBarcode()); // FIXME barcode-based
489  mt.maximize(uniqueID, tmpSGhit.getBarcodePt()); // FIMXE barcode-based
490  tmpSGhit.setTruth(mt);
491 
492  m_eventHeader->addHit(tmpSGhit);
493  } // end for each RDO in the strip collection
494  } // end for each strip RDO collection
495  // dump all RDO's and SDO's for a given event, for debugging purposes
496 
497  return StatusCode::SUCCESS;
498 }

◆ readTruthTracks()

StatusCode FPGATrackSimSGToRawHitsTool::readTruthTracks ( std::vector< FPGATrackSimTruthTrack > &  truth,
const EventContext &  eventContext 
)
private

Definition at line 720 of file FPGATrackSimSGToRawHitsTool.cxx.

721 {
722  auto simTracksHandle = SG::makeHandle(m_mcCollectionKey, eventContext);
723  ATH_MSG_DEBUG("Dump truth tracks, size " << simTracksHandle->size());
724 
725  // dump each truth track
726  for (unsigned int ievt = 0; ievt < simTracksHandle->size(); ++ievt) {
727  const HepMC::GenEvent* genEvent = simTracksHandle->at(ievt);
728  // retrieve the primary interaction vertex here. for now, use the dummy origin.
729  HepGeom::Point3D<double> primaryVtx(0., 0., 0.);
730  // the event should have signal process vertex unless it was generated as single particles.
731  // if it exists, use it for the primary vertex.
733  if (spv) {
734  primaryVtx.set(spv->position().x(),
735  spv->position().y(),
736  spv->position().z());
737  ATH_MSG_DEBUG("using signal process vertex for eventIndex " << ievt << ":"
738  << primaryVtx.x() << "\t" << primaryVtx.y() << "\t" << primaryVtx.z());
739  }
740  for (const auto& particle: *genEvent) {
741  const int pdgcode = particle->pdg_id();
742  // reject generated particles without a production vertex.
743  if (particle->production_vertex() == nullptr) {
744  continue;
745  }
746  // reject neutral or unstable particles
747  const HepPDT::ParticleData* pd = m_particleDataTable->particle(abs(pdgcode));
748  if (pd == nullptr) {
749  continue;
750  }
751  float charge = pd->charge();
752  if (pdgcode < 0) charge *= -1.; // since we took absolute value above
753  if (std::abs(charge) < 0.5) {
754  continue;
755  }
756  if (!MC::isStable(particle)) {
757  continue;
758  }
759  // truth-to-track tool
760  const Amg::Vector3D momentum(particle->momentum().px(), particle->momentum().py(), particle->momentum().pz());
761  const Amg::Vector3D position(particle->production_vertex()->position().x(), particle->production_vertex()->position().y(), particle->production_vertex()->position().z());
762  const Trk::CurvilinearParameters cParameters(position, momentum, charge);
763  Trk::PerigeeSurface persf;
764  if (m_UseNominalOrigin) {
765  Amg::Vector3D origin(0, 0, 0);
766  persf = Trk::PerigeeSurface(origin);
767  }
768  else {
770  Trk::PerigeeSurface persf(beamSpotHandle->beamPos());
771  }
772  const std::unique_ptr<Trk::TrackParameters> tP = m_extrapolator->extrapolate(eventContext, cParameters, persf, Trk::anyDirection, false);
773  const double track_truth_d0 = tP ? tP->parameters()[Trk::d0] : 999.;
774  const double track_truth_phi = tP ? tP->parameters()[Trk::phi] : 999.;
775  const double track_truth_p = (tP && fabs(tP->parameters()[Trk::qOverP]) > 1.e-8) ?
776  tP->charge() / tP->parameters()[Trk::qOverP] : 10E7;
777  const double track_truth_x0 = tP ? tP->position().x() : 999.;
778  const double track_truth_y0 = tP ? tP->position().y() : 999.;
779  const double track_truth_z0 = tP ? tP->parameters()[Trk::z0] : 999.;
780  const double track_truth_q = tP ? tP->charge() : 0.;
781  const double track_truth_sinphi = tP ? std::sin(tP->parameters()[Trk::phi]) : -1.;
782  const double track_truth_cosphi = tP ? std::cos(tP->parameters()[Trk::phi]) : -1.;
783  const double track_truth_sintheta = tP ? std::sin(tP->parameters()[Trk::theta]) : -1.;
784  const double track_truth_costheta = tP ? std::cos(tP->parameters()[Trk::theta]) : -1.;
785  double truth_d0corr = track_truth_d0 - (primaryVtx.y() * cos(track_truth_phi) - primaryVtx.x() * sin(track_truth_phi));
786  double truth_zvertex = 0.;
787  const HepGeom::Point3D<double> startVertex(particle->production_vertex()->position().x(), particle->production_vertex()->position().y(), particle->production_vertex()->position().z());
788  // categorize particle (prompt, secondary, etc.) based on InDetPerformanceRTT/detector paper criteria.
789  bool isPrimary = true;
790  if (std::abs(truth_d0corr) > 2.) { isPrimary = false; }
791  const int bc = HepMC::barcode(particle); // FIXME update barcode-based syntax
792  const int uid = HepMC::uniqueID(particle);
793  if (HepMC::is_simulation_particle(particle) || bc == 0) { isPrimary = false; } // FIXME update barcode-based syntax
794  if (isPrimary && particle->production_vertex()) {
795  const HepGeom::Point3D<double> startVertex(particle->production_vertex()->position().x(), particle->production_vertex()->position().y(), particle->production_vertex()->position().z());
796  if (std::abs(startVertex.z() - truth_zvertex) > 100.) { isPrimary = false; }
797  if (particle->end_vertex()) {
798  HepGeom::Point3D<double> endVertex(particle->end_vertex()->position().x(), particle->end_vertex()->position().y(), particle->end_vertex()->position().z());
799  if (endVertex.perp() < FPGATrackSim_PT_TRUTHMIN && std::abs(endVertex.z()) < FPGATrackSim_Z_TRUTHMIN) { isPrimary = false; }
800  }
801  }
802  else {
803  isPrimary = false;
804  }
805 
807 
808  FPGATrackSimTruthTrack tmpSGTrack;
809  tmpSGTrack.setVtxX(track_truth_x0);
810  tmpSGTrack.setVtxY(track_truth_y0);
811  tmpSGTrack.setVtxZ(track_truth_z0);
812  tmpSGTrack.setD0(track_truth_d0);
813  tmpSGTrack.setZ0(track_truth_z0);
814  tmpSGTrack.setVtxZ(primaryVtx.z());
815  tmpSGTrack.setQ(track_truth_q);
816  tmpSGTrack.setPX(track_truth_p * (track_truth_cosphi * track_truth_sintheta));
817  tmpSGTrack.setPY(track_truth_p * (track_truth_sinphi * track_truth_sintheta));
818  tmpSGTrack.setPZ(track_truth_p * track_truth_costheta);
819  tmpSGTrack.setPDGCode(pdgcode);
820  tmpSGTrack.setStatus(particle->status());
821 
822  tmpSGTrack.setBarcode(truthLink2.barcode());
823  tmpSGTrack.setUniqueID(truthLink2.id());
824  tmpSGTrack.setEventIndex(truthLink2.eventIndex());
825 
826  truth.push_back(tmpSGTrack);
827  } // end for each GenParticle in this GenEvent
828  } // end for each GenEvent
829 
830 
831  return StatusCode::SUCCESS;
832 }

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> FPGATrackSimSGToRawHitsTool::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 60 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_dumpHitsOnTracks

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_dumpHitsOnTracks { this, "dumpHitsOnTracks", false }
private

Definition at line 77 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_dumpTruthIntersections

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_dumpTruthIntersections { this, "dumpTruthIntersections", false }
private

Definition at line 78 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_eventHeader

FPGATrackSimEventInputHeader* FPGATrackSimSGToRawHitsTool::m_eventHeader = nullptr
private

Definition at line 105 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> FPGATrackSimSGToRawHitsTool::m_eventInfoKey { this, "EventInfo", "EventInfo" }
private

Definition at line 61 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> FPGATrackSimSGToRawHitsTool::m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
private

ToolHandle for Extrapolator.

Definition at line 58 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_maxEta

Gaudi::Property<double> FPGATrackSimSGToRawHitsTool::m_maxEta { this, "maxEta", 5.0 }
private

Definition at line 83 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_mcCollectionKey

SG::ReadHandleKey<McEventCollection> FPGATrackSimSGToRawHitsTool::m_mcCollectionKey { this, "McTruth", "TruthEvent" }
private

Definition at line 66 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_minPt

Gaudi::Property<double> FPGATrackSimSGToRawHitsTool::m_minPt { this, "minPt", .8*CLHEP::GeV }
private

Definition at line 84 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_offlineTracksKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> FPGATrackSimSGToRawHitsTool::m_offlineTracksKey { this, "OfflineTracks", "InDetTrackParticles"}
private

Definition at line 65 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_particleDataTable

const HepPDT::ParticleDataTable* FPGATrackSimSGToRawHitsTool::m_particleDataTable = nullptr
private

Definition at line 92 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_PIX_mgr

const InDetDD::SiDetectorManager* FPGATrackSimSGToRawHitsTool::m_PIX_mgr = nullptr
private

Definition at line 90 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_pixelClusterContainerKey

SG::ReadHandleKey<InDet::SiClusterContainer> FPGATrackSimSGToRawHitsTool::m_pixelClusterContainerKey { this, "pixelClustersName", "ITkPixelClusters" }
private

Definition at line 62 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_pixelId

const PixelID* FPGATrackSimSGToRawHitsTool::m_pixelId = nullptr
private

Definition at line 87 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_pixelRDOKey

SG::ReadHandleKey<PixelRDO_Container> FPGATrackSimSGToRawHitsTool::m_pixelRDOKey { this, "PixelRDO", "ITkPixelRDOs" }
private

Definition at line 69 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_pixelSDOKey

SG::ReadHandleKey<InDetSimDataCollection> FPGATrackSimSGToRawHitsTool::m_pixelSDOKey { this, "PixelSDO", "ITkPixelSDO_Map" }
private

Definition at line 67 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_readOfflineClusters

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_readOfflineClusters { this, "ReadOfflineClusters", true, "flag to enable the offline cluster save" }
private

Definition at line 79 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_readOfflineTracks

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_readOfflineTracks { this, "ReadOfflineTracks", true, "flag to enable the offline tracking save" }
private

Definition at line 81 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_readTruthTracks

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_readTruthTracks { this, "ReadTruthTracks", true, "flag to enable the truth tracking save" }
private

Definition at line 80 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_SCT_mgr

const InDetDD::SiDetectorManager* FPGATrackSimSGToRawHitsTool::m_SCT_mgr = nullptr
private

Definition at line 91 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_sctClusterContainerKey

SG::ReadHandleKey<InDet::SiClusterContainer> FPGATrackSimSGToRawHitsTool::m_sctClusterContainerKey { this, "SCT_ClustersName", "SCT_Clusters" }
private

Definition at line 63 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_sctId

const SCT_ID* FPGATrackSimSGToRawHitsTool::m_sctId = nullptr
private

Definition at line 88 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_stripRDOKey

SG::ReadHandleKey<SCT_RDO_Container> FPGATrackSimSGToRawHitsTool::m_stripRDOKey { this, "StripRDO", "ITkStripRDOs" }
private

Definition at line 70 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_stripSDOKey

SG::ReadHandleKey<InDetSimDataCollection> FPGATrackSimSGToRawHitsTool::m_stripSDOKey { this, "StripSDO", "ITkStripSDO_Map" }
private

Definition at line 68 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_tracksTruthName

Gaudi::Property<std::string> FPGATrackSimSGToRawHitsTool::m_tracksTruthName { this, "OfflineName", "InDetTrackParticles", "name of offline tracks collection" }
private

Definition at line 76 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_truthToTrack

ToolHandle<Trk::ITruthToTrack> FPGATrackSimSGToRawHitsTool::m_truthToTrack {this, "TruthToTrackTool", "Trk::TruthToTrack/InDetTruthToTrack" }
private

tool to create track parameters from a gen particle

Definition at line 57 of file FPGATrackSimSGToRawHitsTool.h.

◆ m_UseNominalOrigin

Gaudi::Property<bool> FPGATrackSimSGToRawHitsTool::m_UseNominalOrigin { this, "UseNominalOrigin", false, "if true truth values are always with respect to (0,0,0)" }
private

Definition at line 82 of file FPGATrackSimSGToRawHitsTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
columnar::ContainerId::eventContext
@ eventContext
FPGATrackSimHit::getEventIndex
long getEventIndex() const
Definition: FPGATrackSimHit.h:158
FPGATrackSimOfflineTrack::addHit
void addHit(const FPGATrackSimOfflineHit &s)
Definition: FPGATrackSimOfflineTrack.h:37
FPGATrackSimSGToRawHitsTool::m_readTruthTracks
Gaudi::Property< bool > m_readTruthTracks
Definition: FPGATrackSimSGToRawHitsTool.h:80
getMenu.algname
algname
Definition: getMenu.py:54
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
InDetDD::SolidStateDetectorElementBase::connectedCell
SiCellId connectedCell(const SiCellId cellId, int number) const
Get the cell ids sharing the readout for this cell.
Definition: SolidStateDetectorElementBase.cxx:250
InDetDD::SiDetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const =0
access to individual elements using Identifier or IdentiferHash
FPGATrackSimInputUtils::ParentBitmask
std::bitset< NBITS > ParentBitmask
Definition: FPGATrackSimInputUtils.h:16
FPGATrackSimSGToRawHitsTool::m_truthToTrack
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
tool to create track parameters from a gen particle
Definition: FPGATrackSimSGToRawHitsTool.h:57
SiliconTech::strip
@ strip
FPGATrackSimSGToRawHitsTool::m_UseNominalOrigin
Gaudi::Property< bool > m_UseNominalOrigin
Definition: FPGATrackSimSGToRawHitsTool.h:82
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
FPGATrackSimHit::setStripRowIDForITk
void setStripRowIDForITk(int v)
Definition: FPGATrackSimHit.h:177
FPGATrackSimEventInputHeader::newEvent
void newEvent(FPGATrackSimEventInfo const &event)
Definition: FPGATrackSimEventInputHeader.h:28
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::ParametersBase::charge
double charge() const
Returns the charge.
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
FPGATrackSimCluster
Definition: FPGATrackSimCluster.h:24
FPGATrackSimEventInfo::setBCID
void setBCID(const int &val)
Definition: FPGATrackSimEventInfo.h:60
FPGATrackSimHit::setEtaIndex
void setEtaIndex(unsigned v)
Definition: FPGATrackSimHit.h:102
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
DetectorZone::posEndcap
@ posEndcap
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MatchToEnum::offline
@ offline
FPGATrackSimHit::setisValidForITkHit
void setisValidForITkHit(bool v)
Definition: FPGATrackSimHit.h:176
FPGATrackSimHit::setPhiCoord
void setPhiCoord(float v)
Definition: FPGATrackSimHit.h:105
FPGATrackSimHit::setIdentifierHash
void setIdentifierHash(unsigned v)
Definition: FPGATrackSimHit.h:72
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGATrackSimTruthTrack
Definition: FPGATrackSimTruthTrack.h:14
FPGATrackSimHit::getBarcodePt
float getBarcodePt() const
Definition: FPGATrackSimHit.h:159
FPGATrackSimTruthTrack::setPX
void setPX(double v)
Definition: FPGATrackSimTruthTrack.h:25
InDetDD::DetectorDesign::localPositionOfCell
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const =0
readout or diode id -> position.
FPGATrackSimOfflineHit::setClusterID
void setClusterID(int clus)
Definition: FPGATrackSimOfflineHit.h:22
FPGATrackSimOfflineTrack::setZ0
void setZ0(double v)
Definition: FPGATrackSimOfflineTrack.h:21
Amg::y
@ y
Definition: GeoPrimitives.h:35
FPGATrackSimSGToRawHitsTool::m_offlineTracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineTracksKey
Definition: FPGATrackSimSGToRawHitsTool.h:65
FPGATrackSimSGToRawHitsTool::dumpPixelClusters
StatusCode dumpPixelClusters(HitIndexMap &pixelClusterIndexMap, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:502
FPGATrackSimEventInfo::setRunNumber
void setRunNumber(const unsigned long &val)
Definition: FPGATrackSimEventInfo.h:55
FPGATrackSimSGToRawHitsTool::HitIndexMap
std::map< Identifier, int > HitIndexMap
Definition: FPGATrackSimSGToRawHitsTool.h:94
FPGATrackSimSGToRawHitsTool::m_pixelClusterContainerKey
SG::ReadHandleKey< InDet::SiClusterContainer > m_pixelClusterContainerKey
Definition: FPGATrackSimSGToRawHitsTool.h:62
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Trk::z0
@ z0
Definition: ParamDefs.h:64
FPGATrackSimHit::setEtaWidth
void setEtaWidth(unsigned v)
Definition: FPGATrackSimHit.h:78
FPGATrackSimSGToRawHitsTool::readTruthTracks
StatusCode readTruthTracks(std::vector< FPGATrackSimTruthTrack > &truth, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:720
FPGATrackSimOfflineHit::setTrackNumber
void setTrackNumber(int track)
Definition: FPGATrackSimOfflineHit.h:23
InDetDD::DetectorDesign::connectedCell
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const =0
readout id -> id of connected diodes.
FPGATrackSimHit::setSide
void setSide(unsigned v)
Definition: FPGATrackSimHit.h:74
offline
makeDTCalibBlob_pickPhase.pd
pd
Definition: makeDTCalibBlob_pickPhase.py:342
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
SCT_RDORawData
Definition: SCT_RDORawData.h:24
FPGATrackSimSGToRawHitsTool::m_stripSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_stripSDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:68
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
FPGATrackSimTruthTrack::setPZ
void setPZ(double v)
Definition: FPGATrackSimTruthTrack.h:27
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
FPGATrackSimHit::setY
void setY(float v)
Definition: FPGATrackSimHit.h:138
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
FPGATrackSimTruthTrack::setVtxZ
void setVtxZ(double v)
Definition: FPGATrackSimTruthTrack.h:24
FPGATrackSimCluster::setClusterEquiv
void setClusterEquiv(const FPGATrackSimHit &input)
Definition: FPGATrackSimCluster.h:35
FPGATrackSimHit::setDetectorZone
void setDetectorZone(DetectorZone detZone)
Definition: FPGATrackSimHit.h:56
FPGATrackSimSGToRawHitsTool::m_pixelId
const PixelID * m_pixelId
Definition: FPGATrackSimSGToRawHitsTool.h:87
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
FPGATrackSimEventInfo::setextendedLevel1ID
void setextendedLevel1ID(const unsigned int &val)
Definition: FPGATrackSimEventInfo.h:61
FPGATrackSimSGToRawHitsTool::m_readOfflineClusters
Gaudi::Property< bool > m_readOfflineClusters
Definition: FPGATrackSimSGToRawHitsTool.h:79
FPGATrackSimOptionalEventInfo::nTruthTracks
size_t nTruthTracks() const
Definition: FPGATrackSimOptionalEventInfo.h:38
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
InDet::SiClusterCollection
Trk::PrepRawDataCollection< InDet::SiCluster > SiClusterCollection
Definition: SiClusterCollection.h:26
FPGATrackSimSGToRawHitsTool::m_maxEta
Gaudi::Property< double > m_maxEta
Definition: FPGATrackSimSGToRawHitsTool.h:83
FPGATrackSimOptionalEventInfo::nOfflineClusters
size_t nOfflineClusters() const
Definition: FPGATrackSimOptionalEventInfo.h:28
FPGATrackSimOfflineHit::setLocX
void setLocX(float locx)
Definition: FPGATrackSimOfflineHit.h:17
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
FPGATrackSimHit::setUniqueID
void setUniqueID(const HepMcParticleLink::barcode_type &v)
Definition: FPGATrackSimHit.h:150
FPGATrackSimSGToRawHitsTool::m_readOfflineTracks
Gaudi::Property< bool > m_readOfflineTracks
Definition: FPGATrackSimSGToRawHitsTool.h:81
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
FPGATrackSimSGToRawHitsTool::m_particleDataTable
const HepPDT::ParticleDataTable * m_particleDataTable
Definition: FPGATrackSimSGToRawHitsTool.h:92
FPGATrackSimHit::setDetType
void setDetType(SiliconTech detType)
Definition: FPGATrackSimHit.h:55
FPGATrackSimHit::setX
void setX(float v)
Definition: FPGATrackSimHit.h:137
FPGATrackSimSGToRawHitsTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: FPGATrackSimSGToRawHitsTool.h:61
FPGATrackSimEventInfo
Definition: FPGATrackSimEventInfo.h:14
FPGATrackSimHit::setToT
void setToT(unsigned v)
Definition: FPGATrackSimHit.h:148
FPGATrackSimEventInfo::setEventNumber
void setEventNumber(const unsigned long &val)
Definition: FPGATrackSimEventInfo.h:56
Amg::z
@ z
Definition: GeoPrimitives.h:36
PixelID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
Definition: PixelID.h:605
InDetDD::SiDetectorElement::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: SiDetectorElement.cxx:120
InDetDD::SolidStateDetectorElementBase::numberOfConnectedCells
int numberOfConnectedCells(const SiCellId cellId) const
Test if readout cell has more than one diode associated with it.
Definition: SolidStateDetectorElementBase.cxx:243
FPGATrackSimOfflineHit::setLayer
void setLayer(int lay)
Definition: FPGATrackSimOfflineHit.h:21
FPGATrackSimHit::setPhiIndex
void setPhiIndex(unsigned v)
Definition: FPGATrackSimHit.h:101
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
columnar::ContainerId::cluster
@ cluster
FPGATrackSimSGToRawHitsTool::readRawSilicon
StatusCode readRawSilicon(HitIndexMap &hitIndexMap, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:211
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:355
xAOD::nCells
setRawEt setRawPhi nCells
Definition: TrigCaloCluster_v1.cxx:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
Trk::theta
@ theta
Definition: ParamDefs.h:66
FPGATrackSimOfflineHit::setLocY
void setLocY(float locy)
Definition: FPGATrackSimOfflineHit.h:18
FPGATrackSimEventInputHeader::addHit
void addHit(FPGATrackSimHit const &s)
Definition: FPGATrackSimEventInputHeader.h:39
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
Amg::x
@ x
Definition: GeoPrimitives.h:34
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
FPGATrackSimHit::setStripHitMapForITk
void setStripHitMapForITk(int v)
Definition: FPGATrackSimHit.h:179
FPGATrackSimSGToRawHitsTool::m_SCT_mgr
const InDetDD::SiDetectorManager * m_SCT_mgr
Definition: FPGATrackSimSGToRawHitsTool.h:91
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
FPGATrackSimHit::setEtaModule
void setEtaModule(int v)
Definition: FPGATrackSimHit.h:76
InDetDD::SiDetectorElement::identifierFromCellId
virtual Identifier identifierFromCellId(const SiCellId &cellId) const override final
Identifier <-> SiCellId (ie strip number or pixel eta_index,phi_index) Identifier from SiCellId (ie s...
Definition: SiDetectorElement.cxx:89
InDetSimData
Definition: InDetSimData.h:42
FPGATrackSimHit::setEtaCoord
void setEtaCoord(float v)
Definition: FPGATrackSimHit.h:106
FPGATrackSimMultiTruth::Barcode
std::pair< unsigned long, unsigned long > Barcode
Definition: FPGATrackSimMultiTruth.h:49
FPGATrackSimOptionalEventInfo::addOfflineTrack
void addOfflineTrack(const FPGATrackSimOfflineTrack &t)
Definition: FPGATrackSimOptionalEventInfo.h:34
FPGATrackSimTruthTrack::setD0
void setD0(double v)
Definition: FPGATrackSimTruthTrack.h:19
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
FPGATrackSimTruthTrack::setEventIndex
void setEventIndex(int v)
Definition: FPGATrackSimTruthTrack.h:35
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimInputUtils::construct_truth_bitmap
const ParentBitmask construct_truth_bitmap(HepMC::ConstGenParticlePtr p)
Definition: FPGATrackSimInputUtils.cxx:10
FPGATrackSimOptionalEventInfo
Definition: FPGATrackSimOptionalEventInfo.h:17
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
FPGATrackSimHit::setBarcode
void setBarcode(const HepMcParticleLink::barcode_type &v)
Definition: FPGATrackSimHit.h:149
FPGATrackSimHit::setPhiModule
void setPhiModule(unsigned v)
Definition: FPGATrackSimHit.h:77
DataVector< const Trk::TrackStateOnSurface >
FPGATrackSimOfflineTrack
Definition: FPGATrackSimOfflineTrack.h:12
FPGATrackSimSGToRawHitsTool::m_PIX_mgr
const InDetDD::SiDetectorManager * m_PIX_mgr
Definition: FPGATrackSimSGToRawHitsTool.h:90
FPGATrackSimOfflineTrack::setD0
void setD0(double v)
Definition: FPGATrackSimOfflineTrack.h:20
FPGATrackSimOptionalEventInfo::nOfflineTracks
size_t nOfflineTracks() const
Definition: FPGATrackSimOptionalEventInfo.h:33
FPGATrackSimSGToRawHitsTool::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:69
Trk::MeasurementBase
Definition: MeasurementBase.h:58
FPGATrackSimSGToRawHitsTool::m_sctClusterContainerKey
SG::ReadHandleKey< InDet::SiClusterContainer > m_sctClusterContainerKey
Definition: FPGATrackSimSGToRawHitsTool.h:63
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::SiDetectorElement::endsOfStrip
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
Definition: SiDetectorElement.cxx:339
FPGATrackSimHit::setLayerDisk
void setLayerDisk(unsigned v)
Definition: FPGATrackSimHit.h:73
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
FPGATrackSimOfflineHit::setIsPixel
void setIsPixel(bool is)
Definition: FPGATrackSimOfflineHit.h:19
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
FPGATrackSimSGToRawHitsTool::m_mcCollectionKey
SG::ReadHandleKey< McEventCollection > m_mcCollectionKey
Definition: FPGATrackSimSGToRawHitsTool.h:66
FPGATrackSimMultiTruth::maximize
void maximize(const FPGATrackSimMultiTruth::Barcode &code, const FPGATrackSimMultiTruth::Weight &weight)
Definition: FPGATrackSimMultiTruth.cxx:36
FPGATrackSimMultiTruth
Definition: FPGATrackSimMultiTruth.h:46
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Trk::d0
@ d0
Definition: ParamDefs.h:63
FPGATrackSimOfflineTrack::setEta
void setEta(double v)
Definition: FPGATrackSimOfflineTrack.h:18
FPGATrackSimSGToRawHitsTool::m_pixelSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_pixelSDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:67
FPGATrackSimSGToRawHitsTool::readStripSimulation
StatusCode readStripSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:326
charge
double charge(const T &p)
Definition: AtlasPID.h:931
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
HitType::clustered
@ clustered
FPGATrackSimHit::setPhiWidth
void setPhiWidth(unsigned v)
Definition: FPGATrackSimHit.h:79
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
FPGATrackSimTruthTrack::setZ0
void setZ0(double v)
Definition: FPGATrackSimTruthTrack.h:20
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
FPGATrackSimTruthTrack::setUniqueID
void setUniqueID(const HepMcParticleLink::barcode_type &v)
Definition: FPGATrackSimTruthTrack.h:34
FPGATrackSimSGToRawHitsTool::readOfflineClusters
StatusCode readOfflineClusters(std::vector< FPGATrackSimCluster > &Clusters, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:545
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
FPGATrackSimEventInputHeader::setOptional
void setOptional(FPGATrackSimOptionalEventInfo const &optional)
Definition: FPGATrackSimEventInputHeader.h:29
columnar::ContainerId::eventInfo
@ eventInfo
FPGATrackSimHit::setEventIndex
void setEventIndex(long v)
Definition: FPGATrackSimHit.h:152
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
FPGATrackSimTruthTrack::setPY
void setPY(double v)
Definition: FPGATrackSimTruthTrack.h:26
FPGATrackSimHit::setZ
void setZ(float v)
Definition: FPGATrackSimHit.h:139
FPGATrackSimOptionalEventInfo::addTruthTrack
void addTruthTrack(const FPGATrackSimTruthTrack &t)
Definition: FPGATrackSimOptionalEventInfo.h:39
FPGATrackSimSGToRawHitsTool::m_sctId
const SCT_ID * m_sctId
Definition: FPGATrackSimSGToRawHitsTool.h:88
InDetDD::SiCellId
Definition: SiCellId.h:29
DetectorZone::negEndcap
@ negEndcap
FPGATrackSimEventInfo::setaverageInteractionsPerCrossing
void setaverageInteractionsPerCrossing(const int &val)
Definition: FPGATrackSimEventInfo.h:57
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
FPGATrackSimTruthTrack::setVtxY
void setVtxY(double v)
Definition: FPGATrackSimTruthTrack.h:23
FPGATrackSimEventInfo::setlevel1TriggerType
void setlevel1TriggerType(const unsigned int &val)
Definition: FPGATrackSimEventInfo.h:62
FPGATrackSimSGToRawHitsTool::readOfflineTracks
StatusCode readOfflineTracks(std::vector< FPGATrackSimOfflineTrack > &Track, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:144
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
FPGATrackSimOptionalEventInfo::addOfflineCluster
void addOfflineCluster(const FPGATrackSimCluster &c)
Definition: FPGATrackSimOptionalEventInfo.h:29
FPGATrackSimTruthTrack::setPDGCode
void setPDGCode(int v)
Definition: FPGATrackSimTruthTrack.h:31
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
FPGATrackSimSGToRawHitsTool::m_eventHeader
FPGATrackSimEventInputHeader * m_eventHeader
Definition: FPGATrackSimSGToRawHitsTool.h:105
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
DetectorZone::barrel
@ barrel
FPGATrackSimOfflineTrack::setQOverPt
void setQOverPt(double v)
Definition: FPGATrackSimOfflineTrack.h:17
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
FPGATrackSimSGToRawHitsTool::readPixelSimulation
StatusCode readPixelSimulation(HitIndexMap &hitIndexMap, unsigned int &hitIndex, const EventContext &eventContext)
Definition: FPGATrackSimSGToRawHitsTool.cxx:224
FPGATrackSimTruthTrack::setStatus
void setStatus(int v)
Definition: FPGATrackSimTruthTrack.h:32
FPGATrackSimSGToRawHitsTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: FPGATrackSimSGToRawHitsTool.h:60
FPGATrackSimOfflineHit::setIsBarrel
void setIsBarrel(bool is)
Definition: FPGATrackSimOfflineHit.h:20
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
PixelRDORawData
Definition: PixelRDORawData.h:23
LVL1::gFEXPos
Definition: gFexPos.h:11
Trk::phi
@ phi
Definition: ParamDefs.h:75
FPGATrackSimHit::setStripChipIDForITk
void setStripChipIDForITk(int v)
Definition: FPGATrackSimHit.h:178
FPGATrackSimOfflineHit
Definition: FPGATrackSimOfflineHit.h:12
FPGATrackSimEventInfo::setactualInteractionsPerCrossing
void setactualInteractionsPerCrossing(const int &val)
Definition: FPGATrackSimEventInfo.h:58
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
FPGATrackSimSGToRawHitsTool::getTruthInformation
const HepMcParticleLink * getTruthInformation(InDetSimDataCollection::const_iterator &iter, FPGATrackSimInputUtils::ParentBitmask &parentMask)
Definition: FPGATrackSimSGToRawHitsTool.cxx:835
FPGATrackSimHit::setIdentifier
void setIdentifier(unsigned int v)
Definition: FPGATrackSimHit.h:71
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
FPGATrackSimHit::setTruth
void setTruth(const FPGATrackSimMultiTruth &v)
Definition: FPGATrackSimHit.h:154
InDetDD::SiDetectorDesign
Definition: SiDetectorDesign.h:50
FPGATrackSimHit::setParentageMask
void setParentageMask(unsigned long v)
Definition: FPGATrackSimHit.h:153
makeTOC.header
header
Definition: makeTOC.py:28
InDetSimData::Deposit
std::pair< HepMcParticleLink, float > Deposit
Definition: InDetSimData.h:48
FPGATrackSimTruthTrack::setBarcode
void setBarcode(const HepMcParticleLink::barcode_type &v)
Definition: FPGATrackSimTruthTrack.h:33
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
FPGATrackSimSGToRawHitsTool::m_stripRDOKey
SG::ReadHandleKey< SCT_RDO_Container > m_stripRDOKey
Definition: FPGATrackSimSGToRawHitsTool.h:70
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
FPGATrackSimTruthTrack::setQ
void setQ(int v)
Definition: FPGATrackSimTruthTrack.h:29
FPGATrackSimHit::setBarcodePt
void setBarcodePt(float v)
Definition: FPGATrackSimHit.h:151
FPGATrackSimOfflineTrack::setPhi
void setPhi(double v)
Definition: FPGATrackSimOfflineTrack.h:19
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
FPGATrackSimTruthTrack::setVtxX
void setVtxX(double v)
Definition: FPGATrackSimTruthTrack.h:22
SiliconTech::pixel
@ pixel
HitType::unmapped
@ unmapped
FPGATrackSimEventInfo::setLB
void setLB(const int &val)
Definition: FPGATrackSimEventInfo.h:59
FPGATrackSimHit::getBarcode
HepMcParticleLink::barcode_type getBarcode() const
Definition: FPGATrackSimHit.h:156
egammaParameters::isPrimary
@ isPrimary
true if matched track has a hit in first or second pixel layer
Definition: egammaParamDefs.h:225
SCT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
Definition: SCT_ID.h:721
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:54
FPGATrackSimSGToRawHitsTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
ToolHandle for Extrapolator.
Definition: FPGATrackSimSGToRawHitsTool.h:58
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:625
Identifier
Definition: IdentifierFieldParser.cxx:14