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, TGCIdBase &tgcIdBase, unsigned int &sectorID, unsigned int &roiNumber, unsigned int &r, unsigned int &phi, int &wireSLBId, int &block) const
 
std::unique_ptr< TGCIdBasegetWireASDOut (const TGCIdBase &tgcIdBase, unsigned int sectorID, int wireSLBId, int block, int phi, int offset) const
 
std::unique_ptr< TGCIdBasegetStripASDOut (const TGCIdBase &tgcIdBase, 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< TGCIdBase > w_asdout, EdgeType edge=NonEdge) const
 
void getStripInfo (double &eta, double &phi, Identifier &stripId, std::unique_ptr< TGCIdBase > 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"}
 
const ITGCcablingSvcm_cabling {nullptr}
 

Detailed Description

Definition at line 23 of file TrigT1TGCRecRoiTool.h.

Member Enumeration Documentation

◆ DummyOffset

Enumerator
DummyOffset 

Definition at line 50 of file TrigT1TGCRecRoiTool.h.

50 {DummyOffset=-9999};

◆ EdgeType

Enumerator
NonEdge 
LowerREdge 
UpperREdge 
LowerPhiEdge 
UpperPhiEdge 

Definition at line 45 of file TrigT1TGCRecRoiTool.h.

45  {NonEdge=-1,
46  LowerREdge,
47  UpperREdge,
49  UpperPhiEdge};

Constructor & Destructor Documentation

◆ TrigT1TGCRecRoiTool()

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

Definition at line 17 of file TrigT1TGCRecRoiTool.cxx.

17  : base_class(type,name,parent)
18  {
19  }

◆ ~TrigT1TGCRecRoiTool()

LVL1::TrigT1TGCRecRoiTool::~TrigT1TGCRecRoiTool ( )
virtual

Definition at line 21 of file TrigT1TGCRecRoiTool.cxx.

21  {
22  }

Member Function Documentation

◆ dumpRoiMap()

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

Definition at line 458 of file TrigT1TGCRecRoiTool.cxx.

459  {
460  const unsigned int maxSubsystem = 2;
461  const unsigned int maxTriggerSectorEndcap = 48;
462  const unsigned int maxTriggerSectorForward = 24;
463 
464  const unsigned int maxEndcapR = 37;
465  const unsigned int maxForwardR = 16;
466 
467  const unsigned int maxEndcapPhi = 4;
468  const unsigned int maxForwardPhi = 4;
469 
470  std::ofstream roi_map;
471  roi_map.open(filename.c_str(), std::ios::out );
472  if(!roi_map){
473  ATH_MSG_WARNING( "Unable to open ROI_Mapping file!" );
474  } else {
475  roi_map <<"Endcap"<< std::endl;
476  roi_map <<"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
477  roi_map <<"# ------------------------------------------------------------------------"<< std::endl;
478  for(unsigned int side=0;side < maxSubsystem; side++){
479  for(unsigned int sector=0;sector < maxTriggerSectorEndcap; sector++){
480  for (unsigned int r=0; r<maxEndcapR; r++){
481  for (unsigned int phi=0; phi<maxEndcapPhi; phi++){
482  int roi = (r<<2) + phi;
483  int sectorAddress = sector<<1;
484  sectorAddress |= 0x80;
485  sectorAddress |= (side==0)?(0x1):(0x0);
486  unsigned long int roiWord = (m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
487  TrigT1MuonRecRoiData data;
488  if(!roiData(roiWord,data).isSuccess())continue;
489  roi_map << std::setw(8) << side << " "
490  << std::setw(8) << sector << " "
491  << std::setw(8) << roi << " "
492  << std::setw(12) << data.etaMin() << " "
493  << std::setw(12) << data.etaMax() << " "
494  << std::setw(12) << data.phiMin() << " "
495  << std::setw(12) << data.phiMax() << std::endl;
496  }
497  }
498  }
499  }
500  roi_map <<"Forward"<< std::endl;
501  roi_map <<"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
502  roi_map <<"# ------------------------------------------------------------------------"<< std::endl;
503  for(unsigned int side=0;side < maxSubsystem; side++){
504  for(unsigned int sector=0;sector < maxTriggerSectorForward; sector++){
505  for (unsigned int r=0; r<maxForwardR; r++){
506  for (unsigned int phi=0; phi<maxForwardPhi; phi++){
507  int roi = (r<<2) + phi;
508  int sectorAddress = sector<<1;
509  sectorAddress |= 0x80;
510  sectorAddress |= (side==0)?(0x1):(0x0);
511  unsigned long int roiWord = (m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
512  TrigT1MuonRecRoiData data;
513  if(!roiData(roiWord,data).isSuccess())continue;
514  roi_map << std::setw(8) << side << " "
515  << std::setw(8) << sector << " "
516  << std::setw(8) << roi << " "
517  << std::setw(12) << data.etaMin() << " "
518  << std::setw(12) << data.etaMax() << " "
519  << std::setw(12) << data.phiMin() << " "
520  << std::setw(12) << data.phiMax() << std::endl;
521  }
522  }
523  }
524  }
525  roi_map.close();
526  }
527  return true;
528  }

◆ etaDimHigh()

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

Definition at line 41 of file TrigT1TGCRecRoiTool.h.

41 {return false;}

◆ etaDimLow()

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

Definition at line 40 of file TrigT1TGCRecRoiTool.h.

40 {return false;}

◆ getSLBparameters()

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

Definition at line 101 of file TrigT1TGCRecRoiTool.cxx.

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

◆ getStripASDOut()

std::unique_ptr< TGCIdBase > LVL1::TrigT1TGCRecRoiTool::getStripASDOut ( const TGCIdBase tgcIdBase,
unsigned int  sectorID,
int  wireSLBId,
int  block,
int  phi,
int  wireOffset,
int  stripOffset = DummyOffset 
) const
private

Definition at line 228 of file TrigT1TGCRecRoiTool.cxx.

235  {
236 
237  // If stripOffset is not given, wireOffset is used as stripOffset
238  if(stripOffset==DummyOffset) stripOffset = wireOffset;
239 
240  // wire
241  TGCIdBase w_slbin(TGCIdBase::Channel);
242  w_slbin.setChannelIdType(TGCIdBase::SLBIn);
243  w_slbin.setSideType(tgcIdBase.getSideType());
244  w_slbin.setModuleType(TGCIdBase::WD);
245  w_slbin.setRegionType(tgcIdBase.getRegionType());
246  w_slbin.setSector(sectorID);
247  w_slbin.setId(wireSLBId);
248  w_slbin.setChannel(41+wireOffset+8*block);
249 
250  const TGCCablingBase* tgcCabling = m_cabling->getTGCCabling();
251  std::unique_ptr<TGCIdBase> w_asdout( tgcCabling->getASDOutChannel(&w_slbin) );
252 
253  // strip
254  int stripSLBId = w_asdout->getChamber();
255 
256  TGCIdBase s_slbin(TGCIdBase::Channel);
257  s_slbin.setChannelIdType(TGCIdBase::SLBIn);
258  s_slbin.setSideType(tgcIdBase.getSideType());
259  s_slbin.setModuleType(TGCIdBase::SD);
260  s_slbin.setRegionType(tgcIdBase.getRegionType());
261  s_slbin.setSector(sectorID);
262  s_slbin.setId(stripSLBId);
263  s_slbin.setChannel(41+stripOffset+8*phi);
264 
265  std::unique_ptr<TGCIdBase> s_asdout( tgcCabling->getASDOutChannel (&s_slbin) );
266  return s_asdout;
267  }

◆ getStripInfo()

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

Definition at line 318 of file TrigT1TGCRecRoiTool.cxx.

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

◆ getWireASDOut()

std::unique_ptr< TGCIdBase > LVL1::TrigT1TGCRecRoiTool::getWireASDOut ( const TGCIdBase tgcIdBase,
unsigned int  sectorID,
int  wireSLBId,
int  block,
int  phi,
int  offset 
) const
private

Definition at line 206 of file TrigT1TGCRecRoiTool.cxx.

212  {
213  // wire
214  TGCIdBase w_slbin(TGCIdBase::Channel);
215  w_slbin.setChannelIdType(TGCIdBase::SLBIn);
216  w_slbin.setSideType(tgcIdBase.getSideType());
217  w_slbin.setModuleType(TGCIdBase::WD);
218  w_slbin.setRegionType(tgcIdBase.getRegionType());
219  w_slbin.setSector(sectorID);
220  w_slbin.setId(wireSLBId);
221  w_slbin.setChannel(41+offset+8*block);
222 
223  const TGCCablingBase* tgcCabling = m_cabling->getTGCCabling();
224  std::unique_ptr<TGCIdBase> w_asdout( tgcCabling->getASDOutChannel (&w_slbin) );
225  return w_asdout;
226  }

◆ getWireInfo()

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

Definition at line 269 of file TrigT1TGCRecRoiTool.cxx.

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

◆ initialize()

StatusCode LVL1::TrigT1TGCRecRoiTool::initialize ( )
overridevirtual

Definition at line 24 of file TrigT1TGCRecRoiTool.cxx.

24  {
26  ATH_CHECK( m_idHelperSvc.retrieve() );
27  ServiceHandle<ITGCcablingServerSvc> tgcCabGet("Muon::TGCCablingServerSvc", name());
28  ATH_CHECK( tgcCabGet.retrieve() );
29  ATH_CHECK( tgcCabGet->giveCabling(m_cabling) );
30  if(m_useRun3Config){
31  ATH_MSG_INFO("update to Run 3 bit mask");
32  updateBitMask( Run3 );
33  }
34  return StatusCode::SUCCESS;
35  }

◆ roiData()

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

Definition at line 37 of file TrigT1TGCRecRoiTool.cxx.

38  {
39  // get SLB parameters
40  TGCIdBase tgcIdBase;
41  unsigned int sectorID, roiNumber,r,phi;
42  int wireSLBId, block;
43 
44  if (! getSLBparameters(roiWord,tgcIdBase,sectorID,roiNumber,r,phi,wireSLBId,block)){
45  ATH_MSG_ERROR( "TGCRecRoiSvc::reconstruct : BAD roiWord. "
46  << "Can not get SLBparameters "
47  << " roi word = " << std::hex << roiWord );
48  return StatusCode::FAILURE;
49  }
50  if (tgcIdBase.getSideType() == TGCIdBase::NoSideType) {
51  ATH_MSG_ERROR( "TGCRecRoiSvc::reconstruct : "
52  << "This roiWord is not of TGC" );
53  return StatusCode::FAILURE;
54  }
55 
56 
57  // get ASDout
58  int offset = 4;
59  std::unique_ptr<TGCIdBase> w_asdout =
60  getWireASDOut(tgcIdBase,sectorID,wireSLBId,block,phi,offset);
61  if (w_asdout == nullptr) {
62  ATH_MSG_WARNING( "TGCRecRoiSvc::reconstruct : "
63  << "Cannot get ASD out for Wire " );
64  return StatusCode::FAILURE;
65  }
66 
67  std::unique_ptr<TGCIdBase> s_asdout =
68  getStripASDOut(tgcIdBase,sectorID,wireSLBId,block,phi,offset);
69  if (s_asdout == nullptr) {
70  ATH_MSG_WARNING( "TGCRecRoiSvc::reconstruct : "
71  << "Cannot get ASD out for Strip " );
72  return StatusCode::FAILURE;
73  }
74 
75  // wire(eta)
76  Identifier wireId;
77  double w_eta,w_phi;
78  getWireInfo(w_eta,w_phi,wireId,std::move(w_asdout));
79 
80  // strip(phi)
81  Identifier stripId;
82  double s_eta,s_phi;
83  getStripInfo(s_eta,s_phi,stripId,std::move(s_asdout));
84 
85  ATH_MSG_DEBUG( "(eta,phi)=" <<" (" << w_eta <<","<< s_phi <<")" );
86  ATH_MSG_DEBUG( "channelId_eta=" << wireId << " channelId_phi=" << stripId );
87 
88  data.set_eta(w_eta);
89  data.set_phi(s_phi);
90 
91  double etaMin, etaMax, phiMin, phiMax;
92  if(RoIsize(roiWord,etaMin,etaMax,phiMin,phiMax)!=StatusCode::SUCCESS) return StatusCode::FAILURE;
93  data.set_etaMin(etaMin);
94  data.set_etaMax(etaMax);
95  data.set_phiMin(phiMin);
96  data.set_phiMax(phiMax);
97 
98  return StatusCode::SUCCESS;
99  }

◆ RoIsize()

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

Definition at line 373 of file TrigT1TGCRecRoiTool.cxx.

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

Member Data Documentation

◆ m_cabling

const ITGCcablingSvc* LVL1::TrigT1TGCRecRoiTool::m_cabling {nullptr}
private

Definition at line 92 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 91 of file TrigT1TGCRecRoiTool.h.

◆ m_idHelperSvc

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

Definition at line 90 of file TrigT1TGCRecRoiTool.h.

◆ m_patchForRoIWord

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

Definition at line 88 of file TrigT1TGCRecRoiTool.h.

◆ m_useConditionData

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

Definition at line 89 of file TrigT1TGCRecRoiTool.h.

◆ m_useRun3Config

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

Definition at line 87 of file TrigT1TGCRecRoiTool.h.


The documentation for this class was generated from the following files:
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:90
TGCIdBase::getRegionType
RegionType getRegionType(void) const
Definition: TGCIdBase.cxx:41
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
TGCIdBase::Endcap
@ Endcap
Definition: TGCIdBase.h:39
TGCIdBase::NoRegionType
@ NoRegionType
Definition: TGCIdBase.h:39
TGCIdBase::getChannel
virtual int getChannel(void) const
Definition: TGCIdBase.cxx:50
LVL1::TrigT1TGCRecRoiTool::LowerREdge
@ LowerREdge
Definition: TrigT1TGCRecRoiTool.h:46
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::locX
@ locX
Definition: ParamDefs.h:43
ITGCcablingSvc::getOfflineIDfromOnlineID
virtual bool getOfflineIDfromOnlineID(Identifier &offlineID, const int subsystemNumber, const int octantNumber, const int moduleNumber, const int layerNumber, const int rNumber, const int wireOrStrip, const int channelNumber) const =0
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::TrigT1TGCRecRoiTool::getWireInfo
void getWireInfo(double &eta, double &phi, Identifier &wireId, std::unique_ptr< TGCIdBase > w_asdout, EdgeType edge=NonEdge) const
Definition: TrigT1TGCRecRoiTool.cxx:269
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
TGCIdBase::Aside
@ Aside
Definition: TGCIdBase.h:31
TGCIdBase::getChamber
int getChamber(void) const
Definition: TGCIdBase.cxx:47
TGCIdBase::SD
@ SD
Definition: TGCIdBase.h:33
LVL1::SubSysIDMask
@ SubSysIDMask
Definition: RecMuonRoI.h:40
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TGCIdBase::setSideType
virtual void setSideType(SideType vside)
Definition: TGCIdBase.cxx:93
TGCIdBase::Channel
@ Channel
Definition: TGCIdBase.h:35
TGCCablingBase::getASDOutChannel
virtual TGCIdBase * getASDOutChannel(const TGCIdBase *slb_in) const =0
TGCIdBase::SLBIn
@ SLBIn
Definition: TGCIdBase.h:43
TGCIdBase::setRegionType
virtual void setRegionType(RegionType vregion)
Definition: TGCIdBase.cxx:97
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
LVL1::TrigT1TGCRecRoiTool::m_cabling
const ITGCcablingSvc * m_cabling
Definition: TrigT1TGCRecRoiTool.h:92
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
TGCIdBase::getLayer
int getLayer(void) const
Definition: TGCIdBase.cxx:46
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1::TrigT1TGCRecRoiTool::m_useRun3Config
BooleanProperty m_useRun3Config
Definition: TrigT1TGCRecRoiTool.h:87
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:530
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::TrigT1TGCRecRoiTool::UpperREdge
@ UpperREdge
Definition: TrigT1TGCRecRoiTool.h:47
LVL1::TrigT1TGCRecRoiTool::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: TrigT1TGCRecRoiTool.h:91
TGCIdBase::getSideType
SideType getSideType(void) const
Definition: TGCIdBase.cxx:37
ITGCcablingSvc::getTGCCabling
virtual const TGCCablingBase * getTGCCabling() const =0
TGCIdBase::isAside
bool isAside(void) const
Definition: TGCIdBase.cxx:54
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:49
TGCIdBase::isBackward
bool isBackward(void) const
Definition: TGCIdBase.cxx:63
TGCCablingBase
Definition: TGCCablingBase.h:23
LVL1::TrigT1TGCRecRoiTool::LowerPhiEdge
@ LowerPhiEdge
Definition: TrigT1TGCRecRoiTool.h:48
LVL1::ForwardRoIMask
@ ForwardRoIMask
Definition: RecMuonRoI.h:50
MuonGM::TgcReadoutElement::stripLongWidth
double stripLongWidth(int, int) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:162
LVL1::TrigT1TGCRecRoiTool::getStripInfo
void getStripInfo(double &eta, double &phi, Identifier &stripId, std::unique_ptr< TGCIdBase > s_asdout, EdgeType edge=NonEdge) const
Definition: TrigT1TGCRecRoiTool.cxx:318
Aside
@ Aside
Definition: CellClusterLinkTool.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
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:50
TGCIdBase
Definition: TGCIdBase.h:18
LVL1::TrigT1TGCRecRoiTool::m_patchForRoIWord
BooleanProperty m_patchForRoIWord
Definition: TrigT1TGCRecRoiTool.h:88
LVL1::TrigT1TGCRecRoiTool::RoIsize
virtual StatusCode RoIsize(const unsigned int &roiWord, double &etaMin, double &etaMax, double &phiMin, double &phiMax) const override
Definition: TrigT1TGCRecRoiTool.cxx:373
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:45
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
TGCIdBase::Cside
@ Cside
Definition: TGCIdBase.h:31
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LVL1::TrigT1TGCRecRoiTool::NonEdge
@ NonEdge
Definition: TrigT1TGCRecRoiTool.h:45
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TGCIdBase::NoSideType
@ NoSideType
Definition: TGCIdBase.h:31
TGCIdBase::Forward
@ Forward
Definition: TGCIdBase.h:39
LVL1::TrigT1TGCRecRoiTool::getSLBparameters
bool getSLBparameters(const unsigned int &roIWord, TGCIdBase &tgcIdBase, unsigned int &sectorID, unsigned int &roiNumber, unsigned int &r, unsigned int &phi, int &wireSLBId, int &block) const
Definition: TrigT1TGCRecRoiTool.cxx:101
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
TGCIdBase::getOctant
int getOctant(void) const
Definition: TGCIdBase.cxx:44
merge.status
status
Definition: merge.py:17
TGCIdBase::getSectorModule
virtual int getSectorModule(void) const
Definition: TGCIdBase.cxx:115
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LVL1::TrigT1TGCRecRoiTool::getWireASDOut
std::unique_ptr< TGCIdBase > getWireASDOut(const TGCIdBase &tgcIdBase, unsigned int sectorID, int wireSLBId, int block, int phi, int offset) const
Definition: TrigT1TGCRecRoiTool.cxx:206
TGCIdBase::isStrip
bool isStrip(void) const
Definition: TGCIdBase.cxx:56
LVL1::TrigT1TGCRecRoiTool::roiData
virtual StatusCode roiData(const unsigned int &roiWord, TrigT1MuonRecRoiData &data) const override
Definition: TrigT1TGCRecRoiTool.cxx:37
TGCIdBase::WD
@ WD
Definition: TGCIdBase.h:33
LVL1::TrigT1TGCRecRoiTool::getStripASDOut
std::unique_ptr< TGCIdBase > getStripASDOut(const TGCIdBase &tgcIdBase, unsigned int sectorID, int wireSLBId, int block, int phi, int wireOffset, int stripOffset=DummyOffset) const
Definition: TrigT1TGCRecRoiTool.cxx:228
ServiceHandle< ITGCcablingServerSvc >
LVL1::SysIDMask
@ SysIDMask
Definition: RecMuonRoI.h:39