Loop over the hits and call the hit creator, provide the ActsFatras::Particle to create the hits.
63{
65 for (auto& hit:hits){
68
69
70 auto hit_geoid = hit.geometryId();
71
72 try {
73 auto acts_surface = trackingGeometry->findSurface(hit_geoid);
75 if (!acts_de){
76 continue;
77 }
78 const Trk::Surface& hitSurface = acts_de->atlasSurface();
80
84 const InDetDD::SiDetectorElement* hitSiDetElement = dynamic_cast<const InDetDD::SiDetectorElement*>((detElementBase));
86
92
93 double thickness = hitSiDetElement->
thickness();
95
97
100 Amg::Vector3D localDirection = sTransform.inverse().linear() * particleDir;
101 localDirection *= thickness/
cos(localDirection.theta());
102
103 int movingDirection = localDirection.z() > 0. ? 1 : -1;
104
105 double distX = localDirection.x();
106 double distY = localDirection.y();
107
108 double localEntryX = interX-0.5*distX;
109 double localEntryY = interY-0.5*distY;
110 double localExitX = interX+0.5*distX;
111 double localExitY = interY+0.5*distY;
113
114 Amg::Vector3D localEntry(hitTransform * (sTransform *
Amg::Vector3D(localEntryX,localEntryY,-0.5*movingDirection*thickness)));
116 const HepGeom::Point3D<double> localEntryHep( localEntry.x(), localEntry.y(), localEntry.z() );
117 const HepGeom::Point3D<double> localExitHep( localExit.x(), localExit.y(), localExit.z() );
118
119 auto isPixel=hitSiDetElement->
isPixel();
120 ATH_MSG_VERBOSE(
name() <<
" localEntryHep|localExitHep (atlas)" << localEntryHep <<
"|" << localExitHep);
126
127 auto truth_barcode = isp.
barcode();
128 auto siHit = SiHit(localEntryHep,
129 localExitHep,
130 energyDeposit,
131 time,
132 truth_barcode,
133 isPixel ? 0 : 1,
139 if (isPixel)
141 else
143 ATH_MSG_VERBOSE(
name() <<
" convert and store 1 hit, total " << pixelSiHits.
size() <<
" Pixel | "<<sctSiHits.
size()<<
" SCT hits stored for particle" << isp);
144 }
145 catch (const std::exception& e){
147 }
148 }
149}
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
#define ATH_MSG_VERBOSE(x)
const PixelID * m_pixIdHelper
the Pixel ID helper
const SCT_ID * m_sctIdHelper
the SCT ID helper
void push_back(const T &t)
int barcode() const
the barcode
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.
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...
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
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 energyToAthena(const double actsE)
Converts an energy scalar from Acts to Athena units.
constexpr double timeToAthena(T 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)