ATLAS Offline Software
SiDetElementsComparison.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SiDetElementsComparison_h
6 #define SiDetElementsComparison_h
8 
9 namespace InDet{
10 
12  // Object function for ordering barrel pixels and silicons wafers
13  // in azimuthal angle order
15 
17 
18  public:
19 
21  const InDetDD::SiDetectorElement* e2) const
22  {
23 
24  Amg::Vector3D p1 = e1->center();
25  Amg::Vector3D p2 = e2->center();
26  double f1 = atan2(p1.y(),p1.x());
27  double f2 = atan2(p2.y(),p2.x());
28  return(f1<f2);
29  }
30  };
31 
33  // Object function for ordering barrel pixels and silicons wafers
34  // in radius, azimuthal angle and Z order
36 
38 
39  public:
40 
42  const InDetDD::SiDetectorElement* e2) const
43  {
44 
45  Amg::Vector3D p1 = e1->center();
46  Amg::Vector3D p2 = e2->center();
47  double r1 = sqrt(p1.x()*p1.x()+p1.y()*p1.y());
48  double r2 = sqrt(p2.x()*p2.x()+p2.y()*p2.y());
49  if(fabs(r1-r2)>.1) return(r1<r2);
50  double f1 = atan2(p1.y(),p1.x());
51  double f2 = atan2(p2.y(),p2.x());
52  if(fabs(f1-f2)>.04) return(f1<f2);
53  return(p1.z()<p2.z());
54  }
55  };
56 
58  // Object function for ordering endcap pixels and silicons wafers
59  // in Z, rings and azimuthal angle order
61 
63 
64  public:
65 
67  const InDetDD::SiDetectorElement* e2) const
68  {
69 
70  Amg::Vector3D p1 = e1->center();
71  Amg::Vector3D p2 = e2->center();
72  double z1 = p1.z();
73  double z2 = p2.z();
74  if(fabs(z1-z2)>.1) return(fabs(z1)<fabs(z2));
75 
76  if(e1->isPixel() && e2->isSCT ()) return true ;
77  if(e1->isSCT () && e2->isPixel()) return false;
78 
79  double r1 = sqrt(p1.x()*p1.x()+p1.y()*p1.y());
80  double r2 = sqrt(p2.x()*p2.x()+p2.y()*p2.y());
81  if(r2-r1> 10.) return true;
82  if(r1-r2> 10.) return false;
83 
84  double f1 = atan2(p1.y(),p1.x());
85  double f2 = atan2(p2.y(),p2.x());
86  return(f1<f2);
87  }
88  };
89 
91  public:
94  if (l1.way() == l2.way()){
95  return l1.distance() < l2.distance();
96  }
98  else return l1.way() < l2.way();
99  }
100  };
101 
103  // Object function for ordering InDet::SiDetElementLink_xk
104  // in azimuthal angle order
106 
108 
109  public:
110 
112  const InDet::SiDetElementLink_xk& l2) const
113  {
114  return (l1.phi() < l2.phi());
115  }
116  };
117 
118 }
119 #endif // SiDetElementsComparison_h
InDet::compDetElements_A::operator()
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
Definition: SiDetElementsComparison.h:20
InDet::compDetElements_RAZ::operator()
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
Definition: SiDetElementsComparison.h:41
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
InDet::compDetElements_Azimuthal
Definition: SiDetElementsComparison.h:107
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
InDet::compDetElements_ZRA
Definition: SiDetElementsComparison.h:62
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
InDet::compDetElements_ZRA::operator()
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
Definition: SiDetElementsComparison.h:66
InDet::compDetElementWays
Definition: SiDetElementsComparison.h:90
InDet::compDetElements_Azimuthal::operator()
bool operator()(const InDet::SiDetElementLink_xk &l1, const InDet::SiDetElementLink_xk &l2) const
Definition: SiDetElementsComparison.h:111
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::compDetElementWays::operator()
bool operator()(const SiDetElementLink_xk::ElementWay &l1, const SiDetElementLink_xk::ElementWay &l2) const
Definition: SiDetElementsComparison.h:92
InDet::compDetElements_A
Definition: SiDetElementsComparison.h:16
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
InDet::compDetElements_RAZ
Definition: SiDetElementsComparison.h:37
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4