86 {
87
89 float rtrackunbias = 0;
90 float drrtrackunbias = 0;
91 float drrtrack = 0;
92 float ttrackunbias = 0;
96
97
99 const Trk::TrackStateOnSurface* HitOnTrackToRemove(nullptr);
100
101 double timecor = 0.;
102 const Trk::Track* pTrack = aTrack ;
104 float lbn = -1;
105 float nvrt_rec = -1;
109 double qoverp = 0;
111
112 if(mesp){
118 if (ptinv != 0) {
120 } else {
122 }
124 }
125
127
129
130 nvrt_rec = 0;
131 int countVertices(0);
134 if ( vx-> nTrackParticles() >= 3) countVertices++;
135 }
136 }
137 nvrt_rec = countVertices;
138
141
142 const Trk::MeasurementBase* mesb = nullptr;
143 const Trk::RIO_OnTrack* rotp = nullptr;
144 const InDet::TRT_DriftCircle* dcp = nullptr;
147 const InDet::TRT_DriftCircleOnTrack* trtcirc = nullptr;
148 const TRTCond::RtRelation* rtrelation = nullptr;
149
150
151 for (; tsos != tsosEnd; ++tsos) {
152 mesb = (*tsos)->measurementOnTrack();
153 rotp = dynamic_cast<const Trk::RIO_OnTrack*>(mesb);
154 if(rotp != nullptr) {
158 }
else if (
m_DetID->is_trt(ident)) {
161 trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(rotp);
162 if (trtcirc != nullptr) {
164 tparp = ((*tsos)->trackParameters());
165 mparp = (tparp);
166
167 if (tparp == nullptr) {
168 if (
msgLvl(MSG::DEBUG))
msg() <<
"strange: trk parameters not available" <<
endmsg;
169 }
170 if (dcp == nullptr) {
171 msg(MSG::ERROR) <<
"strange: prepRawData not available" <<
endmsg;
172 }
173
174 if (mparp && dcp) {
175 TRT::HitInfo* newhit = new TRT::HitInfo();
176 output->push_back(newhit);
177
185
186
189 if(errsq<0) errsq=1.0;
191 bool isvalid = false;
192
193
196
197
198
200
202
204
206
208
211
212
213 float HTCorrection = 0;
216 }
217
219
222 if(errsq<0) errsq=1.0;
225 if(errsq<0) errsq=1.0;
227
228 if( rtrelation ) {
231 }
232
234
235 int chip = 0;
236 int board = -1;
238 if(abs(
m_TRTID->barrel_ec(ident))<2){
240 } else if (chip<12) {
241 board = 0;
242 } else {
243 chip = chip-20;
244 board = 1;
245 }
246
247
248 int isArgonStraw = 0;
251 isArgonStraw = 1;
252 }
253 }
254
255
257
260 float h_timeResidual = h_driftTime - h_trkDriftTime;
261
263
265
267
270 float d = h_residualVariance;
272 float h_chiSquare = h_residual*h_residual/
d ;
274 if(dof<1) dof=1;
275 bool hitsel=false;
278 h_trkVariance > 0 &&
279 h_hasValidDriftTime &&
282 hitsel = true;
283 }
284
286 rtrackunbias = 0;
287 drrtrackunbias = 0;
289 drrtrack = sqrt(errsq);
290 ttrackunbias = 0;
291
293 tparp = ((*tsos)->trackParameters());
294 HitOnTrackToRemove = *tsos;
295
296 if(HitOnTrackToRemove){
297 unbiasedTrkParameters =
m_updator->removeFromState(*(HitOnTrackToRemove->trackParameters()),
298 HitOnTrackToRemove->measurementOnTrack()->localParameters(),
299 HitOnTrackToRemove->measurementOnTrack()->localCovariance()).release();
300 ATH_MSG_DEBUG (
"TrackParameters 1: " << *(HitOnTrackToRemove->trackParameters()));
301 }
302 else if (
msgLvl(MSG::DEBUG)) {
303 msg() <<
"TrackParameters 1: nullptr" <<
endmsg;
304 }
305
306 if(unbiasedTrkParameters){
310 if(errsq<0) errsq=1.;
311 drrtrackunbias = sqrt(errsq);
312
313 if( rtrelation ) ttrackunbias = rtrelation->
drifttime(std::abs( rtrackunbias ));
314 ATH_MSG_DEBUG(
"Unbiased TrackParameters 2: " << *unbiasedTrkParameters );
317 }
318
319 }
321 float const ntvar[40]={
324 lbn,
325 nvrt_rec,
327
334 (float)chip,
346
351 drrtrack,
352 rtrackunbias,
353 drrtrackunbias,
355 ttrackunbias,
365 ToTCorrection,
366 HTCorrection,
368 };
369
370 if (hitsel) {
373 }
374
375 }
376 } else {
377 msg(MSG::ERROR) <<
"TRT drift RIO cast failed - no hit stored" <<
endmsg;
378 }
379
380
381 }
383 }
384 }
386 <<
output->size() <<
" hits had FULL info available" <<
endmsg;
387
388
389
390 delete unbiasedTrkParameters;
391
392
393 return true;
394}
Scalar phi() const
phi method
Scalar theta() const
theta method
bool msgLvl(const MSG::Level lvl) const
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ToolHandle< Trk::IUpdator > m_updator
ServiceHandle< ITRT_StrawNeighbourSvc > m_neighbourSvc
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool
Trk::DriftCircleSide side() const
returns the side on which the drift radius is.
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
bool highLevel() const
returns true if the high level threshold was passed
double timeOverThreshold() const
returns Time over threshold in ns
double driftTime(bool &valid) const
returns the raw driftTime, the passed boolean indicates if the drift time is valid or not.
virtual float drdt(float driftime) const =0
driftvelocity for given drifttime
virtual float drifttime(float radius) const =0
drifttime for given radius
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
const Amg::Vector3D & position() const
Access method for the position.
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
Identifier identify() const
return the identifier -extends MeasurementBase
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const Perigee * perigeeParameters() const
return Perigee.
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
uint32_t lumiBlock() const
The current event's luminosity block number.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.