|
ATLAS Offline Software
|
Go to the documentation of this file.
24 const IInterface*
p) :
25 AthAlgTool(
t,
n,
p), m_ITrackFitter(
"Trk::GlobalChi2Fitter/InDetTrackFitter"), m_eventPhaseTool(), m_caldbtool(
26 "TRT_CalDbTool", this), m_doEtaCorrection(true), m_debug(false) {
27 declareInterface<ITRT_TrackTimingTool>(
this);
28 declareInterface<Trk::ITrackTimingTool>(
this);
49 if (
sc.isFailure())
return sc;
54 return StatusCode::FAILURE;
60 ATH_MSG_INFO(
"InDet::TRT_TrackTimingTool::initialize() successful in " <<
name() <<
", do eta correction: " <<
62 return StatusCode::SUCCESS;
76 if (sgmColl !=
nullptr) {
77 ATH_MSG_INFO(
"TRT_TrackTimingTool::timeMeasurements called with SegmentCollection != 0");
80 std::vector<Trk::SpaceTimePoint*> timeMeasurementsVector;
93 int nTRTdriftCircles(0), nMissingRDOs(0), nMissingTrackParameters(0), nUsedHits(0);
94 trackInformation(
track, position, nTRTdriftCircles, nMissingRDOs, nMissingTrackParameters, nUsedHits);
97 "trackInformation: " << nTRTdriftCircles <<
", " << nMissingRDOs <<
", " << nMissingTrackParameters <<
" slimmed? " <<
100 if (!nTRTdriftCircles)
return timeMeasurementsVector;
103 if (nMissingTrackParameters) {
107 if (newtrack ==
nullptr) {
108 ATH_MSG_INFO(
"fit to unslim track has failed, giving up.");
109 return timeMeasurementsVector;
113 const Trk::Track* track_ptr = (newtrack !=
nullptr) ? newtrack : &
track;
116 ATH_MSG_DEBUG(
"timeMeasurements(): diagnosed that track has all information already.");
133 float weight = (time == 0.) ? 0. : 0.02 * nUsedHits;
135 ATH_MSG_DEBUG(
"TRT_TrackTimingTool::timeMeasurements: TRT track with " << nTRTdriftCircles <<
" hits, track time = "
136 << time <<
" ns, position: " << position <<
", error: " <<
error <<
", weight: " <<
weight <<
142 timeMeasurementsVector.push_back(timeMeasurement);
144 ATH_MSG_INFO(
"TRT_TrackTimingTool::timeMeasurement not available");
149 if (newtrack)
delete newtrack;
151 return timeMeasurementsVector;
160 std::vector<Trk::SpaceTimePoint*>
v;
169 std::vector<Trk::SpaceTimePoint*>
v;
185 if (!trtcirc)
continue;
188 if (!tparp)
continue;
191 if (std::abs(driftR) < 0.000001)
continue;
192 if (std::abs(driftR) > 2.)
continue;
198 if (not rtRelation) {
202 float driftT = rtRelation->drifttime(std::abs(driftR));
203 float trackT = rtRelation->drifttime(std::abs(trackR));
206 time += driftT - trackT;
210 if (nHits > 0) time /= (
float) nHits;
218 const float correctionLargeEta = -0.31;
223 ATH_MSG_WARNING(
"missing perigee parameters, can not make eta correction");
227 double eta = trackPar->eta();
228 float correction = (1.3 * eta * eta - 1.9) * eta * eta;
239 int& nTRTdriftCircles,
int& nMissingRDOs,
240 int& nMissingTrackParameters,
int& nUsedHits)
const {
249 if (!trtcirc)
continue;
255 if (!state->trackParameters()) nMissingTrackParameters++;
268 if (nTRTdriftCircles) GlobalPositionSum /= (
double) nTRTdriftCircles;
269 position = GlobalPositionSum;
277 int checkNTRThits(0), missingMeasurement(0), noTRT_DriftCircle(0), missingPrepRawData(0), invalidHits(0),
283 missingMeasurement++;
295 missingPrepRawData++;
311 "debugMissingMeasurements: TRT hit " << checkNTRThits <<
", raw drift time: " << rawhit->
rawDriftTime() <<
" ns, track R: " <<
315 ATH_MSG_INFO(
"debugMissingMeasurements: N valid hits: " << checkNTRThits <<
", missing MeasurementBase / Measurement: " << missingMeasurement
316 <<
", missing TRT_DriftCircleOnTrack: " << noTRT_DriftCircle <<
", missingPrepRawData: " << missingPrepRawData
317 <<
", invalid LE or TE: " << invalidHits <<
", missing track parameters: " <<
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
abstract base class for rt-relations
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
bool const RAWDATA *ch2 const
@ SlimmedTrack
A slimmed track.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
represents the track state (measurement, material, fit parameters and quality) at a surface.
Eigen::Matrix< double, 3, 1 > Vector3D
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
bool driftTimeValid() const
return true if the corrected drift time is OK
double rawDriftTime() const
returns the raw driftTime
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
const Track * originalTrack() const
Return pointer to associated track.
bool firstBinHigh() const
returns true if the first bin is high
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.