ATLAS Offline Software
TRT_SeededSpacePointFinder_ATL.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class TRT_SeededSpacePointFinder_ATL
8 // (c) ATLAS Detector software
10 // Version 1.0 04/15/2006 T.Koffas
12 
13 
14 #include "GaudiKernel/MsgStream.h"
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "CLHEP/Vector/ThreeVector.h"
20 
21 //Cluster collections
22 //
24 //SCT Geometry
25 //
26 #include "InDetIdentifier/SCT_ID.h"
27 
28 //Association tool
29 //
30 
31 #include "StoreGate/ReadHandle.h"
32 
33 #include <ostream>
34 #include <iomanip>
35 #include <set>
36 
37 using namespace std;
38 
40 // Constructor
42 
44 (const std::string& t,const std::string& n,const IInterface* p)
45  : AthAlgTool(t,n,p),
46  m_fieldmode("MapSolenoid"),
47  m_sctId(nullptr)
48 {
49  m_ptmin = 500. ; //Lowest pT of track.Up to 2000MeV bending in (r,phi) is +-4
50  m_r_rmax = 600. ; //Max radial extend of Si ID
51  m_r_rmin = 0. ; //Min radial extend for loading SPs in ID
52  m_r_rstep = 10. ; //Step size for SP and SCT histogramming
53  m_r1max = 560. ; //Max radius of 1st SCT layer
54  m_r12min = 400. ; //Min radius of 2nd SCT layer
55  m_r2min = 340. ; //Min radius of 3rd SCT layer.Never search below that
56  m_dzdrmin = -4.00 ; //Min pseudorapidity cut
57  m_dzdrmax = +4.00 ; //Max pseudorapidity cut
58  m_xiC = 100. ; //Momentum chi2 cut between seed and TRT segment estimate
59  m_xiTC = 100. ; //Polar angle chi2 cut between seed and TRT segment estimate
60  m_xiFC = 100. ; //Azimuthal angle chi2 cut between seed and TRT segment estimate
61  m_search = true ; //Search into neighboring sectors
62  m_loadFull = true ; //Load all the Si space points, otherwise only from the last 3 SCT layers
63  m_doCosmics = false ; //Disable seed selection cuts when reconstructing cosmics tracks
64 
65 
66  declareInterface<ITRT_SeededSpacePointFinder>(this);
67 
68  declareProperty("MagneticFieldMode" ,m_fieldmode );
69  declareProperty("pTmin" ,m_ptmin );
70  declareProperty("NeighborSearch" ,m_search );
71  declareProperty("LoadFull" ,m_loadFull );
72  declareProperty("DoCosmics" ,m_doCosmics );
73  declareProperty("Xi2C" ,m_xiC );
74  declareProperty("Xi2TC" ,m_xiTC );
75  declareProperty("Xi2FC" ,m_xiFC );
76 
77 }
78 
80 // Destructor
82 
84 = default;
85 
87 // Initialisation
89 
91 {
93 
94  // PRD-to-track association (optional)
97  StatusCode sc = detStore()->retrieve(m_sctId, "SCT_ID");
98  if (sc.isFailure()){
99  msg(MSG::FATAL) << "Could not get SCT_ID helper !" << endmsg;
100  return StatusCode::FAILURE;
101  }
102 
103  // Build framework
104  //
105 
106  // Get output print level
107  //
109 
113 
114  return sc;
115 }
116 
118 // Finalize
120 
122 {
123  StatusCode sc = AthAlgTool::finalize(); return sc;
124 
125 }
126 
128 // Initialize tool for new event
130 
131 std::unique_ptr<InDet::ITRT_SeededSpacePointFinder::IEventData>
133 {
134  std::unique_ptr<InDet::TRT_SeededSpacePointFinder_ATL::EventData> event_data_p = std::make_unique<InDet::TRT_SeededSpacePointFinder_ATL::EventData>();
135  event_data_p->buildFrameWork(m_r_rmax, m_r_rstep, m_ptmin);
136  // @TODO remove m_r_Sorted and directly fill m_rf_Sorted ?
137 
138  double irstep = 1./m_r_rstep;
139 
140  std::vector< std::vector<const Trk::SpacePoint*> > r_Sorted;
141  r_Sorted.resize(event_data_p->m_r_size);
142 
143  if(m_loadFull){
144  // Get pixel space points containers from store gate
145  //
147  if (spacepointsPix.isValid()) {
148  SpacePointContainer::const_iterator spc = spacepointsPix->begin ();
149  SpacePointContainer::const_iterator spce = spacepointsPix->end ();
150 
151  for(; spc != spce; ++spc) {
152 
153  SpacePointCollection::const_iterator sp = (*spc)->begin();
154  SpacePointCollection::const_iterator spe = (*spc)->end ();
155  for(; sp != spe; ++sp) {
156 
157  double r = (*sp)->r(); if(r<0. || r>=m_r_rmax) continue;
158  int ir = int(r*irstep);
159  const Trk::SpacePoint* sps = (*sp);
160  r_Sorted[ir].push_back(sps);
161  ++event_data_p->m_r_map[ir];
162  if(event_data_p->m_r_map[ir]==1) event_data_p->m_r_index[event_data_p->m_nr++] = ir;
163  ++event_data_p->m_ns;
164  }
165  }
166  }
167  }
168 
169  SG::ReadHandle<Trk::PRDtoTrackMap> prd_to_track_map;
170  if (!m_prdToTrackMap.key().empty()) {
172  if (!prd_to_track_map.isValid()) {
173  ATH_MSG_ERROR("Failed to read PRD to track association map.");
174  }
175  }
176  // Get sct space points containers from store gate
177  //
179  if (spacepointsSCT.isValid()) {
180 
181  SpacePointContainer::const_iterator spc = spacepointsSCT->begin();
182  SpacePointContainer::const_iterator spce = spacepointsSCT->end ();
183 
184  double r_rmin = (!m_loadFull) ? m_r2min : m_r_rmin;
185  for(; spc != spce; ++spc) {
186 
187  SpacePointCollection::const_iterator sp = (*spc)->begin();
188  SpacePointCollection::const_iterator spe = (*spc)->end ();
189  for(; sp != spe; ++sp) {
190 
191  if(prd_to_track_map.cptr()){
192  bool u1=false; bool u2=false;
193  const Trk::PrepRawData* p1=(*sp)->clusterList().first; u1=prd_to_track_map->isUsed(*p1);
194  const Trk::PrepRawData* p2=(*sp)->clusterList().second;u2=prd_to_track_map->isUsed(*p2);
195  if(u1 || u2){continue;}
196  }
197 
198  double r = (*sp)->r(); if(r<r_rmin || r>=m_r_rmax) continue;
199  int ir = int(r*irstep);
200  const Trk::SpacePoint* sps = (*sp);
201  r_Sorted[ir].push_back(sps); ++event_data_p->m_r_map[ir];
202  if(event_data_p->m_r_map[ir]==1) event_data_p->m_r_index[event_data_p->m_nr++] = ir;
203  ++event_data_p->m_ns;
204  }
205  }
206  }
207 
208  // Get sct overlap space points containers from store gate
209  //
211  if (spacepointsOverlap.isValid()) {
212  SpacePointOverlapCollection::const_iterator sp = spacepointsOverlap->begin();
213  SpacePointOverlapCollection::const_iterator spe = spacepointsOverlap->end ();
214 
215  for (; sp!=spe; ++sp) {
216 
217  if(prd_to_track_map.cptr()){
218  bool u1=false; bool u2=false;
219  const Trk::PrepRawData* p1=(*sp)->clusterList().first; u1=prd_to_track_map->isUsed(*p1);
220  const Trk::PrepRawData* p2=(*sp)->clusterList().second;u2=prd_to_track_map->isUsed(*p2);
221  if(u1 || u2){continue;}
222  }
223 
224  double r = (*sp)->r(); if(r<0. || r>=m_r_rmax) continue;
225  int ir = int(r*irstep);
226  const Trk::SpacePoint* sps = (*sp);
227  r_Sorted[ir].push_back(sps); ++event_data_p->m_r_map[ir];
228  if(event_data_p->m_r_map[ir]==1) event_data_p->m_r_index[event_data_p->m_nr++] = ir;
229  ++event_data_p->m_ns;
230  }
231  }
232 
233  fillLists(r_Sorted, *event_data_p); //Fill the R-phi sectors with the corresponding space points
234  return std::unique_ptr<InDet::ITRT_SeededSpacePointFinder::IEventData>(event_data_p.release());
235 }
236 
238 // Initialize tool for new region
240 
241 std::unique_ptr<InDet::ITRT_SeededSpacePointFinder::IEventData> InDet::TRT_SeededSpacePointFinder_ATL::newRegion
242 (const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT) const
243 {
244  std::unique_ptr<InDet::TRT_SeededSpacePointFinder_ATL::EventData> event_data_p = std::make_unique<InDet::TRT_SeededSpacePointFinder_ATL::EventData>();
245  event_data_p->buildFrameWork(m_r_rmax, m_r_rstep, m_ptmin);
246 
247  std::vector< std::vector<const Trk::SpacePoint*> > r_Sorted;
248  r_Sorted.resize(event_data_p->m_r_size);
249 
250  double irstep = 1./m_r_rstep;
251 
252  if(m_loadFull && !vPixel.empty()){
253  // Get pixel space points containers from store gate
254  //
256  if (spacepointsPix.isValid()) {
257  std::vector<IdentifierHash>::const_iterator l = vPixel.begin(), le = vPixel.end();
258 
259  // Loop through all trigger collections
260  //
261  for(; l!=le; ++l) {
262 
263  const SpacePointCollection *w = spacepointsPix->indexFindPtr(*l);
264  if(w==nullptr) continue;
267  for(; sp != spe; ++sp) {
268 
269  double r = (*sp)->r(); if(r<0. || r>=m_r_rmax) continue;
270  int ir = int(r*irstep);
271  const Trk::SpacePoint* sps = (*sp);
272  r_Sorted[ir].push_back(sps); ++event_data_p->m_r_map[ir];
273  if(event_data_p->m_r_map[ir]==1) event_data_p->m_r_index[event_data_p->m_nr++] = ir;
274  ++event_data_p->m_ns;
275  }
276  }
277  }
278  }
279 
280  // Get sct space points containers from store gate
281  //
282  if(!vSCT.empty()) {
283 
285  if (spacepointsSCT.isValid()) {
286 
287  SG::ReadHandle<Trk::PRDtoTrackMap> prd_to_track_map;
288  if (!m_prdToTrackMap.key().empty()) {
290  if (!prd_to_track_map.isValid()) {
291  ATH_MSG_ERROR("Failed to read PRD to track association map.");
292  }
293  }
294  std::vector<IdentifierHash>::const_iterator l = vSCT.begin(), le = vSCT.end();
295 
296  // Loop through all trigger collections
297  //
298  double r_rmin = (!m_loadFull) ? m_r2min : m_r_rmin;
299  for(; l!=le; ++l) {
300 
301  const SpacePointCollection *w = spacepointsSCT->indexFindPtr(*l);
302  if(w==nullptr) continue;
305  for(; sp != spe; ++sp) {
306 
307  if(prd_to_track_map.cptr()){
308  bool u1=false; bool u2=false;
309  const Trk::PrepRawData* p1=(*sp)->clusterList().first; u1=prd_to_track_map->isUsed(*p1);
310  const Trk::PrepRawData* p2=(*sp)->clusterList().second;u2=prd_to_track_map->isUsed(*p2);
311  if(u1 || u2){continue;}
312  }
313 
314  double r = (*sp)->r(); if(r<r_rmin || r>=m_r_rmax) continue;
315  int ir = int(r*irstep);
316  const Trk::SpacePoint* sps = (*sp);
317  r_Sorted[ir].push_back(sps); ++event_data_p->m_r_map[ir];
318  if(event_data_p->m_r_map[ir]==1) event_data_p->m_r_index[event_data_p->m_nr++] = ir;
319  ++event_data_p->m_ns;
320  }
321  }
322  }
323  }
324 
325  fillLists(r_Sorted,*event_data_p); //Fill the R-phi sectors with the corresponding space points
326  return std::unique_ptr<InDet::ITRT_SeededSpacePointFinder::IEventData>(event_data_p.release());
327 }
328 
330 // Methods to initialize different strategies of seeds production
331 // with two space points with or without vertex constraint
333 
334 std::list<std::pair<const Trk::SpacePoint*, const Trk::SpacePoint*> >
336  const Trk::TrackParameters& tP,
337  ITRT_SeededSpacePointFinder::IEventData &virt_event_data) const
338 {
340 
341  const double pi2 = 2.*M_PI;
342 
344  std::list<std::pair<const Trk::SpacePoint*,const Trk::SpacePoint*> > outputListBuffer;
345 
347  double F = 0.;
348  double GPx=tP.position().x(); double GPy=tP.position().y();
349  F=atan2(GPy,GPx); if(F<0.) F+=pi2;
350  int f = int(F*event_data.m_sF);
351  if (f < 0)
352  f += event_data.m_fNmax;
353  else if (f > event_data.m_fNmax)
354  f -= event_data.m_fNmax;
355 
356 
357  production2Spb (ctx, tP,f, outputListBuffer,event_data); //Get a list of SP pairs.
358 
359  if(msgLvl(MSG::DEBUG)) {
360  dumpEvent( msg(MSG::DEBUG), event_data);
362  msg(MSG::DEBUG) << endmsg;
363  }
364 
365  if(outputListBuffer.size()>10000.) outputListBuffer.clear();
366 
367  return outputListBuffer;
368 }
369 
370 
372 // Dumps conditions information into the MsgStream
374 
376 {
377  int n = 42-m_fieldCondObjInputKey.key().size();
378  std::string s1; for(int i=0; i<n; ++i) s1.append(" "); s1.append("|");
379  n = 42-m_spacepointsSCTname.key().size();
380  std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|");
381  n = 42-m_spacepointsOverlapname.key().size();
382  std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|");
383 
384  std::string fieldmode[9] ={"NoField" ,"ConstantField","SolenoidalField",
385  "ToroidalField" ,"Grid3DField" ,"RealisticField" ,
386  "UndefinedField","AthenaField" , "?????" };
387 
389  if(mode<0 || mode>8 ) mode = 8;
390 
391  n = 62-fieldmode[mode].size();
392  std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|");
393 
394  out<<"|---------------------------------------------------------------------|"
395  <<std::endl;
396  out<<"| Key of magentic field condition Object | "<<m_fieldCondObjInputKey.key()<<s1
397  <<std::endl;
398  out<<"| SCT space points | "<<m_spacepointsSCTname.key()<<s3
399  <<std::endl;
400  out<<"| Overlap space points | "<<m_spacepointsOverlapname.key()<<s4
401  <<std::endl;
402  out<<"| Magnetic field mode | "<<fieldmode[mode]<<s5
403  <<std::endl;
404  out<<"| pTmin (mev) | "
405  <<std::setw(12)<<std::setprecision(5)<<m_ptmin
406  <<" |"<<std::endl;
407  out<<"| max radius SP | "
408  <<std::setw(12)<<std::setprecision(5)<<m_r_rmax
409  <<" |"<<std::endl;
410  out<<"| radius step | "
411  <<std::setw(12)<<std::setprecision(5)<<m_r_rstep
412  <<" |"<<std::endl;
413  out<<"| min radius second SP(3) | "
414  <<std::setw(12)<<std::setprecision(5)<<m_r2min
415  <<" |"<<std::endl;
416  out<<"| min radius first SP(3) | "
417  <<std::setw(12)<<std::setprecision(5)<<m_r12min
418  <<" |"<<std::endl;
419  out<<"| max radius first SP(3) | "
420  <<std::setw(12)<<std::setprecision(4)<<m_r1max
421  <<" |"<<std::endl;
422  out<<"| min seeds dZ/dR | "
423  <<std::setw(12)<<std::setprecision(5)<<m_dzdrmin
424  <<" |"<<std::endl;
425  out<<"| max seeds dZ/dR | "
426  <<std::setw(12)<<std::setprecision(5)<<m_dzdrmax
427  <<" |"<<std::endl;
428  out<<"| momentum chi2 cut | "
429  <<std::setw(12)<<std::setprecision(5)<<m_xiC
430  <<" |"<<std::endl;
431  out<<"| polar angle chi2 cut | "
432  <<std::setw(12)<<std::setprecision(5)<<m_xiTC
433  <<" |"<<std::endl;
434  out<<"| azimuthal angle chi2 cut | "
435  <<std::setw(12)<<std::setprecision(5)<<m_xiFC
436  <<" |"<<std::endl;
437  out<<"|---------------------------------------------------------------------|"
438  <<std::endl;
439  return out;
440 }
441 
443 // Dumps event information into the MsgStream
445 namespace {
446  class StreamState
447  {
448  public:
449  explicit StreamState(std::ostream& out)
450  : m_out(out), m_prec(out.precision())
451  {
452  }
453 
454  ~StreamState()
455  {
456  m_out.precision(m_prec);
457  }
458 
459  private:
460  std::ostream& m_out;
461  std::streamsize m_prec;
462  };
463 }
464 
466 {
467  const double pi2 = 2.*M_PI;
468  out<<"|---------------------------------------------------------------------|"
469  <<"\n";
470  out<<"| m_ns | "
471  <<std::setw(12)<<event_data.m_ns
472  <<" |"<<"\n";
473  out<<"|---------------------------------------------------------------------|"
474  <<"\n";
475 
476  if(msgLvl(MSG::DEBUG)) return out;
477 
478  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
479  out<<"-------|-------|-------|-------|-------|-------|"
480  <<"\n";
481 
482  out<<"| Azimuthal | n | z[ 0] | z[ 1] | z[ 2] | z[ 3] | z[4] |";
483  out<<" z[ 5] | z[ 6] | z[ 7] | z[ 8] | z[ 9] | z[10] |"
484  <<"\n";
485  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
486  out<<"-------|-------|-------|-------|-------|-------|"
487  <<"\n";
488 
489  double sF1 = pi2/double(event_data.m_fNmax+1);
490 
491  //StreamState restore_precision(out);
492  auto prec(out.precision());
493  for(int f=0; f<=event_data.m_fNmax; ++f) {
494  out<<"| "
495  <<std::setw(10)<<std::setprecision(4)<<sF1*double(f)<<" | "
496  <<std::setw(6)<<event_data.m_rf_map[f]<<" |";
497  out<<"\n";
498  }
499  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
500  out<<"-------|-------|-------|-------|-------|-------|"
501  <<"\n";
502  out<<endmsg;
503  out.precision(prec);
504  return out;
505 }
506 
508 // Dumps relevant information into the ostream
510 
511 MsgStream& InDet::TRT_SeededSpacePointFinder_ATL::dump( MsgStream& out ) const
512 {
513  return dumpConditions(out);
514 }
515 
516 std::ostream& InDet::TRT_SeededSpacePointFinder_ATL::dump( std::ostream& out ) const
517 {
518  return out;
519 }
520 
522 // Initiate frame work for seed generator
524 
526 {
527 
528  m_ns = m_nr = m_nrf = 0;
529 
530  // Build radius sorted containers
531  //
532  m_r_size = int((r_rmax+.1)/r_rstep);
533  m_r_index = new int[m_r_size];
534  m_r_map = new int[m_r_size];
535  m_nr = 0; for(int i=0; i!=m_r_size; ++i) {m_r_index[i]=0; m_r_map[i]=0;}
536 
537  // Build radius-azimuthal sorted containers
538  //
539  const double pi2 = 2.*M_PI ;
540  const int NFmax = 530 ;
541  const double sFmax = double(NFmax )/pi2;
542  m_sF = ptmin /60. ; if(m_sF >sFmax ) m_sF = sFmax ;
543  m_fNmax = int(pi2*m_sF); if(m_fNmax >=NFmax) m_fNmax = NFmax-1;
544  m_nrf = 0; for(int i=0; i!= 530; ++i) {m_rf_index [i]=0; m_rf_map [i]=0;}
545 
546 }
547 
549 // Initiate space points seed maker
551 
552 void InDet::TRT_SeededSpacePointFinder_ATL::fillLists(std::vector< std::vector<const Trk::SpacePoint*> > &r_Sorted,
554 {
555  assert( static_cast<size_t>(event_data.m_r_size) == r_Sorted.size());
556  const double pi2 = 2.*M_PI;
557 
558  for(int i=0; i!= event_data.m_r_size; ++i) {
559  if(!event_data.m_r_map[i]) continue;
560  for(const Trk::SpacePoint *space_point : r_Sorted[i]) {
561 
562  // Azimuthal angle sort
563  //
564  double F = space_point->phi(); if(F<0.) F+=pi2;
565  int f = int(F*event_data.m_sF);
566  if (f < 0)
567  f += event_data.m_fNmax;
568  else if (f > event_data.m_fNmax)
569  f -= event_data.m_fNmax;
570  int isBRL = 1000; int isLYR = 1000; int DD = 1000;
571 
572  geoInfo(space_point,isBRL,isLYR);
573 
574  // Use 4 lower bits (Mask == ((2^4 -1) == 15)) for isLYR
575  // the upper 28 bits for isBRL (including sign)
576  DD = ((isBRL+3) << 4) + (isLYR & 15);
577 
578  event_data.m_rf_Sorted[f].emplace_back(space_point,DD);
579  if(!event_data.m_rf_map[f]++) event_data.m_rf_index[event_data.m_nrf++] = f;
580 
581  }
582  event_data.m_r_map[i] = 0;
583  }
584 
585  event_data.m_nr = 0;
586 }
587 
589 // Erase space point information
591 
593 {
594 
595  for(int i=0; i!=m_nrf; ++i) {
596  int n = m_rf_index[i]; m_rf_map[n] = 0;
597  m_rf_Sorted[n].erase(m_rf_Sorted[n].begin(),m_rf_Sorted[n].end());
598  }
599 
600  m_ns = 0;
601  m_nr = 0;
602  m_nrf = 0;
603 }
604 
605 // // // // // // // // // // // // // // // // // // // // // // // // // //
606 
607 // Monotonic function of the angle to map the comparison to replace atan2
608 // Computation is not in the inner loop, so trigonometric functions are OK
609 double
610 rollrating(double angle) {
611  while (angle < 0) {
612  angle += 2*M_PI;
613  }
614  while (angle > 2*M_PI) {
615  angle -= 2*M_PI;
616  }
617  double rotations = angle/(2*M_PI);
618  double rquadrant = rotations*4.0;
619  long quadrant = (long)rquadrant & 3;
620  double twist;
621  if ((quadrant & 1) != 0) {
622  twist = cos(angle);
623  }
624  else {
625  twist = sin(angle);
626  }
627  twist *= twist;
628  quadrant -= ((quadrant & 2) << 1);
629  return quadrant + twist;
630 }
631 
632 // Since the theta and phi cuts in cutTP are essentially
633 // checks for the angle to be within a specified region,
634 // only the upper and the lower boundaries have to calculated,
635 // once again, not in the inner loop but just once
636 // The logic is:
637 // {lower <= angle <= upper_} necessary and sufficient for
638 // {rollrating(lower) <= rollrating(angle) <= rollrating(upper)}
639 void
640 bracket_angle(double angle, double delta,
641  double *min, double *max) {
642  double amin = rollrating(angle - delta);
643  double amax = rollrating(angle + delta);
644  if (delta >= M_PI) {
645  amin = 0.0;
646  amax = 4.0;
647  }
648  *min = amin;
649  *max = amax;
650 }
651 
652 
653 // rotrating(sin(angle), cos(angle)) == rollrating(angle)
654 // Called many times, for each pair still in consideration
655 // Performance critical, so no SQRTs or transcendentals here
656 inline double
657 rotrating(double y, double x) {
658  long asign_x = (long)(x < 0.0);
659  long asign_y = (long)(y < 0.0);
660  long quadrant = -(asign_y << 1) + (asign_y ^ asign_x);
661  double x2 = x*x;
662  double y2 = y*y;
663  double denominator = x2 + y2;
664  double numerator = ((quadrant & 1) != 0) ? x2 : y2;
665  return (double)quadrant + numerator/denominator;
666 }
667 
668 void
670  const Trk::TrackParameters& tP,
671  int phi,
672  std::list<std::pair<const Trk::SpacePoint*,const Trk::SpacePoint*> > &outputListBuffer,
674 {
675  uint64_t spcount = 0;
676  // // // // // // <Fill the invar_bypass // // // // // // //
677 
678  //const Trk::MeasuredAtaStraightLine &ntP =
679  //dynamic_cast<const Trk::MeasuredAtaStraightLine&>(tP);
680  const AmgVector(5)& pTS=tP.parameters();
681  const AmgSymMatrix(5)* vCM = tP.covariance();
682 
683  double sPhi = (*vCM)(2,2) ; //Sigma on TRT segment azimuthal angle
684  double sTheta = (*vCM)(3,3); //Sigma on TRT segment polar angle
685  double sp = (*vCM)(4,4) ; //Sigma on TRT segment inverse momentum estimate
686 
687  double ipdelta = sqrt(m_xiC*sp);
688 
689  invar_bypass_struct tmp_invar_bypass{};
690  tmp_invar_bypass.invp_min = pTS[4] - ipdelta;
691  tmp_invar_bypass.invp_max = pTS[4] + ipdelta;
692 
693  tmp_invar_bypass.invp_min2 = tmp_invar_bypass.invp_min*tmp_invar_bypass.invp_min;
694  tmp_invar_bypass.invp_max2 = tmp_invar_bypass.invp_max*tmp_invar_bypass.invp_max;
695 
696  double theta_center = pTS[3];
697  double theta_delta = sqrt(m_xiTC*sTheta);
698 
699  double phi_center = pTS[2];
700  double phi_delta = sqrt(m_xiFC*sPhi);
701 
702  bracket_angle(theta_center, theta_delta,
703  &(tmp_invar_bypass.min_theta), &(tmp_invar_bypass.max_theta));
704  bracket_angle(phi_center, phi_delta,
705  &(tmp_invar_bypass.min_phi), &(tmp_invar_bypass.max_phi));
706 
707  // // // // // // Fill the invar_bypass> // // // // // // //
708 
710  double x0=tP.position().x() ;
711  double y0=tP.position().y() ;
712  double z0=tP.position().z() ;
713  double H[3]; double gP[3] = {x0,y0,z0};
714 
715  // Get field cache object
717  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
718  if (fieldCondObj == nullptr) {
719  ATH_MSG_ERROR("TRT_SeededSpacePointFinder_ATL: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
720  return;
721  }
722  MagField::AtlasFieldCache fieldCache;
723  fieldCondObj->getInitializedCache (fieldCache);
724  fieldCache.getField (gP, H);
725 
726  //need conversion kilotesla -> kilogauss - Previously used getMagneticFiledKiloGauss, whereas new function returns value in kiloTesla...
727  H[0] *= 10000;
728  H[1] *= 10000;
729  H[2] *= 10000;
730 
731  std::list<std::pair<const Trk::SpacePoint*,int> >::iterator r0,r0e,r,re, rb;
732  const Trk::SpacePoint* SpToPair = nullptr;
733 
734 
736  //
737  int fmin=phi; int fmax=phi;
738  if(m_search){fmin = phi-1; fmax = phi+1;}
739  for(int f=fmin; f<=fmax; ++f) {
740  int j=0; f<0 ? j=f+event_data.m_fNmax+1 : f>event_data.m_fNmax ? j=f-event_data.m_fNmax-1 : j=f;
741  if(!event_data.m_rf_map[j]){
742  continue;
743  }
744  r0 = event_data.m_rf_Sorted[j].begin();
745  r0e = event_data.m_rf_Sorted[j].end();
746 
748  for(; r0!=r0e; ++r0){
749  if((((*r0).first)->r() > m_r1max) ||
750  (((*r0).first)->r() < m_r2min)) {
751  continue; //Fill only the SCT SPs
752  }
753  event_data.m_newRfi_Sorted.push_back(*r0);
754  }
755  }
756 
757  if(event_data.m_newRfi_Sorted.size()>5000 && event_data.m_newRfi_Sorted.size()<=10000) {
758  event_data.m_newRfi_Sorted.erase(event_data.m_newRfi_Sorted.begin(),event_data.m_newRfi_Sorted.end());
759  int fmin=phi; int fmax=phi;
760  for(int f=fmin; f<=fmax; ++f) {
761  int j=0; f<0 ? j=f+event_data.m_fNmax+1 : f>event_data.m_fNmax ? j=f-event_data.m_fNmax-1 : j=f;
762  if(!event_data.m_rf_map[j]){
763  continue;
764  }
765  r0 = event_data.m_rf_Sorted[j].begin();
766  r0e = event_data.m_rf_Sorted[j].end();
767 
769  for(; r0!=r0e; ++r0){
770  if((((*r0).first)->r()>m_r1max) || (((*r0).first)->r()<m_r2min)) {
771  continue; //Fill only the SCT SPs
772  }
773  event_data.m_newRfi_Sorted.push_back(*r0);
774  }
775  }
776  }
777  if(event_data.m_newRfi_Sorted.size()>10000) {
778  event_data.m_newRfi_Sorted.erase(event_data.m_newRfi_Sorted.begin(),event_data.m_newRfi_Sorted.end());
779  return;
780  }
781 
782  event_data.m_newRfi_Sorted.sort(MyNewDataSortPredicate());
783 
784  spcount = event_data.m_newRfi_Sorted.size();
785 
786  r = event_data.m_newRfi_Sorted.begin();
787  re = event_data.m_newRfi_Sorted.end();
788 
789  std::vector<bypass_struct> tmp_prod_bypass;
790  std::vector<const Trk::SpacePoint *> vrp;
791  std::vector<double> rk;
792  std::vector<long> geo_info;
793  std::vector<double> zSP;
794  tmp_prod_bypass.reserve(spcount);
795  vrp.reserve(spcount);
796  rk.reserve(spcount);
797  geo_info.reserve(spcount);
798  zSP.reserve(spcount);
799 
800  // // // // // // <Fill m_prod_bypass and the local array // // // //
801  for (; r != re; ++r) {
802  const Trk::SpacePoint *vrpi = (*r).first;
803 
804  geo_info.push_back((*r).second);
805  vrp.push_back(vrpi);
806  rk.push_back(vrpi->r());
807 
808  double X = vrpi->globalPosition().x() - x0;
809  double Y = vrpi->globalPosition().y() - y0;
810  double zSPi = vrpi->globalPosition().z();
811  zSP.push_back(zSPi);
812  double Z = zSPi - z0;
813 
814  double RR = X*X + Y*Y;
815  double R = sqrt(RR);
816  double invR = 1.0/R;
817 
818  double a = X*invR;
819  double b = Y*invR;
820 
821  tmp_prod_bypass.emplace_back();
822  tmp_prod_bypass.back().X = X;
823  tmp_prod_bypass.back().Y = Y;
824  tmp_prod_bypass.back().Z = Z;
825 
826  tmp_prod_bypass.back().R = R;
827  tmp_prod_bypass.back().invR = invR;
828 
829  tmp_prod_bypass.back().a = a;
830  tmp_prod_bypass.back().b = b;
831  }
832 
833  // // // // // // Fill m_prod_bypass and the local array> // // // //
834 
836 
837  if (m_doCosmics) { // no need to check this every time in the loop
838  for (long i = 0; i < (long)spcount; i++) {
839  SpToPair = nullptr;
840  const Trk::SpacePoint *up = vrp[i];
841  for (long j = i + 1; j < (long)spcount; j++) {
842  const Trk::SpacePoint *bp = vrp[j];
843  SpToPair = bp;
844  outputListBuffer.emplace_back(up, SpToPair);
845  }
846  if(!SpToPair) {
847  outputListBuffer.emplace_back(up, up);
848  }
849  }
850  }
851  else { // (!m_doCosmics)
852  for (long i = 0; i < (long)spcount; i++) {
853  SpToPair = nullptr;
854  const Trk::SpacePoint *up = vrp[i];
855  double R = rk[i];
856  if(R<m_r12min) {
857  continue;
858  }
859  double Z = zSP[i];
860  long geoi = geo_info[i];
861  int isBU = (geoi >> 4)-3;
862  int eleU = geoi & 15;
863 
864  for (long j = i + 1; j < (long)spcount; j++) {
865  const Trk::SpacePoint *bp = vrp[j];
866  double Zb = zSP[j];
867  double Rb = rk[j];
868  long geoj = geo_info[j];
869  int isBB = (geoj >> 4)-3;
870  int eleB = geoj & 15;
871  // // // // // // // // // // // // // // // // // // // // // //
872 
873  // Equivalent to {
874  // if ((isBU == 0) && (isBB != isBU)) continue;
875  // if((isBU == isBB) && (eleU <= eleB)) continue;
876  // }
877  // Rather cryptic but 2 to 3 times faster
878  // than the 4 branches above...
879 
880  int Bd = (isBU - isBB) | (isBB - isBU);
881  int Ed = (eleB - eleU);
882  int BUzero = (isBU | -isBU);
883  if (((BUzero | ~Bd) & (Bd | Ed) & (((unsigned)(-1) >> 1) + 1))
884  == 0) {
885  continue;
886  }
887 
888  // // // // // // // // // // // // // // // // // // // // // //
889  double dR = R - Rb;
890  double dZ = Z - Zb;
891  double dz_min = m_dzdrmin*dR;
892  double dz_max = m_dzdrmax*dR;
893  if (dZ < dz_min || dZ > dz_max) {
894  continue;//Should be within the +-2.5 pseudorapidity range
895  }
896  if(fieldCache.solenoidOn()) {
897  if(!cutTPb(tmp_invar_bypass, tmp_prod_bypass,i, j, H[2])) {
898  continue;
899  }
900  }
901  SpToPair = bp;
902  outputListBuffer.emplace_back(up, SpToPair);
903  }
904  if(!SpToPair) {
905  outputListBuffer.emplace_back(up, up);
906  }
907  }
908  }
909 
910  event_data.m_newRfi_Sorted.erase(event_data.m_newRfi_Sorted.begin(),event_data.m_newRfi_Sorted.end());
911 }
912 
913 // comment out to enable angle discontinuity correction
914 // so that e.g. angles PI-epsilon and -Pi+epsilon are treated
915 // as being 2*epsilon apart as they should, instead of 2*Pi-2*epsilon
916 // as they would w/o this correction
917 //#define ANGLE_DISCO_COMPAT
918 
919 bool
921  const std::vector<bypass_struct> &tmp_prod_bypass,
922  long bSP1, long bSP2, double H) const
923 {
924 
925  double inv_r2 = tmp_prod_bypass[bSP2].invR;
926  double inv_r1 = tmp_prod_bypass[bSP1].invR; // == u1 in original cutTP
927  double r1 = tmp_prod_bypass[bSP1].R;
928 
929  double inv_rr2 = inv_r2*inv_r2;
930  double x2 = tmp_prod_bypass[bSP2].X;
931  double y2 = tmp_prod_bypass[bSP2].Y;
932  double a1 = tmp_prod_bypass[bSP1].a;
933  double b1 = tmp_prod_bypass[bSP1].b;
934 
935  double u2 = (a1*x2 + b1*y2)*inv_rr2;
936  double v2 = (a1*y2 - b1*x2)*inv_rr2;
937 
938  double A = v2/(u2 - inv_r1);
939  double B = 2.0*(v2 - A*u2);
940  double CC = B*B/(1.0 + A*A);
941  double rcrc = CC*r1*r1;
942  double z1 = tmp_prod_bypass[bSP1].Z;
943  double T = -z1/(r1*(1.0 + 0.04*rcrc));
944 
945  if(H==0.) return false;
946 
947  double invpSignature = B*H;
948 
949  double invP2 = CC/(0.03*0.03*H*H*(1.0 + T*T));
950 
951  if (invpSignature >= 0 && invP2*0.9*0.9*m_ptmin*m_ptmin > 1.0) {
952  return false;
953  }
954 
955  double invp_min = tmp_invar_bypass.invp_min;
956  double invp_max = tmp_invar_bypass.invp_max;
957 
958  double invp_min2 = tmp_invar_bypass.invp_min2;
959  double invp_max2 = tmp_invar_bypass.invp_max2;
960 
961  if (invp_min >= 0) {
962  if (invpSignature < 0 || invP2 < invp_min2) {
963  return false;
964  }
965  }
966  else {
967  if (invpSignature < 0 && invP2 > invp_min2) {
968  return false;
969  }
970  }
971  if (invp_max >= 0) {
972  if (invpSignature >= 0 && invP2 > invp_max2) {
973  return false;
974  }
975  }
976  else {
977  if (invpSignature >= 0 || invP2 < invp_max2) {
978  return false;
979  }
980  }
981 
982  //Estimate the seed polar angle. Make a chi2 cut based on that suggested by the TRT segment
983 
984  double theta_rating = rotrating(1.0, T);
985  double tmin = tmp_invar_bypass.min_theta;
986  double tmax = tmp_invar_bypass.max_theta;
987 
988  if (tmin > tmax) {
989 #ifndef ANGLE_DISCO_COMPAT
990  // correct math but incompatible with old version
991  if (theta_rating >= 0) {
992  tmax += 4.0;
993  }
994  else {
995  tmin -= 4.0;
996  }
997 #else
998  // compatibility mode
999  if (tmin + tmax <= 0) {
1000  // center in "+" (YES, "+") range; any negative theta_rating => false
1001  tmax = 2.0; // forcing range into all positive
1002  }
1003  else {
1004  // center in "-" (YES, "-") range; any positive theta_rating => false
1005  tmin = -2.0; // forcing range into all negative
1006  }
1007 #endif
1008  }
1009 
1010  if (theta_rating < tmin || theta_rating > tmax) {
1011  return false;
1012  }
1013 
1014  double phi_rating = rotrating(-(b1 + a1*A), -(a1 - b1*A));
1015  double pmin = tmp_invar_bypass.min_phi;
1016  double pmax = tmp_invar_bypass.max_phi;
1017 
1018  if (pmin > pmax) {
1019 #ifndef ANGLE_DISCO_COMPAT
1020  // correct math but incompatible with old version
1021  if (phi_rating >= 0) {
1022  pmax += 4.0;
1023  }
1024  else {
1025  pmin -= 4.0;
1026  }
1027 #else
1028  // compatibility mode
1029  if (pmin + pmax <= 0) {
1030  // center in "+" (YES, "+") range; any negative phi_rating => false
1031  pmax = 2.0; // forcing range into all positive
1032  }
1033  else {
1034  // center in "-" (YES, "-") range; any positive phi_rating => false
1035  pmin = -2.0; // forcing range into all negative
1036  }
1037 #endif
1038  }
1039 
1040  return phi_rating >= pmin && phi_rating <= pmax;
1041 }
1042 
1043 // // // // // // // // // // // // // // // // // // // // // // // // // //
1044 
1045 
1047 // Check whether the SP belongs to a barrel or an endcap element
1049 
1050 void
1052 {
1053  const Trk::PrepRawData* p1;
1054  const InDet::SCT_Cluster* c1;
1055  Identifier id;
1056 
1057  p1 = SP->clusterList().first;
1058  if(p1){
1059  c1=dynamic_cast<const InDet::SCT_Cluster*>(p1);
1060  if(c1){
1061  id=c1->detectorElement()->identify();
1062  isB = m_sctId->barrel_ec(id);
1063  ld = m_sctId->layer_disk(id);
1064  }
1065  }
1066 
1067 }
1068 
1070 // MagneticFieldProperties production
1072 
1074 {
1078 }
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::TRT_SeededSpacePointFinder_ATL::m_xiC
double m_xiC
Max R-z direction cut
Definition: TRT_SeededSpacePointFinder_ATL.h:142
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
beamspotman.r
def r
Definition: beamspotman.py:676
rollrating
double rollrating(double angle)
Definition: TRT_SeededSpacePointFinder_ATL.cxx:610
InDet::TRT_SeededSpacePointFinder_ATL::m_spacepointsOverlapname
SG::ReadHandleKey< SpacePointOverlapCollection > m_spacepointsOverlapname
Definition: TRT_SeededSpacePointFinder_ATL.h:196
InDet::TRT_SeededSpacePointFinder_ATL::m_loadFull
bool m_loadFull
Do full neighbor search
Definition: TRT_SeededSpacePointFinder_ATL.h:146
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::max_phi
double max_phi
Definition: TRT_SeededSpacePointFinder_ATL.h:245
InDet::TRT_SeededSpacePointFinder_ATL::TRT_SeededSpacePointFinder_ATL
TRT_SeededSpacePointFinder_ATL(const std::string &, const std::string &, const IInterface *)
Standard tool methods
Definition: TRT_SeededSpacePointFinder_ATL.cxx:44
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::max_theta
double max_theta
Definition: TRT_SeededSpacePointFinder_ATL.h:245
TRT_SeededSpacePointFinder_ATL.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
InDet::ITRT_SeededSpacePointFinder::IEventData
Definition: ITRT_SeededSpacePointFinder.h:51
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
InDet::TRT_SeededSpacePointFinder_ATL::m_spacepointsPixname
SG::ReadHandleKey< SpacePointContainer > m_spacepointsPixname
Space points containers
Definition: TRT_SeededSpacePointFinder_ATL.h:194
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_nrf
int m_nrf
Definition: TRT_SeededSpacePointFinder_ATL.h:185
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_sF
double m_sF
Definition: TRT_SeededSpacePointFinder_ATL.h:186
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
WriteCellNoiseToCool.rb
rb
Definition: WriteCellNoiseToCool.py:229
SiSpacePointsSeed.h
InDet::TRT_SeededSpacePointFinder_ATL::m_r_rmax
double m_r_rmax
Minimum SCT radius to be searched
Definition: TRT_SeededSpacePointFinder_ATL.h:135
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
SG::ReadHandle< SpacePointContainer >
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigJetMonitorAlgorithm.ptmin
ptmin
Definition: TrigJetMonitorAlgorithm.py:1081
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
InDet::TRT_SeededSpacePointFinder_ATL::m_xiTC
double m_xiTC
qOverP based chi2 cut
Definition: TRT_SeededSpacePointFinder_ATL.h:143
extractSporadic.c1
c1
Definition: extractSporadic.py:134
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
InDet::TRT_SeededSpacePointFinder_ATL::newEvent
std::unique_ptr< InDet::ITRT_SeededSpacePointFinder::IEventData > newEvent() const
Method to initialize tool for new event
Definition: TRT_SeededSpacePointFinder_ATL.cxx:132
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
python.PhysicalConstants.pi2
float pi2
Definition: PhysicalConstants.py:52
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_ns
int m_ns
Definition: TRT_SeededSpacePointFinder_ATL.h:182
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_rf_index
int m_rf_index[530]
Definition: TRT_SeededSpacePointFinder_ATL.h:185
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
InDet::TRT_SeededSpacePointFinder_ATL::fillLists
void fillLists(std::vector< std::vector< const Trk::SpacePoint * > > &r_Sorted, InDet::TRT_SeededSpacePointFinder_ATL::EventData &event_data) const
Fill the space point container lists at beginning of each event.
Definition: TRT_SeededSpacePointFinder_ATL.cxx:552
InDet::TRT_SeededSpacePointFinder_ATL::m_r12min
double m_r12min
Max radius of last SCT layer
Definition: TRT_SeededSpacePointFinder_ATL.h:138
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ReadCellNoiseFromCoolCompare.s4
s4
Definition: ReadCellNoiseFromCoolCompare.py:381
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
InDet::MyNewDataSortPredicate
Sorting function according to space point radial position.
Definition: TRT_SeededSpacePointFinder_ATL.h:49
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::min_theta
double min_theta
Definition: TRT_SeededSpacePointFinder_ATL.h:245
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::TRT_SeededSpacePointFinder_ATL::EventData::buildFrameWork
void buildFrameWork(double r_rmax, double r_rstep, double ptmin)
Definition: TRT_SeededSpacePointFinder_ATL.cxx:525
Trk::SpacePoint::r
double r() const
returns the r value of the SpacePoint's position (in cylindrical coordinates).
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:137
x
#define x
SCT_Cluster.h
InDet::TRT_SeededSpacePointFinder_ATL::m_sctId
const SCT_ID * m_sctId
Magnetic field properties
Definition: TRT_SeededSpacePointFinder_ATL.h:127
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
InDet::TRT_SeededSpacePointFinder_ATL::~TRT_SeededSpacePointFinder_ATL
virtual ~TRT_SeededSpacePointFinder_ATL()
InDet::TRT_SeededSpacePointFinder_ATL::cutTPb
bool cutTPb(const invar_bypass_struct &invar_bypass, const std::vector< bypass_struct > &prod_bypass, long, long, double) const
Cut on chi2 based on TRT segment qOverP, theta and phi track parameters.
Definition: TRT_SeededSpacePointFinder_ATL.cxx:920
Trk::FastField
@ FastField
call the fast field access method of the FieldSvc
Definition: MagneticFieldMode.h:20
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_rf_map
int m_rf_map[530]
Definition: TRT_SeededSpacePointFinder_ATL.h:185
InDet::TRT_SeededSpacePointFinder_ATL::m_dzdrmax
double m_dzdrmax
Min R-z direction cut
Definition: TRT_SeededSpacePointFinder_ATL.h:141
H
#define H(x, y, z)
Definition: MD5.cxx:114
InDet::TRT_SeededSpacePointFinder_ATL::finalize
virtual StatusCode finalize()
Definition: TRT_SeededSpacePointFinder_ATL.cxx:121
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::TRT_SeededSpacePointFinder_ATL::m_fieldprop
Trk::MagneticFieldProperties m_fieldprop
Magnetic field mode
Definition: TRT_SeededSpacePointFinder_ATL.h:123
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_r_index
int * m_r_index
Definition: TRT_SeededSpacePointFinder_ATL.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_rf_Sorted
std::list< std::pair< const Trk::SpacePoint *, int > > m_rf_Sorted[530]
Definition: TRT_SeededSpacePointFinder_ATL.h:179
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
InDet::TRT_SeededSpacePointFinder_ATL::initialize
virtual StatusCode initialize()
Definition: TRT_SeededSpacePointFinder_ATL.cxx:90
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
python.selector.AtlRunQuerySelectorDQ.DD
DD
Definition: AtlRunQuerySelectorDQ.py:15
InDet::TRT_SeededSpacePointFinder_ATL::newRegion
std::unique_ptr< InDet::ITRT_SeededSpacePointFinder::IEventData > newRegion(const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &) const
Definition: TRT_SeededSpacePointFinder_ATL.cxx:242
InDet::TRT_SeededSpacePointFinder_ATL::m_ptmin
double m_ptmin
Seed selection criteria
Definition: TRT_SeededSpacePointFinder_ATL.h:133
SpacePointCLASS_DEF.h
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_r_map
int * m_r_map
Definition: TRT_SeededSpacePointFinder_ATL.h:184
CalibCoolCompareRT.up
up
Definition: CalibCoolCompareRT.py:109
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::invp_min2
double invp_min2
Definition: TRT_SeededSpacePointFinder_ATL.h:246
InDet::TRT_SeededSpacePointFinder_ATL::m_spacepointsSCTname
SG::ReadHandleKey< SpacePointContainer > m_spacepointsSCTname
Definition: TRT_SeededSpacePointFinder_ATL.h:195
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
Preparation.mode
mode
Definition: Preparation.py:95
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_fNmax
int m_fNmax
Definition: TRT_SeededSpacePointFinder_ATL.h:183
Trk::ParametersBase
Definition: ParametersBase.h:55
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
InDet::TRT_SeededSpacePointFinder_ATL::m_search
bool m_search
phi based chi2 cut
Definition: TRT_SeededSpacePointFinder_ATL.h:145
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
Trk::PRDtoTrackMap::isUsed
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
InDet::TRT_SeededSpacePointFinder_ATL::dump
MsgStream & dump(MsgStream &out) const
Print internal tool parameters and status
Definition: TRT_SeededSpacePointFinder_ATL.cxx:511
MagField::AtlasFieldCache::solenoidOn
bool solenoidOn() const
status of the magnets
Trk::FullField
@ FullField
Field is set to be realistic, but within a given Volume.
Definition: MagneticFieldMode.h:21
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
InDet::TRT_SeededSpacePointFinder_ATL::m_fieldmode
std::string m_fieldmode
Protected data and methods
Definition: TRT_SeededSpacePointFinder_ATL.h:121
InDet::TRT_SeededSpacePointFinder_ATL::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TRT_SeededSpacePointFinder_ATL.h:198
min
#define min(a, b)
Definition: cfImp.cxx:40
bracket_angle
void bracket_angle(double angle, double delta, double *min, double *max)
Definition: TRT_SeededSpacePointFinder_ATL.cxx:640
Trk::PrepRawData
Definition: PrepRawData.h:62
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
InDet::TRT_SeededSpacePointFinder_ATL::m_dzdrmin
double m_dzdrmin
Min radius to search for SP pairs
Definition: TRT_SeededSpacePointFinder_ATL.h:140
Trk::NoField
@ NoField
Field is set to 0., 0., 0.,.
Definition: MagneticFieldMode.h:18
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::invp_max
double invp_max
Definition: TRT_SeededSpacePointFinder_ATL.h:245
InDet::TRT_SeededSpacePointFinder_ATL::geoInfo
void geoInfo(const Trk::SpacePoint *, int &, int &) const
Obtain geo model info for a specific space point
Definition: TRT_SeededSpacePointFinder_ATL.cxx:1051
ReadCellNoiseFromCoolCompare.s3
s3
Definition: ReadCellNoiseFromCoolCompare.py:380
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::invp_min
double invp_min
Definition: TRT_SeededSpacePointFinder_ATL.h:245
InDet::TRT_SeededSpacePointFinder_ATL::m_r2min
double m_r2min
Min radius of last SCT layer
Definition: TRT_SeededSpacePointFinder_ATL.h:139
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct
Definition: TRT_SeededSpacePointFinder_ATL.h:244
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::TRT_SeededSpacePointFinder_ATL::EventData::erase
void erase()
Definition: TRT_SeededSpacePointFinder_ATL.cxx:592
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Trk::MagneticFieldProperties::magneticFieldMode
MagneticFieldMode magneticFieldMode() const
Returns the MagneticFieldMode as specified.
InDet::TRT_SeededSpacePointFinder_ATL::magneticFieldInit
void magneticFieldInit()
Get magnetic field properties
Definition: TRT_SeededSpacePointFinder_ATL.cxx:1073
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
IdentifiableContainerMT::indexFindPtr
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
Definition: IdentifiableContainerMT.h:292
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
InDet::TRT_SeededSpacePointFinder_ATL::dumpConditions
MsgStream & dumpConditions(MsgStream &out) const
Protected methods
Definition: TRT_SeededSpacePointFinder_ATL.cxx:375
InDet::TRT_SeededSpacePointFinder_ATL::m_doCosmics
bool m_doCosmics
Load full Si space point container
Definition: TRT_SeededSpacePointFinder_ATL.h:147
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_newRfi_Sorted
std::list< std::pair< const Trk::SpacePoint *, int > > m_newRfi_Sorted
Definition: TRT_SeededSpacePointFinder_ATL.h:180
InDet::TRT_SeededSpacePointFinder_ATL::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: TRT_SeededSpacePointFinder_ATL.h:201
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
InDet::TRT_SeededSpacePointFinder_ATL::m_xiFC
double m_xiFC
theta based chi2 cut
Definition: TRT_SeededSpacePointFinder_ATL.h:144
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::invp_max2
double invp_max2
Definition: TRT_SeededSpacePointFinder_ATL.h:246
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_r_size
int m_r_size
Definition: TRT_SeededSpacePointFinder_ATL.h:178
SpacePointCollection
Definition: SpacePointCollection.h:40
re
const boost::regex re(r_e)
DEBUG
#define DEBUG
Definition: page_access.h:11
F
#define F(x, y, z)
Definition: MD5.cxx:112
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
InDet::TRT_SeededSpacePointFinder_ATL::m_r1max
double m_r1max
Step size for space point storage
Definition: TRT_SeededSpacePointFinder_ATL.h:137
InDet::TRT_SeededSpacePointFinder_ATL::production2Spb
void production2Spb(const EventContext &ctx, const Trk::TrackParameters &, int, std::list< std::pair< const Trk::SpacePoint *, const Trk::SpacePoint * > > &outputListBuffer, InDet::TRT_SeededSpacePointFinder_ATL::EventData &event_data) const
Form possible space point combinations within allowed radial and pseudorapidity ranges.
Definition: TRT_SeededSpacePointFinder_ATL.cxx:669
InDet::TRT_SeededSpacePointFinder_ATL::m_r_rmin
double m_r_rmin
Minimum pT cut
Definition: TRT_SeededSpacePointFinder_ATL.h:134
InDet::TRT_SeededSpacePointFinder_ATL::m_r_rstep
double m_r_rstep
Maximum STC radius to be searched
Definition: TRT_SeededSpacePointFinder_ATL.h:136
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition: AtlasFieldCache.cxx:42
InDet::TRT_SeededSpacePointFinder_ATL::dumpEvent
MsgStream & dumpEvent(MsgStream &out, InDet::TRT_SeededSpacePointFinder_ATL::EventData &event_data) const
Definition: TRT_SeededSpacePointFinder_ATL.cxx:465
jobOptions.prec
prec
Definition: jobOptions.Superchic_UPC_yyMuMu.py:20
InDet::TRT_SeededSpacePointFinder_ATL::EventData::m_nr
int m_nr
Definition: TRT_SeededSpacePointFinder_ATL.h:184
Trk::EventDataBase< EventData, InDet::ITRT_SeededSpacePointFinder::IEventData >::getPrivateEventData
static EventData & getPrivateEventData(InDet::ITRT_SeededSpacePointFinder::IEventData &virt_event_data)
Definition: EventDataBase.h:19
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
ReadHandle.h
Handle class for reading from StoreGate.
AthAlgTool
Definition: AthAlgTool.h:26
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
InDet::TRT_SeededSpacePointFinder_ATL::EventData
Definition: TRT_SeededSpacePointFinder_ATL.h:155
InDet::TRT_SeededSpacePointFinder_ATL::find2Sp
std::list< std::pair< const Trk::SpacePoint *, const Trk::SpacePoint * > > find2Sp(const EventContext &ctx, const Trk::TrackParameters &, ITRT_SeededSpacePointFinder::IEventData &event_data) const
Main method of seed production
Definition: TRT_SeededSpacePointFinder_ATL.cxx:335
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:14
Analysis::CC
@ CC
Definition: JpsiFinder.h:39
rotrating
double rotrating(double y, double x)
Definition: TRT_SeededSpacePointFinder_ATL.cxx:657
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDet::TRT_SeededSpacePointFinder_ATL::invar_bypass_struct::min_phi
double min_phi
Definition: TRT_SeededSpacePointFinder_ATL.h:245