CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
SortLayersByZR Class Reference

#include <SortLayersByZR.h>

Public Member Functions

bool LayersSortedInZR (const std::vector< const Ring * > &layerA, const std::vector< const Ring * > &layerB) const
 
bool operator() (const std::vector< const Ring * > &layerA, const std::vector< const Ring * > &layerB) const
 
 SortLayersByZR ()
 
 ~SortLayersByZR ()
 

Detailed Description

Definition at line 22 of file SortLayersByZR.h.

Constructor & Destructor Documentation

SortLayersByZR::SortLayersByZR ( )

Definition at line 18 of file SortLayersByZR.cc.

18  {
19  //
20  // default constructor
21  //
22 }
SortLayersByZR::~SortLayersByZR ( )

Definition at line 24 of file SortLayersByZR.cc.

24  {
25  //
26  // default destructor
27  //
28 }

Member Function Documentation

bool SortLayersByZR::LayersSortedInZR ( const std::vector< const Ring * > &  layerA,
const std::vector< const Ring * > &  layerB 
) const

Definition at line 30 of file SortLayersByZR.cc.

References a, b, Ring::getindex(), and query::result.

Referenced by operator()().

30  {
31  //
32  // return true if layers are sorted in abs ZR, else return false
33  // use first ring of layer as reference
34 
35  const Ring* a = (*(layerA.begin()));
36  const Ring* b = (*(layerB.begin()));
37 
38  // return value
39  bool result = true;
40 
41  if ( a->getindex() > b->getindex() ) {
42  result = false;
43  }
44 
45 // double r1 = (a->getrmax() - a->getrmin())/2 + a->getrmin();
46 // double z1 = (a->getzmax() - a->getzmin())/2 + a->getzmin();
47 
48 // double r2 = (b->getrmax() - b->getrmin())/2 + b->getrmin();
49 // double z2 = (b->getzmax() - b->getzmin())/2 + b->getzmin();
50 
51 // if ( a->getType() == b->getType() ) {
52 // if ( a->getType() == Ring::TIBRing ||
53 // a->getType() == Ring::TOBRing ||
54 // a->getType() == Ring::PXBRing ) {
55 // if ( r1 > r2 ) {
56 // result = false;
57 // } else {
58 // if ( z1 > z2 ) {
59 // result = false;
60 // }
61 // }
62 // } else {
63 // if ( z1 > z2 ) {
64 // result = false;
65 // } else {
66 // if ( r1 > r2 ) {
67 // result = false;
68 // }
69 // }
70 // }
71 // } else {
72 // if ( (a->getType() == Ring::PXBRing && b->getType() == Ring::TIBRing) ||
73 // (a->getType() == Ring::TIBRing && b->getType() == Ring::PXBRing) ) {
74 // if ( r1 > r2 ) {
75 // result = false;
76 // }
77 // else {
78 // if ( z1 > z2 ) {
79 // result = false;
80 // }
81 // }
82 
83 // } else if ( (a->getType() == Ring::PXBRing && b->getType() == Ring::TOBRing) ||
84 // (a->getType() == Ring::TOBRing && b->getType() == Ring::PXBRing) ) {
85 // if ( r1 > r2 ) {
86 // result = false;
87 // }
88 // else {
89 // if ( z1 > z2 ) {
90 // result = false;
91 // }
92 // }
93 
94 // } else if ( (a->getType() == Ring::PXBRing && b->getType() == Ring::PXFRing) ||
95 // (a->getType() == Ring::PXFRing && b->getType() == Ring::PXBRing) ) {
96 // if ( z1 > z2 ) {
97 // result = false;
98 // }
99 // else {
100 // if ( r1 > r2 ) {
101 // result = false;
102 // }
103 // }
104 
105 // } else if ( (a->getType() == Ring::PXBRing && b->getType() == Ring::TIDRing) ||
106 // (a->getType() == Ring::TIDRing && b->getType() == Ring::PXBRing) ) {
107 // if ( z1 > z2 ) {
108 // result = false;
109 // }
110 // else {
111 // if ( r1 > r2 ) {
112 // result = false;
113 // }
114 // }
115 
116 // } else if ( (a->getType() == Ring::PXBRing && b->getType() == Ring::TECRing) ||
117 // (a->getType() == Ring::TECRing && b->getType() == Ring::PXBRing) ) {
118 // if ( z1 > z2 ) {
119 // result = false;
120 // }
121 // else {
122 // if ( r1 > r2 ) {
123 // result = false;
124 // }
125 // }
126 
127 // } else if ( (a->getType() == Ring::TIBRing && b->getType() == Ring::TOBRing) ||
128 // (a->getType() == Ring::TOBRing && b->getType() == Ring::TIBRing) ) {
129 // if ( r1 > r2 ) {
130 // result = false;
131 // }
132 // else {
133 // if ( z1 > z2 ) {
134 // result = false;
135 // }
136 // }
137 
138 // } else if ( (a->getType() == Ring::TIBRing && b->getType() == Ring::PXFRing) ||
139 // (a->getType() == Ring::PXFRing && b->getType() == Ring::TIBRing) ) {
140 // if ( r1 > r2 ) {
141 // result = false;
142 // }
143 // else {
144 // if ( z1 > z2 ) {
145 // result = false;
146 // }
147 // }
148 
149 // } else if ( (a->getType() == Ring::TIBRing && b->getType() == Ring::TIDRing) ||
150 // (a->getType() == Ring::TIDRing && b->getType() == Ring::TIBRing) ) {
151 // if ( z1 > z2 ) {
152 // result = false;
153 // }
154 // else {
155 // if ( r1 > r2 ) {
156 // result = false;
157 // }
158 // }
159 
160 // } else if ( (a->getType() == Ring::TIBRing && b->getType() == Ring::TECRing) ||
161 // (a->getType() == Ring::TECRing && b->getType() == Ring::TIBRing) ) {
162 // if ( z1 > z2 ) {
163 // result = false;
164 // }
165 // else {
166 // if ( r1 > r2 ) {
167 // result = false;
168 // }
169 // }
170 
171 // } else if ( (a->getType() == Ring::TOBRing && b->getType() == Ring::PXFRing) ||
172 // (a->getType() == Ring::PXFRing && b->getType() == Ring::TOBRing) ) {
173 // if ( r1 > r2 ) {
174 // result = false;
175 // }
176 // else {
177 // if ( z1 > z2 ) {
178 // result = false;
179 // }
180 // }
181 
182 // } else if ( (a->getType() == Ring::TOBRing && b->getType() == Ring::TIDRing) ||
183 // (a->getType() == Ring::TIDRing && b->getType() == Ring::TOBRing) ) {
184 // if ( r1 > r2 ) {
185 // result = false;
186 // }
187 // else {
188 // if ( z1 > z2 ) {
189 // result = false;
190 // }
191 // }
192 
193 // } else if ( (a->getType() == Ring::TOBRing && b->getType() == Ring::TECRing) ||
194 // (a->getType() == Ring::TECRing && b->getType() == Ring::TOBRing) ) {
195 // if ( z1 > z2 ) {
196 // result = false;
197 // }
198 // else {
199 // if ( r1 > r2 ) {
200 // result = false;
201 // }
202 // }
203 
204 // } else if ( (a->getType() == Ring::PXFRing && b->getType() == Ring::TIDRing) ||
205 // (a->getType() == Ring::TIDRing && b->getType() == Ring::PXFRing) ) {
206 // if ( z1 > z2 ) {
207 // result = false;
208 // }
209 // else {
210 // if ( r1 > r2 ) {
211 // result = false;
212 // }
213 // }
214 
215 // } else if ( (a->getType() == Ring::PXFRing && b->getType() == Ring::TECRing) ||
216 // (a->getType() == Ring::TECRing && b->getType() == Ring::PXFRing) ) {
217 // if ( z1 > z2 ) {
218 // result = false;
219 // }
220 // else {
221 // if ( r1 > r2 ) {
222 // result = false;
223 // }
224 // }
225 
226 // } else if ( (a->getType() == Ring::TIDRing && b->getType() == Ring::TECRing) ||
227 // (a->getType() == Ring::TECRing && b->getType() == Ring::TIDRing) ) {
228 // if ( z1 > z2 ) {
229 // result = false;
230 // }
231 // else {
232 // if ( r1 > r2 ) {
233 // result = false;
234 // }
235 // }
236 
237 // }
238 
239 // }
240 
241  return result;
242 }
unsigned int getindex() const
Definition: Ring.h:185
Definition: Ring.h:31
tuple result
Definition: query.py:137
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
bool SortLayersByZR::operator() ( const std::vector< const Ring * > &  layerA,
const std::vector< const Ring * > &  layerB 
) const
inline

Definition at line 29 of file SortLayersByZR.h.

References LayersSortedInZR().

29  {
30  return LayersSortedInZR(layerA,layerB);
31  }
bool LayersSortedInZR(const std::vector< const Ring * > &layerA, const std::vector< const Ring * > &layerB) const