21 <<
" is not a valid RPC id";
30 <<
" is not a valid RPC id";
39 this->
init(region,ring,station,sector,layer,subsector,roll);
45 const std::string& subs,
46 const std::string& roll,
47 const std::string& dbname){
53 if (trlayer==1 || trlayer==2) station = 1;
54 else if (trlayer==3 || trlayer==4) station = 2;
55 else station = trlayer-2;
62 if (barrel && station==1) layer = trlayer;
63 if (barrel && station==2) layer = trlayer-2;
69 if (station==3 && subs==
"+") subsector = 2;
71 ( sector==1 || sector==2 || sector==3
72 || sector==5 || sector==6
73 || sector==7 || sector==8
74 || sector==10 || sector==12)
79 if (station==4 && sector==4) {
80 if (subs==
"--") subsector=1;
81 if (subs==
"-") subsector=2;
82 if (subs==
"+") subsector=3;
83 if (subs==
"++") subsector=4;
90 if (roll==
"Backward" || roll==
"A") iroll = 1;
91 else if (roll==
"Central" || roll==
"B") iroll = 2;
92 else if (roll==
"Forward" || roll==
"C") iroll = 3;
93 else if (roll==
"D") iroll = 4;
95 std::cout <<
"** RPC: DBSpecToDetUnit, how to assigne roll to: "
96 <<roll<<
" ???" << std::endl;
104 if(trlayer==2) plane_id=5;
105 if(trlayer==4) plane_id=6;
106 int sector_id = sector*3;
109 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+roll_id;
113 int eta_id = trlayer;
114 if(ring>0) eta_id = 12-trlayer;
115 int plane_id =
abs(ring);
119 if (sector_id < 20 ){
120 sector_id = 19+ 1-sector_id;
122 sector_id = 36+20-sector_id;
130 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+ roll_id;
139 int eta_id = trIndex/100000;
146 else if (eta_id >=9 ) {
154 trIndex = trIndex%100000;
155 int plane_id = trIndex/10000;
163 station = plane_id -4;
166 trIndex = trIndex%10000;
167 int sector_id = trIndex/100;
169 if ( !(ring == 1 && station > 1 && region==1)) {
171 if (sector_id==37)sector_id=1;
175 if (sector_id < 20 ){
176 sector_id = 19+ 1-sector_id;
178 sector_id = 36+20-sector_id;
181 trIndex = trIndex%100;
182 int copy_id = trIndex/10;
183 int sector=(sector_id-1)/3+1;
192 if ( ring == 1 && station > 1) {
194 subsector = ((sector_id+1)/2-1)%3+1;
197 subsector = (sector_id-1)%6+1;
205 this->
init(region,ring,station,sector,layer,subsector,roll);
212 int layer,
int subsector,
int roll)
222 if ( region < minRegionId || region >
maxRegionId ||
223 ring < minRing || ring > maxRing ||
230 <<
" Invalid parameters: "
231 <<
" region "<<region
233 <<
" station "<<station
234 <<
" sector "<<sector
236 <<
" subsector "<<subsector
268 os <<
" Re "<<
id.region()
270 <<
" St "<<
id.station()
271 <<
" Se "<<
id.sector()
272 <<
" La "<<
id.layer()
273 <<
" Su "<<
id.subsector()
275 <<
" 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.