|
ATLAS Offline Software
|
Time correction.
More...
#include <TRTTimeCorrection.h>
|
Identifier | getIdentifier (int hitID, bool &statusok) |
|
void | Initialize () |
|
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. More...
|
|
double | calculateTimeShift_EndCap (const unsigned int &iPhi, const unsigned int &iWheel, const unsigned int &iLayer, const int strawID) |
| Time shift for end cap straws. More...
|
|
double | calculateTimeShiftFromStrawEnds (const Amg::Vector3D &strawend1_globalcoord, const Amg::Vector3D &strawend2_globalcoord, const int strawID) |
| Time shift from straw endpoints in global system. More...
|
|
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. More...
|
|
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. More...
|
|
void | initMessaging () const |
| Initialize our message level and MessageSvc. More...
|
|
Time correction.
Definition at line 26 of file TRTTimeCorrection.h.
◆ TRTTimeCorrection()
◆ ~TRTTimeCorrection()
TRTTimeCorrection::~TRTTimeCorrection |
( |
| ) |
|
|
default |
◆ calculateSignalDists_Barrel()
void TRTTimeCorrection::calculateSignalDists_Barrel |
( |
const unsigned int & |
iRing, |
|
|
const unsigned int & |
iLayer, |
|
|
double & |
direct_dist, |
|
|
double & |
reflect_dist |
|
) |
| const |
|
private |
Calculate the distance along the wire the signal travels before reaching the electronics.
Both the direct and reflected signal. The signal starts in the middle of the straw.
Definition at line 334 of file TRTTimeCorrection.cxx.
◆ calculateSignalDists_EndCap()
void TRTTimeCorrection::calculateSignalDists_EndCap |
( |
const unsigned int & |
iWheel, |
|
|
double & |
direct_dist, |
|
|
double & |
reflect_dist |
|
) |
| const |
|
private |
Calculate the distance along the wire the signal travels before reaching the electronics.
Both the direct and reflected signal. The signal starts in the middle of the straw.
Definition at line 357 of file TRTTimeCorrection.cxx.
◆ calculateTimeShift_Barrel()
double TRTTimeCorrection::calculateTimeShift_Barrel |
( |
const unsigned int & |
iPhi, |
|
|
const unsigned int & |
iRing, |
|
|
const unsigned int & |
iLayer, |
|
|
const unsigned int & |
iStraw, |
|
|
const int |
strawID |
|
) |
| |
|
private |
Time shift for barrel straws.
Definition at line 172 of file TRTTimeCorrection.cxx.
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.");
196 Amg::Vector3D strawend1(0,0, barrel_element->strawLength()*0.5 );
197 Amg::Vector3D strawend2(0,0, -(barrel_element->strawLength()*0.5) );
200 strawend1 = barrel_element->strawTransform(iStraw) * strawend1;
201 strawend2 = barrel_element->strawTransform(iStraw) * strawend2;
◆ calculateTimeShift_EndCap()
double TRTTimeCorrection::calculateTimeShift_EndCap |
( |
const unsigned int & |
iPhi, |
|
|
const unsigned int & |
iWheel, |
|
|
const unsigned int & |
iLayer, |
|
|
const int |
strawID |
|
) |
| |
|
private |
Time shift for end cap straws.
Definition at line 208 of file TRTTimeCorrection.cxx.
214 iWheel, iLayer,
iPhi ));
218 ATH_MSG_ERROR(
"calculateTimeShift_EndCap: Could not get element for iWheel = "
219 << iWheel <<
" and iLayer = "<<iLayer<<
". Timeshift becomes 0.");
224 Amg::Vector3D strawend1(0,0, ec_element->strawLength() * 0.5 );
225 Amg::Vector3D strawend2(0,0, ec_element->strawLength() * (-0.5) );
228 strawend1 = ec_element->strawTransform(0) * strawend1;
229 strawend2 = ec_element->strawTransform(0) * strawend2;
◆ calculateTimeShiftFromStrawEnds()
Time shift from straw endpoints in global system.
Definition at line 236 of file TRTTimeCorrection.cxx.
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");
◆ getIdentifier()
Identifier TRTTimeCorrection::getIdentifier |
( |
int |
hitID, |
|
|
bool & |
statusok |
|
) |
| |
|
private |
Definition at line 373 of file TRTTimeCorrection.cxx.
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.");
◆ Initialize()
void TRTTimeCorrection::Initialize |
( |
| ) |
|
|
private |
Definition at line 39 of file TRTTimeCorrection.cxx.
48 ATH_MSG_ERROR(
"Could not find TRT_CalDbTool => cannot use t0 of data.");
60 timeShiftForBarrelStraw.resize(numerology->getNBarrelRings());
61 for (
unsigned int iRing = 0; iRing < timeShiftForBarrelStraw.size(); ++iRing) {
62 timeShiftForBarrelStraw[iRing].resize(numerology->getNBarrelLayers(iRing));
63 for (
unsigned int iLayer = 0; iLayer < timeShiftForBarrelStraw[iRing].size(); ++iLayer) {
66 timeShiftForBarrelStraw[iRing][iLayer].assign(nstraws_in_layer,
m_notInitVal);
75 timeShiftForEndCapPlane.resize(numerology->getNEndcapWheels());
76 for (
unsigned int iWheel = 0; iWheel < timeShiftForEndCapPlane.size(); ++iWheel) {
77 timeShiftForEndCapPlane[iWheel].assign(numerology->getNEndcapLayers(iWheel),
m_notInitVal);
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ PropagationTime()
void TRTTimeCorrection::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.
Result are two times: direct and reflected signal.
- Parameters
-
strawID | straw ID |
meanZ | z coordinate of signal in straw local coordinates (z counted positive away from electronics) |
propagationTime1 | propagation time - direct signal |
propagationTime2 | propagation time - reflected signal |
Definition at line 287 of file TRTTimeCorrection.cxx.
290 double direct_distance, reflect_distance;
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ TimeShift()
double TRTTimeCorrection::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 (where the electronics are).
- Parameters
-
- Returns
- time correction
Definition at line 96 of file TRTTimeCorrection.cxx.
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.");
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_detmgr
◆ m_directDistsForBarrelLayers
std::vector< std::vector<double> > TRTTimeCorrection::m_directDistsForBarrelLayers |
|
private |
◆ m_directDistsForEndCapWheels
std::vector<double> TRTTimeCorrection::m_directDistsForEndCapWheels |
|
private |
◆ m_getT0FromData
bool TRTTimeCorrection::m_getT0FromData = false |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lengthDeadRegion
double TRTTimeCorrection::m_lengthDeadRegion = 0.0 |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_maxVertexDisplacement
double TRTTimeCorrection::m_maxVertexDisplacement = 0.0 |
|
private |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_notInitVal
const double TRTTimeCorrection::m_notInitVal |
|
private |
◆ m_reflectedDistsForBarrelLayers
std::vector< std::vector<double> > TRTTimeCorrection::m_reflectedDistsForBarrelLayers |
|
private |
◆ m_reflectedDistsForEndCapWheels
std::vector<double> TRTTimeCorrection::m_reflectedDistsForEndCapWheels |
|
private |
◆ m_right5Bits
const unsigned int TRTTimeCorrection::m_right5Bits |
|
private |
◆ m_settings
◆ m_shift10Bits
const unsigned int TRTTimeCorrection::m_shift10Bits |
|
private |
◆ m_shift15Bits
const unsigned int TRTTimeCorrection::m_shift15Bits |
|
private |
◆ m_shift5Bits
const unsigned int TRTTimeCorrection::m_shift5Bits |
|
private |
◆ m_signalPropagationSpeed
double TRTTimeCorrection::m_signalPropagationSpeed = 0.0 |
|
private |
◆ m_subdetectorMask
const unsigned int TRTTimeCorrection::m_subdetectorMask |
|
private |
◆ m_timeShiftForBarrelStraws
std::vector< std::vector< std::vector< std::vector<double> > > > TRTTimeCorrection::m_timeShiftForBarrelStraws |
|
private |
◆ m_timeShiftForEndCapPlanes
std::vector< std::vector< std::vector<double> > > TRTTimeCorrection::m_timeShiftForEndCapPlanes |
|
private |
◆ m_timeShiftPhiSectSymmetry
bool TRTTimeCorrection::m_timeShiftPhiSectSymmetry = false |
|
private |
◆ m_trt_id
◆ m_trtcaldbtool
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
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.
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.
const unsigned int m_shift15Bits
std::vector< double > m_directDistsForEndCapWheels
Cached distances.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
bool m_timeShiftPhiSectSymmetry
IMessageSvc * getMessageSvc(bool quiet=false)
std::vector< std::vector< std::vector< double > > > m_timeShiftForEndCapPlanes
Cached timeshifts.
Identifier getIdentifier(int hitID, bool &statusok)
const unsigned int m_shift10Bits
AthMessaging()
Default constructor:
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
const unsigned int m_shift5Bits
std::vector< double > m_reflectedDistsForEndCapWheels
Cached distances.
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.
std::vector< std::vector< double > > m_directDistsForBarrelLayers
Cached distances.
virtual Identifier identify() const override final
identifier of this detector element:
double calculateTimeShift_EndCap(const unsigned int &iPhi, const unsigned int &iWheel, const unsigned int &iLayer, const int strawID)
Time shift for end cap straws.
MsgStream & msg() const
The standard message stream.
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
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
double maxVertexDisplacement() const
Get max vertex displacement.
void initMessaging() const
Initialize our message level and MessageSvc.
double timeOffsetCalcVertexY() const
Get y value of point where particles are assumed to originate.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
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: