28 updateBitMask( Run3 );
30 return StatusCode::SUCCESS;
36 unsigned int sectorID, roiNumber,
r,
phi;
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 );
86 double etaMin, etaMax, phiMin, phiMax;
87 if(
RoIsize(roiWord,etaMin,etaMax,phiMin,phiMax)!=StatusCode::SUCCESS)
return StatusCode::FAILURE;
88 data.set_etaMin(etaMin);
89 data.set_etaMax(etaMax);
90 data.set_phiMin(phiMin);
91 data.set_phiMax(phiMax);
93 return StatusCode::SUCCESS;
98 unsigned int & sectorID,
99 unsigned int & roiNumber,
107 sectorID = roiNumber =
r =
phi = 9999;
108 wireSLBId = block = 0;
111 unsigned int sysID = getBitMaskValue(&roiWord,
SysIDMask());
112 unsigned int subSysID = getBitMaskValue(&roiWord,
SubSysIDMask());
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 );
200std::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));
221std::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));
245 int stripSLBId = w_asdout->getChamber();
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;
269 bool status =
m_cabling->getOfflineIDfromOnlineID (wireId,
271 w_asdout->getOctant(),
272 w_asdout->getSectorModule(),
273 w_asdout->getLayer(),
274 w_asdout->getChamber(),
276 w_asdout->getChannel());
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;
317 bool status =
m_cabling->getOfflineIDfromOnlineID (stripId,
319 s_asdout->getOctant(),
320 s_asdout->getSectorModule(),
321 s_asdout->getLayer(),
322 s_asdout->getChamber(),
324 s_asdout->getChannel());
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);
359 double & etaMin,
double & etaMax,
360 double & phiMin,
double & phiMax)
const {
362 etaMin=etaMax=phiMin=phiMax=0;
365 unsigned int sectorID, roiNumber,
r,
phi;
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;
385 int wireOffset = offset;
388 if(wireOffset==1) wireOffset = 3;
389 }
else if(roiNumber>=144) {
390 if(wireOffset==8) wireOffset = 4;
394 if(wireOffset==1) wireOffset = 4;
395 }
else if(roiNumber>=60) {
396 if(wireOffset==8) wireOffset = 5;
400 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout =
403 std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout =
406 if (w_asdout!=
nullptr) {
408 if (i==0) etaMin=w_eta;
412 if (s_asdout!=
nullptr) {
417 getStripInfo(s_eta,s_phi,stripId,std::move(s_asdout),stripEdge);
418 if (i==0) phiMin=s_phi;
425 double temp=etaMin; etaMin=etaMax; etaMax=temp;
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;
454 roi_map.open(filename.c_str(), std::ios::out );
458 roi_map <<
"Endcap"<< std::endl;
459 roi_map <<
"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
460 roi_map <<
"# ------------------------------------------------------------------------"<< std::endl;
461 for(
unsigned int side=0;side < maxSubsystem; side++){
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)?(0x1):(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;
486 for(
unsigned int side=0;side < maxSubsystem; side++){
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)?(0x1):(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;
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
double stripShortWidth(int, int) const
double stripLongWidth(int, int) const
double gangRadialLength(int gasGap, int gang) const
Returns the length of the wire gang along the radial direction [pitch x N_{wire}^{gang}...
virtual TGCChannelId * getASDOutChannel(const TGCChannelId *slb_in) const
virtual void setChannel(int channel)
void setSideType(SideType side)
void setRegionType(RegionType region)
RegionType getRegionType(void) const
virtual void setSector(int vsector)
SideType getSideType(void) const
void setModuleType(ModuleType module)
const_pointer_type cptr()
Eigen::Matrix< double, 3, 1 > Vector3D
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...