557{
558
559
560
561
564 for (const InDet::SiClusterCollection* pixelClusterCollection : *pixelClusterContainerHandler) {
565 if (pixelClusterCollection == nullptr) {
567 continue;
568 }
569 const int size = pixelClusterCollection->size();
571 for (const InDet::SiCluster* cluster : *pixelClusterCollection) {
572
573
575 const HepMcParticleLink* bestTruthLink{};
577 for (const Identifier& rdoId : cluster->rdoList()) {
578 const InDetDD::SiDetectorElement* sielement =
m_PIX_mgr->getDetectorElement(rdoId);
579 assert(sielement);
582 InDetSimDataCollection::const_iterator
iter(pixelSDOHandle->find(rdoId));
583
584 if (nCells > 1 && iter == pixelSDOHandle->end()) {
585 InDetDD::SiReadoutCellId SiRC(
m_pixelId->phi_index(rdoId),
m_pixelId->eta_index(rdoId));
586 for (
int ii = 0; ii <
nCells &&
iter == pixelSDOHandle->end(); ++ii) {
588 }
589 }
590
591 if (iter != pixelSDOHandle->end()) { bestTruthLink =
getTruthInformation(iter, parentMask); }
592 }
593 }
595
596 Identifier theID = cluster->identify();
597
598 FPGATrackSimCluster clusterOut;
599
600 FPGATrackSimHit clusterEquiv;
601
602 const InDetDD::SiDetectorElement* sielement =
m_PIX_mgr->getDetectorElement(theID);
603 assert(sielement);
607 clusterEquiv.
setX(globalPos.x());
608 clusterEquiv.
setY(globalPos.y());
609 clusterEquiv.
setZ(globalPos.z());
613
614 int barrel_ec =
m_pixelId->barrel_ec(theID);
615 if (barrel_ec == 0)
617 else if (barrel_ec == 2)
619 else if (barrel_ec == -2)
621
629
630 clusterEquiv.
setPhiWidth(cluster->width().colRow()[1]);
631 clusterEquiv.
setEtaWidth(cluster->width().colRow()[0]);
632
633 if (bestParent) {
637 }
638 else {
639 clusterEquiv.
setEventIndex(std::numeric_limits<long>::max());
640 clusterEquiv.
setBarcode(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
641 clusterEquiv.
setUniqueID(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
642 }
643
644 clusterEquiv.
setBarcodePt(
static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
648 }
649 }
650
651
652
653
657
658 for (const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection : *stripRDOHandle) {
659 if (SCT_Collection == nullptr) { continue; }
660 for (const SCT_RDORawData* sctRawData : *SCT_Collection) {
661 const Identifier rdoId = sctRawData->identify();
662
663 const InDetDD::SiDetectorElement* sielement =
m_SCT_mgr->getDetectorElement(rdoId);
664 const InDetDD::SiDetectorDesign& design =
dynamic_cast<const InDetDD::SiDetectorDesign&
>(sielement->
design());
667
668
670 const HepMcParticleLink* bestTruthLink{};
672 InDetSimDataCollection::const_iterator
iter(stripSDOHandle->find(rdoId));
673
674 if (iter != stripSDOHandle->end()) { bestTruthLink =
getTruthInformation(iter, parentMask); }
675 }
677
678
679 FPGATrackSimCluster clusterOut;
680 FPGATrackSimHit clusterEquiv;
682 clusterEquiv.
setX(gPos.x());
683 clusterEquiv.
setY(gPos.y());
684 clusterEquiv.
setZ(gPos.z());
688
689 int barrel_ec =
m_sctId->barrel_ec(rdoId);
690 if (barrel_ec == 0)
692 else if (barrel_ec == 2)
694 else if (barrel_ec == -2)
696
705
706 clusterEquiv.
setPhiWidth(sctRawData->getGroupSize());
707
708 if (bestParent) {
712 }
713 else {
714 clusterEquiv.
setEventIndex(std::numeric_limits<long>::max());
715 clusterEquiv.
setBarcode(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
716 clusterEquiv.
setUniqueID(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
717 }
718
719 clusterEquiv.
setBarcodePt(
static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
723 }
724 }
725
726
727 return StatusCode::SUCCESS;
728}
size_t size() const
Number of registered mappings.
void setClusterEquiv(const FPGATrackSimHit &input)
void setPhiModule(unsigned v)
void setIdentifierHash(unsigned v)
void setEtaIndex(unsigned v)
void setEventIndex(long v)
void setPhiIndex(unsigned v)
void setHitType(HitType type)
void setPhiCoord(float v)
void setIdentifier(unsigned int v)
void setBarcode(const HepMcParticleLink::barcode_type &v)
void setParentageMask(unsigned long v)
void setBarcodePt(float v)
void setLayerDisk(unsigned v)
void setEtaCoord(float v)
void setEtaWidth(unsigned v)
void setPhiWidth(unsigned v)
void setUniqueID(const HepMcParticleLink::barcode_type &v)
void setDetectorZone(DetectorZone detZone)
void setDetType(SiliconTech detType)
int id() const
Return the id of the target particle.
index_type eventIndex() const
Return the event number of the referenced GenEvent.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const =0
readout or diode id -> position.
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
virtual Identifier identify() const override final
identifier of this detector element (inline)
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Eigen::Matrix< double, 3, 1 > Vector3D
HepMC3::ConstGenParticlePtr ConstGenParticlePtr