7 #ifndef ADD_PrimitiveConverter_Neighbor 8 #define ADD_PrimitiveConverter_Neighbor 20 int CompIndex = (endcap - 1)*6 + sector - 1;
21 bool AdSector =
false;
22 if((SectIndex == 0 && CompIndex == 5) ||
23 (SectIndex == 1 && CompIndex == 0) ||
24 (SectIndex == 2 && CompIndex == 1) ||
25 (SectIndex == 3 && CompIndex == 2) ||
26 (SectIndex == 4 && CompIndex == 3) ||
27 (SectIndex == 5 && CompIndex == 4) ||
28 (SectIndex == 6 && CompIndex == 11) ||
29 (SectIndex == 7 && CompIndex == 6) ||
30 (SectIndex == 8 && CompIndex == 7) ||
31 (SectIndex == 9 && CompIndex == 8) ||
32 (SectIndex == 10 && CompIndex == 9) ||
33 (SectIndex == 11 && CompIndex == 10) ){AdSector =
true;}
35 if(AdSector && sub == 2 && station == 1 && (
id == 3 ||
id == 6 ||
id == 9) )
38 if(AdSector && station > 1 && (
id == 3 ||
id == 9) )
48 {{{39,39,-99}, {57,57,-99}, {76,76,-99}, {39,-99,-99}, {58,-99,-99},
49 {76,-99,-99}, {41,-99,-99}, {60,-99,-99}, {79,-99,-99}, {21,21,23}},
50 {{95,95,-99}, {114,114,-99}, {132,132,-99}, {95,-99,-99}, {114,-99,-99},
51 {133,-99,-99}, {98,-99,-99}, {116,-99,-99}, {135,-99,-99}, {21,21,23}},
52 {{38,38,-99}, {76,76,-99}, {113,113,-99}, {39,39,-99}, {58,58,-99},
53 {76,76,-99}, {95,95,-99}, {114,114,-99}, {132,132,-99}, {1,21,21}},
54 {{38,-99,-99}, {76,-99,-99}, {113,-99,-99}, {39,39,39}, {58,58,58},
55 {76,76,76}, {95,95,95}, {114,114,114}, {132,132,132}, {1,21,21}},
56 {{38,-99,-99}, {76,-99,-99}, {113,-99,-99}, {38,38,-99}, {57,57,-99},
57 {76,76,-99}, {95,95,-99}, {113,113,-99}, {132,132,-99}, {1,20,20}}};
59 std::vector<ConvertedHit>
PrimConv(std::vector<L1TMuon::TriggerPrimitive> TriggPrim,
int SectIndex){
63 std::vector<ConvertedHit> ConvHits;
64 for(std::vector<L1TMuon::TriggerPrimitive>::iterator C1 = TriggPrim.begin();C1 != TriggPrim.end();C1++){
76 if(station == 1 &&
ring == 1 &&
strip > 127){
95 bool IsNeighbor =
neighbor(
endcap,sector,SectIndex,Id,sub,station);
97 if(
ring == 4){Id += 9;}
100 if( (SectIndex == (
endcap - 1)*6 + sector - 1 ) || IsNeighbor )
113 int ph_tmp = -999, th_tmp = -999;
114 int clctpatcor = -999, clctpatsign = -999;
115 int eightstrip = -999;
118 (station == 1 &&
ring == 4) ? 1707:
119 (station == 1 &&
ring == 3) ? 947:
120 (station == 1 &&
ring == 1) ? 1301:
126 (
endcap == 1 && station >= 3) ? 1:
127 (
endcap == 2 && station < 3) ? 1: 0;
130 (station <= 1 && Id > 6 && Id < 10) ? 15 :
131 (station >= 2 && Id <= 3) ? 40 : 20;
134 (station == 1 && Id <= 3) ? 45 :
135 (station == 1 && Id > 6 && Id < 10) ? 27 :
136 (station == 1 && Id > 3) ? 39 :
137 (station == 2 && Id <= 3) ? 43 :
138 (station == 2 && Id > 3) ? 56 :
139 (station == 3 && Id <= 3) ? 34 :
140 (station == 3 && Id > 3) ? 52 :
141 (station == 4 && Id <= 3) ? 28 :
142 (station == 4 && Id > 3) ? 50 : 0;
145 (station <= 1 && (Id <= 3 || Id > 9)) ? 41 :
146 (station == 2 && Id <= 3) ? 41 :
147 (station == 2 && Id > 3) ? 87 :
148 (station == 3 && Id > 3) ? 49 :
149 (station == 4 && Id > 3) ? 49 : 127;
151 int ph_zone_bnd2 = (station == 3 && Id > 3) ? 87 : 127;
153 int zone_overlap = 2;
155 int fph = -999, th = -999, ph_hit = -999, phzvl = -999;
190 case 1: LUTi = nId - 1;
break;
191 case 2: LUTi = 15 + nId;
break;
195 case 2: LUTi = 27 + nId;
break;
196 case 3: LUTi = 38 + nId;
break;
197 case 4: LUTi = 49 + nId;
break;
201 if(IsNeighbor && station == 1){
205 case 1: LUTi = 15 + nId;
break;
206 case 2: LUTi = nId - 1;
break;
221 clctpatsign = ((
pattern%2) == 0);
223 if(
pattern >= 2) {clctpatcor = 5;}
224 if(
pattern >= 6) {clctpatcor = 2;}
225 if(
pattern == 10) {clctpatcor = 0;clctpatsign = 0;}
232 eightstrip = 8*
strip;
233 int patcor = clctpatcor;
237 if(station == 1 || Id > 3){
239 eightstrip = (eightstrip>>1);
240 patcor = (patcor>>1);
241 if(
ring == 4 &&
strip > 127) eightstrip -= 512;
246 if(clctpatsign) patcor = -patcor;
247 eightstrip += patcor;
253 ph_tmp = ((eightstrip*factor)>>10);
254 int phShift = (ph_tmp>>5);
264 int phInitIndex = Id;
269 int neighborId = C3.
Id()/3;
274 phInitIndex = 12 + neighborId;
285 int neighborId = Id/3;
290 phInitIndex = 9 + neighborId;
309 int neighborId = C3.
Id()/3;
314 idl = 12 + neighborId;
326 int neighborId = Id/3;
331 idl = 9 + neighborId;
341 if(station == 1 && (
ring == 1 ||
ring == 4) ){
343 index = (wire>>4)*32 + (eightstrip>>4);
353 if(IsNeighbor &&
ring == 4){
363 if(ph_reverse) th_corr = -th_corr;
368 if(th_tmp < 0 || wire == 0)
371 if(th_tmp > th_coverage)
372 th_tmp = th_coverage;
378 if(th_tmp <= th_coverage){
382 th = th_tmp + Th_Init_Neighbor[SectIndex][LUTi];
397 if(th <= (ph_zone_bnd1 + zone_overlap))
400 if(th > (ph_zone_bnd2 - zone_overlap))
403 if((th > (ph_zone_bnd1 - zone_overlap)) && (th <= (ph_zone_bnd2 + zone_overlap)))
413 int zhit = -99, pz = -99;
415 std::vector<int> zonecontribution;
425 if((phzvl & 1) && (Id < 4 || Id > 9)){pz=0;zonecontribution.push_back(0);}
426 if((phzvl & 2) && (Id < 4)){pz=1;zonecontribution.push_back(1);}
427 if((phzvl & 1) && (Id > 3) && (station > 2)){pz=0;zonecontribution.push_back(1);}
428 if((phzvl & 1) && (Id > 3) && (Id < 7) && (station == 1)){pz=0;zonecontribution.push_back(2);}
429 if((phzvl & 1) && (Id > 3) && (station == 2)){pz=0;zonecontribution.push_back(2);}
430 if((phzvl & 2) && (Id > 3) && (station > 2)){pz=1;zonecontribution.push_back(2);}
431 if((phzvl & 1) && (Id > 4) && (station < 2)){pz=0;zonecontribution.push_back(3);}
432 if(phzvl & 4){pz=2;zonecontribution.push_back(3);}
433 if((phzvl & 2) && (Id > 3) && (station < 3)){pz=1;zonecontribution.push_back(3);}
474 Hit.
SetValues(fph,th,ph_hit,phzvl,station,sub,Id,quality,
pattern,wire,
strip,
BX);
481 if(Hit.
Theta() != -999 && Hit.
Phi() > 0){
482 ConvHits.push_back(Hit);
int Th_LUT_St234_Neighbor[3][12][11][112]
std::vector< ConvertedHit > PrimConv(std::vector< L1TMuon::TriggerPrimitive > TriggPrim, int SectIndex)
void SetNeighbor(int neighbor)
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
const CSCData getCSCData() const
int Th_LUT_St1_Neighbor[2][12][16][64]
int ph_offsets_neighbor[5][10][3]
void SetTP(L1TMuon::TriggerPrimitive tp)
const int getPattern() const
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)