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;
70 if (station==3 && subs==
"+") subsector = 2;
72 ( sector==1 || sector==2 || sector==3
73 || sector==5 || sector==6
74 || sector==7 || sector==8
75 || sector==10 || sector==12)
80 if (station==4 && sector==4) {
81 if (subs==
"--") subsector=1;
82 if (subs==
"-") subsector=2;
83 if (subs==
"+") subsector=3;
84 if (subs==
"++") subsector=4;
91 if (roll==
"Backward" || roll==
"A") iroll = 1;
92 else if (roll==
"Central" || roll==
"B") iroll = 2;
93 else if (roll==
"Forward" || roll==
"C") iroll = 3;
94 else if (roll==
"D") iroll = 4;
96 std::cout <<
"** RPC: DBSpecToDetUnit, how to assigne roll to: "
97 <<roll<<
" ???" << std::endl;
105 if(trlayer==2) plane_id=5;
106 if(trlayer==4) plane_id=6;
107 int sector_id = sector*3;
110 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+roll_id;
114 int eta_id = trlayer;
115 if(ring>0) eta_id = 12-trlayer;
116 int plane_id =
abs(ring);
120 if (sector_id < 20 ){
121 sector_id = 19+ 1-sector_id;
123 sector_id = 36+20-sector_id;
131 trIndex=(eta_id*10000+plane_id*1000+sector_id*10+copy_id)*10+ roll_id;
140 int eta_id = trIndex/100000;
147 else if (eta_id >=9 ) {
155 trIndex = trIndex%100000;
156 int plane_id = trIndex/10000;
164 station = plane_id -4;
167 trIndex = trIndex%10000;
168 int sector_id = trIndex/100;
170 if ( !(ring == 1 && station > 1 && region==1)) {
172 if (sector_id==37)sector_id=1;
176 if (sector_id < 20 ){
177 sector_id = 19+ 1-sector_id;
179 sector_id = 36+20-sector_id;
182 trIndex = trIndex%100;
183 int copy_id = trIndex/10;
184 int sector=(sector_id-1)/3+1;
193 if ( ring == 1 && station > 1) {
195 subsector = ((sector_id+1)/2-1)%3+1;
198 subsector = (sector_id-1)%6+1;
206 this->
init(region,ring,station,sector,layer,subsector,roll);
213 int layer,
int subsector,
int roll)
223 if ( region < minRegionId || region >
maxRegionId ||
224 ring < minRing || ring > maxRing ||
231 <<
" Invalid parameters: "
232 <<
" region "<<region
234 <<
" station "<<station
235 <<
" sector "<<sector
237 <<
" subsector "<<subsector
269 os <<
" Re "<<
id.region()
271 <<
" St "<<
id.station()
272 <<
" Se "<<
id.sector()
273 <<
" La "<<
id.layer()
274 <<
" Su "<<
id.subsector()
276 <<
" 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.