ATLAS Offline Software
Loading...
Searching...
No Matches
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"}
SG::ReadCondHandleKey< Muon::TgcCablingMapm_cablingKey {this, "CablingKey", "MuonTgc_CablingMap"}

Detailed Description

Definition at line 26 of file TrigT1TGCRecRoiTool.h.

Member Enumeration Documentation

◆ DummyOffset

Enumerator
DummyOffset 

Definition at line 53 of file TrigT1TGCRecRoiTool.h.

◆ EdgeType

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 442 of file TrigT1TGCRecRoiTool.cxx.

443{
444 const unsigned int maxSubsystem = 2;
445 const unsigned int maxTriggerSectorEndcap = 48;
446 const unsigned int maxTriggerSectorForward = 24;
447
448 const unsigned int maxEndcapR = 37;
449 const unsigned int maxForwardR = 16;
450
451 const unsigned int maxEndcapPhi = 4;
452 const unsigned int maxForwardPhi = 4;
453
454 std::ofstream roi_map;
455 roi_map.open(filename.c_str(), std::ios::out );
456 if(!roi_map){
457 ATH_MSG_WARNING( "Unable to open ROI_Mapping file!" );
458 } else {
459 roi_map <<"Endcap"<< std::endl;
460 roi_map <<"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
461 roi_map <<"# ------------------------------------------------------------------------"<< std::endl;
462 for(unsigned int side=0;side < maxSubsystem; side++){
463 for(unsigned int sector=0;sector < maxTriggerSectorEndcap; sector++){
464 for (unsigned int r=0; r<maxEndcapR; r++){
465 for (unsigned int phi=0; phi<maxEndcapPhi; phi++){
466 int roi = (r<<2) + phi;
467 int sectorAddress = sector<<1;
468 sectorAddress |= 0x80;
469 sectorAddress |= (side==0)?(0x1):(0x0);
470 unsigned long int roiWord = (m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
471 TrigT1MuonRecRoiData data;
472 if(!roiData(roiWord,data).isSuccess())continue;
473 roi_map << std::setw(8) << side << " "
474 << std::setw(8) << sector << " "
475 << std::setw(8) << roi << " "
476 << std::setw(12) << data.etaMin() << " "
477 << std::setw(12) << data.etaMax() << " "
478 << std::setw(12) << data.phiMin() << " "
479 << std::setw(12) << data.phiMax() << std::endl;
480 }
481 }
482 }
483 }
484 roi_map <<"Forward"<< std::endl;
485 roi_map <<"# side sector roi etaMin etaMax phiMin phiMax"<< std::endl;
486 roi_map <<"# ------------------------------------------------------------------------"<< std::endl;
487 for(unsigned int side=0;side < maxSubsystem; side++){
488 for(unsigned int sector=0;sector < maxTriggerSectorForward; sector++){
489 for (unsigned int r=0; r<maxForwardR; r++){
490 for (unsigned int phi=0; phi<maxForwardPhi; phi++){
491 int roi = (r<<2) + phi;
492 int sectorAddress = sector<<1;
493 sectorAddress |= 0x80;
494 sectorAddress |= (side==0)?(0x1):(0x0);
495 unsigned long int roiWord = (m_useRun3Config) ? (roi+(sectorAddress<<21)) : ((roi<<2)+(sectorAddress<<14));
496 TrigT1MuonRecRoiData data;
497 if(!roiData(roiWord,data).isSuccess())continue;
498 roi_map << std::setw(8) << side << " "
499 << std::setw(8) << sector << " "
500 << std::setw(8) << roi << " "
501 << std::setw(12) << data.etaMin() << " "
502 << std::setw(12) << data.etaMax() << " "
503 << std::setw(12) << data.phiMin() << " "
504 << std::setw(12) << data.phiMax() << std::endl;
505 }
506 }
507 }
508 }
509 roi_map.close();
510 }
511 return true;
512}
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
virtual StatusCode roiData(const unsigned int &roiWord, TrigT1MuonRecRoiData &data) const override
int r
Definition globals.cxx:22

◆ 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}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
void setSideType(SideType side)
Definition TGCId.h:194
void setRegionType(RegionType region)
Definition TGCId.h:198
SideType getSideType() const
Definition TGCId.h:134
@ SysIDMask
Definition RecMuonRoI.h:39
@ EndcapRoIMask
Definition RecMuonRoI.h:48
@ ForwardRoIMask
Definition RecMuonRoI.h:50
@ SubSysIDMask
Definition RecMuonRoI.h:40
setTeId setLumiBlock setRoiId setRoiSubsystem roiNumber

◆ 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 221 of file TrigT1TGCRecRoiTool.cxx.

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

◆ 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 SG::ReadCondHandle tgcCabling{m_cablingKey};
318 bool status = tgcCabling->getOfflineIDfromOnlineID (stripId,
319 subsystemNumber,
320 s_asdout->getOctant(),
321 s_asdout->getSectorModule(),
322 s_asdout->getLayer(),
323 s_asdout->getChamber(),
324 wireOrStrip,
325 s_asdout->getChannel());
326 if (status==false) return;
327
328 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
329 const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
330 if(muonMgr==nullptr){
331 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
332 return;
333 }
334
335
336 const MuonGM::TgcReadoutElement* tgcstrip
337 = muonMgr->getTgcReadoutElement(m_idHelperSvc->tgcIdHelper().parentID(stripId));
338 s_pos = tgcstrip -> channelPos(stripId);
339
340 // If edge correction is needed,
341 // the half width in the phi direction is added (subtracted) for the upper (lower) edge.
342 if(edge==UpperPhiEdge || edge==LowerPhiEdge) {
343 int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(stripId);
344 int channel = m_idHelperSvc->tgcIdHelper().channel(stripId);
345 double shortWidth = tgcstrip->stripShortWidth(gasGap, channel);
346 double longWidth = tgcstrip->stripLongWidth(gasGap, channel);
347 double halfWidth = (shortWidth + longWidth)/4.;
348 double r = s_pos.perp();
349 double phi = s_pos.phi();
350 double dPhi = atan2(halfWidth, r);
351 phi += dPhi*(edge==UpperPhiEdge ? +1. : -1.);
352 s_pos[Trk::locX] = r*cos(phi);
353 s_pos[Trk::locY] = r*sin(phi);
354 }
355 s_eta = s_pos.eta();
356 s_phi = s_pos.phi();
357}
#define ATH_MSG_ERROR(x)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const_pointer_type cptr()
Eigen::Matrix< double, 3, 1 > Vector3D
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
status
Definition merge.py:16

◆ 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
208 MuonTGC_Cabling::TGCChannelId w_slbin(MuonTGC_Cabling::TGCChannelId::ChannelIdType::SLBIn);
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 SG::ReadCondHandle tgcCabling{m_cablingKey};
217 return tgcCabling->getASDOutChannel(w_slbin);
218}

◆ 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 258 of file TrigT1TGCRecRoiTool.cxx.

261 {
262 // init
263 wireId=Identifier(0);
264 auto w_pos=Amg::Vector3D(0,0,0);
265 //
266 int subsystemNumber = (w_asdout->isAside())? 1 : -1;
267 int wireOrStrip = (w_asdout->isStrip())? 1 : 0;
268 SG::ReadCondHandle tgcCabling{m_cablingKey};
269 bool status = tgcCabling->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
279 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
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}
double gangRadialLength(int gasGap, int gang) const
Returns the length of the wire gang along the radial direction [pitch x N_{wire}^{gang}...

◆ initialize()

StatusCode LVL1::TrigT1TGCRecRoiTool::initialize ( )
overridevirtual

Definition at line 22 of file TrigT1TGCRecRoiTool.cxx.

22 {
23 ATH_CHECK(m_DetectorManagerKey.initialize());
24 ATH_CHECK( m_idHelperSvc.retrieve() );
25 ATH_CHECK( m_cablingKey.initialize() );
27 ATH_MSG_INFO("update to Run 3 bit mask");
28 updateBitMask( Run3 );
29 }
30 return StatusCode::SUCCESS;
31}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ 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
35 MuonTGC_Cabling::TGCId tgcId;
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}
virtual StatusCode RoIsize(const unsigned int &roiWord, double &etaMin, double &etaMax, double &phiMin, double &phiMax) const override
std::unique_ptr< MuonTGC_Cabling::TGCChannelId > getWireASDOut(const MuonTGC_Cabling::TGCId &tgcId, unsigned int sectorID, int wireSLBId, int block, int phi, int offset) const
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
void getWireInfo(double &eta, double &phi, Identifier &wireId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > w_asdout, EdgeType edge=NonEdge) const
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
void getStripInfo(double &eta, double &phi, Identifier &stripId, std::unique_ptr< MuonTGC_Cabling::TGCChannelId > s_asdout, EdgeType edge=NonEdge) const

◆ RoIsize()

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

Definition at line 359 of file TrigT1TGCRecRoiTool.cxx.

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

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<Muon::TgcCablingMap> LVL1::TrigT1TGCRecRoiTool::m_cablingKey {this, "CablingKey", "MuonTgc_CablingMap"}
private

Definition at line 95 of file TrigT1TGCRecRoiTool.h.

95{this, "CablingKey", "MuonTgc_CablingMap"};

◆ 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.

94{this, "DetectorManagerKey","MuonDetectorManager","Key of input MuonDetectorManager condition data"};

◆ m_idHelperSvc

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

Definition at line 93 of file TrigT1TGCRecRoiTool.h.

93{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ 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.

91{this,"PatchForRoIWord",false,"apply a patch to RoI word"};

◆ m_useConditionData

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

Definition at line 92 of file TrigT1TGCRecRoiTool.h.

92{this,"UseConditionData",true,"use condition data"};

◆ m_useRun3Config

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

Definition at line 90 of file TrigT1TGCRecRoiTool.h.

90{this,"UseRun3Config",false,"use Run 3 config"};

The documentation for this class was generated from the following files: