22 <<
" is not a valid RPC id";
31 <<
" is not a valid RPC id";
40 this->
init(region,ring,station,sector,layer,subsector,roll);
54 if (trlayer==1 || trlayer==2) station = 1;
55 else if (trlayer==3 || trlayer==4) station = 2;
56 else station = trlayer-2;
71 if (station==3 && subs==
"+") subsector = 2;
73 ( sector==1 || sector==2 || sector==3
74 || sector==5 || sector==6
75 || sector==7 || sector==8
76 || sector==10 || sector==12)
81 if (station==4 && sector==4) {
82 if (subs==
"--") subsector=1;
83 if (subs==
"-") subsector=2;
84 if (subs==
"+") subsector=3;
85 if (subs==
"++") subsector=4;
92 if (roll==
"Backward" || roll==
"A") iroll = 1;
93 else if (roll==
"Central" || roll==
"B") iroll = 2;
94 else if (roll==
"Forward" || roll==
"C") iroll = 3;
95 else if (roll==
"D") iroll = 4;
97 std::cout <<
"** RPC: DBSpecToDetUnit, how to assigne roll to: " 98 <<roll<<
" ???" << std::endl;
106 if(trlayer==2) plane_id=5;
107 if(trlayer==4) plane_id=6;
108 int sector_id = sector*3;
111 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+roll_id;
115 int eta_id = trlayer;
116 if(ring>0) eta_id = 12-trlayer;
117 int plane_id =
abs(ring);
121 if (sector_id < 20 ){
122 sector_id = 19+ 1-sector_id;
124 sector_id = 36+20-sector_id;
132 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+ roll_id;
141 int eta_id = trIndex/100000;
148 else if (eta_id >=9 ) {
156 trIndex = trIndex%100000;
157 int plane_id = trIndex/10000;
165 station = plane_id -4;
168 trIndex = trIndex%10000;
169 int sector_id = trIndex/100;
180 if ( !(ring == 1 && station > 1 && region==1)) {
182 if(!(ring == 1 && station == 1 && region!=0)) {
184 if (sector_id==37) sector_id=1;
190 if (sector_id < 20 ){
191 sector_id = 19+ 1-sector_id;
193 sector_id = 36+20-sector_id;
196 trIndex = trIndex%100;
197 int copy_id = trIndex/10;
198 int sector=(sector_id-1)/3+1;
207 if ( ring == 1 && station > 1) {
209 subsector = ((sector_id+1)/2-1)%3+1;
212 subsector = (sector_id-1)%6+1;
220 this->
init(region,ring,station,sector,layer,subsector,roll);
237 if ( region < minRegionId || region >
maxRegionId ||
238 ring < minRing || ring > maxRing ||
245 <<
" Invalid parameters: " 246 <<
" region "<<region
248 <<
" station "<<station
249 <<
" sector "<<sector
251 <<
" subsector "<<subsector
283 os <<
" Re "<<
id.region()
285 <<
" St "<<
id.station()
286 <<
" Se "<<
id.sector()
287 <<
" La "<<
id.layer()
288 <<
" Su "<<
id.subsector()
290 <<
" 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
std::ostream & operator<<(std::ostream &os, const RPCDetId &id)
static const int maxRingForwardId
static const int minRingBarrelId
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_
Abs< T >::type abs(const T &t)
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.