28 updateBitMask( Run3 );
30 return StatusCode::SUCCESS;
41 <<
"Can not get SLBparameters "
42 <<
" roi word = " << std::hex <<
roiWord );
43 return StatusCode::FAILURE;
47 <<
"This roiWord is not of TGC" );
48 return StatusCode::FAILURE;
54 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout =
56 if (w_asdout ==
nullptr) {
58 <<
"Cannot get ASD out for Wire " );
59 return StatusCode::FAILURE;
62 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout =
64 if (s_asdout ==
nullptr) {
66 <<
"Cannot get ASD out for Strip " );
67 return StatusCode::FAILURE;
73 getWireInfo(w_eta,w_phi,wireId,std::move(w_asdout));
80 ATH_MSG_DEBUG(
"(eta,phi)=" <<
" (" << w_eta <<
","<< s_phi <<
")" );
81 ATH_MSG_DEBUG(
"channelId_eta=" << wireId <<
" channelId_phi=" << stripId );
90 data.set_phiMin(phiMin);
91 data.set_phiMax(phiMax);
93 return StatusCode::SUCCESS;
98 unsigned int & sectorID,
108 wireSLBId = block = 0;
115 unsigned int t_sectorID;
123 t_sectorID = getBitMaskValue(&
roiWord,ForwardSectorIDMask());
129 isOK = (t_sectorID<32) && (
roiNumber<64);
131 isOK = (t_sectorID<24) && (
roiNumber<64);
135 r = getBitMaskValue(&
roiWord,ForwardRMask());
136 phi = getBitMaskValue(&
roiWord,ForwardPhiMask());
141 int sec = (t_sectorID + 2 )%32;
143 sectorID = 3*oct + sec%3;
145 sectorID = (t_sectorID )%24;
148 }
else if (sysID>1) {
152 t_sectorID = getBitMaskValue(&
roiWord,EndcapSectorIDMask());
156 isOK = (t_sectorID<48) && (
roiNumber<148);
159 r = getBitMaskValue(&
roiWord,EndcapRMask());
160 phi = getBitMaskValue(&
roiWord,EndcapPhiMask());
165 sectorID = (t_sectorID + 2 )%48;
167 sectorID = (t_sectorID )%48;
172 <<
" roi word = " << std::hex <<
roiWord
173 <<
" sysID = " << std::dec << sysID );
179 <<
" roi word = " << std::hex <<
roiWord
180 <<
" sysID = " << std::dec << sysID
181 <<
" subSysID = " << std::dec << subSysID
183 <<
" trigger sectorID = " << std::dec << t_sectorID
184 <<
" sectorID = " << std::dec << sectorID
185 <<
" roiNumber = " << std::dec <<
roiNumber );
189 <<
" sysID = " << std::dec << sysID
190 <<
" subSysID = " << std::dec << subSysID
192 <<
" trigger sectorID = " << std::dec << t_sectorID
193 <<
" sectorID = " << std::dec << sectorID
194 <<
" roiNumber = " << std::dec <<
roiNumber );
200 std::unique_ptr<MuonTGC_Cabling::TGCChannelId>
202 unsigned int sectorID,
213 w_slbin.
setId(wireSLBId);
217 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout(tgcCabling->
getASDOutChannel(&w_slbin));
221 std::unique_ptr<MuonTGC_Cabling::TGCChannelId>
223 unsigned int sectorID,
228 int stripOffset)
const {
230 if(stripOffset==
DummyOffset) stripOffset = wireOffset;
238 w_slbin.
setId(wireSLBId);
242 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout(tgcCabling->
getASDOutChannel(&w_slbin));
252 s_slbin.
setId(stripSLBId);
255 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout(tgcCabling->
getASDOutChannel(&s_slbin));
261 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout,
267 int subsystemNumber = (w_asdout->
isAside())? 1 : -1;
268 int wireOrStrip = (w_asdout->
isStrip())? 1 : 0;
277 if (
status==
false)
return;
281 if(muonMgr==
nullptr){
282 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object.");
289 w_pos = tgcwire -> channelPos(wireId);
297 double r = w_pos.perp();
298 double phi = w_pos.phi();
309 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout,
315 int subsystemNumber = (s_asdout->
isAside())? 1 : -1;
316 int wireOrStrip = (s_asdout->
isStrip())? 1 : 0;
325 if (
status==
false)
return;
329 if(muonMgr==
nullptr){
330 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object.");
337 s_pos = tgcstrip -> channelPos(stripId);
346 double halfWidth = (shortWidth + longWidth)/4.;
347 double r = s_pos.perp();
348 double phi = s_pos.phi();
349 double dPhi = atan2(halfWidth,
r);
360 double & phiMin,
double & phiMax)
const {
366 int wireSLBId, block;
367 double w_eta,w_phi,s_eta,s_phi;
370 for(
int i=0;
i<2;
i++) {
376 return StatusCode::FAILURE;
381 <<
"This roiWord is not of TGC" );
382 return StatusCode::FAILURE;
388 if(wireOffset==1) wireOffset = 3;
390 if(wireOffset==8) wireOffset = 4;
394 if(wireOffset==1) wireOffset = 4;
396 if(wireOffset==8) wireOffset = 5;
400 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout =
401 getWireASDOut(tgcId,sectorID,wireSLBId,block,phi,wireOffset);
403 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout =
406 if (w_asdout!=
nullptr) {
412 if (s_asdout!=
nullptr) {
417 getStripInfo(s_eta,s_phi,stripId,std::move(s_asdout),stripEdge);
418 if (
i==0) phiMin=s_phi;
429 double temp=phiMin; phiMin=phiMax; phiMax=temp;
432 if(phiMin<-3. && phiMax>3.) {
435 double temp=phiMin; phiMin=phiMax; phiMax=temp;
438 return StatusCode::SUCCESS;
443 const unsigned int maxSubsystem = 2;
444 const unsigned int maxTriggerSectorEndcap = 48;
445 const unsigned int maxTriggerSectorForward = 24;
447 const unsigned int maxEndcapR = 37;
448 const unsigned int maxForwardR = 16;
450 const unsigned int maxEndcapPhi = 4;
451 const unsigned int maxForwardPhi = 4;
453 std::ofstream roi_map;
458 roi_map <<
"Endcap"<< std::endl;
459 roi_map <<
"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
460 roi_map <<
"# ------------------------------------------------------------------------"<< std::endl;
462 for(
unsigned int sector=0;sector < maxTriggerSectorEndcap; sector++){
463 for (
unsigned int r=0;
r<maxEndcapR;
r++){
464 for (
unsigned int phi=0; phi<maxEndcapPhi; phi++){
465 int roi = (
r<<2) + phi;
466 int sectorAddress = sector<<1;
467 sectorAddress |= 0x80;
468 sectorAddress |= (
side==0)?(0
x1):(0x0);
469 unsigned long int roiWord = (
m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
472 roi_map << std::setw(8) <<
side <<
" "
473 << std::setw(8) << sector <<
" "
474 << std::setw(8) << roi <<
" "
475 << std::setw(12) <<
data.etaMin() <<
" "
476 << std::setw(12) <<
data.etaMax() <<
" "
477 << std::setw(12) <<
data.phiMin() <<
" "
478 << std::setw(12) <<
data.phiMax() << std::endl;
483 roi_map <<
"Forward"<< std::endl;
484 roi_map <<
"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
485 roi_map <<
"# ------------------------------------------------------------------------"<< std::endl;
487 for(
unsigned int sector=0;sector < maxTriggerSectorForward; sector++){
488 for (
unsigned int r=0;
r<maxForwardR;
r++){
489 for (
unsigned int phi=0; phi<maxForwardPhi; phi++){
490 int roi = (
r<<2) + phi;
491 int sectorAddress = sector<<1;
492 sectorAddress |= 0x80;
493 sectorAddress |= (
side==0)?(0
x1):(0x0);
494 unsigned long int roiWord = (
m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
497 roi_map << std::setw(8) <<
side <<
" "
498 << std::setw(8) << sector <<
" "
499 << std::setw(8) << roi <<
" "
500 << std::setw(12) <<
data.etaMin() <<
" "
501 << std::setw(12) <<
data.etaMax() <<
" "
502 << std::setw(12) <<
data.phiMin() <<
" "
503 << std::setw(12) <<
data.phiMax() << std::endl;