|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "CLHEP/Units/PhysicalConstants.h"
17 #include "Identifier/Identifier.h"
18 #include "GaudiKernel/IService.h"
27 m_settings(digset), m_detmgr(detmgr), m_trt_id(trt_id),
28 m_subdetectorMask(0x00200000), m_right5Bits(0x0000001F),
29 m_shift5Bits(5), m_shift10Bits(10), m_shift15Bits(15), m_notInitVal(-999999.0), m_trtcaldbtool(calDbTool)
48 ATH_MSG_ERROR(
"Could not find TRT_CalDbTool => cannot use t0 of data.");
61 for (
unsigned int iRing = 0; iRing < timeShiftForBarrelStraw.size(); ++iRing) {
63 for (
unsigned int iLayer = 0; iLayer < timeShiftForBarrelStraw[iRing].size(); ++iLayer) {
66 timeShiftForBarrelStraw[iRing][iLayer].assign(nstraws_in_layer,
m_notInitVal);
76 for (
unsigned int iWheel = 0; iWheel < timeShiftForEndCapPlane.size(); ++iWheel) {
117 ATH_MSG_ERROR(
"TimeCorrection::TimeShift: (iWheel,iLayer) = ("
118 << iWheel <<
", " << iLayer <<
") out of bounds! Returning 0.");
120 ATH_MSG_ERROR(
"TimeCorrection::TimeShift: (iPhi,iWheel,iLayer) = ("
121 <<
iPhi <<
", " << iWheel <<
", " << iLayer <<
") out of bounds! Returning 0.");
147 ATH_MSG_ERROR(
"TimeCorrection::TimeShift: (iRing,iLayer,iStraw) = ("
148 << iRing <<
", " << iLayer <<
", " << iStraw
149 <<
") out of bounds! Returning 0.");
151 ATH_MSG_ERROR(
"TimeCorrection::TimeShift: (iPhi,iRing,iLayer,iStraw) = ("
152 <<
iPhi <<
", " << iRing <<
", " << iLayer <<
", " << iStraw
153 <<
") out of bounds! Returning 0.");
173 const unsigned int& iRing,
174 const unsigned int& iLayer,
175 const unsigned int& iStraw,
179 iRing,
iPhi, iLayer ));
182 if (!barrel_element) {
183 ATH_MSG_ERROR(
"calculateTimeShift_Barrel: Could not get element for iRing = "
184 << iRing <<
" and iLayer = "<<iLayer<<
". Timeshift becomes 0.");
188 if (iStraw >= barrel_element->
nStraws()) {
189 ATH_MSG_ERROR(
"calculateTimeShift_Barrel: Trying to access iStraw "
190 << iStraw <<
" in an element with "<<barrel_element->
nStraws()<<
" straws (iRing="
191 << iRing <<
",iLayer="<<iLayer<<
"). Timeshift becomes 0.");
209 const unsigned int& iWheel,
210 const unsigned int& iLayer,
214 iWheel, iLayer,
iPhi ));
218 ATH_MSG_ERROR(
"calculateTimeShift_EndCap: Could not get element for iWheel = "
219 << iWheel <<
" and iLayer = "<<iLayer<<
". Timeshift becomes 0.");
238 const int strawID ) {
251 const double mindisttoend1(
std::min((strawend1_globalcoord-vertexExtension1).
mag(),
252 (strawend1_globalcoord-vertexExtension2).
mag()));
255 const double mindisttoend2(
std::min((strawend2_globalcoord-vertexExtension1).
mag(),
256 (strawend2_globalcoord-vertexExtension2).
mag()));
260 ATH_MSG_WARNING(
"It would seem that the local z-coordinate of a test straw grows TOWARDS"
261 <<
" the electronics ends. This will give trouble elsewhere!!");
274 ATH_MSG_ERROR(
"Attempt to use t0 from data failed: TRTCalDbSvc was not able to supply t0 for straw with identifier: "
275 << idStraw <<
". Please set getT0FromData=false in jobOptions and run again");
288 double& propagationTime1,
double& propagationTime2) {
290 double direct_distance, reflect_distance;
335 double& direct_dist,
double& reflect_dist )
const {
359 double& reflect_dist )
const {
381 const int mask(0x0000001F);
382 const int word_shift(5);
383 int trtID, ringID, moduleID, layerID, strawID;
384 int wheelID, planeID, sectorID;
389 if ( !(hitID & 0x00200000) ) {
390 strawID = hitID &
mask;
391 hitID >>= word_shift;
392 layerID = hitID &
mask;
393 hitID >>= word_shift;
394 moduleID = hitID &
mask;
395 hitID >>= word_shift;
396 ringID = hitID &
mask;
397 trtID = hitID >> word_shift;
401 if ( barrelElement ) {
403 IdLayer = barrelElement->
identify();
406 ATH_MSG_ERROR(
"Could not find detector element for barrel identifier with "
407 <<
"(ipos,iring,imod,ilayer,istraw) = ("
408 << trtID <<
", " << ringID <<
", " << moduleID <<
", "
409 << layerID <<
", " << strawID <<
")");
413 strawID = hitID &
mask;
414 hitID >>= word_shift;
415 planeID = hitID &
mask;
416 hitID >>= word_shift;
417 sectorID = hitID &
mask;
418 hitID >>= word_shift;
419 wheelID = hitID &
mask;
420 trtID = hitID >> word_shift;
423 if (trtID == 3) trtID = 0;
429 if ( endcapElement ) {
430 IdLayer = endcapElement->
identify();
433 ATH_MSG_ERROR(
"Could not find detector element for endcap identifier with "
434 <<
"(ipos,iwheel,isector,iplane,istraw) = ("
435 << trtID <<
", " << wheelID <<
", " << sectorID <<
", "
436 << planeID <<
", " << strawID <<
")");
437 ATH_MSG_ERROR(
"If this happens very rarely, don't be alarmed (it is a Geant4 'feature')");
438 ATH_MSG_ERROR(
"If it happens a lot, you probably have misconfigured geometry in the sim. job.");
double m_maxVertexDisplacement
const unsigned int m_subdetectorMask
bool getT0FromData() const
double m_signalPropagationSpeed
double timeOffsetCalcVertexZ() const
Get x value of point where particles are assumed to originate.
const InDetDD::TRT_DetectorManager * m_detmgr
double calculateTimeShift_Barrel(const unsigned int &iPhi, const unsigned int &iRing, const unsigned int &iLayer, const unsigned int &iStraw, const int strawID)
Time shift for barrel straws.
double m_lengthDeadRegion
void calculateSignalDists_Barrel(const unsigned int &iRing, const unsigned int &iLayer, double &direct_dist, double &reflect_dist) const
Calculate the distance along the wire the signal travels before reaching the electronics.
TRTTimeCorrection(const TRTDigSettings *digset, const InDetDD::TRT_DetectorManager *detmgr, const TRT_ID *, const ITRT_CalDbTool *)
double calculateTimeShiftFromStrawEnds(const Amg::Vector3D &strawend1_globalcoord, const Amg::Vector3D &strawend2_globalcoord, const int strawID)
Time shift from straw endpoints in global system.
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
const unsigned int m_right5Bits
bool timeshiftsSymmetricForPhiSectors() const
Query whether time offsets are assumed to be symmetric in phi.
unsigned int nStraws() const
Number of straws in the element.
double lengthOfDeadRegion() const
Get length of dead region at end of straws.
void PropagationTime(const int &strawID, const double &meanZ, double &propagationTime1, double &propagationTime2)
Calculates the time between the signal reaching the wire and when it reaches the electronics.
const unsigned int m_shift15Bits
std::vector< double > m_directDistsForEndCapWheels
Cached distances.
bool m_timeShiftPhiSectSymmetry
std::vector< std::vector< std::vector< double > > > m_timeShiftForEndCapPlanes
Cached timeshifts.
double TimeShift(const int &strawID)
Returns the time it would take to travel at light-speed from (0,0,0) to the farthest end of the wire ...
Identifier getIdentifier(int hitID, bool &statusok)
const unsigned int m_shift10Bits
unsigned int getNEndcapWheels() const
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
const unsigned int m_shift5Bits
std::vector< double > m_reflectedDistsForEndCapWheels
Cached distances.
virtual const double & strawLength() const override final
Get the length of the straws (active length):
double timeOffsetCalcVertexX() const
Get x value of point where particles are assumed to originate.
const TRTDigSettings * m_settings
std::vector< std::vector< double > > m_reflectedDistsForBarrelLayers
Cached distances.
Class to provide easy MsgStream access and capabilities.
unsigned int getNBarrelPhi() const
std::vector< std::vector< double > > m_directDistsForBarrelLayers
Cached distances.
virtual Identifier identify() const override final
identifier of this detector element:
unsigned int getNBarrelLayers(unsigned int iMod) const
double calculateTimeShift_EndCap(const unsigned int &iPhi, const unsigned int &iWheel, const unsigned int &iLayer, const int strawID)
Time shift for end cap straws.
const double m_notInitVal
Value used to denote an uninitialized value.
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
std::vector< std::vector< std::vector< std::vector< double > > > > m_timeShiftForBarrelStraws
Cached timeshifts.
const ITRT_CalDbTool * m_trtcaldbtool
bool electronicsAreAtFarEnd() const
Query whether electronics is assumed to be at far end of straw.
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const double & strawLength() const override
Active straw length.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
#define ATH_MSG_WARNING(x)
double maxVertexDisplacement() const
Get max vertex displacement.
unsigned int getNEndcapPhi() const
unsigned int getNEndcapLayers(unsigned int iWheel) const
unsigned int getNBarrelRings() const
Class containing parameters and settings used by TRT digitization.
double timeOffsetCalcVertexY() const
Get y value of point where particles are assumed to originate.
double signalPropagationSpeed() const
Get wire signal propagation speed.
double distanceToTimeFactor() const
Get "distanceToTimeFactor" (fugde factor)
Scalar mag() const
mag method
void calculateSignalDists_EndCap(const unsigned int &iWheel, double &direct_dist, double &reflect_dist) const
Calculate the distance along the wire the signal travels before reaching the electronics.
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: