ATLAS Offline Software
Loading...
Searching...
No Matches
SimpleIDNtupleTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4
6
8//Eigen stuff
10//
11#include "TrkTrack/Track.h"
14
16
18
21
27
29
30#include "TFile.h"
31#include "TTree.h"
32#include "TMath.h"
33#include <cmath>
34
35
36namespace InDet {
37//________________________________________________________________________
39 if (m_hit_rho) {
40 delete [] m_hit_rho;
41 delete [] m_hit_phi;
42 delete [] m_hit_z;
43 delete [] m_hit_cotth;
44 delete [] m_hit_eta;
45 delete [] m_hit_xloc;
46 delete [] m_hit_yloc;
47 delete [] m_hit_zloc;
48 delete [] m_hit_drd;
49 delete [] m_hit_sig;
50 delete [] m_hit_tpar_x;
51 delete [] m_hit_tpar_y;
52 delete [] m_hit_resx;
53 delete [] m_hit_resx_err;
54 delete [] m_hit_resy;
55 delete [] m_hit_resy_err;
56 delete [] m_hit_det;
57 delete [] m_hit_type;
58
60 delete [] m_hit_derivx_transx;
61 delete [] m_hit_derivx_transy;
62 delete [] m_hit_derivx_transz;
63 delete [] m_hit_derivx_rotx;
64 delete [] m_hit_derivx_roty;
65 delete [] m_hit_derivx_rotz;
66 delete [] m_hit_derivx_bowx;
67 delete [] m_hit_derivx_bowy;
68 delete [] m_hit_derivx_bowz;
69 delete [] m_hit_derivy_transx;
70 delete [] m_hit_derivy_transy;
71 delete [] m_hit_derivy_transz;
72 delete [] m_hit_derivy_rotx;
73 delete [] m_hit_derivy_roty;
74 delete [] m_hit_derivy_rotz;
75 delete [] m_hit_derivy_bowx;
76 delete [] m_hit_derivy_bowy;
77 delete [] m_hit_derivy_bowz;
78 }
79 }
80 }
81
82//________________________________________________________________________
84 ATH_MSG_DEBUG("initialize() of SimpleIDNtupleTool");
85
86 // retrieve TRT ID helper
87 ATH_CHECK(detStore()->retrieve(m_idHelper, "TRT_ID"));
88
89 // get TrackParticleCreatorTool
90 ATH_CHECK(m_particleCreator.retrieve());
91
92 // get AlignModuleTool
93 if (m_alignModuleTool.empty() || m_alignModuleTool.retrieve().isFailure()) {
94 ATH_MSG_FATAL("Failed to retrieve tool " << m_alignModuleTool);
95 return StatusCode::FAILURE;
96 }
97 ATH_MSG_INFO("Retrieved tool " << m_alignModuleTool);
98
99 return StatusCode::SUCCESS;
100 }
101
102//________________________________________________________________________
104 if (m_file && m_file->IsOpen()) {
105 m_file->cd();
106 if (m_tree) m_tree->Write();
107 else ATH_MSG_WARNING("Variable m_tree not set, nothing to write.");
108 } else ATH_MSG_WARNING("Variable m_file not set or not pointing to open output file.");
109 return StatusCode::SUCCESS;
110 }
111
112//________________________________________________________________________
114 ATH_MSG_DEBUG("finalize() of SimpleIDNtupleTool");
115
116 return StatusCode::SUCCESS;
117 }
118
119//________________________________________________________________________
120 void SimpleIDNtupleTool::dumpTrack(const EventContext& ctx, int itrk, const Trk::AlignTrack* alignTrack) {
121 ATH_MSG_DEBUG("In dumpTrack()");
122
123 if (!m_tree) initializeNtuple();
124
125 // get run and event numbers
126 ATH_MSG_DEBUG("Retrieving event info.");
127 const xAOD::EventInfo* eventInfo;
128 if (evtStore()->retrieve(eventInfo).isFailure()) ATH_MSG_ERROR("Could not retrieve event info.");
129 else {
130 m_runNumber = eventInfo->runNumber();
131 m_evtNumber = eventInfo->eventNumber();
132 }
133
134 // initialize variables
135 constexpr double invalidParameterValue{-999.};
136 m_d0 = invalidParameterValue;
137 m_z0 = invalidParameterValue;
138 m_phi0 = invalidParameterValue;
139 m_theta = invalidParameterValue;
140 m_qoverp = invalidParameterValue;;
141 m_pt = invalidParameterValue;
142 m_eta = invalidParameterValue;
143 m_xvtx = invalidParameterValue;
144 m_yvtx = invalidParameterValue;
145 m_zvtx = invalidParameterValue;;
146
147 constexpr int initialiseNHits{0};
148 m_nhitspix = initialiseNHits;
149 m_nhitssct = initialiseNHits;
150 m_nhitstrt = initialiseNHits;
151 m_nshared = initialiseNHits;
152 m_nshpix = initialiseNHits;
153 m_nshsct = initialiseNHits;
154 m_nholes = initialiseNHits;
155 m_nhpix = initialiseNHits;
156 m_nhsct = initialiseNHits;
157
158 constexpr double invalidChiSq(-1e12);
159 constexpr int invalidDegreesOfFreedom{-999};
160 m_chi2 = invalidChiSq;
161 m_chi2prob = invalidChiSq;
162 m_ndof = invalidDegreesOfFreedom;
163
164 const Trk::Perigee* aMeasPer = (alignTrack->perigeeParameters());
165 if (not aMeasPer) ATH_MSG_ERROR("Could not get Trk::MeasuredPerigee");
166 else {
167 m_d0 = aMeasPer->parameters()[Trk::d0];
168 m_z0 = aMeasPer->parameters()[Trk::z0];
169 m_phi0 = aMeasPer->parameters()[Trk::phi0];
170 m_theta = aMeasPer->parameters()[Trk::theta];
171 m_qoverp = aMeasPer->parameters()[Trk::qOverP];
172 ATH_MSG_DEBUG(itrk << ". " << " Track Parameters (d0, z0, phi0, theta, q/p)");
173 ATH_MSG_DEBUG(" " << m_d0 << ", " << m_z0 << ", " << m_phi0 << ", " << m_theta << ", " << m_qoverp);
174 m_pt = std::sqrt((aMeasPer->momentum().x()) * (aMeasPer->momentum().x())
175 + (aMeasPer->momentum().y()) * (aMeasPer->momentum().y()));
176 m_eta = aMeasPer->eta();
177 m_xvtx = aMeasPer->position().x();
178 m_yvtx = aMeasPer->position().y();
179 m_zvtx = aMeasPer->position().z();
180
181 xAOD::TrackParticle* trackPart = m_particleCreator->createParticle(ctx, *alignTrack);
182 uint8_t iSummaryValue(0); // Dummy counter to retrieve summary values
183
184 if (not trackPart) ATH_MSG_ERROR("Could not get xAOD::TrackParticle");
185 else {
186 // hits
187 m_nhitspix = trackPart->summaryValue(iSummaryValue, xAOD::numberOfPixelHits) ? iSummaryValue : 0;
188 m_nhitssct = trackPart->summaryValue(iSummaryValue, xAOD::numberOfSCTHits) ? iSummaryValue : 0;
189 m_nhitstrt = trackPart->summaryValue(iSummaryValue, xAOD::numberOfTRTHits) ? iSummaryValue : 0;
190
191 ATH_MSG_DEBUG(" -- number of Pixel hits : " << m_nhitspix);
192 ATH_MSG_DEBUG(" -- number of SCT hits : " << m_nhitssct);
193 ATH_MSG_DEBUG(" -- number of TRT hits : " << m_nhitstrt);
194
195 // shared hits
196 m_nshpix = trackPart->summaryValue(iSummaryValue, xAOD::numberOfPixelSharedHits) ? iSummaryValue : 0;
197 m_nshsct = trackPart->summaryValue(iSummaryValue, xAOD::numberOfSCTSharedHits) ? iSummaryValue : 0;
199
200 if (m_nshpix < 0) m_nshpix = 0;
201 if (m_nshsct < 0) m_nshsct = 0;
202 if (m_nshared < 0) m_nshared = 0;
203
204 ATH_MSG_DEBUG(" - number of shared hits : " << m_nshared);
205 ATH_MSG_DEBUG(" -- number of Pixel shared hits : " << m_nshpix);
206 ATH_MSG_DEBUG(" -- number of SCT shared hits : " << m_nshsct);
207
208 // holes
209 m_nhpix = trackPart->summaryValue(iSummaryValue, xAOD::numberOfPixelHoles) ? iSummaryValue : 0;
210 m_nhsct = trackPart->summaryValue(iSummaryValue, xAOD::numberOfSCTHoles) ? iSummaryValue : 0;
212
213 if (m_nhpix < 0) m_nhpix = 0;
214 if (m_nhsct < 0) m_nhsct = 0;
215 if (m_nholes < 0) m_nholes = 0;
216
217 ATH_MSG_DEBUG(" - number of Pixel holes : " << m_nhpix);
218 ATH_MSG_DEBUG(" -- number of SCT holes : " << m_nhsct);
219 ATH_MSG_DEBUG(" -- number of holes : " << m_nholes);
220 }
221
222 // get fit quality and chi2 probability of track
223 const Trk::FitQuality* fitQual = alignTrack->fitQuality();
224 if (not fitQual) ATH_MSG_ERROR("No fit quality assigned to the track");
225 else {
226 if (fitQual->chiSquared() > 0. && fitQual->numberDoF() > 0) {
227 m_chi2 = fitQual->chiSquared();
228 m_ndof = fitQual->numberDoF();
229 m_chi2prob = TMath::Prob(m_chi2, m_ndof);
230
231 ATH_MSG_DEBUG(" - chi2 : " << m_chi2);
232 ATH_MSG_DEBUG(" - ndof : " << m_ndof);
233 ATH_MSG_DEBUG(" - chi2/ndof : " << m_chi2 / (double) m_ndof);
234 ATH_MSG_DEBUG(" - chi2 propability : " << m_chi2prob);
235 }
236 }
237 }
238
239 // store information for all hits on this track, including
240 // scattering centers
241 const Trk::AlignTSOSCollection* alignTSOSCollection = alignTrack->alignTSOSCollection();
242 int nhitsTotal = alignTSOSCollection->size();
243 if (nhitsTotal > m_max_hits) nhitsTotal = m_max_hits;
244
245
246 fillHits(alignTrack);
247
248
249 m_file->cd();
250 m_tree->Fill();
251 ATH_MSG_DEBUG("tree filled");
252
253 ++itrk;
254 return;
255 }
256
257//________________________________________________________________________
259 ATH_MSG_DEBUG("In fillHits()");
260
261 // store information for all hits on this track
262 // initialize ntuple variables
263 for (int i = 0; i < m_max_hits; i++) {
264 m_hit_rho[i] = -999.;
265 m_hit_phi[i] = -999.;
266 m_hit_z[i] = -999.;
267 m_hit_cotth[i] = -999.;
268 m_hit_eta[i] = -999.;
269 m_hit_xloc[i] = -999.;
270 m_hit_yloc[i] = -999.;
271 m_hit_zloc[i] = -999.;
272 m_hit_drd[i] = -999.;
273 m_hit_sig[i] = -999.;
274
275 m_hit_tpar_x[i] = -999.;
276 m_hit_tpar_y[i] = -999.;
277
278 m_hit_resx[i] = -999.;
279 m_hit_resx_err[i] = -999.;
280 m_hit_resy[i] = -999.;
281 m_hit_resy_err[i] = -999.;
282
283 m_hit_det[i] = -999;
284 m_hit_type[i] = -999;
285
286 if (m_storeDerivatives) {
287 m_hit_derivx_transx[i] = -999.;
288 m_hit_derivx_transy[i] = -999.;
289 m_hit_derivx_transz[i] = -999.;
290 m_hit_derivx_rotx[i] = -999.;
291 m_hit_derivx_roty[i] = -999.;
292 m_hit_derivx_rotz[i] = -999.;
293 m_hit_derivx_bowx[i] = -999.;
294 m_hit_derivx_bowy[i] = -999.;
295 m_hit_derivx_bowz[i] = -999.;
296
297 m_hit_derivy_transx[i] = -999.;
298 m_hit_derivy_transy[i] = -999.;
299 m_hit_derivy_transz[i] = -999.;
300 m_hit_derivy_rotx[i] = -999.;
301 m_hit_derivy_roty[i] = -999.;
302 m_hit_derivy_rotz[i] = -999.;
303 m_hit_derivy_bowx[i] = -999.;
304 m_hit_derivy_bowy[i] = -999.;
305 m_hit_derivy_bowz[i] = -999.;
306 }
307 }
308
309 const Trk::AlignTSOSCollection* alignTSOSCollection = alignTrack->alignTSOSCollection();
310 m_nhits = alignTSOSCollection->size();
311 ATH_MSG_DEBUG("have " << m_nhits << " hits on alignTrack in total");
312
313 int nhits = 0;
314
315 DataVector<Trk::AlignTSOS>::const_iterator atsit = alignTSOSCollection->begin();
316 DataVector<Trk::AlignTSOS>::const_iterator atsit_end = alignTSOSCollection->end();
317 for (; atsit != atsit_end; ++atsit) {
318 const Trk::AlignTSOS* atsos = *atsit;
319 ATH_MSG_DEBUG("in loop over AlignTSOS, nhits=" << nhits);
320 if (nhits == m_max_hits) break;
321
322 if (!atsos->type(Trk::TrackStateOnSurface::Measurement)) continue;
323
324 m_hit_det[nhits] = atsos->measType();
325 ATH_MSG_DEBUG("measurement type: " << atsos->dumpMeasType());
326
327
328 // get RIO
329 const Trk::RIO_OnTrack* rio = atsos->rio();
330 ATH_MSG_DEBUG("have RIO");
331 Amg::Vector3D pos = rio->globalPosition();
332
333 double locPosX(0.);
334 if (rio->localParameters().contains(Trk::locX)) locPosX = rio->localParameters()[Trk::locX];
335 double locPosY(0.);
336 if (rio->localParameters().contains(Trk::locY)) locPosY = rio->localParameters()[Trk::locY];
337 double locPosZ(0.);
338 if (rio->localParameters().contains(Trk::locZ)) locPosZ = rio->localParameters()[Trk::locZ];
339
340 double error = Amg::error(rio->localCovariance(), Trk::locX);
341 ATH_MSG_DEBUG("error: " << error);
342
343 Identifier id = rio->identify();
344
345
346 m_hit_xloc[nhits] = locPosX;
347 m_hit_yloc[nhits] = locPosY;
348 m_hit_zloc[nhits] = locPosZ;
349
350 m_hit_rho[nhits] = pos.perp();
351 m_hit_phi[nhits] = pos.phi();
352 m_hit_z[nhits] = pos.z();
353 m_hit_sig[nhits] = error;
354
355 // get residual x
356 std::vector<Trk::Residual>::const_iterator ires = atsos->firstResidual();
357
358 m_hit_resx[nhits] = ires->residual();
359 m_hit_resx_err[nhits] = ires->error();
360
361 // get residual y if applicable
362 if (atsos->nResDim() > 1) {
363 ++ires;
364 m_hit_resy[nhits] = ires->residual();
365 m_hit_resy_err[nhits] = ires->error();
366 }
367
368 // get local track parameters
369 const Trk::TrackParameters* trackPars = nullptr;
370 if (atsos->firstResidual()->residualType() == Trk::HitOnly) trackPars = atsos->trackParameters();
371 else trackPars = atsos->unbiasedTrackPars();
372
373 m_hit_tpar_x[nhits] = trackPars->parameters()[Trk::locX];
374 m_hit_tpar_y[nhits] = trackPars->parameters()[Trk::locY];
375
376
377 if (m_idHelper->is_barrel(id)) {
378 m_hit_cotth[nhits] = 0.;
379 m_hit_eta[nhits] = 0.;
380 } else {
381 m_hit_cotth[nhits] = 1. / std::tan(pos.theta());
382 double etaval = -std::log(std::tan(std::atan(1. / std::abs(m_hit_cotth[nhits])) / 2.));
383 if (m_hit_cotth[nhits] < 0.) etaval *= -1.;
384 m_hit_eta[nhits] = etaval;
385 }
386 if (atsos->measType() != Trk::TrackState::TRT) m_hit_drd[nhits] = locPosX;
387
388 // fill derivatives
389 if (m_storeDerivatives) {
390 //const std::vector<CLHEP::HepVector> * derivs = atsos->derivatives();
391 const std::vector<Amg::VectorX>* derivs = atsos->derivatives();
392 if (derivs) {
393 int npar = derivs->at(0).rows();
394
395 const DataVector<Trk::AlignPar>* alignPars = m_alignModuleTool->getAlignPars(atsos->module());
396 int naPar = alignPars->size();
397
398 if (npar != naPar) ATH_MSG_WARNING("number of derivatives on AlignTSOS doesn't match the one on AlignModule");
399
400 else {
401 for (int i = 0; i < npar; i++) {
402 double derivative = (*derivs)[0][i];
403 Trk::AlignModule::TransformParameters ptype = alignPars->at(i)->paramType();
404 switch (ptype) {
406 m_hit_derivx_transx[nhits] = derivative;
407 break;
408
410 m_hit_derivx_transy[nhits] = derivative;
411 break;
412
414 m_hit_derivx_transz[nhits] = derivative;
415 break;
416
418 m_hit_derivx_rotx[nhits] = derivative;
419 break;
420
422 m_hit_derivx_roty[nhits] = derivative;
423 break;
424
426 m_hit_derivx_rotz[nhits] = derivative;
427 break;
428
430 m_hit_derivx_bowx[nhits] = derivative;
431 break;
432
434 m_hit_derivx_bowy[nhits] = derivative;
435 break;
436
438 m_hit_derivx_bowz[nhits] = derivative;
439 break;
440
441 default:
442 ATH_MSG_WARNING("Unknown parameter type " << ptype);
443 }
444 }
445 if (atsos->nResDim() > 1) {
446 for (int i = 0; i < npar; i++) {
447 double derivative = (*derivs)[1][i];
448 Trk::AlignModule::TransformParameters ptype = alignPars->at(i)->paramType();
449 switch (ptype) {
451 m_hit_derivy_transx[nhits] = derivative;
452 break;
453
455 m_hit_derivy_transy[nhits] = derivative;
456 break;
457
459 m_hit_derivy_transz[nhits] = derivative;
460 break;
461
463 m_hit_derivy_rotx[nhits] = derivative;
464 break;
465
467 m_hit_derivy_roty[nhits] = derivative;
468 break;
469
471 m_hit_derivy_rotz[nhits] = derivative;
472 break;
473
475 m_hit_derivy_bowx[nhits] = derivative;
476 break;
477
479 m_hit_derivy_bowy[nhits] = derivative;
480 break;
481
483 m_hit_derivy_bowz[nhits] = derivative;
484 break;
485
486 default:
487 ATH_MSG_WARNING("Unknown parameter type " << ptype);
488 }
489 }
490 }
491 }
492 }
493 } // end of storing derivatives
494
495 ++nhits;
496
497 if (nhits >= m_max_hits) {
498 ATH_MSG_WARNING("Number of hits on track more that maximum: " << m_nhits << " > " << m_max_hits.value() << " "
499 << "Some hits will not be stored.");
500 break;
501 }
502 } //atsos
503
504 ATH_MSG_DEBUG("done with loop over TSOS");
505 }
506
507//________________________________________________________________________
510
511//________________________________________________________________________
514
515//________________________________________________________________________
518
519//________________________________________________________________________
522
523//________________________________________________________________________
525 m_hit_rho = new double[m_max_hits];
526 m_hit_phi = new double[m_max_hits];
527 m_hit_z = new double[m_max_hits];
528 m_hit_cotth = new double[m_max_hits];
529 m_hit_eta = new double[m_max_hits];
530 m_hit_xloc = new double[m_max_hits];
531 m_hit_yloc = new double[m_max_hits];
532 m_hit_zloc = new double[m_max_hits];
533 m_hit_drd = new double[m_max_hits];
534 m_hit_sig = new double[m_max_hits];
535
536 m_hit_tpar_x = new double[m_max_hits];
537 m_hit_tpar_y = new double[m_max_hits];
538
539 m_hit_resx = new double[m_max_hits];
540 m_hit_resx_err = new double[m_max_hits];
541 m_hit_resy = new double[m_max_hits];
542 m_hit_resy_err = new double[m_max_hits];
543
544 m_hit_det = new int[m_max_hits];
545 m_hit_type = new int[m_max_hits];
546
547 m_file->cd();
548 m_tree = new TTree("IDAlign", "Inner Detector Alignment Ntuple");
549
550 m_tree->Branch("run", &m_runNumber, "run/I");
551 m_tree->Branch("evt", &m_evtNumber, "evt/I");
552
553 m_tree->Branch("xvtx", &m_xvtx, "xvtx/D");
554 m_tree->Branch("yvtx", &m_yvtx, "yvtx/D");
555 m_tree->Branch("zvtx", &m_zvtx, "zvtx/D");
556 m_tree->Branch("d0", &m_d0, "d0/D");
557 m_tree->Branch("z0", &m_z0, "z0/D");
558 m_tree->Branch("phi0", &m_phi0, "phi0/D");
559 m_tree->Branch("theta", &m_theta, "theta/D");
560 m_tree->Branch("qoverp", &m_qoverp, "qoverp/D");
561 m_tree->Branch("pt", &m_pt, "pt/D");
562 m_tree->Branch("eta", &m_eta, "eta/D");
563 m_tree->Branch("chi2", &m_chi2, "chi2/D");
564 m_tree->Branch("ndof", &m_ndof, "ndof/I");
565 m_tree->Branch("chi2prob", &m_chi2prob, "chi2prob/D");
566
567 m_tree->Branch("nhits", &m_nhits, "nhits/I");
568 m_tree->Branch("nhitstrt", &m_nhitstrt, "nhitstrt/I");
569 m_tree->Branch("nhitssct", &m_nhitssct, "nhitssct/I");
570 m_tree->Branch("nhitspix", &m_nhitspix, "nhitspix/I");
571 m_tree->Branch("nshared", &m_nshared, "nshared/I");
572 m_tree->Branch("nshsct", &m_nshsct, "nshsct/I");
573 m_tree->Branch("nshpix", &m_nshpix, "nshpix/I");
574 m_tree->Branch("nholes", &m_nholes, "nholes/I");
575 m_tree->Branch("nhsct", &m_nhsct, "nhsct/I");
576 m_tree->Branch("nhpix", &m_nhpix, "nhpix/I");
577
578 m_tree->Branch("hit_rho", m_hit_rho, "hit_rho[nhits]/D");
579 m_tree->Branch("hit_phi", m_hit_phi, "hit_phi[nhits]/D");
580 m_tree->Branch("hit_z", m_hit_z, "hit_z[nhits]/D");
581 m_tree->Branch("hit_cotth", m_hit_cotth, "hit_cotth[nhits]/D");
582 m_tree->Branch("hit_eta", m_hit_eta, "hit_eta[nhits]/D");
583 m_tree->Branch("hit_xloc", m_hit_xloc, "hit_xloc[nhits]/D");
584 m_tree->Branch("hit_yloc", m_hit_yloc, "hit_yloc[nhits]/D");
585 m_tree->Branch("hit_zloc", m_hit_zloc, "hit_zloc[nhits]/D");
586 m_tree->Branch("hit_drd", m_hit_drd, "hit_drd[nhits]/D");
587 m_tree->Branch("hit_sig", m_hit_sig, "hit_sig[nhits]/D");
588
589 m_tree->Branch("hit_tpar_x", m_hit_tpar_x, "hit_tpar_x[nhits]/D");
590 m_tree->Branch("hit_tpar_y", m_hit_tpar_y, "hit_tpar_y[nhits]/D");
591
592 m_tree->Branch("hit_resx", m_hit_resx, "hit_resx[nhits]/D");
593 m_tree->Branch("hit_resx_err", m_hit_resx_err, "hit_resx_err[nhits]/D");
594 m_tree->Branch("hit_resy", m_hit_resy, "hit_resy[nhits]/D");
595 m_tree->Branch("hit_resy_err", m_hit_resy_err, "hit_resy_err[nhits]/D");
596
597 m_tree->Branch("hit_det", m_hit_det, "hit_det[nhits]/I");
598 m_tree->Branch("hit_type", m_hit_type, "hit_type[nhits]/I");
599
600 if (m_storeDerivatives) {
601 m_hit_derivx_transx = new double[m_max_hits];
602 m_hit_derivx_transy = new double[m_max_hits];
603 m_hit_derivx_transz = new double[m_max_hits];
604 m_hit_derivx_rotx = new double[m_max_hits];
605 m_hit_derivx_roty = new double[m_max_hits];
606 m_hit_derivx_rotz = new double[m_max_hits];
607 m_hit_derivx_bowx = new double[m_max_hits];
608 m_hit_derivx_bowy = new double[m_max_hits];
609 m_hit_derivx_bowz = new double[m_max_hits];
610 m_hit_derivy_transx = new double[m_max_hits];
611 m_hit_derivy_transy = new double[m_max_hits];
612 m_hit_derivy_transz = new double[m_max_hits];
613 m_hit_derivy_rotx = new double[m_max_hits];
614 m_hit_derivy_roty = new double[m_max_hits];
615 m_hit_derivy_rotz = new double[m_max_hits];
616 m_hit_derivy_bowx = new double[m_max_hits];
617 m_hit_derivy_bowy = new double[m_max_hits];
618 m_hit_derivy_bowz = new double[m_max_hits];
619
620 m_tree->Branch("derivx_transx", m_hit_derivx_transx, "derivx_transx[nhits]/D");
621 m_tree->Branch("derivx_transy", m_hit_derivx_transy, "derivx_transy[nhits]/D");
622 m_tree->Branch("derivx_transz", m_hit_derivx_transz, "derivx_transz[nhits]/D");
623 m_tree->Branch("derivx_rotx", m_hit_derivx_rotx, "derivx_rotx[nhits]/D");
624 m_tree->Branch("derivx_roty", m_hit_derivx_roty, "derivx_roty[nhits]/D");
625 m_tree->Branch("derivx_rotz", m_hit_derivx_rotz, "derivx_rotz[nhits]/D");
626 m_tree->Branch("derivx_bowx", m_hit_derivx_bowx, "derivx_bowx[nhits]/D");
627 m_tree->Branch("derivx_bowy", m_hit_derivx_bowy, "derivx_bowy[nhits]/D");
628 m_tree->Branch("derivx_bowz", m_hit_derivx_bowz, "derivx_bowz[nhits]/D");
629 m_tree->Branch("derivy_transx", m_hit_derivy_transx, "derivy_transx[nhits]/D");
630 m_tree->Branch("derivy_transy", m_hit_derivy_transy, "derivy_transy[nhits]/D");
631 m_tree->Branch("derivy_transz", m_hit_derivy_transz, "derivy_transz[nhits]/D");
632 m_tree->Branch("derivy_rotx", m_hit_derivy_rotx, "derivy_rotx[nhits]/D");
633 m_tree->Branch("derivy_roty", m_hit_derivy_roty, "derivy_roty[nhits]/D");
634 m_tree->Branch("derivy_rotz", m_hit_derivy_rotz, "derivy_rotz[nhits]/D");
635 m_tree->Branch("derivy_bowx", m_hit_derivy_bowx, "derivy_bowx[nhits]/D");
636 m_tree->Branch("derivy_bowy", m_hit_derivy_bowy, "derivy_bowy[nhits]/D");
637 m_tree->Branch("derivy_bowz", m_hit_derivy_bowz, "derivy_bowz[nhits]/D");
638 }
639 return;
640 }
641} // end namespace
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
This is an Identifier helper class for the TRT subdetector.
Derived DataVector<T>.
Definition DataVector.h:818
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:861
const T * at(size_type n) const
Access an element, as an rvalue.
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.
size_type size() const noexcept
Returns the number of elements in the collection.
double * m_hit_derivy_rotx
derivatives of Y-residual wrt.
double * m_hit_tpar_y
track parameter locY
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
Pointer to track particle creator tool.
int * m_hit_det
detector type for the hit
int m_nhitstrt
number of TRT hits on track (ntrthits in ntuple)
double m_eta
eta of perigee of reconstructed track (eta in ntuple)
virtual void storeHitmap() override
double * m_hit_tpar_x
track parameter locX
double * m_hit_derivy_roty
derivatives of Y-residual wrt.
virtual StatusCode finalize() override
virtual StatusCode fillNtuple() override
double * m_hit_derivx_transx
derivatives of X-residual wrt.
double * m_hit_phi
phi angle of hit (hit_phi in ntuple)
virtual void fillSummary() override
double * m_hit_derivx_rotx
derivatives of X-residual wrt.
int m_nhitssct
number of SCT hits on track (nscthits in ntuple)
double * m_hit_derivx_bowz
derivatives of X-residual wrt.
int m_ndof
number of degrees of freedom of the track fit (ndof in ntuple)
double * m_hit_derivy_bowx
derivatives of Y-residual wrt.
double * m_hit_derivx_transz
derivatives of X-residual wrt.
double * m_hit_derivy_rotz
derivatives of Y-residual wrt.
double * m_hit_derivx_bowx
derivatives of X-residual wrt.
double * m_hit_drd
drift distance to wire for hit (hit_drd in ntuple)
int m_nhpix
number of Pixel holes on track (nhpix in ntuple)
double * m_hit_resy
Y-residual of the hit.
double * m_hit_resy_err
Y-residual error of the hit.
double * m_hit_derivx_roty
derivatives of X-residual wrt.
virtual StatusCode initialize() override
virtual void fillHitmap() override
double * m_hit_rho
radius of hit (hit_rho in ntuple)
double m_pt
pt perigee parameter of reconstructed track (pt in ntuple)
virtual void showStatistics() override
double * m_hit_resx_err
X-residual error of the hit.
Gaudi::Property< int > m_max_hits
max number of hits on track stored in ntuple
PublicToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignmModuleTool.
double * m_hit_derivx_transy
derivatives of X-residual wrt.
double * m_hit_yloc
local y coord of hit (hit_yloc in ntuple)
double * m_hit_cotth
cot(theta) of hit (hit_cotth in ntuple)
double m_phi0
phi perigee parameter of reconstructed track (phi0 in ntuple)
double * m_hit_derivx_rotz
derivatives of X-residual wrt.
double m_yvtx
y coord of track perigee (yvtx in ntuple)
double * m_hit_xloc
local x coord of hit (hit_xloc in ntuple)
double * m_hit_z
z coord of hit (hit_z in ntuple)
Gaudi::Property< bool > m_storeDerivatives
double m_theta
theta perigee parameter of reconstructed track (theta in ntuple)
double * m_hit_derivy_transx
derivatives of Y-residual wrt.
double * m_hit_eta
eta angle of hit (hit_eta in ntuple)
double * m_hit_sig
hit error (hit_sig in ntuple)
int m_nhitspix
number of Pixel hits on track (ntrthits in ntuple)
double m_chi2prob
Chi2 probability of the track fit (chi2prob in ntuple).
double m_zvtx
z coord of track perigee (zvtx in ntuple)
int m_nshpix
number of shared Pixel hits on track (nshpix in ntuple)
double m_z0
z0 perigee parameter of reconstructed track (z0 in ntuple)
double * m_hit_derivy_bowz
derivatives of Y-residual wrt.
double m_chi2
Chi2 of the track fit (chi2 in ntuple).
void fillHits(const Trk::AlignTrack *alignTrack)
fills hit information to ntuple
double m_xvtx
x coord of track perigee (xvtx in ntuple)
double * m_hit_derivx_bowy
derivatives of X-residual wrt.
int m_nhsct
number of SCT holes on track (nhsct in ntuple)
int m_nshared
number of shared hits on track (nshared in ntuple)
int m_nhits
number of hits on track [including scattering centers] (nhits in ntuple)
virtual void dumpTrack(const EventContext &ctx, int itrk, const Trk::AlignTrack *alignTrack) override
fills track information to ntuple
double * m_hit_derivy_transy
derivatives of Y-residual wrt.
int m_nshsct
number of shared SCT hits on track (nshsct in ntuple)
double * m_hit_resx
X-residual of the hit.
int m_nholes
number of holes on track (nholes in ntuple)
double * m_hit_derivy_bowy
derivatives of Y-residual wrt.
double * m_hit_zloc
local z coord of hit (hit_zloc in ntuple)
double m_qoverp
Q over p perigee parameter of reconstructed track (qoverp in ntuple).
double m_d0
d0 perigee parameter of reconstructed track (d0 in ntuple)
double * m_hit_derivy_transz
derivatives of Y-residual wrt.
TransformParameters
enum to keep track of transformation coordinates
Definition AlignModule.h:55
const RIO_OnTrack * rio() const
returns RIO_OnTrack or leading RIO of CompetingRIOsOnTrack (assigned by c'tor)
const TrackParameters * unbiasedTrackPars() const
returns pointer to unbiased track parameters if present
Definition AlignTSOS.h:134
const std::vector< Amg::VectorX > * derivatives() const
returns pointer to vector of derivatives
Definition AlignTSOS.h:140
int nResDim() const
returns number of measurement residual + scatterer residual dimensions
Definition AlignTSOS.h:77
std::vector< Residual >::const_iterator firstResidual() const
returns first Residual iterator
Definition AlignTSOS.h:104
const AlignModule * module() const
accessor method for AlignModule to which tsos belongs
Definition AlignTSOS.h:69
std::string dumpMeasType() const
returns string corresponding to the measurement type
TrackState::MeasurementType measType() const
returns measurement type enum
Definition AlignTSOS.h:80
const AlignTSOSCollection * alignTSOSCollection() const
returns collection of alignTSOS
Definition AlignTrack.h:267
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition FitQuality.h:97
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
bool contains(ParamDefs par) const
The simple check for the clients whether the parameter is contained.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
Identifier identify() const
return the identifier -extends MeasurementBase
virtual const Amg::Vector3D & globalPosition() const override=0
Interface method to get the global Position.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
const Perigee * perigeeParameters() const
return Perigee.
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
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 ...
Eigen::Matrix< double, 3, 1 > Vector3D
Primary Vertex Finder.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
DataVector< AlignTSOS > AlignTSOSCollection
Definition AlignTrack.h:37
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
@ phi0
Definition ParamDefs.h:65
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ locZ
local cylindrical
Definition ParamDefs.h:42
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
ParametersBase< TrackParametersDim, Charged > TrackParameters
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].