ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LVL1::TrigT1TGCRecRoiTool Class Reference

#include <TrigT1TGCRecRoiTool.h>

Inheritance diagram for LVL1::TrigT1TGCRecRoiTool:
Collaboration diagram for LVL1::TrigT1TGCRecRoiTool:

Public Member Functions

 TrigT1TGCRecRoiTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TrigT1TGCRecRoiTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode roiData (const unsigned int &roiWord, TrigT1MuonRecRoiData &data) const override
 
virtual StatusCode RoIsize (const unsigned int &roiWord, double &etaMin, double &etaMax, double &phiMin, double &phiMax) const override
 
virtual bool dumpRoiMap (const std::string &filename) const override
 
bool etaDimLow (const TrigT1MuonRecRoiData &, double &, double &) const override
 
bool etaDimHigh (const TrigT1MuonRecRoiData &, double &, double &) const override
 

Private Types

enum  EdgeType {
  NonEdge =-1, LowerREdge, UpperREdge, LowerPhiEdge,
  UpperPhiEdge
}
 
enum  DummyOffset { DummyOffset =-9999 }
 

Private Member Functions

bool getSLBparameters (const unsigned int &roIWord, MuonTGC_Cabling::TGCId &tgcId, unsigned int &sectorID, unsigned int &roiNumber, unsigned int &r, unsigned int &phi, int &wireSLBId, int &block) const
 
std::unique_ptr< MuonTGC_Cabling::TGCChannelIdgetWireASDOut (const MuonTGC_Cabling::TGCId &tgcId, unsigned int sectorID, int wireSLBId, int block, int phi, int offset) const
 
std::unique_ptr< MuonTGC_Cabling::TGCChannelIdgetStripASDOut (const MuonTGC_Cabling::TGCId &tgcId, unsigned int sectorID, int wireSLBId, int block, int phi, int wireOffset, int stripOffset=DummyOffset) const
 
void getWireInfo (double &eta, double &phi, Identifier &wireId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > w_asdout, EdgeType edge=NonEdge) const
 
void getStripInfo (double &eta, double &phi, Identifier &stripId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > s_asdout, EdgeType edge=NonEdge) const
 

Private Attributes

BooleanProperty m_useRun3Config {this,"UseRun3Config",false,"use Run 3 config"}
 
BooleanProperty m_patchForRoIWord {this,"PatchForRoIWord",false,"apply a patch to RoI word"}
 
BooleanProperty m_useConditionData {this,"UseConditionData",true,"use condition data"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey {this, "DetectorManagerKey","MuonDetectorManager","Key of input MuonDetectorManager condition data"}
 
ServiceHandle< MuonTGC_CablingSvcm_cabling {this, "TGCCablingSvc", "MuonTGC_CablingSvc"}
 

Detailed Description

Definition at line 26 of file TrigT1TGCRecRoiTool.h.

Member Enumeration Documentation

◆ DummyOffset

Enumerator
DummyOffset 

Definition at line 53 of file TrigT1TGCRecRoiTool.h.

53 {DummyOffset=-9999};

◆ EdgeType

Enumerator
NonEdge 
LowerREdge 
UpperREdge 
LowerPhiEdge 
UpperPhiEdge 

Definition at line 48 of file TrigT1TGCRecRoiTool.h.

48  {NonEdge=-1,
49  LowerREdge,
50  UpperREdge,
52  UpperPhiEdge};

Constructor & Destructor Documentation

◆ TrigT1TGCRecRoiTool()

LVL1::TrigT1TGCRecRoiTool::TrigT1TGCRecRoiTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 15 of file TrigT1TGCRecRoiTool.cxx.

16 : base_class(type,name,parent) {
17 }

◆ ~TrigT1TGCRecRoiTool()

LVL1::TrigT1TGCRecRoiTool::~TrigT1TGCRecRoiTool ( )
virtual

Definition at line 19 of file TrigT1TGCRecRoiTool.cxx.

19  {
20 }

Member Function Documentation

◆ dumpRoiMap()

bool LVL1::TrigT1TGCRecRoiTool::dumpRoiMap ( const std::string &  filename) const
overridevirtual

Definition at line 441 of file TrigT1TGCRecRoiTool.cxx.

442 {
443  const unsigned int maxSubsystem = 2;
444  const unsigned int maxTriggerSectorEndcap = 48;
445  const unsigned int maxTriggerSectorForward = 24;
446 
447  const unsigned int maxEndcapR = 37;
448  const unsigned int maxForwardR = 16;
449 
450  const unsigned int maxEndcapPhi = 4;
451  const unsigned int maxForwardPhi = 4;
452 
453  std::ofstream roi_map;
454  roi_map.open(filename.c_str(), std::ios::out );
455  if(!roi_map){
456  ATH_MSG_WARNING( "Unable to open ROI_Mapping file!" );
457  } else {
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));
470  TrigT1MuonRecRoiData data;
471  if(!roiData(roiWord,data).isSuccess())continue;
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;
479  }
480  }
481  }
482  }
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));
495  TrigT1MuonRecRoiData data;
496  if(!roiData(roiWord,data).isSuccess())continue;
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;
504  }
505  }
506  }
507  }
508  roi_map.close();
509  }
510  return true;
511 }

◆ etaDimHigh()

bool LVL1::TrigT1TGCRecRoiTool::etaDimHigh ( const TrigT1MuonRecRoiData ,
double &  ,
double &   
) const
inlineoverride

Definition at line 44 of file TrigT1TGCRecRoiTool.h.

44 {return false;}

◆ etaDimLow()

bool LVL1::TrigT1TGCRecRoiTool::etaDimLow ( const TrigT1MuonRecRoiData ,
double &  ,
double &   
) const
inlineoverride

Definition at line 43 of file TrigT1TGCRecRoiTool.h.

43 {return false;}

◆ getSLBparameters()

bool LVL1::TrigT1TGCRecRoiTool::getSLBparameters ( const unsigned int &  roIWord,
MuonTGC_Cabling::TGCId tgcId,
unsigned int &  sectorID,
unsigned int &  roiNumber,
unsigned int &  r,
unsigned int &  phi,
int &  wireSLBId,
int &  block 
) const
private

Definition at line 96 of file TrigT1TGCRecRoiTool.cxx.

103  {
104  // init
107  sectorID = roiNumber = r = phi = 9999;
108  wireSLBId = block = 0;
109 
110  // sysID, subSysID
111  unsigned int sysID = getBitMaskValue(&roiWord,SysIDMask());
112  unsigned int subSysID = getBitMaskValue(&roiWord,SubSysIDMask());
113 
114  // trigger sector ID in the roiWord
115  unsigned int t_sectorID;
116 
117  //
118  bool isOK = true;
119 
120  if (sysID==1) { // Forward
122  // trigger sector ID
123  t_sectorID = getBitMaskValue(&roiWord,ForwardSectorIDMask());
124  // roi number
125  roiNumber = getBitMaskValue(&roiWord,ForwardRoIMask());
126 
127  // convert trigger sector ID to sector ID
128  if (m_patchForRoIWord) {
129  isOK = (t_sectorID<32) && (roiNumber<64);
130  } else {
131  isOK = (t_sectorID<24) && (roiNumber<64);
132  }
133 
135  r = getBitMaskValue(&roiWord,ForwardRMask());
136  phi = getBitMaskValue(&roiWord,ForwardPhiMask());
137  wireSLBId = r/4;
138  block = r%4;
139  // convert trigger sector ID to sector ID
140  if (m_patchForRoIWord) {
141  int sec = (t_sectorID + 2 )%32;
142  int oct = sec/4;
143  sectorID = 3*oct + sec%3;
144  } else {
145  sectorID = (t_sectorID )%24;
146  }
147 
148  } else if (sysID>1) {
149  // Endcap
151  // trigger sector ID
152  t_sectorID = getBitMaskValue(&roiWord,EndcapSectorIDMask());
153  // roi number
154  roiNumber = getBitMaskValue(&roiWord,EndcapRoIMask());
155 
156  isOK = (t_sectorID<48) && (roiNumber<148);
157 
159  r = getBitMaskValue(&roiWord,EndcapRMask());
160  phi = getBitMaskValue(&roiWord,EndcapPhiMask());
161  wireSLBId = (r+3)/4;
162  block = (r+3)%4;
163  // convert trigger sector ID to sector ID
164  if (m_patchForRoIWord) {
165  sectorID = (t_sectorID + 2 )%48;
166  } else {
167  sectorID = (t_sectorID )%48;
168  }
169 
170  } else {
171  ATH_MSG_INFO( "Bad roiWord "
172  << " roi word = " << std::hex << roiWord
173  << " sysID = " << std::dec << sysID );
174  return false;
175  }
176 
177  if (!isOK) {
178  ATH_MSG_INFO( "Bad roiWord "
179  << " roi word = " << std::hex << roiWord
180  << " sysID = " << std::dec << sysID
181  << " subSysID = " << std::dec << subSysID
182  << " (side " << (tgcId.getSideType()==MuonTGC_Cabling::TGCId::SideType::Aside ? "A)" : "C)")
183  << " trigger sectorID = " << std::dec << t_sectorID
184  << " sectorID = " << std::dec << sectorID
185  << " roiNumber = " << std::dec << roiNumber );
186  return false;
187  } else {
188  ATH_MSG_DEBUG( " roi word = " << std::hex << roiWord
189  << " sysID = " << std::dec << sysID
190  << " subSysID = " << std::dec << subSysID
191  << " (side " << (tgcId.getSideType()==MuonTGC_Cabling::TGCId::SideType::Aside ? "A)" : "C)")
192  << " trigger sectorID = " << std::dec << t_sectorID
193  << " sectorID = " << std::dec << sectorID
194  << " roiNumber = " << std::dec << roiNumber );
195  }
196  return true;
197 
198 }

◆ getStripASDOut()

std::unique_ptr< MuonTGC_Cabling::TGCChannelId > LVL1::TrigT1TGCRecRoiTool::getStripASDOut ( const MuonTGC_Cabling::TGCId tgcId,
unsigned int  sectorID,
int  wireSLBId,
int  block,
int  phi,
int  wireOffset,
int  stripOffset = DummyOffset 
) const
private

Definition at line 222 of file TrigT1TGCRecRoiTool.cxx.

228  {
229  // If stripOffset is not given, wireOffset is used as stripOffset
230  if(stripOffset==DummyOffset) stripOffset = wireOffset;
231 
232  // wire
234  w_slbin.setSideType(tgcId.getSideType());
235  w_slbin.setModuleType(MuonTGC_Cabling::TGCId::WD);
236  w_slbin.setRegionType(tgcId.getRegionType());
237  w_slbin.setSector(sectorID);
238  w_slbin.setId(wireSLBId);
239  w_slbin.setChannel(41+wireOffset+8*block);
240 
241  const MuonTGC_Cabling::TGCCabling* tgcCabling = m_cabling->getTGCCabling();
242  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout(tgcCabling->getASDOutChannel(&w_slbin));
243 
244  // strip
245  int stripSLBId = w_asdout->getChamber();
246 
248  s_slbin.setSideType(tgcId.getSideType());
249  s_slbin.setModuleType(MuonTGC_Cabling::TGCId::SD);
250  s_slbin.setRegionType(tgcId.getRegionType());
251  s_slbin.setSector(sectorID);
252  s_slbin.setId(stripSLBId);
253  s_slbin.setChannel(41+stripOffset+8*phi);
254 
255  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout(tgcCabling->getASDOutChannel(&s_slbin));
256  return s_asdout;
257 }

◆ getStripInfo()

void LVL1::TrigT1TGCRecRoiTool::getStripInfo ( double &  eta,
double &  phi,
Identifier stripId,
std::unique_ptr< MuonTGC_Cabling::TGCChannelId s_asdout,
EdgeType  edge = NonEdge 
) const
private

Definition at line 307 of file TrigT1TGCRecRoiTool.cxx.

310  {
311  // init
312  auto s_pos = Amg::Vector3D(0,0,0);
313  stripId=Identifier(0);
314  //
315  int subsystemNumber = (s_asdout->isAside())? 1 : -1;
316  int wireOrStrip = (s_asdout->isStrip())? 1 : 0;
317  bool status = m_cabling->getOfflineIDfromOnlineID (stripId,
318  subsystemNumber,
319  s_asdout->getOctant(),
320  s_asdout->getSectorModule(),
321  s_asdout->getLayer(),
322  s_asdout->getChamber(),
323  wireOrStrip,
324  s_asdout->getChannel());
325  if (status==false) return;
326 
328  const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
329  if(muonMgr==nullptr){
330  ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
331  return;
332  }
333 
334 
335  const MuonGM::TgcReadoutElement* tgcstrip
336  = muonMgr->getTgcReadoutElement(m_idHelperSvc->tgcIdHelper().parentID(stripId));
337  s_pos = tgcstrip -> channelPos(stripId);
338 
339  // If edge correction is needed,
340  // the half width in the phi direction is added (subtracted) for the upper (lower) edge.
341  if(edge==UpperPhiEdge || edge==LowerPhiEdge) {
342  int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(stripId);
343  int channel = m_idHelperSvc->tgcIdHelper().channel(stripId);
344  double shortWidth = tgcstrip->stripShortWidth(gasGap, channel);
345  double longWidth = tgcstrip->stripLongWidth(gasGap, channel);
346  double halfWidth = (shortWidth + longWidth)/4.;
347  double r = s_pos.perp();
348  double phi = s_pos.phi();
349  double dPhi = atan2(halfWidth, r);
350  phi += dPhi*(edge==UpperPhiEdge ? +1. : -1.);
351  s_pos[Trk::locX] = r*cos(phi);
352  s_pos[Trk::locY] = r*sin(phi);
353  }
354  s_eta = s_pos.eta();
355  s_phi = s_pos.phi();
356 }

◆ getWireASDOut()

std::unique_ptr< MuonTGC_Cabling::TGCChannelId > LVL1::TrigT1TGCRecRoiTool::getWireASDOut ( const MuonTGC_Cabling::TGCId tgcId,
unsigned int  sectorID,
int  wireSLBId,
int  block,
int  phi,
int  offset 
) const
private

Definition at line 201 of file TrigT1TGCRecRoiTool.cxx.

206  {
207  // wire
209  w_slbin.setSideType(tgcId.getSideType());
210  w_slbin.setModuleType(MuonTGC_Cabling::TGCId::WD);
211  w_slbin.setRegionType(tgcId.getRegionType());
212  w_slbin.setSector(sectorID);
213  w_slbin.setId(wireSLBId);
214  w_slbin.setChannel(41+offset+8*block);
215 
216  const MuonTGC_Cabling::TGCCabling* tgcCabling = m_cabling->getTGCCabling();
217  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout(tgcCabling->getASDOutChannel(&w_slbin));
218  return w_asdout;
219 }

◆ getWireInfo()

void LVL1::TrigT1TGCRecRoiTool::getWireInfo ( double &  eta,
double &  phi,
Identifier wireId,
std::unique_ptr< MuonTGC_Cabling::TGCChannelId w_asdout,
EdgeType  edge = NonEdge 
) const
private

Definition at line 259 of file TrigT1TGCRecRoiTool.cxx.

262  {
263  // init
264  wireId=Identifier(0);
265  auto w_pos=Amg::Vector3D(0,0,0);
266  //
267  int subsystemNumber = (w_asdout->isAside())? 1 : -1;
268  int wireOrStrip = (w_asdout->isStrip())? 1 : 0;
269  bool status = m_cabling->getOfflineIDfromOnlineID (wireId,
270  subsystemNumber,
271  w_asdout->getOctant(),
272  w_asdout->getSectorModule(),
273  w_asdout->getLayer(),
274  w_asdout->getChamber(),
275  wireOrStrip,
276  w_asdout->getChannel());
277  if (status==false) return;
278 
280  const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
281  if(muonMgr==nullptr){
282  ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
283  return;
284  }
285 
286 
287  const MuonGM::TgcReadoutElement* tgcwire
288  = muonMgr->getTgcReadoutElement(m_idHelperSvc->tgcIdHelper().parentID(wireId));
289  w_pos = tgcwire -> channelPos(wireId);
290 
291  // If edge correction is needed,
292  // the half length in the r direction is added (subtracted) for the upper (lower) edge.
293  if(edge==UpperREdge || edge==LowerREdge) {
294  int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(wireId);
295  int channel = m_idHelperSvc->tgcIdHelper().channel(wireId);
296  double halfLength = tgcwire->gangRadialLength(gasGap, channel)/2.;
297  double r = w_pos.perp();
298  double phi = w_pos.phi();
299  r += halfLength*(edge==UpperREdge ? +1. : -1.);
300  w_pos[Trk::locX] = r*cos(phi);
301  w_pos[Trk::locY] = r*sin(phi);
302  }
303  w_eta = w_pos.eta();
304  w_phi = w_pos.phi();
305 }

◆ initialize()

StatusCode LVL1::TrigT1TGCRecRoiTool::initialize ( )
overridevirtual

Definition at line 22 of file TrigT1TGCRecRoiTool.cxx.

22  {
24  ATH_CHECK( m_idHelperSvc.retrieve() );
25  ATH_CHECK( m_cabling.retrieve() );
26  if(m_useRun3Config){
27  ATH_MSG_INFO("update to Run 3 bit mask");
28  updateBitMask( Run3 );
29  }
30  return StatusCode::SUCCESS;
31 }

◆ roiData()

StatusCode LVL1::TrigT1TGCRecRoiTool::roiData ( const unsigned int &  roiWord,
TrigT1MuonRecRoiData data 
) const
overridevirtual

Definition at line 33 of file TrigT1TGCRecRoiTool.cxx.

33  {
34  // get SLB parameters
36  unsigned int sectorID, roiNumber,r,phi;
37  int wireSLBId, block;
38 
39  if (! getSLBparameters(roiWord,tgcId,sectorID,roiNumber,r,phi,wireSLBId,block)){
40  ATH_MSG_ERROR( "TGCRecRoiSvc::reconstruct : BAD roiWord. "
41  << "Can not get SLBparameters "
42  << " roi word = " << std::hex << roiWord );
43  return StatusCode::FAILURE;
44  }
46  ATH_MSG_ERROR( "TGCRecRoiSvc::reconstruct : "
47  << "This roiWord is not of TGC" );
48  return StatusCode::FAILURE;
49  }
50 
51 
52  // get ASDout
53  int offset = 4;
54  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout =
55  getWireASDOut(tgcId,sectorID,wireSLBId,block,phi,offset);
56  if (w_asdout == nullptr) {
57  ATH_MSG_WARNING( "TGCRecRoiSvc::reconstruct : "
58  << "Cannot get ASD out for Wire " );
59  return StatusCode::FAILURE;
60  }
61 
62  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout =
63  getStripASDOut(tgcId,sectorID,wireSLBId,block,phi,offset);
64  if (s_asdout == nullptr) {
65  ATH_MSG_WARNING( "TGCRecRoiSvc::reconstruct : "
66  << "Cannot get ASD out for Strip " );
67  return StatusCode::FAILURE;
68  }
69 
70  // wire(eta)
71  Identifier wireId;
72  double w_eta,w_phi;
73  getWireInfo(w_eta,w_phi,wireId,std::move(w_asdout));
74 
75  // strip(phi)
76  Identifier stripId;
77  double s_eta,s_phi;
78  getStripInfo(s_eta,s_phi,stripId,std::move(s_asdout));
79 
80  ATH_MSG_DEBUG( "(eta,phi)=" <<" (" << w_eta <<","<< s_phi <<")" );
81  ATH_MSG_DEBUG( "channelId_eta=" << wireId << " channelId_phi=" << stripId );
82 
83  data.set_eta(w_eta);
84  data.set_phi(s_phi);
85 
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);
92 
93  return StatusCode::SUCCESS;
94 }

◆ RoIsize()

StatusCode LVL1::TrigT1TGCRecRoiTool::RoIsize ( const unsigned int &  roiWord,
double &  etaMin,
double &  etaMax,
double &  phiMin,
double &  phiMax 
) const
overridevirtual

Definition at line 358 of file TrigT1TGCRecRoiTool.cxx.

360  {
361  // init
362  etaMin=etaMax=phiMin=phiMax=0;
363  //
365  unsigned int sectorID, roiNumber,r,phi;
366  int wireSLBId, block;
367  double w_eta,w_phi,s_eta,s_phi;
368  Identifier wireId, stripId;
369  // get wire/strip positions of both edges
370  for(int i=0; i<2; i++) {
371  // get edge, the range is from 1 to 8. One subsector consists of 8 (or less) wire channels and 8 strip channels
372  int offset=1+i*7;
373  if (! getSLBparameters(roiWord,tgcId,sectorID,roiNumber,r,phi,wireSLBId,block)) {
374  ATH_MSG_ERROR( "TGCRecRoiSvc::RoIsize : "
375  << "BAD roiWord " );
376  return StatusCode::FAILURE;
377  }
378 
380  ATH_MSG_ERROR( "TGCRecRoiSvc::RoIsize : "
381  << "This roiWord is not of TGC" );
382  return StatusCode::FAILURE;
383  }
384 
385  int wireOffset = offset;
387  if(roiNumber<4) { // Outermost ROI (|eta|~1.04)
388  if(wireOffset==1) wireOffset = 3; // The largest R channel
389  } else if(roiNumber>=144) { // Innermost ROI (|eta|~1.91)
390  if(wireOffset==8) wireOffset = 4; // The smallest R channel
391  }
392  } else if(tgcId.getRegionType()==MuonTGC_Cabling::TGCId::Forward) {
393  if(roiNumber<4) { // Outermost ROI (|eta|~1.93)
394  if(wireOffset==1) wireOffset = 4; // The largest R channel
395  } else if(roiNumber>=60) { // Innermost ROI (|eta|~2.40)
396  if(wireOffset==8) wireOffset = 5; // The smallest R channel
397  }
398  }
399 
400  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> w_asdout =
401  getWireASDOut(tgcId,sectorID,wireSLBId,block,phi,wireOffset);
402 
403  std::unique_ptr<MuonTGC_Cabling::TGCChannelId> s_asdout =
404  getStripASDOut(tgcId,sectorID,wireSLBId,block,phi,wireOffset,offset);
405 
406  if (w_asdout!=nullptr) {
407  getWireInfo(w_eta,w_phi,wireId,std::move(w_asdout), (i==0 ? UpperREdge : LowerREdge));
408  if (i==0) etaMin=w_eta;
409  else etaMax=w_eta;
410  }
411 
412  if (s_asdout!=nullptr) {
413  EdgeType stripEdge = NonEdge;
414  // Logic to know the relation between phi and strip channel directions
415  stripEdge = ((i==0) ^ ((s_asdout->isAside()) ^ (!(s_asdout->isBackward())))) ? LowerPhiEdge : UpperPhiEdge;
416 
417  getStripInfo(s_eta,s_phi,stripId,std::move(s_asdout),stripEdge);
418  if (i==0) phiMin=s_phi;
419  else phiMax=s_phi;
420  }
421  }
422 
423  if (etaMin>etaMax){
424  // SWAP(etaMin, etaMax);
425  double temp=etaMin; etaMin=etaMax; etaMax=temp;
426  }
427  if (phiMin>phiMax){
428  // SWAP(phiMin, phiMax);
429  double temp=phiMin; phiMin=phiMax; phiMax=temp;
430  }
431 
432  if(phiMin<-3. && phiMax>3.) {
433  phiMin += 2.*M_PI;
434  // SWAP(phiMin, phiMax);
435  double temp=phiMin; phiMin=phiMax; phiMax=temp;
436  }
437 
438  return StatusCode::SUCCESS;
439 }

Member Data Documentation

◆ m_cabling

ServiceHandle<MuonTGC_CablingSvc> LVL1::TrigT1TGCRecRoiTool::m_cabling {this, "TGCCablingSvc", "MuonTGC_CablingSvc"}
private

Definition at line 95 of file TrigT1TGCRecRoiTool.h.

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> LVL1::TrigT1TGCRecRoiTool::m_DetectorManagerKey {this, "DetectorManagerKey","MuonDetectorManager","Key of input MuonDetectorManager condition data"}
private

Definition at line 94 of file TrigT1TGCRecRoiTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> LVL1::TrigT1TGCRecRoiTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 93 of file TrigT1TGCRecRoiTool.h.

◆ m_patchForRoIWord

BooleanProperty LVL1::TrigT1TGCRecRoiTool::m_patchForRoIWord {this,"PatchForRoIWord",false,"apply a patch to RoI word"}
private

Definition at line 91 of file TrigT1TGCRecRoiTool.h.

◆ m_useConditionData

BooleanProperty LVL1::TrigT1TGCRecRoiTool::m_useConditionData {this,"UseConditionData",true,"use condition data"}
private

Definition at line 92 of file TrigT1TGCRecRoiTool.h.

◆ m_useRun3Config

BooleanProperty LVL1::TrigT1TGCRecRoiTool::m_useRun3Config {this,"UseRun3Config",false,"use Run 3 config"}
private

Definition at line 90 of file TrigT1TGCRecRoiTool.h.


The documentation for this class was generated from the following files:
MuonTGC_Cabling::TGCId::getChamber
int getChamber() const
Definition: TGCId.h:131
beamspotman.r
def r
Definition: beamspotman.py:676
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1::TrigT1TGCRecRoiTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: TrigT1TGCRecRoiTool.h:93
MuonTGC_Cabling::TGCId::setRegionType
void setRegionType(RegionType region)
Definition: TGCId.h:148
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
LVL1::TrigT1TGCRecRoiTool::LowerREdge
@ LowerREdge
Definition: TrigT1TGCRecRoiTool.h:49
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MuonTGC_Cabling::TGCId::getSideType
SideType getSideType(void) const
Definition: TGCId.h:122
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
MuonTGC_Cabling::TGCId::getRegionType
RegionType getRegionType(void) const
Definition: TGCId.h:126
MuonTGC_Cabling::TGCId::isAside
bool isAside() const
Definition: TGCId.h:134
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
LVL1::SubSysIDMask
@ SubSysIDMask
Definition: RecMuonRoI.h:40
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MuonTGC_Cabling::TGCId::isStrip
bool isStrip() const
Definition: TGCId.h:136
MuonTGC_Cabling::TGCId::setSideType
void setSideType(SideType side)
Definition: TGCId.h:144
MuonTGC_Cabling::TGCId
Definition: TGCId.h:10
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
TRT::Hit::side
@ side
Definition: HitInfo.h:83
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
MuonTGC_Cabling::TGCChannelId::ChannelIdType::SLBIn
@ SLBIn
MuonTGC_Cabling::TGCId::isBackward
bool isBackward() const
Definition: TGCId.cxx:39
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1::TrigT1TGCRecRoiTool::getSLBparameters
bool getSLBparameters(const unsigned int &roIWord, MuonTGC_Cabling::TGCId &tgcId, unsigned int &sectorID, unsigned int &roiNumber, unsigned int &r, unsigned int &phi, int &wireSLBId, int &block) const
Definition: TrigT1TGCRecRoiTool.cxx:96
LVL1::TrigT1TGCRecRoiTool::m_useRun3Config
BooleanProperty m_useRun3Config
Definition: TrigT1TGCRecRoiTool.h:90
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1::TrigT1TGCRecRoiTool::getWireInfo
void getWireInfo(double &eta, double &phi, Identifier &wireId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > w_asdout, EdgeType edge=NonEdge) const
Definition: TrigT1TGCRecRoiTool.cxx:259
MuonTGC_Cabling::TGCId::getOctant
int getOctant() const
Definition: TGCId.h:129
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
LVL1::EndcapRoIMask
@ EndcapRoIMask
Definition: RecMuonRoI.h:48
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
MuonTGC_Cabling::TGCCabling::getASDOutChannel
virtual TGCChannelId * getASDOutChannel(const TGCChannelId *slb_in) const
Definition: TGCCabling.cxx:68
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::TrigT1TGCRecRoiTool::UpperREdge
@ UpperREdge
Definition: TrigT1TGCRecRoiTool.h:50
LVL1::TrigT1TGCRecRoiTool::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: TrigT1TGCRecRoiTool.h:94
MuonGM::TgcReadoutElement::gangRadialLength
double gangRadialLength(int gasGap, int gang) const
Returns the length of the wire gang along the radial direction [pitch x N_{wire}^{gang}].
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:72
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::TrigT1TGCRecRoiTool::UpperPhiEdge
@ UpperPhiEdge
Definition: TrigT1TGCRecRoiTool.h:52
MuonTGC_Cabling::TGCId::WD
@ WD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::Endcap
@ Endcap
Definition: TGCId.h:53
LVL1::TrigT1TGCRecRoiTool::LowerPhiEdge
@ LowerPhiEdge
Definition: TrigT1TGCRecRoiTool.h:51
LVL1::ForwardRoIMask
@ ForwardRoIMask
Definition: RecMuonRoI.h:50
MuonGM::TgcReadoutElement::stripLongWidth
double stripLongWidth(int, int) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:162
Aside
@ Aside
Definition: CellClusterLinkTool.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LVL1::TrigT1TGCRecRoiTool::getStripASDOut
std::unique_ptr< MuonTGC_Cabling::TGCChannelId > getStripASDOut(const MuonTGC_Cabling::TGCId &tgcId, unsigned int sectorID, int wireSLBId, int block, int phi, int wireOffset, int stripOffset=DummyOffset) const
Definition: TrigT1TGCRecRoiTool.cxx:222
xAOD::roiNumber
setTeId setLumiBlock setRoiId setRoiSubsystem roiNumber
Definition: L2StandAloneMuon_v1.cxx:339
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LVL1::TrigT1TGCRecRoiTool::DummyOffset
DummyOffset
Definition: TrigT1TGCRecRoiTool.h:53
LVL1::TrigT1TGCRecRoiTool::m_patchForRoIWord
BooleanProperty m_patchForRoIWord
Definition: TrigT1TGCRecRoiTool.h:91
LVL1::TrigT1TGCRecRoiTool::getWireASDOut
std::unique_ptr< MuonTGC_Cabling::TGCChannelId > getWireASDOut(const MuonTGC_Cabling::TGCId &tgcId, unsigned int sectorID, int wireSLBId, int block, int phi, int offset) const
Definition: TrigT1TGCRecRoiTool.cxx:201
LVL1::TrigT1TGCRecRoiTool::RoIsize
virtual StatusCode RoIsize(const unsigned int &roiWord, double &etaMin, double &etaMax, double &phiMin, double &phiMax) const override
Definition: TrigT1TGCRecRoiTool.cxx:358
MuonTGC_Cabling::TGCId::NoRegionType
@ NoRegionType
Definition: TGCId.h:53
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGM::TgcReadoutElement::stripShortWidth
double stripShortWidth(int, int) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:150
LVL1::TrigT1TGCRecRoiTool::EdgeType
EdgeType
Definition: TrigT1TGCRecRoiTool.h:48
LVL1::TrigT1TGCRecRoiTool::m_cabling
ServiceHandle< MuonTGC_CablingSvc > m_cabling
Definition: TrigT1TGCRecRoiTool.h:95
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
MuonTGC_Cabling::TGCId::Cside
@ Cside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::NoSideType
@ NoSideType
Definition: TGCId.h:45
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LVL1::TrigT1TGCRecRoiTool::getStripInfo
void getStripInfo(double &eta, double &phi, Identifier &stripId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > s_asdout, EdgeType edge=NonEdge) const
Definition: TrigT1TGCRecRoiTool.cxx:307
LVL1::TrigT1TGCRecRoiTool::NonEdge
@ NonEdge
Definition: TrigT1TGCRecRoiTool.h:48
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonTGC_Cabling::TGCChannelId
Definition: TGCChannelId.h:15
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
MuonTGC_Cabling::TGCChannelId::getLayer
int getLayer() const
Definition: TGCChannelId.cxx:27
merge.status
status
Definition: merge.py:17
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LVL1::TrigT1TGCRecRoiTool::roiData
virtual StatusCode roiData(const unsigned int &roiWord, TrigT1MuonRecRoiData &data) const override
Definition: TrigT1TGCRecRoiTool.cxx:33
MuonTGC_Cabling::TGCId::Aside
@ Aside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCChannelId::getChannel
int getChannel() const
Definition: TGCChannelId.cxx:29
MuonTGC_Cabling::TGCCabling
Definition: TGCCabling.h:35
MuonTGC_Cabling::TGCId::getSectorModule
virtual int getSectorModule() const
Definition: TGCId.cxx:139
LVL1::SysIDMask
@ SysIDMask
Definition: RecMuonRoI.h:39
Identifier
Definition: IdentifierFieldParser.cxx:14