23 <<
" is not a valid RPC id";
32 <<
" is not a valid RPC id";
41 this->
init(region,ring,station,sector,layer,subsector,roll);
55 if (trlayer==1 || trlayer==2) station = 1;
56 else if (trlayer==3 || trlayer==4) station = 2;
57 else station = trlayer-2;
72 if (station==3 && subs==
"+") subsector = 2;
74 ( sector==1 || sector==2 || sector==3
75 || sector==5 || sector==6
76 || sector==7 || sector==8
77 || sector==10 || sector==12)
82 if (station==4 && sector==4) {
83 if (subs==
"--") subsector=1;
84 if (subs==
"-") subsector=2;
85 if (subs==
"+") subsector=3;
86 if (subs==
"++") subsector=4;
93 if (roll==
"Backward" || roll==
"A") iroll = 1;
94 else if (roll==
"Central" || roll==
"B") iroll = 2;
95 else if (roll==
"Forward" || roll==
"C") iroll = 3;
96 else if (roll==
"D") iroll = 4;
98 std::cout <<
"** RPC: DBSpecToDetUnit, how to assigne roll to: "
99 <<roll<<
" ???" << std::endl;
107 if(trlayer==2) plane_id=5;
108 if(trlayer==4) plane_id=6;
109 int sector_id = sector*3;
112 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+roll_id;
116 int eta_id = trlayer;
117 if(ring>0) eta_id = 12-trlayer;
118 int plane_id =
abs(ring);
122 if (sector_id < 20 ){
123 sector_id = 19+ 1-sector_id;
125 sector_id = 36+20-sector_id;
133 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+ roll_id;
142 int eta_id = trIndex/100000;
149 else if (eta_id >=9 ) {
157 trIndex = trIndex%100000;
158 int plane_id = trIndex/10000;
166 station = plane_id -4;
169 trIndex = trIndex%10000;
170 int sector_id = trIndex/100;
172 if ( !(ring == 1 && station > 1 && region==1)) {
174 if (sector_id==37)sector_id=1;
178 if (sector_id < 20 ){
179 sector_id = 19+ 1-sector_id;
181 sector_id = 36+20-sector_id;
184 trIndex = trIndex%100;
185 int copy_id = trIndex/10;
186 int sector=(sector_id-1)/3+1;
195 if ( ring == 1 && station > 1) {
197 subsector = ((sector_id+1)/2-1)%3+1;
200 subsector = (sector_id-1)%6+1;
208 this->
init(region,ring,station,sector,layer,subsector,roll);
215 int layer,
int subsector,
int roll)
225 if ( region < minRegionId || region >
maxRegionId ||
226 ring < minRing || ring > maxRing ||
233 <<
" Invalid parameters: "
234 <<
" region "<<region
236 <<
" station "<<station
237 <<
" sector "<<sector
239 <<
" subsector "<<subsector
271 os <<
" Re "<<
id.region()
273 <<
" St "<<
id.station()
274 <<
" Se "<<
id.sector()
275 <<
" La "<<
id.layer()
276 <<
" Su "<<
id.subsector()
278 <<
" Tr "<<
id.trIndex()
static const int maxStationId
static const unsigned int RingMask_
static const int SubSectorStartBit_
void buildfromDB(int region, int ring, int layer, int sector, const std::string &subsector, const std::string &roll, const std::string &dbname)
void buildfromTrIndex(int trIndex)
Built from the trigger det Index.
void init(int region, int ring, int station, int sector, int layer, int subsector, int roll)
static const int maxLayerId
static const int maxRingForwardId
static const int minRingBarrelId
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static const int minSubSectorId
static const int LayerStartBit_
static const int minSectorId
static const int StationStartBit_
static const unsigned int SectorMask_
static const int minRegionId
static const unsigned int LayerMask_
static const int maxSubSectorId
static const int RingStartBit_
static const int RegionStartBit_
static const int RegionMask_
static const unsigned int SubSectorMask_
static const int maxRollId
static const int SectorStartBit_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const int RingBarrelOffSet
static const int maxRegionId
static const int minStationId
static const int RollStartBit_
static const unsigned int StationMask_
static const int maxRingBarrelId
static const int maxSectorId
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
static const int minRingForwardId
static const unsigned int RollMask_
Detector det() const
get the detector field from this detid
static const int minLayerId
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.