14 int CompIndex = (endcap - 1)*6 + sector - 1;
15 bool AdSector =
false;
16 if((SectIndex == 0 && CompIndex == 5) ||
17 (SectIndex == 1 && CompIndex == 0) ||
18 (SectIndex == 2 && CompIndex == 1) ||
19 (SectIndex == 3 && CompIndex == 2) ||
20 (SectIndex == 4 && CompIndex == 3) ||
21 (SectIndex == 5 && CompIndex == 4) ||
22 (SectIndex == 6 && CompIndex == 11) ||
23 (SectIndex == 7 && CompIndex == 6) ||
24 (SectIndex == 8 && CompIndex == 7) ||
25 (SectIndex == 9 && CompIndex == 8) ||
26 (SectIndex == 10 && CompIndex == 9) ||
27 (SectIndex == 11 && CompIndex == 10) ){AdSector =
true;}
29 if(AdSector && sub == 2 && station == 1 && (
id == 3 ||
id == 6 ||
id == 9) )
32 if(AdSector && station > 1 && (
id == 3 ||
id == 9) )
42 {{{39,39,-99}, {57,57,-99}, {76,76,-99}, {39,-99,-99}, {58,-99,-99},
43 {76,-99,-99}, {41,-99,-99}, {60,-99,-99}, {79,-99,-99}, {21,21,23}},
44 {{95,95,-99}, {114,114,-99}, {132,132,-99}, {95,-99,-99}, {114,-99,-99},
45 {133,-99,-99}, {98,-99,-99}, {116,-99,-99}, {135,-99,-99}, {21,21,23}},
46 {{38,38,-99}, {76,76,-99}, {113,113,-99}, {39,39,-99}, {58,58,-99},
47 {76,76,-99}, {95,95,-99}, {114,114,-99}, {132,132,-99}, {1,21,21}},
48 {{38,-99,-99}, {76,-99,-99}, {113,-99,-99}, {39,39,39}, {58,58,58},
49 {76,76,76}, {95,95,95}, {114,114,114}, {132,132,132}, {1,21,21}},
50 {{38,-99,-99}, {76,-99,-99}, {113,-99,-99}, {38,38,-99}, {57,57,-99},
51 {76,76,-99}, {95,95,-99}, {113,113,-99}, {132,132,-99}, {1,20,20}}};
53 std::vector<ConvertedHit>
PrimConv(std::vector<TriggerPrimitive> TriggPrim,
int SectIndex){
57 std::vector<ConvertedHit> ConvHits;
58 for(std::vector<TriggerPrimitive>::iterator C1 = TriggPrim.begin();C1 != TriggPrim.end();C1++){
63 TriggerPrimitive C3 = *C1;
67 int sector = Det.
triggerSector(), strip = C3.getCSCData().strip,
pattern = C3.getPattern(), Id = C3.Id();
70 if(station == 1 &&
ring == 1 && strip > 127){
89 bool IsNeighbor =
neighbor(
endcap,sector,SectIndex,Id,sub,station);
91 if(
ring == 4){Id += 9;}
94 if( (SectIndex == (
endcap - 1)*6 + sector - 1 ) || IsNeighbor )
107 int ph_tmp = -999, th_tmp = -999;
108 int clctpatcor = -999, clctpatsign = -999;
109 int eightstrip = -999;
112 (station == 1 &&
ring == 4) ? 1707:
113 (station == 1 &&
ring == 3) ? 947:
114 (station == 1 &&
ring == 1) ? 1301:
120 (
endcap == 1 && station >= 3) ? 1:
121 (
endcap == 2 && station < 3) ? 1: 0;
124 (station <= 1 && Id > 6 && Id < 10) ? 15 :
125 (station >= 2 && Id <= 3) ? 40 : 20;
128 (station == 1 && Id <= 3) ? 45 :
129 (station == 1 && Id > 6 && Id < 10) ? 27 :
130 (station == 1 && Id > 3) ? 39 :
131 (station == 2 && Id <= 3) ? 43 :
132 (station == 2 && Id > 3) ? 56 :
133 (station == 3 && Id <= 3) ? 34 :
134 (station == 3 && Id > 3) ? 52 :
135 (station == 4 && Id <= 3) ? 28 :
136 (station == 4 && Id > 3) ? 50 : 0;
139 (station <= 1 && (Id <= 3 || Id > 9)) ? 41 :
140 (station == 2 && Id <= 3) ? 41 :
141 (station == 2 && Id > 3) ? 87 :
142 (station == 3 && Id > 3) ? 49 :
143 (station == 4 && Id > 3) ? 49 : 127;
145 int ph_zone_bnd2 = (station == 3 && Id > 3) ? 87 : 127;
147 int zone_overlap = 2;
149 int fph = -999, th = -999, ph_hit = -999, phzvl = -999;
184 case 1: LUTi = nId - 1;
break;
185 case 2: LUTi = 15 + nId;
break;
189 case 2: LUTi = 27 + nId;
break;
190 case 3: LUTi = 38 + nId;
break;
191 case 4: LUTi = 49 + nId;
break;
195 if(IsNeighbor && station == 1){
199 case 1: LUTi = 15 + nId;
break;
200 case 2: LUTi = nId - 1;
break;
215 clctpatsign = ((
pattern%2) == 0);
217 if(
pattern >= 2) {clctpatcor = 5;}
218 if(
pattern >= 6) {clctpatcor = 2;}
219 if(
pattern == 10) {clctpatcor = 0;clctpatsign = 0;}
226 eightstrip = 8*strip;
227 int patcor = clctpatcor;
231 if(station == 1 || Id > 3){
233 eightstrip = (eightstrip>>1);
234 patcor = (patcor>>1);
235 if(
ring == 4 && strip > 127) eightstrip -= 512;
240 if(clctpatsign) patcor = -patcor;
241 eightstrip += patcor;
247 ph_tmp = ((eightstrip*
factor)>>10);
248 int phShift = (ph_tmp>>5);
258 int phInitIndex = Id;
263 int neighborId = C3.Id()/3;
268 phInitIndex = 12 + neighborId;
279 int neighborId = Id/3;
284 phInitIndex = 9 + neighborId;
303 int neighborId = C3.Id()/3;
308 idl = 12 + neighborId;
320 int neighborId = Id/3;
325 idl = 9 + neighborId;
335 if(station == 1 && (
ring == 1 ||
ring == 4) ){
337 index = (wire>>4)*32 + (eightstrip>>4);
347 if(IsNeighbor &&
ring == 4){
357 if(ph_reverse) th_corr = -th_corr;
362 if(th_tmp < 0 || wire == 0)
365 if(th_tmp > th_coverage)
366 th_tmp = th_coverage;
372 if(th_tmp <= th_coverage){
376 th = th_tmp + Th_Init_Neighbor[SectIndex][LUTi];
391 if(th <= (ph_zone_bnd1 + zone_overlap))
394 if(th > (ph_zone_bnd2 - zone_overlap))
397 if((th > (ph_zone_bnd1 - zone_overlap)) && (th <= (ph_zone_bnd2 + zone_overlap)))
407 int zhit = -99, pz = -99;
409 std::vector<int> zonecontribution;
419 if((phzvl & 1) && (Id < 4 || Id > 9)){pz=0;zonecontribution.push_back(0);}
420 if((phzvl & 2) && (Id < 4)){pz=1;zonecontribution.push_back(1);}
421 if((phzvl & 1) && (Id > 3) && (station > 2)){pz=0;zonecontribution.push_back(1);}
422 if((phzvl & 1) && (Id > 3) && (Id < 7) && (station == 1)){pz=0;zonecontribution.push_back(2);}
423 if((phzvl & 1) && (Id > 3) && (station == 2)){pz=0;zonecontribution.push_back(2);}
424 if((phzvl & 2) && (Id > 3) && (station > 2)){pz=1;zonecontribution.push_back(2);}
425 if((phzvl & 1) && (Id > 4) && (station < 2)){pz=0;zonecontribution.push_back(3);}
426 if(phzvl & 4){pz=2;zonecontribution.push_back(3);}
427 if((phzvl & 2) && (Id > 3) && (station < 3)){pz=1;zonecontribution.push_back(3);}
468 Hit.
SetValues(fph,th,ph_hit,phzvl,station,sub,Id,quality,
pattern,wire,strip,
BX);
471 Hit.SetZoneContribution(zonecontribution);
475 if(Hit.
Theta() != -999 && Hit.
Phi() > 0){
476 ConvHits.push_back(Hit);
int Th_LUT_St234_Neighbor[3][12][11][112]
void SetNeighbor(int neighbor)
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
std::vector< ConvertedHit > PrimConv(std::vector< TriggerPrimitive > TriggPrim, int SectIndex)
int Th_LUT_St1_Neighbor[2][12][16][64]
tuple quality
[pTError/pT]*max(1,normChi2) <= ptErrorCut
int ph_offsets_neighbor[5][10][3]
void SetTP(L1TMuon::TriggerPrimitive tp)
SeedingHitSet::ConstRecHitPointer Hit
int Th_Corr_Neighbor[2][12][4][96]
int triggerSector() const
unsigned int Ph_Disp_Neighbor[12][61]
unsigned int Th_Init_Neighbor[12][61]
void SetValues(int phi, int theta, int ph_hit, int phzvl, int station, int sub, int id, int quality, int pattern, int wire, int strip, int BX)
int Ph_Init_Neighbor[12][5][16]
void SetSectorIndex(int sectorIndex)