14 int ph_offsetss[5][9][3] = {{{2,2,-99},{20,20,-99},{39,39,-99},{2,-99,-99},{21,-99,-99},{39,-99,-99},{4,-99,-99},{23,-99,-99},{42,-99,-99}},
15 {{58,58,-99},{77,77,-99},{95,95,-99},{58,-99,-99},{77,-99,-99},{96,-99,-99},{61,-99,-99},{79,-99,-99},{98,-99,-99}},
16 {{1,1,-99},{39,39,-99},{76,76,-99},{2,2,-99},{21,21,-99},{39,39,-99},{58,58,-99},{77,77,-99},{95,95,-99}},
17 {{1,-99,-99},{39,-99,-99},{76,-99,-99},{2,2,2},{21,21,21},{39,39,39},{58,58,58},{77,77,77},{95,95,95}},
18 {{1,-99,-99},{39,-99,-99},{76,-99,-99},{2,1,-99},{21,20,-99},{39,39,-99},{58,58,-99},{77,76,-99},{95,95,-99}}};
21 std::vector<ConvertedHit>
PrimConv(std::vector<TriggerPrimitive> TriggPrim,
int SectIndex){
25 std::vector<ConvertedHit> ConvHits;
26 for(std::vector<TriggerPrimitive>::iterator C1 = TriggPrim.begin();C1 != TriggPrim.end();C1++){
37 if(
ring == 4){Id += 9;}
40 if(SectIndex == (
endcap - 1)*6 + sector - 1)
52 int ph_tmp = -999, th_tmp = -999;
53 int clctpatcor = -999, clctpatsign = -999;
54 int eightstrip = -999;
56 int factor = (station == 1 &&
ring == 4) ? 1707:
57 (station == 1 &&
ring == 3) ? 947:
58 (station == 1 &&
ring == 1) ? 1301:
63 bool ph_reverse = (
endcap == 1 && station >= 3) ? 1:
64 (
endcap == 2 && station < 3) ? 1: 0;
66 int ph_coverage = (station <= 1 && Id > 6 && Id < 10) ? 15 :
67 (station >= 2 && Id <= 3) ? 40 : 20;
69 int th_coverage = (station == 1 && Id <= 3) ? 45 :
70 (station == 1 && Id > 6 && Id < 10) ? 27 :
71 (station == 1 && Id > 3) ? 39 :
72 (station == 2 && Id <= 3) ? 43 :
73 (station == 2 && Id > 3) ? 56 :
74 (station == 3 && Id <= 3) ? 34 :
75 (station == 3 && Id > 3) ? 52 :
76 (station == 4 && Id <= 3) ? 28 :
77 (station == 4 && Id > 3) ? 50 : 0;
79 int ph_zone_bnd1 = (station <= 1 && (Id <= 3 || Id > 9)) ? 41 :
80 (station == 2 && Id <= 3) ? 41 :
81 (station == 2 && Id > 3) ? 87 :
82 (station == 3 && Id > 3) ? 49 :
83 (station == 4 && Id > 3) ? 49 : 127;
85 int ph_zone_bnd2 = (station == 3 && Id > 3) ? 87 : 127;
89 int fph = -999, th = -999, ph_hit = -999, phzvl = -999;
121 case 1: LUTi = Id - 1;
break;
122 case 2: LUTi = 11 + Id;
break;
126 case 2: LUTi = 23 + Id;
break;
127 case 3: LUTi = 32 + Id;
break;
128 case 4: LUTi = 41 + Id;
break;
139 if(pattern > 0 && pattern < 11){
141 clctpatsign = ((pattern%2) == 0);
143 if(pattern >= 2) {clctpatcor = 5;}
144 if(pattern >= 6) {clctpatcor = 2;}
145 if(pattern == 10) {clctpatcor = 0;clctpatsign = 0;}
154 eightstrip = 8*strip;
155 int patcor = clctpatcor;
157 if(station == 1 || Id > 3){
159 eightstrip = (eightstrip>>1);
160 patcor = (patcor>>1);
164 if(clctpatsign) patcor = -patcor;
165 eightstrip += patcor;
171 ph_tmp = ((eightstrip*factor)>>10);
172 int phShift = (ph_tmp>>5);
185 fph =
PhInit[SectIndex][sub-1][Id - 1] + ph_tmp;
193 ph_hit = phLow + phShift + (
PhDisp[SectIndex][LUTi]>>1);
208 th_tmp =
St1ThLUT[sub-1][SectIndex][idl -1][wire];
212 th_tmp =
ThLUT[station-2][SectIndex][Id-1][wire];
217 th = th_tmp +
ThInit[SectIndex][LUTi];
220 if(station == 1 && (
ring == 1 ||
ring == 4) ){
222 index = (wire>>4)*32 + (eightstrip>>4);
234 if(ph_reverse) th_corr = -th_corr;
241 if(th_tmp < th_coverage){
243 if(
ring == 1){LUTi += 9;}
245 th = th_tmp + ThInit[SectIndex][LUTi];
259 if(th <= (ph_zone_bnd1 + zone_overlap))
262 if(th > (ph_zone_bnd2 - zone_overlap))
265 if((th > (ph_zone_bnd1 - zone_overlap)) && (th <= (ph_zone_bnd2 + zone_overlap)))
279 Id -= 9;strip += 128;
283 int zhit = -99, pz = -99;
284 std::vector<int> zonecontribution;
288 if((phzvl & 1) && (Id < 4)){pz=0;zonecontribution.push_back(0);}
289 if((phzvl & 2) && (Id < 4)){pz=1;zonecontribution.push_back(1);}
290 if((phzvl & 1) && (Id > 3) && (station > 2)){pz=0;zonecontribution.push_back(1);}
291 if((phzvl & 1) && (Id > 3) && (Id < 7) && (station == 1)){pz=0;zonecontribution.push_back(2);}
292 if((phzvl & 1) && (Id > 3) && (station == 2)){pz=0;zonecontribution.push_back(2);}
293 if((phzvl & 2) && (Id > 3) && (station > 2)){pz=1;zonecontribution.push_back(2);}
294 if((phzvl & 1) && (Id > 4) && (station < 2)){pz=0;zonecontribution.push_back(3);}
295 if(phzvl & 4){pz=2;zonecontribution.push_back(3);}
296 if((phzvl & 2) && (Id > 3) && (station < 3)){pz=1;zonecontribution.push_back(3);}
303 zhit = ph_hit + ph_offsetss[
station][Id-1][pz];
317 Hit.
SetValues(fph,th,ph_hit,phzvl,station,sub,Id,
quality,pattern,wire,strip,
BX);
322 if(Hit.
Theta() != -999 && Hit.
Phi() > 0){
323 ConvHits.push_back(Hit);
int St1ThLUT[2][12][12][64]
void SetZoneContribution(std::vector< int > zonecontribution)
const CSCData getCSCData() const
unsigned int ThInit[12][51]
unsigned int PhDisp[12][51]
const int getPattern() const
SeedingHitSet::ConstRecHitPointer Hit
std::vector< ConvertedHit > PrimConv(std::vector< TriggerPrimitive > TriggPrim, int SectIndex)
int triggerSector() const
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)
void SetTP(TriggerPrimitive tp)