Loop over the hits and call the hit creator, provide the ActsFatras::Particle to create the hits.
63{
65 for (auto& hit:hits){
66 double energyDeposit = hit.depositedEnergy() / Acts::UnitConstants::MeV;
68
69
70 auto hit_geoid = hit.geometryId();
71
72 try {
73 auto acts_surface = trackingGeometry->findSurface(hit_geoid);
74 const ActsDetectorElement* acts_de = dynamic_cast<const ActsDetectorElement*>(acts_surface->associatedDetectorElement());
75
76 const Trk::Surface& hitSurface = acts_de->
atlasSurface();
78
82 const InDetDD::SiDetectorElement* hitSiDetElement = dynamic_cast<const InDetDD::SiDetectorElement*>((detElementBase));
84
90
91 double thickness = hitSiDetElement->
thickness();
93
95
98 Amg::Vector3D localDirection = sTransform.inverse().linear() * particleDir;
99 localDirection *= thickness/
cos(localDirection.theta());
100
101 int movingDirection = localDirection.z() > 0. ? 1 : -1;
102
103 double distX = localDirection.x();
104 double distY = localDirection.y();
105
106 double localEntryX = interX-0.5*distX;
107 double localEntryY = interY-0.5*distY;
108 double localExitX = interX+0.5*distX;
109 double localExitY = interY+0.5*distY;
111
112 Amg::Vector3D localEntry(hitTransform * (sTransform *
Amg::Vector3D(localEntryX,localEntryY,-0.5*movingDirection*thickness)));
114 const HepGeom::Point3D<double> localEntryHep( localEntry.x(), localEntry.y(), localEntry.z() );
115 const HepGeom::Point3D<double> localExitHep( localExit.x(), localExit.y(), localExit.z() );
116
117 auto isPixel=hitSiDetElement->
isPixel();
118 ATH_MSG_VERBOSE(
name() <<
" localEntryHep|localExitHep (atlas)" << localEntryHep <<
"|" << localExitHep);
124
126 auto siHit = SiHit(localEntryHep,
127 localExitHep,
128 energyDeposit,
129 time,
130 *partLink,
131 isPixel ? 0 : 1,
137 if (isPixel)
139 else
141 ATH_MSG_VERBOSE(
name() <<
" convert and store 1 hit, total " << pixelSiHits.
size() <<
" Pixel | "<<sctSiHits.
size()<<
" SCT hits stored for particle" << isp);
142 }
143 catch (const std::exception& e){
145 }
146 }
147}
#define ATH_MSG_VERBOSE(x)
const Trk::Surface & atlasSurface() const
Return a shared pointer on the ATLAS surface associated with this identifier,.
const PixelID * m_pixIdHelper
the Pixel ID helper
const SCT_ID * m_sctIdHelper
the SCT ID helper
void push_back(const T &t)
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
const GeoTrf::Transform3D & transformHit() const
Local (simulation/hit frame) to global transform.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
const Amg::Vector3D & center() const
Returns the center position of the Surface.
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
constexpr double timeToAthena(const double actsT)
Converts a time unit from Acts to Athena units.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
time(flags, cells_name, *args, **kw)