ATLAS Offline Software
Loading...
Searching...
No Matches
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
9namespace 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
Class to hold geometrical description of a silicon detector element.
bool operator()(const SiDetElementLink_xk::ElementWay &l1, const SiDetElementLink_xk::ElementWay &l2) const
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
bool operator()(const InDet::SiDetElementLink_xk &l1, const InDet::SiDetElementLink_xk &l2) const
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
bool operator()(const InDetDD::SiDetectorElement *e1, const InDetDD::SiDetectorElement *e2) const
Eigen::Matrix< double, 3, 1 > Vector3D
Primary Vertex Finder.