9#include "GaudiKernel/ISvcLocator.h"
30#include "CLHEP/Units/PhysicalConstants.h"
31#include "CLHEP/Random/RandFlat.h"
32#include "CLHEP/Random/RandGauss.h"
33#include "CLHEP/Random/RandLandau.h"
38 const IInterface* p ) :
54 return StatusCode::FAILURE;
68 return StatusCode::SUCCESS;
74 if ( inc.type() == IncidentType::BeginEvent ){
95 const Trk::Surface &hitSurface = pars.associatedSurface();
100 if ( !hitTrtDetElement )
return;
102 if (hitTrtDetElement) {
107 ATH_MSG_VERBOSE(
"[ trthit ] Straw is not active ( says ConditionsTool). Ignore. ");
123 double k = (direc.y())/(direc.x());
124 double d = (lpoint2.x()*lpoint1.y() - lpoint1.x()*lpoint2.y())/(direc.x());
125 double R = hitSurface.
bounds().
r();
130 double t1 = (pquad.
first - lpoint1.x())/direc.x();
131 double t2 = (pquad.
second - lpoint1.x())/direc.x();
137 ATH_MSG_VERBOSE(
"[ trthit ] Entry / exit : " << sol1raw <<
", " << sol2raw );
140 const double mass = isp.
mass();
141 const double mom2 = pars.momentum().mag2();
142 const float kineticEnergy = sqrt(mom2+mass*mass)-mass;
143 const float energyDepositInKeV = 0.;
145 int barrel_endcap = 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;
153 ATH_MSG_WARNING(
"[ trthit ] Problem estimating barrel_endcap and ispos" );
return;
162 const int hitID = hitid_helper->
buildHitId( barrel_endcap, ispos, ringwheel, phisector,layer,istraw);
164 ATH_MSG_VERBOSE(
"[ trthit ] Add a TRTUncompressedHit hit to the collection. ");
172 (
float) kineticEnergy, (
float) energyDepositInKeV,
173 (
float) sol1raw.x(), (
float) sol1raw.y(), sol1raw.z(),
174 (
float) sol2raw.x(), (
float) sol2raw.y(), sol2raw.z(),
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
AtlasHitsVector< TRTUncompressedHit > TRTUncompressedHitCollection
This is an Identifier helper class for the TRT subdetector.
a link optimized in size for a GenParticle in a McEventCollection
The generic ISF particle definition,.
int pdgCode() const
PDG value.
double mass() const
mass of the particle
Virtual base class of TRT readout elements.
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.
Abstract Base Class for tracking surfaces.
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.
This is the base class for all tracking detector elements with read-out relevant information.
void handle(const Incident &inc)
handle for incident service
TRTUncompressedHitCollection * m_hitColl
the sim hit collection
ServiceHandle< IIncidentSvc > m_incidentSvc
const TRT_ID * m_trtIdHelper
TRT ID helper.
ServiceHandle< IAtRndmGenSvc > m_randomSvc
Pointer to the random number generator service.
StringProperty m_collectionName
name of the collection on storegate
ToolHandle< ITRT_StrawStatusSummaryTool > m_trtStatusSummaryTool
Handle to TRT conditions service.
CLHEP::HepRandomEngine * m_randomEngine
Random Engine.
StringProperty m_trtIdHelperName
where to find the SCT helper
StringProperty m_randomEngineName
Name of the random number stream.
StatusCode initialize()
AlgTool initailize method.
HitCreatorTRT(const std::string &, const std::string &, const IInterface *)
Constructor.
void createSimHit(const ISF::ISFParticle &isp, const Trk::TrackParameters &, double) const
Record the hit.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersBase< TrackParametersDim, Charged > TrackParameters
RQESolutionType solutions