17 const bool BIT_COMP) {
20 if ((mode % 8) / 4 > 0)
22 else if ((mode % 4) / 2 > 0)
24 else if ((mode % 2) > 0)
33 int nBits = (mode == 15 ? 4 : 5);
34 theta = ENG.
getTheta(theta, st1_ring2, nBits);
57 const bool BIT_COMP) {
67 if ((mode % 8) / 4 > 0)
68 dPhSign = (dPh12 >= 0 ? +1 : -1);
69 else if ((mode % 4) / 2 > 0)
70 dPhSign = (dPh13 >= 0 ? +1 : -1);
71 else if ((mode % 2) > 0)
72 dPhSign = (dPh14 >= 0 ? +1 : -1);
73 }
else if ((mode % 8) / 4 > 0) {
74 if ((mode % 4) / 2 > 0)
75 dPhSign = (dPh23 >= 0 ? +1 : -1);
76 else if ((mode % 2) > 0)
77 dPhSign = (dPh24 >= 0 ? +1 : -1);
78 }
else if ((mode % 4) / 2 > 0) {
80 dPhSign = (dPh34 >= 0 ? +1 : -1);
83 if (not(dPhSign != 0)) {
103 if (mode == 7 || mode == 11 || mode > 12) {
127 dPh13 = dPh12 + dPh23;
128 dPh14 = dPh13 + dPh34;
129 dPh24 = dPh23 + dPh34;
132 dPh13 = dPh12 + dPh23;
135 dPh14 = dPh12 + dPh24;
138 dPh14 = dPh13 + dPh34;
141 dPh24 = dPh23 + dPh34;
151 CalcDeltaPhiSums(dPhSum4, dPhSum4A, dPhSum3, dPhSum3A, outStPh, dPh12, dPh13, dPh14, dPh23, dPh24, dPh34);
166 const bool BIT_COMP) {
175 int nBits = (mode == 15 ? 2 : 3);
198 const bool BIT_COMP) {
206 if (mode == 7 || mode == 11 || mode > 12)
210 bend1 = ENG.
getCLCT(pat1, endcap, dPhSign, nBits);
211 if ((mode % 8) / 4 > 0)
212 bend2 = ENG.
getCLCT(pat2, endcap, dPhSign, nBits);
213 if ((mode % 4) / 2 > 0)
214 bend3 = ENG.
getCLCT(pat3, endcap, dPhSign, nBits);
216 bend4 = ENG.
getCLCT(pat4, endcap, dPhSign, nBits);
228 const bool BIT_COMP) {
232 if (mode == 15 && !st1_ring2) {
241 int nRPC = (RPC1 == 1) + (RPC2 == 1) + (RPC3 == 1) + (RPC4 == 1);
246 if (RPC1 == 1 && RPC2 == 1) {
249 }
else if (RPC1 == 1 && RPC3 == 1) {
251 }
else if (RPC4 == 1 && RPC2 == 1) {
253 }
else if (RPC3 == 1 && RPC4 == 1 && !st1_ring2) {
256 }
else if (mode == 14) {
260 }
else if (RPC3 == 1) {
263 }
else if (mode == 13) {
267 }
else if (RPC4 == 1) {
270 }
else if (mode == 11) {
274 }
else if (RPC4 == 1) {
277 }
else if (mode == 7) {
281 }
else if (RPC4 == 1) {
298 else if ((pattern % 2) == 0)
300 else if ((pattern % 2) == 1)
301 bend = -1 * (11 - pattern) / 2;
307 if (not(bend != -99)) {
325 dPhSum4 = dPh12 + dPh13 + dPh14 + dPh23 + dPh24 + dPh34;
326 dPhSum4A =
abs(dPh12) +
abs(dPh13) +
abs(dPh14) +
abs(dPh23) +
abs(dPh24) +
abs(dPh34);
327 int devSt1 =
abs(dPh12) +
abs(dPh13) +
abs(dPh14);
328 int devSt2 =
abs(dPh12) +
abs(dPh23) +
abs(dPh24);
329 int devSt3 =
abs(dPh13) +
abs(dPh23) +
abs(dPh34);
330 int devSt4 =
abs(dPh14) +
abs(dPh24) +
abs(dPh34);
332 if (devSt4 > devSt3 && devSt4 > devSt2 && devSt4 > devSt1)
334 else if (devSt3 > devSt4 && devSt3 > devSt2 && devSt3 > devSt1)
336 else if (devSt2 > devSt4 && devSt2 > devSt3 && devSt2 > devSt1)
338 else if (devSt1 > devSt4 && devSt1 > devSt3 && devSt1 > devSt2)
344 dPhSum3 = dPh12 + dPh13 + dPh23;
345 dPhSum3A =
abs(dPh12) +
abs(dPh13) +
abs(dPh23);
346 }
else if (outStPh == 3) {
347 dPhSum3 = dPh12 + dPh14 + dPh24;
348 dPhSum3A =
abs(dPh12) +
abs(dPh14) +
abs(dPh24);
349 }
else if (outStPh == 2) {
350 dPhSum3 = dPh13 + dPh14 + dPh34;
351 dPhSum3A =
abs(dPh13) +
abs(dPh14) +
abs(dPh34);
353 dPhSum3 = dPh23 + dPh24 + dPh34;
354 dPhSum3A =
abs(dPh23) +
abs(dPh24) +
abs(dPh34);
int getTheta(int theta, int ring2, int bits=5) const
void CalcBends(int &bend1, int &bend2, int &bend3, int &bend4, const int pat1, const int pat2, const int pat3, const int pat4, const int dPhSign, const int endcap, const int mode, const bool BIT_COMP)
Geom::Theta< T > theta() const
int CalcTrackTheta(const int th1, const int th2, const int th3, const int th4, const int st1_ring2, const int mode, const bool BIT_COMP)
int CalcBendFromPattern(const int pattern, const int endcap)
void CalcDeltaPhis(int &dPh12, int &dPh13, int &dPh14, int &dPh23, int &dPh24, int &dPh34, int &dPhSign, int &dPhSum4, int &dPhSum4A, int &dPhSum3, int &dPhSum3A, int &outStPh, const int ph1, const int ph2, const int ph3, const int ph4, const int mode, const bool BIT_COMP)
void CalcDeltaPhiSums(int &dPhSum4, int &dPhSum4A, int &dPhSum3, int &dPhSum3A, int &outStPh, const int dPh12, const int dPh13, const int dPh14, const int dPh23, const int dPh24, const int dPh34)
int getNLBdPhi(int dPhi, int bits=7, int max=512) const
Abs< T >::type abs(const T &t)
int getCLCT(int clct, int endcap, int dPhiSign, int bits=3) const
void CalcDeltaThetas(int &dTh12, int &dTh13, int &dTh14, int &dTh23, int &dTh24, int &dTh34, const int th1, const int th2, const int th3, const int th4, const int mode, const bool BIT_COMP)
void CalcRPCs(int &RPC1, int &RPC2, int &RPC3, int &RPC4, const int mode, const int st1_ring2, const int theta, const bool BIT_COMP)
int getdTheta(int dTheta, int bits=3) const
PtAssignmentEngineAux2017 ENG