93{
94
95 const Trk::Surface &hitSurface =
pars.associatedSurface();
97
98 const InDetDD::TRT_BaseElement* hitTrtDetElement = dynamic_cast<const InDetDD::TRT_BaseElement*>((detElementBase));
99
100 if ( !hitTrtDetElement ) return;
101
102 if (hitTrtDetElement) {
103
105
107 ATH_MSG_VERBOSE(
"[ trthit ] Straw is not active ( says ConditionsTool). Ignore. ");
108 return;
109 }
110
113
115
118
119
121
122
124 double d = (lpoint2.x()*lpoint1.y() - lpoint1.x()*lpoint2.y())/(
direc.x());
126
127
128 Trk::RealQuadraticEquation pquad(1 + k*k, 2*k*d, d*d - R*R);
130 double t1 = (pquad.first - lpoint1.x())/
direc.x();
131 double t2 = (pquad.second - lpoint1.x())/
direc.x();
132
135
137 ATH_MSG_VERBOSE(
"[ trthit ] Entry / exit : " << sol1raw <<
", " << sol2raw );
138
141 const double mom2 =
pars.momentum().mag2();
142 const float kineticEnergy = sqrt(mom2+mass*mass)-
mass;
143 const float energyDepositInKeV = 0.;
144
145 int barrel_endcap = 0;
146 int ispos = 0;
148 case -2: barrel_endcap = 1; ispos = 1; break;
149 case -1: barrel_endcap = 0; ispos = 0; break;
150 case 1: barrel_endcap = 0; ispos = 1; break;
151 case 2: barrel_endcap = 1; ispos = 0; break;
152 default:
153 ATH_MSG_WARNING(
"[ trthit ] Problem estimating barrel_endcap and ispos" );
return;
154 }
155
160
162 const int hitID = hitid_helper->
buildHitId( barrel_endcap, ispos, ringwheel, phisector,layer,istraw);
163
164 ATH_MSG_VERBOSE(
"[ trthit ] Add a TRTUncompressedHit hit to the collection. ");
165
170 partLink,
172 (float) kineticEnergy, (float) energyDepositInKeV,
173 (float) sol1raw.x(), (float) sol1raw.y(), sol1raw.z(),
174 (float) sol2raw.x(), (float) sol2raw.y(), sol2raw.z(),
175 (float) time );
176 }
177
178 }
179}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
int pdgCode() const
PDG value.
double mass() const
mass of the particle
static const TRTHitIdHelper * GetHelper()
int buildHitId(const int, const int, const int, const int, const int, const int) const
virtual double r() const =0
Interface method for the maximal extension or the radius.
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 const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
TRTUncompressedHitCollection * m_hitColl
the sim hit collection
const TRT_ID * m_trtIdHelper
TRT ID helper.
ToolHandle< ITRT_StrawStatusSummaryTool > m_trtStatusSummaryTool
Handle to TRT conditions service.
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)