556{
557
558
559
560
563 for (const InDet::SiClusterCollection* pixelClusterCollection : *pixelClusterContainerHandler) {
564 if (pixelClusterCollection == nullptr) {
566 continue;
567 }
568 const int size = pixelClusterCollection->size();
570 for (const InDet::SiCluster* cluster : *pixelClusterCollection) {
571
572
574 const HepMcParticleLink* bestTruthLink{};
576 for (const Identifier& rdoId : cluster->rdoList()) {
577 const InDetDD::SiDetectorElement* sielement =
m_PIX_mgr->getDetectorElement(rdoId);
578 assert(sielement);
581 InDetSimDataCollection::const_iterator
iter(pixelSDOHandle->find(rdoId));
582
583 if (nCells > 1 && iter == pixelSDOHandle->end()) {
584 InDetDD::SiReadoutCellId SiRC(
m_pixelId->phi_index(rdoId),
m_pixelId->eta_index(rdoId));
585 for (
int ii = 0; ii <
nCells &&
iter == pixelSDOHandle->end(); ++ii) {
587 }
588 }
589
590 if (iter != pixelSDOHandle->end()) { bestTruthLink =
getTruthInformation(iter, parentMask); }
591 }
592 }
594
595 Identifier theID = cluster->identify();
596
597 FPGATrackSimCluster clusterOut;
598
599 FPGATrackSimHit clusterEquiv;
600
601 const InDetDD::SiDetectorElement* sielement =
m_PIX_mgr->getDetectorElement(theID);
602 assert(sielement);
606 clusterEquiv.
setX(globalPos.x());
607 clusterEquiv.
setY(globalPos.y());
608 clusterEquiv.
setZ(globalPos.z());
612
613 int barrel_ec =
m_pixelId->barrel_ec(theID);
614 if (barrel_ec == 0)
616 else if (barrel_ec == 2)
618 else if (barrel_ec == -2)
620
628
629 clusterEquiv.
setPhiWidth(cluster->width().colRow()[1]);
630 clusterEquiv.
setEtaWidth(cluster->width().colRow()[0]);
631
632 if (bestParent) {
636 }
637 else {
638 clusterEquiv.
setEventIndex(std::numeric_limits<long>::max());
639 clusterEquiv.
setBarcode(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
640 clusterEquiv.
setUniqueID(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
641 }
642
643 clusterEquiv.
setBarcodePt(
static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
647 }
648 }
649
650
651
652
656
657 for (const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection : *stripRDOHandle) {
658 if (SCT_Collection == nullptr) { continue; }
659 for (const SCT_RDORawData* sctRawData : *SCT_Collection) {
660 const Identifier rdoId = sctRawData->identify();
661
662 const InDetDD::SiDetectorElement* sielement =
m_SCT_mgr->getDetectorElement(rdoId);
663 const InDetDD::SiDetectorDesign& design =
dynamic_cast<const InDetDD::SiDetectorDesign&
>(sielement->
design());
666
667
669 const HepMcParticleLink* bestTruthLink{};
671 InDetSimDataCollection::const_iterator
iter(stripSDOHandle->find(rdoId));
672
673 if (iter != stripSDOHandle->end()) { bestTruthLink =
getTruthInformation(iter, parentMask); }
674 }
676
677
678 FPGATrackSimCluster clusterOut;
679 FPGATrackSimHit clusterEquiv;
681 clusterEquiv.
setX(gPos.x());
682 clusterEquiv.
setY(gPos.y());
683 clusterEquiv.
setZ(gPos.z());
687
688 int barrel_ec =
m_sctId->barrel_ec(rdoId);
689 if (barrel_ec == 0)
691 else if (barrel_ec == 2)
693 else if (barrel_ec == -2)
695
704
705 clusterEquiv.
setPhiWidth(sctRawData->getGroupSize());
706
707 if (bestParent) {
711 }
712 else {
713 clusterEquiv.
setEventIndex(std::numeric_limits<long>::max());
714 clusterEquiv.
setBarcode(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
715 clusterEquiv.
setUniqueID(std::numeric_limits<HepMcParticleLink::barcode_type>::max());
716 }
717
718 clusterEquiv.
setBarcodePt(
static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
722 }
723 }
724
725
726 return StatusCode::SUCCESS;
727}
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