ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::TrigT1RPCRecRoiTool Class Reference

#include <TrigT1RPCRecRoiTool.h>

Inheritance diagram for LVL1::TrigT1RPCRecRoiTool:
Collaboration diagram for LVL1::TrigT1RPCRecRoiTool:

Public Member Functions

 TrigT1RPCRecRoiTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TrigT1RPCRecRoiTool ()=default
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 &data, double &etaMin, double &etaMax) const override
bool etaDimHigh (const TrigT1MuonRecRoiData &data, double &etaMin, double &etaMax) const override

Private Attributes

BooleanProperty m_useRun3Config {this,"UseRun3Config",false,"use Run 3 config"}
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< RpcCablingCondDatam_rpcKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}

Detailed Description

Definition at line 18 of file TrigT1RPCRecRoiTool.h.

Constructor & Destructor Documentation

◆ TrigT1RPCRecRoiTool()

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

Definition at line 10 of file TrigT1RPCRecRoiTool.cxx.

10 :
11 base_class(type,name,parent) {
12 }

◆ ~TrigT1RPCRecRoiTool()

virtual LVL1::TrigT1RPCRecRoiTool::~TrigT1RPCRecRoiTool ( )
virtualdefault

Member Function Documentation

◆ dumpRoiMap()

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

Definition at line 127 of file TrigT1RPCRecRoiTool.cxx.

128 {
129 const unsigned int maxSubsystem = 2;
130 const unsigned int maxLogicSector = 32;
131 const unsigned int maxRoI = 32;
132
133 std::ofstream roi_map;
134 roi_map.open(filename.c_str(), std::ios::out );
135 if(!roi_map){
136 ATH_MSG_WARNING( "Unable to open ROI_Mapping file!" );
137 } else {
138 roi_map <<"# side sector roi etaMin etaMax phiMin phiMax etaMinLow etaMaxLow etaMinHigh etaMaxHigh "<< std::endl;
139 roi_map <<"# ------------------------------------------------------------------------------------------------------------------------------ "<< std::endl;
140 for(unsigned int side=0;side < maxSubsystem; side++){
141 for(unsigned int sector=0;sector < maxLogicSector; sector++){
142 for (unsigned int roi=0; roi<maxRoI; roi++){
143 unsigned long int roIWord = (m_useRun3Config) ? (roi+(side<<21)+(sector<<22)) : ((roi<<2)+(side<<14)+(sector<<15));
144 TrigT1MuonRecRoiData data;
145 if(!roiData(roIWord,data).isSuccess())continue;
146 double etaMinLow(0),etaMaxLow(0),etaMinHigh(0),etaMaxHigh(0);
147 etaDimLow (data,etaMinLow, etaMaxLow);
148 etaDimHigh(data,etaMinHigh,etaMaxHigh);
149 roi_map << std::setw(8) << side << " "
150 << std::setw(8) << sector << " "
151 << std::setw(8) << roi << " "
152 << std::setw(12) << data.etaMin() << " "
153 << std::setw(12) << data.etaMax() << " "
154 << std::setw(12) << data.phiMin() << " "
155 << std::setw(12) << data.phiMax() << " "
156 << std::setw(8) << etaMinLow << " "
157 << std::setw(8) << etaMaxLow << " "
158 << std::setw(8) << etaMinHigh << " "
159 << std::setw(8) << etaMaxHigh << std::endl;
160 }
161 }
162 }
163 roi_map.close();
164 }
165 return true;
166 }
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
bool etaDimLow(const TrigT1MuonRecRoiData &data, double &etaMin, double &etaMax) const override
bool etaDimHigh(const TrigT1MuonRecRoiData &data, double &etaMin, double &etaMax) const override
virtual StatusCode roiData(const unsigned int &roiWord, TrigT1MuonRecRoiData &data) const override

◆ etaDimHigh()

bool LVL1::TrigT1RPCRecRoiTool::etaDimHigh ( const TrigT1MuonRecRoiData & data,
double & etaMin,
double & etaMax ) const
override

Definition at line 227 of file TrigT1RPCRecRoiTool.cxx.

229 {
230 // Get the strips delimiting the RoIs from rPCcablingSvc
231 Identifier EtaLowBorder_id;
232 Identifier EtaHighBorder_id;
233 Identifier PhiLowBorder_id;
234 Identifier PhiHighBorder_id;
235 Amg::Vector3D EtaLowBorder_pos(0.,0.,0.);
236 Amg::Vector3D EtaHighBorder_pos(0.,0.,0.);
237
238 SG::ReadCondHandle<RpcCablingCondData> rpcReadHandle{m_rpcKey};
239 const RpcCablingCondData* rpcCab{*rpcReadHandle};
240 if (rpcCab==nullptr){
241 ATH_MSG_ERROR("Null pointer to the read RpcCablingCondData conditions object.");
242 return false;
243 }
244
245 if(!rpcCab->give_HighPt_borders_id(data.side(), data.sector(), data.roi(),
246 EtaLowBorder_id, EtaHighBorder_id,
247 PhiLowBorder_id, PhiHighBorder_id,
248 &m_idHelperSvc->rpcIdHelper())) return false;
249
250 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
251 const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
252 if(muonMgr==nullptr){
253 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
254 return false;
255 }
256
257 const MuonGM::RpcReadoutElement* EtaLowBorder_descriptor =
258 muonMgr->getRpcReadoutElement(EtaLowBorder_id);
259 if(EtaLowBorder_descriptor==nullptr){
260 ATH_MSG_WARNING("Null pointer to the RpcReadoutElement object for EtaLowBorder.");
261 return false;
262 }
263 EtaLowBorder_pos = EtaLowBorder_descriptor->stripPos(EtaLowBorder_id);
264
265 const MuonGM::RpcReadoutElement* EtaHighBorder_descriptor =
266 muonMgr->getRpcReadoutElement(EtaHighBorder_id);
267 if(EtaHighBorder_descriptor==nullptr){
268 ATH_MSG_WARNING("Null pointer to the RpcReadoutElement object for EtaHighBorder.");
269 return false;
270 }
271 EtaHighBorder_pos = EtaHighBorder_descriptor->stripPos(EtaHighBorder_id);
272
273 etaMin=EtaLowBorder_pos.eta();
274 etaMax=EtaHighBorder_pos.eta();
275 if (etaMin>etaMax){
276 double tmp=etaMin;
278 etaMax=tmp;
279 }
280 return true;
281 }
#define ATH_MSG_ERROR(x)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< RpcCablingCondData > m_rpcKey
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
bool give_HighPt_borders_id(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int RoIId, Identifier &EtaLowBorder_id, Identifier &EtaHighBorder_id, Identifier &PhiLowBorder_id, Identifier &PhiHighBorder_id, const RpcIdHelper *rpcId) const
const_pointer_type cptr()
Eigen::Matrix< double, 3, 1 > Vector3D

◆ etaDimLow()

bool LVL1::TrigT1RPCRecRoiTool::etaDimLow ( const TrigT1MuonRecRoiData & data,
double & etaMin,
double & etaMax ) const
override

Definition at line 169 of file TrigT1RPCRecRoiTool.cxx.

171 {
172 // Get the strips delimiting the RoIs from rPCcablingSvc
173 Identifier EtaLowBorder_id;
174 Identifier EtaHighBorder_id;
175 Identifier PhiLowBorder_id;
176 Identifier PhiHighBorder_id;
177 Amg::Vector3D EtaLowBorder_pos(0.,0.,0.);
178 Amg::Vector3D EtaHighBorder_pos(0.,0.,0.);
179
180 SG::ReadCondHandle<RpcCablingCondData> rpcReadHandle{m_rpcKey};
181 const RpcCablingCondData* rpcCab{*rpcReadHandle};
182 if (rpcCab==nullptr){
183 ATH_MSG_ERROR("Null pointer to the read RpcCablingCondData conditions object.");
184 return false;
185 }
186
187 if(!rpcCab->give_LowPt_borders_id(data.side(), data.sector(), data.roi(),
188 EtaLowBorder_id, EtaHighBorder_id,
189 PhiLowBorder_id, PhiHighBorder_id,
190 &m_idHelperSvc->rpcIdHelper())) return false;
191
192
193 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
194 const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
195 if(muonMgr==nullptr){
196 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
197 return false;
198 }
199
200
201 const MuonGM::RpcReadoutElement* EtaLowBorder_descriptor =
202 muonMgr->getRpcReadoutElement(EtaLowBorder_id);
203 if(EtaLowBorder_descriptor==nullptr){
204 ATH_MSG_WARNING("Null pointer to the RpcReadoutElement object for EtaLowBorder.");
205 return false;
206 }
207 EtaLowBorder_pos = EtaLowBorder_descriptor->stripPos(EtaLowBorder_id);
208
209 const MuonGM::RpcReadoutElement* EtaHighBorder_descriptor =
210 muonMgr->getRpcReadoutElement(EtaHighBorder_id);
211 if(EtaHighBorder_descriptor==nullptr){
212 ATH_MSG_WARNING("Null pointer to the RpcReadoutElement object for EtaHighBorder.");
213 return false;
214 }
215 EtaHighBorder_pos = EtaHighBorder_descriptor->stripPos(EtaHighBorder_id);
216
217 etaMin=EtaLowBorder_pos.eta();
218 etaMax=EtaHighBorder_pos.eta();
219 if (etaMin>etaMax){
220 double tmp=etaMin;
222 etaMax=tmp;
223 }
224 return true;
225 }
bool give_LowPt_borders_id(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int RoIId, Identifier &EtaLowBorder_id, Identifier &EtaHighBorder_id, Identifier &PhiLowBorder_id, Identifier &PhiHighBorder_id, const RpcIdHelper *rpcId) const

◆ initialize()

StatusCode LVL1::TrigT1RPCRecRoiTool::initialize ( )
overridevirtual

Definition at line 14 of file TrigT1RPCRecRoiTool.cxx.

14 {
15 ATH_CHECK(m_DetectorManagerKey.initialize());
16 ATH_CHECK(m_idHelperSvc.retrieve() );
17 ATH_CHECK(m_rpcKey.initialize());
19 ATH_MSG_INFO("update to Run 3 bit mask");
20 updateBitMask( Run3 );
21 }
22 return StatusCode::SUCCESS;
23 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ roiData()

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

Definition at line 25 of file TrigT1RPCRecRoiTool.cxx.

26 {
27
28 // subsystem ID and sector ID
29 data.set_side( getBitMaskValue(&roiWord,SubSysIDMask()) );
30 data.set_sector( getBitMaskValue(&roiWord,BarrelSectorIDMask()) );
31 // RoI
32 data.set_roi( getBitMaskValue(&roiWord,BarrelRoIMask()) );
33
34 // Get the strips delimiting the RoIs from rPCcablingSvc
35 Identifier EtaLowBorder_id;
36 Identifier EtaHighBorder_id;
37 Identifier PhiLowBorder_id;
38 Identifier PhiHighBorder_id;
39
40 Amg::Vector3D EtaLowBorder_pos(0.,0.,0.);
41 Amg::Vector3D EtaHighBorder_pos(0.,0.,0.);
42 Amg::Vector3D PhiLowBorder_pos(0.,0.,0.);
43 Amg::Vector3D PhiHighBorder_pos(0.,0.,0.);
44
45 SG::ReadCondHandle<RpcCablingCondData> rpcReadHandle{m_rpcKey};
46 const RpcCablingCondData* rpcCab{*rpcReadHandle};
47 if (rpcCab==nullptr){
48 ATH_MSG_ERROR("Null pointer to the read RpcCablingCondData conditions object.");
49 return StatusCode::FAILURE;
50 }
51
52 if(rpcCab->give_RoI_borders_id(data.side(), data.sector(), data.roi(),
53 EtaLowBorder_id, EtaHighBorder_id,
54 PhiLowBorder_id, PhiHighBorder_id, &m_idHelperSvc->rpcIdHelper()))
55 {
56
57 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
58 const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
59 if(muonMgr==nullptr){
60 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
61 return StatusCode::FAILURE;
62 }
63
64
65 const MuonGM::RpcReadoutElement* EtaLowBorder_descriptor =
66 muonMgr->getRpcReadoutElement(EtaLowBorder_id);
67 EtaLowBorder_pos = EtaLowBorder_descriptor->stripPos(EtaLowBorder_id);
68
69 const MuonGM::RpcReadoutElement* EtaHighBorder_descriptor =
70 muonMgr->getRpcReadoutElement(EtaHighBorder_id);
71 EtaHighBorder_pos = EtaHighBorder_descriptor->stripPos(EtaHighBorder_id);
72
73 const MuonGM::RpcReadoutElement* PhiLowBorder_descriptor =
74 muonMgr->getRpcReadoutElement(PhiLowBorder_id);
75 PhiLowBorder_pos = PhiLowBorder_descriptor->stripPos(PhiLowBorder_id);
76
77 const MuonGM::RpcReadoutElement* PhiHighBorder_descriptor =
78 muonMgr->getRpcReadoutElement(PhiHighBorder_id);
79 PhiHighBorder_pos = PhiHighBorder_descriptor->stripPos(PhiHighBorder_id);
80
81 data.set_etaMin( EtaLowBorder_pos.eta() );
82 data.set_etaMax( EtaHighBorder_pos.eta() );
83 data.set_eta( (data.etaMin()+data.etaMax())/2. );
84
85 data.set_phiMin( PhiLowBorder_pos.phi() );
86 data.set_phiMax( PhiHighBorder_pos.phi() );
87 data.set_phi( (data.phiMin()+data.phiMax())/2. );
88
89 data.update();
90
91 }
92 return StatusCode::SUCCESS;
93 }
bool give_RoI_borders_id(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int RoIId, Identifier &EtaLowBorder_id, Identifier &EtaHighBorder_id, Identifier &PhiLowBorder_id, Identifier &PhiHighBorder_id, const RpcIdHelper *rpcId) const
@ SubSysIDMask
Definition RecMuonRoI.h:40
@ BarrelRoIMask
Definition RecMuonRoI.h:46

◆ RoIsize()

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

Definition at line 94 of file TrigT1RPCRecRoiTool.cxx.

97 {
98 double etaMin_Low=0;
99 double etaMin_High=0;
100 double etaMax_Low=0;
101 double etaMax_High=0;
102
103 TrigT1MuonRecRoiData data;
104 ATH_CHECK( roiData(roiWord,data) );
105 phiMin_LowHigh=data.phiMin();
106 phiMax_LowHigh=data.phiMax();
107
108 bool low = etaDimLow(data,etaMin_Low,etaMax_Low);
109 bool high = etaDimHigh(data,etaMin_High,etaMax_High);
110
111 if (low&&high) {
112 etaMin_LowHigh=std::min(etaMin_Low,etaMin_High);
113 etaMax_LowHigh=std::max(etaMax_Low,etaMax_High);
114 } else if (low) {
115 etaMin_LowHigh =std::min(etaMin_Low,data.etaMin());
116 etaMax_LowHigh =std::max(etaMax_Low,data.etaMax());
117 } else if (high) {
118 etaMin_LowHigh =std::min(etaMin_High,data.etaMin());
119 etaMax_LowHigh =std::max(etaMax_High,data.etaMax());
120 } else {
121 etaMin_LowHigh = data.etaMin();
122 etaMax_LowHigh = data.etaMax();
123 }
124 return StatusCode::SUCCESS;
125 }

Member Data Documentation

◆ m_DetectorManagerKey

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

Definition at line 42 of file TrigT1RPCRecRoiTool.h.

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

◆ m_idHelperSvc

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

Definition at line 41 of file TrigT1RPCRecRoiTool.h.

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

◆ m_rpcKey

SG::ReadCondHandleKey<RpcCablingCondData> LVL1::TrigT1RPCRecRoiTool::m_rpcKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}
private

Definition at line 43 of file TrigT1RPCRecRoiTool.h.

43{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};

◆ m_useConditionData

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

Definition at line 40 of file TrigT1RPCRecRoiTool.h.

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

◆ m_useRun3Config

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

Definition at line 39 of file TrigT1RPCRecRoiTool.h.

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

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