ATLAS Offline Software
TrigTrackSelector.cxx
Go to the documentation of this file.
1 
13 
15 
16 #include <stdexcept>
17 
21 const double TrigTrackSelector::s_default_radius = 47;
22 
23 
24 TrigTrackSelector::TrigTrackSelector( TrackFilter* selector, double radius, int selectPdgId, int selectParentPdgId ) :
25  TrackSelector(selector), m_id(0), m_xBeam(0), m_yBeam(0), m_zBeam(0),
26  m_correctTrkTracks(false),
27  m_radius(radius), m_selectPdgId(selectPdgId), m_selectParentPdgId(selectParentPdgId) {
28 }
29 
30 
31 
38 
40  if ( p==nullptr ) return nullptr;
41  if ( MC::isElectron(p) || MC::isMuon(p) ) return nullptr; //don't want light leptons from eg tau decays - they are found directly
42  if ( p->absPdgId()==pdg_id ) {
43  return p; // recursive stopping conditions
44  }
45  auto vertex = p->prodVtx();
46  if ( vertex == nullptr ) {
47  return nullptr; // has no production vertex !!!
48  }
49  if ( vertex->nIncomingParticles() < 1 ) {
50  return nullptr; // recursive stopping conditions
51  }
52  for( unsigned ip = 0; ip < vertex->nIncomingParticles(); ip++ ) {
53  auto* in = vertex->incomingParticle(ip);
54  auto parent = fromAncestor( pdg_id, in);
55  if ( parent!=nullptr ) {
56  if (parent->absPdgId()==pdg_id) return parent;
57  }
58  }
59 
60  return nullptr;
61 }
62 
63 
72 
73 const xAOD::TruthParticle* TrigTrackSelector::fromAncestor( const std::vector<int>& ids, const xAOD::TruthParticle *p ) const {
74  if ( p==nullptr ) return nullptr;
75  if (MC::isElectron(p) || MC::isMuon(p)) return nullptr; //don't want light leptons from eg tau decays - they are found directly
76  for ( size_t i=ids.size() ; i-- ; ) {
77  if ( p->absPdgId()==ids[i] ) return p; // recursive stopping conditions
78  }
79 
80  auto vertex = p->prodVtx();
81  if ( vertex == nullptr ) return nullptr; // has no production vertex !!!
82 
83  if ( vertex->nIncomingParticles()<1 ) return nullptr; // recursive stopping conditions
84 
85  for( unsigned ip = 0; ip < vertex->nIncomingParticles(); ip++ ) {
86  auto* in = vertex->incomingParticle(ip);
87  auto parent = fromAncestor( ids, in);
88  if ( parent!=nullptr ) {
89  for ( size_t i=ids.size() ; i-- ; ) {
90  if ( parent->absPdgId()==ids[i] ) return parent;
91  }
92  }
93  }
94 
95  return nullptr;
96 }
97 
98 
99 
106 
107 // const xAOD::TruthParticle* TrigTrackSelector::fromAncestor(const int pdg_id, const xAOD::TruthParticle *p) const {
108 // return fromAncestor( std::vector<int>(1,pdg_id), p );
109 // }
110 
111 
112 
113 
114 
115 
117  // do the track extraction stuff here....
118  if ( track ) {
119 
120  double eta = track->param()->eta();
121  double phi = track->param()->phi0();
122  double z0 = track->param()->z0();
123  double pT = track->param()->pT();
124  double d0 = track->param()->a0();
125 
126  double deta = track->param()->eeta();
127  double dphi = track->param()->ephi0();
128  double dz0 = track->param()->ez0();
129  double dpT = track->param()->epT();
130  double dd0 = track->param()->ea0();
131 
132  double theta = 2*std::atan( exp( (-1)*eta ) );
133  correctToBeamline( z0, dz0, d0, dd0, theta, phi );
134 
135  int algoid = track->algorithmId();
136 
137  int nBlayerHits = (track->HitPattern() & 0x1);
138  int nPixelHits = 2 * track->NPixelSpacePoints(); // NB: for comparison with offline
139  int nSctHits = 2 * track->NSCT_SpacePoints(); // a spacepoint is 2 "hits"
140  int nStrawHits = track->NStrawHits();
141  int nTrHits = track->NTRHits();
142 
143  int nSiHits = nPixelHits + nSctHits;
144 
145  bool expectBL = false; //not filled in
146 
147  unsigned long id = (unsigned long)track;
148 
149  unsigned hitPattern = track->HitPattern();
150  unsigned multiPattern = 0;
151 
152  double chi2 = track->chi2();
153  double dof = 0;
154 
155  bool truth = false;
156  int match_barcode = -1;
157 
158  if ( truthMap ) {
159  const TrigInDetTrackTruth* trackTruth = truthMap->truth(track);
160  if (trackTruth!=0 && trackTruth->nrMatches() > 0) {
161  match_barcode = HepMC::barcode(trackTruth->bestSiMatch()); // FIXME barcode-based
162  truth = true;
163  }
164  }
165 
166 
167  TIDA::Track* t = new TIDA::Track( eta, phi, z0, d0, pT, chi2, dof,
168  deta, dphi, dz0, dd0, dpT,
169  nBlayerHits, nPixelHits, nSctHits, nSiHits,
170  nStrawHits, nTrHits,
171  hitPattern, multiPattern,
172  algoid, truth, -1, match_barcode,
173  expectBL, id) ;
174 
175  // std::cout << "SUTT ID track " << *t << "\t0x" << std::hex << track->HitPattern() << std::dec << std::endl;
176 
177  if ( !addTrack( t ) ){
178  delete t;
179  return false;
180  }
181  return true;
182  }
183  return false;
184 }
185 
186 
187 // extract all the tracks from a TrigInDetTrack collection and associated TruthMap and convert them
189  // do the track extraction stuff here....
190  TrigInDetTrackCollection::const_iterator trackitr = trigtracks->begin();
191  TrigInDetTrackCollection::const_iterator trackend = trigtracks->end();
192  while ( trackitr!=trackend ) {
193  selectTrack( *trackitr, truthMap );
194  ++trackitr;
195  }
196 }
197 
198 
199 // add a TrackParticle
201 
202  // do the track extraction stuff here....
203 
204  static const int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
205 
206  if ( track ) {
207 
208 #ifdef TRKPARAMETERS_MEASUREDPERIGEE_H
209  const Trk::MeasuredPerigee* measPer = track->measuredPerigee();
210 #else
211  const Trk::Perigee* measPer = track->measuredPerigee();
212 #endif
213  // CLHEP::HepVector perigeeParams = measPer->parameters();
214 
215  double pT = measPer->pT();
216  double eta = measPer->eta();
217  double phi = measPer->parameters()[Trk::phi0];
218  double z0 = measPer->parameters()[Trk::z0] + m_zBeam;
219  double d0 = measPer->parameters()[Trk::d0];
220 
221  double theta = measPer->parameters()[Trk::theta];
222  double p = 1/measPer->parameters()[Trk::qOverP];
223 
224  // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! )
225  if ( measPer->parameters()[Trk::qOverP]<0 && pT>0 ) pT *= -1;
226 
227 #ifdef TRKPARAMETERS_MEASUREDPERIGEE_H
228  const Trk::ErrorMatrix err = measPer->localErrorMatrix();
229  double dtheta = err.error(Trk::theta);
230  double dqovp = err.error(Trk::qOverP);
231  double covthetaOvP = err.covValue(Trk::qOverP,Trk::theta);
232 #else
233  double dtheta = std::sqrt((*measPer->covariance())(Trk::theta,Trk::theta));
234  double dqovp = std::sqrt((*measPer->covariance())(Trk::qOverP,Trk::qOverP));
235  double covthetaOvP = (*measPer->covariance())(Trk::qOverP,Trk::theta);
236 #endif
237 
238 
239  double deta = 0.5*dtheta/(std::cos(0.5*theta)*std::cos(0.5*theta)*std::tan(0.5*theta));
240 
241 #ifdef TRKPARAMETERS_MEASUREDPERIGEE_H
242  double dphi = err.error(Trk::phi0);
243  double dz0 = err.error(Trk::z0);
244  double dd0 = err.error(Trk::d0);
245 #else
246  double dphi = std::sqrt((*measPer->covariance())(Trk::phi0,Trk::phi0));
247  double dz0 = std::sqrt((*measPer->covariance())(Trk::z0,Trk::z0));
248  double dd0 = std::sqrt((*measPer->covariance())(Trk::d0,Trk::d0));
249 #endif
250 
251  double dpT = 0;
252 
253 
254  double sintheta = std::sin(theta);
255  double costheta = std::cos(theta);
256  double dpt2 = (p*p*sintheta)*(p*p*sintheta)*dqovp*dqovp + (p*costheta)*(p*costheta)*dtheta*dtheta - 2*(p*p*sintheta)*(p*costheta)*covthetaOvP;
257 
258  if ( dpt2>0 ) dpT = std::sqrt( dpt2 );
259 
260  // Check number of hits
261  // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really
262  // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersecting
263  // stereo clusters making a spacepoint are two "hits"
264  const Trk::TrackSummary *summary = track->trackSummary();
265  int nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits);
267  int nSctHits = summary->get(Trk::numberOfSCTHits);
268  int nStrawHits = summary->get(Trk::numberOfTRTHits);
269  int nTrHits = summary->get(Trk::numberOfTRTHighThresholdHits);
270 
271  int nSiHits = nPixelHits + nSctHits;
272  bool expectBL = false; // Not stored for Rec::TrackParticle
273 
274  const Trk::FitQuality *quality = track->fitQuality();
275  double chi2 = quality->chiSquared();
276  double dof = quality->numberDoF();
277 
278  unsigned bitmap = 0;
279 
280 
281  unsigned long id = (unsigned long)track;
282 
283  for ( int ih=0 ; ih<20 ; ih++ ) {
284  if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] );
285  }
286 
289 
290  // std::cout << "fetching author info :" << track->info().trackFitter() << ":"
291  // << track->info().dumpInfo() << ": bm 0x" << std::hex << bitmap << std::dec << std::endl;
292 
293  int fitter = track->info().trackFitter();
294  std::string dumpinfo = track->info().dumpInfo();
295 
296  int trackAuthor = -1;
298  if ( dumpinfo.find("TRTStandalone")!=std::string::npos) trackAuthor = 2;
299  else if ( dumpinfo.find("TRTSeededTrackFinder")!=std::string::npos) trackAuthor = 1;
300  else trackAuthor = 0;
301  }
302 
303 #if 0
304  std::cout << "\t\t\tSUTT TP track"
305  << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta()
306  << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi()
307  << "\tz0=" << z0
308  << "\tpT=" << pT // << "\t( " << 1/qoverp << ")"
309  << "\td0=" << d0
310  << "\tNsi=" << nSiHits
311  << "\tNtrt=" << nTrHits
312  << "\tNstr=" << nStrawHits
313  << "\tauthor=" << trackAuthor
314  << std::endl;
315 #endif
316 
317  // Create and save Track
318 
319  TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, dof,
320  deta, dphi, dz0, dd0, dpT,
321  nBlayerHits, nPixelHits, nSctHits, nSiHits,
322  nStrawHits, nTrHits, bitmap, 0,
323  trackAuthor, false, -1, -1,
324  expectBL, id) ;
325 
326  // std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl;
327 
328  if ( !addTrack( t ) ){
329  delete t;
330  return false;
331  }
332  return true;
333 
334  }
335  return false;
336 }
337 
338 
339 // extract all the tracks from a TrackParticle collection and add them
341 
342  // std::cout << "\t\t\tSUTT \tTrackParticleContainer->size() = " << trigtracks->size() << std::endl;
343 
344  Rec::TrackParticleContainer::const_iterator trackitr = trigtracks->begin();
345  Rec::TrackParticleContainer::const_iterator trackend = trigtracks->end();
346 
347  while ( trackitr!=trackend ) {
348 
349  selectTrack( *trackitr );
350 
351  ++trackitr;
352 
353  } // loop over tracks
354 
355 }
356 
357 
358 
359 // extract all the tracks from a TruthParticle collection and add them
361  // std::cout << "\t\t\tSUTT \tTrackParticleContainer->size() = " << trigtracks->size() << std::endl;
362 
363  TruthParticleContainer::const_iterator trackitr = truthtracks->begin();
364  TruthParticleContainer::const_iterator trackend = truthtracks->end();
365 
366  while ( trackitr!=trackend ) {
367 
368  selectTrack( *trackitr );
369 
370  ++trackitr;
371 
372  } // loop over tracks
373 
374 }
375 
376 
380 
381 void TrigTrackSelector::truthBeamline( const xAOD::TruthParticleContainer* truthtracks, double& x0, double& y0 ) {
382 
383  x0 = 0;
384  y0 = 0;
385 
387 
388  int Nx = 300;
389  int Ny = 300;
390 
392  std::vector<double> xpos(Nx,0);
393  std::vector<double> ypos(Ny,0);
394 
396  std::vector<int> xn(Nx,0);
397  std::vector<int> yn(Ny,0);
398 
399  int xoffset = Nx/2;;
400  int yoffset = Ny/2;
401 
402  double deltax = 3.0/Nx;
403  double deltay = 3.0/Ny;
404 
406 
407  xAOD::TruthParticleContainer::const_iterator trackitr = truthtracks->begin();
408  xAOD::TruthParticleContainer::const_iterator trackend = truthtracks->end();
409 
410  for ( ; trackitr!=trackend ; ++trackitr ) {
411 
412  const xAOD::TruthParticle* track = (*trackitr);
413 
414  if ( !MC::isStable(track) || !track->hasProdVtx() ) continue;
415 
417 
418  double xp[3] = { track->prodVtx()->x(), track->prodVtx()->y(), track->prodVtx()->z() };
419 
421 
422  int ix = xp[0]/deltax + xoffset;
423  int iy = xp[1]/deltay + yoffset;
424 
425  if ( ix<0 || ix>=Nx || iy<0 || iy>=Nx ) continue;
426 
427  xpos[ix] += xp[0];
428  ypos[iy] += xp[1];
429 
430  xn[ix]++;
431  yn[iy]++;
432 
433  } // loop over tracks
434 
436 
437  int imx = 0;
438  int imy = 0;
439 
440  for ( size_t i=0 ; i<xpos.size() ; i++ ) {
441  if ( xn[i]>xn[imx] ) imx = i;
442  if ( yn[i]>yn[imy] ) imy = i;
443  }
444 
448  if ( xn[imx]>1 ) x0 = xpos[imx]/xn[imx];
449  if ( yn[imy]>1 ) y0 = ypos[imy]/yn[imy];
450 
451 }
452 
453 
454 // extract all the tracks from a xAOD::TruthParticle collection and add them
456 
457  xAOD::TruthParticleContainer::const_iterator trackitr = truthtracks->begin();
458  xAOD::TruthParticleContainer::const_iterator trackend = truthtracks->end();
459 
461  double x0 = 0;
462  double y0 = 0;
463 
464  truthBeamline( truthtracks, x0, y0 );
465 
466 
467  for ( ; trackitr!=trackend; ++trackitr) {
468 
469 
470  // Only select charged final state particles
471  double q = (*trackitr)->charge();
472 
474  static const particleType ptype;
475  if ( q==-999 ) q = ptype.charge( (*trackitr)->pdgId() );
476 
477  if (q == 0 || !MC::isStable(*trackitr) ) continue;
478 
479  // If looking for tau parents, don't select mu or e children
480 
481  // select based on the pdg of final state particle
482  bool gotPdgId = true;
483  if (m_selectPdgId!=0) gotPdgId = (*trackitr)->absPdgId()==m_selectPdgId;
484 
485  // select based on the pdg of the parent or ancestor
486  bool gotParentPdgId = true;
487  if ( gotPdgId && m_selectParentPdgId!=0 ) gotParentPdgId = fromAncestor(m_selectParentPdgId, (*trackitr))!=nullptr;
490 
491  if ( gotParentPdgId && gotPdgId ) selectTrack( *trackitr, x0, y0);
492 
493  } // loop over tracks
494 
495 }
496 
497 
498 
499 // add a TruthParticle from a GenParticle - easy, bet it doesn't work
501 
503  if ( !MC::isStable(track) ) return false;
504 
506 //AV Using memory to get some value is not a good idea. This is not a repruducible/portable way, but I leave it as is.
507 #ifdef HEPMC3
508  m_id = (unsigned long)(track.get());
509 #else
510  m_id = (unsigned long)track;
511 #endif
512  bool sel;
514  m_id = 0;
515 
516  return sel;
517 
518 }
519 
520 
521 // add a TruthParticle
523 
524  return selectTrack( &track );
525 
526 }
527 
528 
529 // add a TruthParticle
532  if ( t == 0 ) return false;
533  if ( !addTrack(t) ) {
534  delete t;
535  return false;
536  }
537  return true;
538 }
539 
540 
541 
542 
543 // add an xAOD::TruthParticle
544 bool TrigTrackSelector::selectTrack( const xAOD::TruthParticle* track, double x0, double y0) {
545  if ( track ) {
546 
547  if (!MC::isStable(track) ) return false;
548 
550  const xAOD::TruthParticle* measPer = track;
551 
552  double pT = measPer->pt();
553  double eta = measPer->eta();
554  double phi = measPer->phi();
555 
556  // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! )
557  if ( measPer->charge()<0 && pT>0 ) pT *= -1;
558  double q = track->charge();
559 
560  static const particleType ptype;
561 
563  if ( q==-999 ) q = ptype.charge( track->pdgId() );
564 
566  if ( q==0 ) return 0;
567 
571  // double xbeam = getBeamX(); // track->vx();
572  // double ybeam = getBeamY(); // track->vy();
573  // double zbeam = getBeamZ(); // track->vz();
574 
575  if ( !track->hasProdVtx() ) return false;
576 
578 
579  double xp[3] = { measPer->prodVtx()->x(), measPer->prodVtx()->y(), measPer->prodVtx()->z() };
580  double xb[3] = { xp[0]-x0, xp[1]-y0, measPer->prodVtx()->z() };
581  double xd[3] = { 0, 0, 0 };
582 
583  if ( track->hasDecayVtx() ) {
584  xd[0] = track->decayVtx()->x();
585  xd[1] = track->decayVtx()->y();
586  xd[2] = track->decayVtx()->z();
587  }
588 
589  double rp = std::sqrt( xp[0]*xp[0] + xp[1]*xp[1] );
590  double rd = std::sqrt( xd[0]*xd[0] + xd[1]*xd[1] );
591 
594  double theta = 2*std::atan( std::exp( -eta ) );
595  double z0 = xb[2] - (xb[0]*std::cos(phi) + xb[1]*std::sin(phi))/std::tan(theta);
596  double d0 = xb[1]*std::cos(phi) - xb[0]*std::sin(phi);
597 
598  bool final_state = false;
599 
611  const double inner_radius = m_radius;
612  const double outer_radius = m_radius;
613 
614  if ( ( track->hasProdVtx() && rp<=inner_radius ) &&
615  ( !track->hasDecayVtx() || rd>outer_radius ) ) final_state = true;
616 
617  if ( !final_state ) return false;
618 
619  double deta = 0;
620  double dphi = 0;
621  double dz0 = 0;
622  double dd0 = 0;
623 
624  double dpT = 0;
625 
626  int nBlayerHits = 0;
627  int nPixelHits = 0;
628  int nSctHits = 0;
629  int nStrawHits = 0;
630  int nTrtHits = 0;
631 
632  double chi2 = 0;
633  double dof = 0;
634 
635  bool expectBL = false;
636 
637  nSctHits += 0;
638  nPixelHits += 0;
639 
641  int nSiHits = 0;
642 
643  unsigned long id = (unsigned long)track;
644 
645  unsigned bitmap = 0;
646 
647  int trackAuthor = track->pdgId();
648  int barcode = HepMC::barcode(track); // FIXME barcode-based
649 
650 #if 0
651  std::cout << "\t\t\tSUTT TP track"
652  << "\teta=" << eta
653  << "\tphi=" << phi
654  << "\tz0=" << z0
655  << "\tpT=" << pT
656  << "\td0=" << d0
657  << "\tauthor=" << trackAuthor
658  << "\tVTX x " << xp[0]<< "\ty " << xp[1] << "\tz " << xp[2]
659  << std::endl;
660 #endif
661 
662  // Create and save Track
663 
664  TIDA::Track* t = new TIDA::Track( eta, phi, z0, d0, pT, chi2, dof,
665  deta, dphi, dz0, dd0, dpT,
666  nBlayerHits, nPixelHits, nSctHits, nSiHits,
667  nStrawHits, nTrtHits, bitmap, 0,
668  trackAuthor, false, barcode, -1,
669  expectBL, id) ;
670 
672  // std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl;
673 
674  // addTrack applies additional cuts using the Filter
675  if ( !addTrack( t ) ){
676  delete t;
677  return false;
678  }
679  }
680  return false;
681 
682 }
683 
684 
685 
686 
687 // make a TIDA::Track from a GenParticle
689 //AV Using memory to get some value is not a good idea. This is not a repruducible/portable way, but I leave it as is.
690 #ifdef HEPMC3
691  unsigned long id = (unsigned long)(track.get());
692 #else
693  unsigned long id = (unsigned long)track;
694 #endif
696  return makeTrack( &t, id );
697 }
698 
699 // make a TIDA::Track from a TruthParticle
701 
702  if ( track==0 ) return 0;
703  if ( !MC::isStable(track)) return 0;
704 
705 
706  double phi = track->phi();
707  double eta = track->eta();
708 
712  double xp[3] = { 0, 0, 0 };
713 
714  if ( track->genParticle()->production_vertex() ) {
715  xp[0] = track->genParticle()->production_vertex()->position().x();
716  xp[1] = track->genParticle()->production_vertex()->position().y();
717  xp[2] = track->genParticle()->production_vertex()->position().z();
718  }
719 
720  // CHANGED BY JK - z0 with respect to (0,0)
721  // double z0 = xp[2];
722  double theta = 2*std::atan( exp( (-1)*eta ) );
723  double z0 = xp[2] - (xp[0]*std::cos(phi) + xp[1]*std::sin(phi))/std::tan(theta);
724 
725  double xd[3] = { 0, 0, 0 };
726 
727  if ( track->genParticle()->end_vertex() ) {
728  xd[0] = track->genParticle()->end_vertex()->position().x();
729  xd[1] = track->genParticle()->end_vertex()->position().y();
730  xd[2] = track->genParticle()->end_vertex()->position().z();
731  }
732 
733  double rp = std::sqrt( xp[0]*xp[0] + xp[1]*xp[1] );
734  double rd = std::sqrt( xd[0]*xd[0] + xd[1]*xd[1] );
735 
736 
737  bool final_state = false;
738 
750  const double inner_radius = m_radius;
751  const double outer_radius = m_radius;
752  if ( ( track->genParticle()->production_vertex() && rp<=inner_radius ) &&
753  ( track->genParticle()->end_vertex()==0 || rd>outer_radius ) ) final_state = true;
754 
755 
756  if ( !final_state ) return 0;
757 
768 
769  double q = track->charge();
770 
771  static const particleType ptype;
772 
774  if ( q==-999 ) q = ptype.charge( track->pdgId() );
775 
777  if ( q==0 ) return 0;
778 
779  double pT = q*track->pt();
780 
781 
782  double d0 = 0;
783 
788 
790 
791 
792  // CHANGED BY JK - d0 with respect to (0,0)
793  // d0 = q*rp*std::sin(phi);
794  d0 = xp[1]*std::cos(phi) - xp[0]*std::sin(phi);
795 
796 
798 
799  double dz0 = 0;
800  double dd0 = 0;
801 
802  correctToBeamline( z0, dz0, d0, dd0, theta, phi );
803 
804 
805 
807 
821 
823  int author = track->pdgId();
824  int barcode = HepMC::barcode(track);
825 
826 
827  unsigned long id = (unsigned long)track;
828  if ( tid!=0 ) id = tid;
829 
833 
834 
836 
837  // std::cout << "\t\t\tSUTT Truth track"
838  // << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta()
839  // << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi()
840  // << "\tz0=" << z0
841  // << "\tpT=" << pT // << "\t( " << 1/qoverp << ")"
842  // << "\td0=" << d0
843  // << "\tauthor=" << author
844  // << std::endl;
845 
846 
847 
848  TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, 0, 0,
849  0, 0, 0, 0, 0,
850  0, 0, 0, 0,
851  0, 0, 0, 0,
852  author, false, barcode, -1,
853  false,
854  id ) ;
855 
856  return t;
857 
858 }
859 
860 
861 
862 // add a Trk::Track
864 
865  // do the track extraction stuff here....
866 
867  static const int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
868  // std::cout << __FILE__<< " " <<__LINE__<<std::endl;
869 
870  if ( track ) {
871 
872  // const Trk::Perigee* startPerigee = track->perigeeParameters();
873 
874 #ifdef TRKPARAMETERS_MEASUREDPERIGEE_H
875  const Trk::MeasuredPerigee* startPerigee = dynamic_cast<const Trk::MeasuredPerigee*>(track->perigeeParameters());
876  // const Trk::MeasuredPerigee* measPer = startPerigee; // just out of laziness
877 #else
878  const Trk::Perigee* startPerigee = track->perigeeParameters();
879  const Trk::Perigee* measPer = startPerigee; // just out of laziness
880 #endif
881 
882 
883  // CLHEP::HepVector perigeeParams = measPer->parameters();
884  // double pT = measPer->pT();
885  // double eta = measPer->eta();
886  // double phi = perigeeParams[Trk::phi0];
887  // double z0 = perigeeParams[Trk::z0];
888  // double d0 = perigeeParams[Trk::d0];
889  // // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! )
890  // if ( perigeeParams[Trk::qOverP]<0 ) pT *= -1;
891  // std::cout <<pT1<<" pt1vspT "<<pT<<std::endl;
892 
893  if (startPerigee){
894 
895  double theta = startPerigee->parameters()[Trk::theta];
896  double p = 1/startPerigee->parameters()[Trk::qOverP];
897  double qOverPt = startPerigee->parameters()[Trk::qOverP]/std::sin(theta);
898  double charge = startPerigee->charge();
899  double eta = startPerigee->eta();
900  double phi = startPerigee->parameters()[Trk::phi0];
901  double z0 = startPerigee->parameters()[Trk::z0];
902  double d0 = startPerigee->parameters()[Trk::d0];
903  // double pT = (1./qOverPt)*(charge);
904  double pT = (1./qOverPt); // always use signed PT
905 
906  if ( charge<0 && pT>0 ) pT *= -1;
907  if ( charge<0 && p>0 ) p *= -1;
908 
909 
910 
911 #ifdef TRKPARAMETERS_MEASUREDPERIGEE_H
912  const Trk::ErrorMatrix err = startPerigee->localErrorMatrix();
913  double dtheta = err.error(Trk::theta);
914  double dqovp = err.error(Trk::qOverP);
915  double covthetaOvP = err.covValue(Trk::qOverP,Trk::theta);
916 
917  double dphi = err.error(Trk::phi0);
918  double dz0 = err.error(Trk::z0);
919  double dd0 = err.error(Trk::d0);
920 #else
921  double dtheta = std::sqrt((*measPer->covariance())(Trk::theta,Trk::theta));
922  double dqovp = std::sqrt((*measPer->covariance())(Trk::qOverP,Trk::qOverP));
923  double covthetaOvP = (*measPer->covariance())(Trk::qOverP,Trk::theta);
924 
925  double dphi = std::sqrt((*measPer->covariance())(Trk::phi0,Trk::phi0));
926  double dz0 = std::sqrt((*measPer->covariance())(Trk::z0,Trk::z0));
927  double dd0 = std::sqrt((*measPer->covariance())(Trk::d0,Trk::d0));
928 #endif
929 
930  double deta = 0.5*dtheta/(std::cos(0.5*theta)*std::cos(0.5*theta)*std::tan(0.5*theta));
931 
932 
933  if ( m_correctTrkTracks ) correctToBeamline( z0, dz0, d0, dd0, theta, phi );
934 
935  double dpT = 0;
936 
937 
938  double sintheta = std::sin(theta);
939  double costheta = std::cos(theta);
940  double dpT2 = (p*p*sintheta)*(p*p*sintheta)*dqovp*dqovp + (p*costheta)*(p*costheta)*dtheta*dtheta - 2*(p*p*sintheta)*(p*costheta)*covthetaOvP;
941 
942  if ( dpT2>0 ) dpT = std::sqrt( dpT2 );
943 
944  // Check number of hits
945  // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really
946  // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
947  // stereo clusters making a spacepoint are two "hits"
948  // const Trk::TrackSummary *summary = dynamic_cast<const Trk::TrackSummary*>(track->trackSummary());
949  //ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool;
950  //m_trackSumTool = ToolHandle<Trk::ITrackSummaryTool>("Trk::TrackSummaryTool/InDetTrackSummaryTool");
951  //const Trk::TrackSummary* summary = NULL;
952  //summary = m_trackSumTool->createSummary(*track);
953 
954  const Trk::TrackSummary * summary = track->trackSummary();
955  int nBlayerHits = 0;
956  int nPixelHits = 0;
957  int nSctHits = 0;
958  int nStrawHits = 0;
959  int nTrHits = 0;
960  int nSiHits = 0;
961  bool expectBL = false; // Not stored for Trk::Track
962  unsigned bitmap = 0;
963 
964  if(summary==0){
965  std::cerr << "Could not create TrackSummary - Track will likely fail hits requirements" << std::endl;
966  }
967  else{
968  nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits);
970  nSctHits = summary->get(Trk::numberOfSCTHits);
971  nStrawHits = summary->get(Trk::numberOfTRTHits);
973  nSiHits = nPixelHits + nSctHits;
974 
975  for ( int ih=0 ; ih<20 ; ih++ ) {
976  if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] );
977  }
978  }
979 
980  unsigned long id = (unsigned long)track;
981  double chi2 = 0;
982  double dof = 0;
983  //const Trk::FitQuality *quality = dynamic_cast<const Trk::FitQuality*>(track->fitQuality());
984  const Trk::FitQuality *quality = (track->fitQuality());
985  if(quality==0) std::cerr << "Could not create FitQuality - Track will likely fail hits requirements" << std::endl;
986  else{
987  chi2 = quality->chiSquared();
988  dof = quality->numberDoF();
989  }
990 
991  int trackAuthor = -1;
992 
995 
996  // std::cout << "fetching author info :" << track->info().trackFitter() << ":"
997  // << track->info().dumpInfo() << ": bm 0x" << std::hex << bitmap << std::dec << std::endl;
998 
999  int fitter = track->info().trackFitter();
1000  // std::string dumpinfo = track->info().dumpInfo();
1001 
1003  if ((track->info().dumpInfo()).find("TRTStandalone") != std::string::npos) trackAuthor = 2;
1004  else if ((track->info().dumpInfo()).find("TRTSeededTrackFinder") != std::string::npos) trackAuthor = 1;
1005  else trackAuthor = 0;
1006  }
1007 
1008  #if 0
1009  std::cout << "\t\t\tSUTT TP track"
1010  << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta()
1011  << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi()
1012  << "\tz0=" << z0
1013  << "\tpT=" << pT // << "\t( " << 1/qoverp << ")"
1014  << "\td0=" << d0
1015  << "\tNsi=" << nSiHits
1016  << "\tNtrt=" << nTrHits
1017  << "\tNstr=" << nStrawHits
1018  << "\tauthor=" << trackAuthor
1019  << std::endl;
1020  #endif
1021  // Create and save Track
1022  TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, dof,
1023  deta, dphi, dz0, dd0, dpT,
1024  nBlayerHits, nPixelHits, nSctHits, nSiHits,
1025  nStrawHits, nTrHits, bitmap, 0,
1026  trackAuthor, false, -1, -1,
1027  expectBL, id) ;
1028 
1029  if ( !addTrack( t ) ){
1030  delete t;
1031  return false;
1032  }
1033  return true;
1034 
1035  //std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl;
1036  }
1037  }
1038 
1039  return false;
1040 }
1041 
1042 // extract all the tracks from a TrackCollection and add them
1044 
1045  // std::cout << "\t\t\tSUTT \tTrackContainer->size() = " << trigtracks->size() << std::endl;
1046 
1047  TrackCollection::const_iterator trackitr = trigtracks->begin();
1048  TrackCollection::const_iterator trackend = trigtracks->end();
1049 
1050  while ( trackitr!=trackend ) {
1051  selectTrack( *trackitr );
1052  ++trackitr;
1053  } // loop over tracks
1054 
1055 }
1056 
1057 
1058 
1060  // do the track extraction stuff here....
1061 
1062  // static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
1063 
1064  if ( track ) {
1065 
1067  const xAOD::TrackParticle* measPer = track;
1068 
1069  // CLHEP::HepVector perigeeParams = measPer->parameters();
1070 
1071  double pT = measPer->pt();
1072  double eta = measPer->eta();
1073  double phi = measPer->phi0();
1074  double z0 = measPer->z0() + measPer->vz();
1075  double d0 = measPer->d0();
1076 
1077  double theta = measPer->theta();
1078 
1083  // if ( measPer->qOverP()==0 ) return false;
1084  if ( measPer->qOverP()==0 ) throw std::runtime_error( "probable corrupted track - this should never happen" );
1085  double p = 1/measPer->qOverP();
1086 
1087  // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! )
1088  if ( measPer->qOverP()<0 && pT>0 ) pT *= -1;
1089 
1090  double dtheta = std::sqrt(measPer->definingParametersCovMatrix()(Trk::theta,Trk::theta));
1091  double dqovp = std::sqrt(measPer->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP));
1092  double covthetaOvP = measPer->definingParametersCovMatrix()(Trk::qOverP,Trk::theta);
1093 
1094  double deta = 0.5*dtheta/(std::cos(0.5*theta)*std::cos(0.5*theta)*std::tan(0.5*theta)); // ???? CHECK THIS <<--
1095 
1096  double dphi = std::sqrt(measPer->definingParametersCovMatrix()(Trk::phi0,Trk::phi0));
1097  double dz0 = std::sqrt(measPer->definingParametersCovMatrix()(Trk::z0,Trk::z0));
1098  double dd0 = std::sqrt(measPer->definingParametersCovMatrix()(Trk::d0,Trk::d0));
1099 
1100  double dpT = 0;
1101 
1102 
1104  // if ( m_xBeam!=0 || m_yBeam!=0 ) correctToBeamline( z0, dz0, d0, dd0, theta, phi );
1105 
1106 
1107  double sintheta = std::sin(theta);
1108  double costheta = std::cos(theta);
1109  double dpt2 = (p*p*sintheta)*(p*p*sintheta)*dqovp*dqovp + (p*costheta)*(p*costheta)*dtheta*dtheta - 2*(p*p*sintheta)*(p*costheta)*covthetaOvP;
1110 
1111  if ( dpt2>0 ) dpT = std::sqrt( dpt2 );
1112 
1113  // Check number of hits
1114  // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really
1115  // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
1116  // stereo clusters making a spacepoint are two "hits"
1117 
1118  uint8_t sum_nBlayerHits = 0;
1119  track->summaryValue( sum_nBlayerHits, xAOD::numberOfInnermostPixelLayerHits);
1120  int nBlayerHits = 2*sum_nBlayerHits;
1121 
1122  uint8_t sum_nPixelHits = 0;
1123  track->summaryValue( sum_nPixelHits, xAOD::numberOfPixelHits);
1124  int nPixelHits = 2*sum_nPixelHits;
1125 
1126  uint8_t sum_nSctHits = 0;
1127  track->summaryValue( sum_nSctHits, xAOD::numberOfSCTHits);
1128  int nSctHits = sum_nSctHits;
1129 
1130  uint8_t sum_nStrawHits = 0;
1131  track->summaryValue( sum_nStrawHits, xAOD::numberOfTRTHits);
1132  int nStrawHits = sum_nStrawHits;
1133 
1134  uint8_t sum_nTrtHits = 0;
1135  track->summaryValue( sum_nTrtHits, xAOD::numberOfTRTHighThresholdHits);
1136  int nTrtHits = sum_nTrtHits;
1137 
1138 
1139  uint8_t sum_expectBL = 0;
1140  track->summaryValue( sum_expectBL, xAOD::expectInnermostPixelLayerHit);
1141  bool expectBL = ( sum_expectBL ? true : false );
1142 
1144 
1145  uint8_t sum_sctholes = 0;
1146  track->summaryValue( sum_sctholes, xAOD::numberOfSCTHoles);
1147 
1148  uint8_t sum_pixholes = 0;
1149  track->summaryValue( sum_pixholes, xAOD::numberOfPixelHoles);
1150 
1154 
1155  nSctHits += 1000*sum_sctholes;
1156  nPixelHits += 1000*sum_pixholes;
1157 
1159  int nSiHits = nPixelHits + nSctHits;
1160 
1162 
1163  double chi2 = track->chiSquared();
1164  double dof = track->numberDoF();
1165 
1166  unsigned long id = (unsigned long)track;
1167 
1168  unsigned bitmap = track->hitPattern();
1169 
1170 
1171 
1172  double xbeam = track->vx();
1173  double ybeam = track->vy();
1174  double zbeam = track->vz();
1175 
1176  if ( xbeam!=getBeamX() || ybeam!=getBeamY() || zbeam!=getBeamZ() ) setBeamline( xbeam, ybeam, zbeam );
1177 
1178  int trackAuthor = 0;
1179 
1180  int fitter = track->trackFitter();
1181  std::bitset<xAOD::NumberOfTrackRecoInfo> patternrec = track->patternRecoInfo();
1182 
1183  //int icount = 0;<- never used if section below is commented
1184  for ( unsigned ipr=patternrec.size() ; ipr-- ; ) {
1185  if ( patternrec[ipr] ) {
1186  //icount++; <- never used if section below is commented
1187  trackAuthor |= (ipr >> 16);
1188  // static bool first = true;
1189  // if ( first && icount>1 ) {
1190  // std::cerr << "more than one pattern rec strategy " << ipr << "\t(suppressing further output)" << std::endl;
1191  // first = false;
1192  // }
1193  }
1194  }
1195 
1196  trackAuthor |= fitter;
1197 
1198  // if ( fitter>0 && fitter<Trk::TrackInfo::NumberOfTrackFitters ) {
1199  // if ( dumpinfo.find("TRTStandalone")!=std::string::npos) trackAuthor = 2;
1200  // else if ( dumpinfo.find("TRTSeededTrackFinder")!=std::string::npos) trackAuthor = 1;
1201  // else trackAuthor = 0;
1202  // }
1203 
1204 #if 0
1205  std::cout << "\t\t\tSUTT TP track"
1206  << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta()
1207  << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi()
1208  << "\tz0=" << z0
1209  << "\tpT=" << pT // << "\t( " << 1/qoverp << ")"
1210  << "\td0=" << d0
1211  << "\tNsi=" << nSiHits
1212  // << "\tNtrt=" << nTrtHits
1213  // << "\tNstr=" << nStrawHits
1214  << "\tfitter=" << fitter
1215  << "\tauthor=" << trackAuthor
1216  << "\tVTX x " << track->vx() << "\ty " << track->vy() << "\tz " << track->vz()
1217  << std::endl;
1218 #endif
1219 
1220  // Create and save Track
1221 
1222  TIDA::Track* t = new TIDA::Track( eta, phi, z0, d0, pT, chi2, dof,
1223  deta, dphi, dz0, dd0, dpT,
1224  nBlayerHits, nPixelHits, nSctHits, nSiHits,
1225  nStrawHits, nTrtHits, bitmap, 0,
1226  trackAuthor, false, -1, -1,
1227  expectBL, id) ;
1228 
1229  // std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl;
1230 
1231  if ( !addTrack( t ) ){
1232  delete t;
1233  return false;
1234  }
1235  return true;
1236 
1237  }
1238  return false;
1239 
1240 
1241 }
1242 
1243 
1245  // std::cout << "\t\t\tSUTT \tTrackContainer->size() = " << trigtracks->size() << std::endl;
1248  while ( trackitr!=trackend ) {
1249  selectTrack( *trackitr );
1250  ++trackitr;
1251  } // loop over tracks
1252 }
1253 
1254 
1255 
1260  // std::cout << "\t\t\tSUTT \tTrackContainer->size() = " << trigtracks->size() << std::endl;
1261  while ( trackitr!=trackend ) {
1262  selectTrack( *trackitr );
1263  ++trackitr;
1264  } // loop over tracks
1265 }
1266 
1267 
1269  for( const auto& track : tracks ) selectTrack( *track );
1270 }
1271 
1272 
1273 
1274 
1275 
1276 void TrigTrackSelector::correctToBeamline( double& z0, double& dz0,
1277  double& d0, double& dd0,
1278  double theta, double phi ) {
1279 
1281 
1282  // if ( m_first ) {
1283  // if ( m_xBeam==0 && m_yBeam==0 ) {
1284  // std::cerr << "TrigTrackSelector::correctToBeamline() WARNING -- Beamline set to (0,0) -- WARNING" << std::endl;
1285  // }
1286  // else {
1287  // std::cout << "TrigTrackSelector::correctToBeamline() Beamline set to " << m_xBeam << " " << m_yBeam << std::endl;
1288  // }
1289  // m_first = false;
1290  // }
1291 
1292 
1293  // double theta = 2*std::atan( exp( (-1)*eta ) );
1294  double z0t = z0 + ((std::cos(phi)*m_xBeam + std::sin(phi)*m_yBeam)/std::tan(theta));
1295  double a0t = d0 + std::sin(phi)*m_xBeam - std::cos(phi)*m_yBeam;
1296 
1298  double dz0t = dz0 + ((std::cos(phi)*m_xBeam + std::sin(phi)*m_yBeam)/std::tan(theta));
1299  double da0t = dd0 + std::sin(phi)*m_xBeam - std::cos(phi)*m_yBeam;
1300 
1301  z0 = z0t;
1302  d0 = a0t;
1303 
1304  dz0 = dz0t;
1305  dd0 = da0t;
1306 }
1307 
particleType::charge
double charge(int id) const
Definition: particleType.h:121
TrigTrackSelector::m_radius
double m_radius
Definition: TrigTrackSelector.h:200
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigTrackSelector::m_id
unsigned long m_id
Definition: TrigTrackSelector.h:192
Trk::numberOfTRTHighThresholdHits
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:87
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrigInDetTrackCollection
Definition: TrigInDetTrackCollection.h:13
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrackFilter
Definition: TrackFilter.h:26
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
TruthVertexContainer.h
TrackSelector::addTrack
virtual bool addTrack(TIDA::Track *t, bool(*f)(const TIDA::Track *)=0)
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:35
xAOD::TrackParticle_v1::vz
float vz() const
The z origin for the parameters.
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
TrigInDetTrackTruth::bestSiMatch
const HepMcParticleLink * bestSiMatch() const
returns best match according to the number of hits
Definition: TrigInDetTrackTruth.cxx:190
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
Trk::z0
@ z0
Definition: ParamDefs.h:64
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:236
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
TrigTrackSelector::TrigTrackSelector
TrigTrackSelector(TrackFilter *selector)
use a radius of 47 mm corresponding to the Run 1 pixel inner radius For the IBL it should be 32 mm,...
Definition: TrigTrackSelector.h:70
particleType
Definition: particleType.h:29
IDTPM::nPixelHits
float nPixelHits(const U &p)
Definition: TrackParametersHelper.h:354
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
TrigInDetTrack
Definition: TrigInDetTrack.h:34
TrackSelector
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:24
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
TrigTrackSelector::correctToBeamline
void correctToBeamline(double &z0, double &dz0, double &d0, double &dd0, double theta, double phi)
Definition: TrigTrackSelector.cxx:1276
xAOD::numberOfTRTHighThresholdHits
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
Definition: TrackingPrimitives.h:278
Trk::numberOfBLayerHits
@ numberOfBLayerHits
these are the hits in the 0th pixel layer?
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:51
Trk::ErrorMatrix
Definition: ErrorMatrixCnv_p1.h:25
TrigTrackSelector::getBeamX
double getBeamX() const
Definition: TrigTrackSelector.h:96
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
sel
sel
Definition: SUSYToolsTester.cxx:97
TrigInDetTrackTruthMap
Definition: TrigInDetTrackTruthMap.h:38
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
TrigTrackSelector.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
plotBeamSpotCompare.xd
xd
Definition: plotBeamSpotCompare.py:220
TrigTrackSelector::m_zBeam
double m_zBeam
Definition: TrigTrackSelector.h:196
TrigTrackSelector::m_xBeam
double m_xBeam
Definition: TrigTrackSelector.h:194
TrigTrackSelector::selectTrack
bool selectTrack(const TrigInDetTrack *track, const TrigInDetTrackTruthMap *truthMap=0)
neater code to make use of vector function also for a single ancestor pdgid, instead of the full code...
Definition: TrigTrackSelector.cxx:116
TrigInDetTrackTruth
Definition: TrigInDetTrackTruth.h:36
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
xAOD::TrackParticle_v1::phi0
float phi0() const
Returns the parameter, which has range to .
Definition: TrackParticle_v1.cxx:158
TrigTrackSelector::fromAncestor
const xAOD::TruthParticle * fromAncestor(const int pdg_id, const xAOD::TruthParticle *p) const
recursive functions to identify whether a particle comes from some particle of a specific PDG ID,...
Definition: TrigTrackSelector.cxx:39
xAOD::TrackParticle_v1::qOverP
float qOverP() const
Returns the parameter.
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
TrackSelector::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:53
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
Trk::d0
@ d0
Definition: ParamDefs.h:63
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
charge
double charge(const T &p)
Definition: AtlasPID.h:756
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
TrigTrackSelector::m_selectParentPdgId
int m_selectParentPdgId
Definition: TrigTrackSelector.h:203
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
TrigTrackSelector::selectTracks
void selectTracks(const TrigInDetTrackCollection *trigtracks, const TrigInDetTrackTruthMap *truthMap=0)
Definition: TrigTrackSelector.cxx:188
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
DataModelTestDataCommonDict::xb
DMTest::CView::Pers_t xb
Definition: DataModelTestDataCommonDict.h:55
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::DetectorType
DetectorType
enumerates the various detector types currently accessible from the isHit() method.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:231
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
TrigTrackSelector::m_correctTrkTracks
bool m_correctTrkTracks
Definition: TrigTrackSelector.h:198
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
xAOD::TruthParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition: TruthParticle_v1.cxx:181
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
TrigTrackSelector::setBeamline
void setBeamline(double x, double y, double z=0)
Definition: TrigTrackSelector.h:94
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
extractSporadic.q
list q
Definition: extractSporadic.py:98
TrigTrackSelector::getBeamZ
double getBeamZ() const
Definition: TrigTrackSelector.h:98
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
TrigInDetTrackTruthMap::truth
const TrigInDetTrackTruth * truth(const TrigInDetTrack *p_trig_trk) const
Definition: TrigInDetTrackTruthMap.cxx:82
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
TrigTrackSelector::getBeamY
double getBeamY() const
Definition: TrigTrackSelector.h:97
TrigTrackSelector::truthBeamline
void truthBeamline(const xAOD::TruthParticleContainer *truthtracks, double &x0, double &y0)
extract all the tracks from a xAOD::TruthParticle collection and histogram the x and y production coo...
Definition: TrigTrackSelector.cxx:381
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TrigTrackSelector::m_yBeam
double m_yBeam
Definition: TrigTrackSelector.h:195
TrigInDetTrackTruth::nrMatches
unsigned int nrMatches() const
returns number of matching particles
Definition: TrigInDetTrackTruth.cxx:244
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
rp
ReadCards * rp
Definition: IReadCards.cxx:26
TrigTrackSelector::m_selectPdgId
int m_selectPdgId
Definition: TrigTrackSelector.h:202
Trk::TrackInfo::NumberOfTrackFitters
@ NumberOfTrackFitters
maximum number of enums
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:71
TrigTrackSelector::makeTrack
TIDA::Track * makeTrack(HepMC::ConstGenParticlePtr track)
Definition: TrigTrackSelector.cxx:688
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
TrigTrackSelector::TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Definition: TrigTrackSelector.h:62
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
TrigTrackSelector::s_default_radius
static const double s_default_radius
NB: This was 47 for Run 2, but with the addition of the IBL it should be 32 It was kept at 47 for all...
Definition: TrigTrackSelector.h:205
xAOD::TruthParticle_v1::charge
double charge() const
Physical charge.
HepMCHelpers.h
IDTPM::nSiHits
float nSiHits(const U &p)
Definition: TrackParametersHelper.h:427
zbeam
Definition: zbeam.h:24
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:170
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65