30 ISvcLocator* pSvcLocator ) :
31 base_class( name, pSvcLocator ),
41 declareProperty(
"DetectorStore",
m_detStore );
55 StatusCode
sc(StatusCode::SUCCESS);
59 if (
sc.isFailure() ) {
66 if (
sc.isFailure() ) {
67 ATH_MSG_ERROR(
"Unable to retrieve pointer to TRT ID Helper." );
73 if (
sc.isFailure() ) {
88 std::string chanName =
"";
100 if ( theMap ==
nullptr ) {
101 ATH_MSG_WARNING(
"Couldn't retrieve DCS HV names. Is TRTHWMapCondAlg added to condSeq?");
106 if ( abs(barrel_ec) == 1 ) {
116 }
else if ( barrel_ec == 2 ) {
120 int hashedCell =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
127 }
else if ( barrel_ec == -2 ) {
131 int hashedCell =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
163 if ( theMap ==
nullptr ) {
164 ATH_MSG_WARNING(
"Couldn't retrieve DCS HV numbers. Is TRTHWMapCondAlg added to condSeq?");
169 if ( abs(barrel_ec) == 1 ) {
180 }
else if ( barrel_ec == 2 ) {
184 int hashedPad =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
192 }
else if ( barrel_ec == -2 ) {
196 int hashedPad =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
238 int nPadsPerSector = 42+65+100;
242 case 0: padOffset = 0;
break;
243 case 1: padOffset = 42;
break;
244 case 2: padOffset = 42+65;
break;
246 msg(MSG::ERROR) <<
"Couldn't hash this pad: "
247 << sector <<
"," << module <<
"," << padNum <<
endmsg;
252 hashedPad += sector*nPadsPerSector;
253 hashedPad += padNum + padOffset;
278 if ( straw >= 0 && straw < 8 ) cellNum = 0;
279 else if ( straw >= 8 && straw < 16 ) cellNum = 1;
280 else if ( straw >=16 && straw < 24 ) cellNum = 2;
282 msg(MSG::WARNING) <<
"Straw number out of range for Endcap!" <<
endmsg;
294 int fourPlaneWheelNum = -1;
310 if ( straw_layer >= 0 && straw_layer < 4 ) fourPlaneWheelNum = 0;
311 else if ( straw_layer >= 4 && straw_layer < 8 ) fourPlaneWheelNum = 1;
312 else if ( straw_layer >= 8 && straw_layer < 12 ) fourPlaneWheelNum = 2;
313 else if ( straw_layer >= 12 && straw_layer < 16 ) fourPlaneWheelNum = 3;
315 msg(MSG::WARNING) <<
"Straw layer number out of range for Endcap!" <<
endmsg;
316 fourPlaneWheelNum = -1;
319 return fourPlaneWheelNum;
344 if ( straw == 0 or straw == 1 ) fuseNum = 0;
345 if ( straw == 2 or straw == 3 ) fuseNum = 1;
346 if ( straw == 4 or straw == 5 ) fuseNum = 2;
347 if ( straw == 6 or straw == 7 ) fuseNum = 3;
372 if ( wheel >= 0 && wheel < 6 ) wheelType = 0;
373 if ( wheel >= 6 && wheel < 14 ) wheelType = 1;
374 if ( wheelType == -1 ) {
375 msg(MSG::ERROR) <<
"Invalid wheel number." <<
endmsg;
379 int nCellsPerSector = (6*4+8*2)*3;
380 int fourPlaneWheelNum;
381 if ( wheelType == 0 ) {
382 fourPlaneWheelNum = layer + 4*wheel;
384 fourPlaneWheelNum = layer + 24 + 2*(wheel-6);
387 hashedCell = cellNum + 3*fourPlaneWheelNum + sector*nCellsPerSector;
398 return StatusCode::SUCCESS;
409 if ( theMap ==
nullptr ) {
410 ATH_MSG_WARNING(
"Couldn't retrieve DCS HV. Is TRTHWMapCondAlg added to condSeq?");
429 ATH_MSG_INFO(
"Dumping TRT Barrel HV-line/pad channel values...");
430 for (
int mapItr = 0; mapItr < (int)theMap->
get_Barrel_HV_Nums()->size(); ++mapItr ) {
434 ATH_MSG_INFO(
"Dumping TRT EndcapA HV-line/pad channel values...");
439 ATH_MSG_INFO(
"Dumping TRT EndcapA HV-line/pad channel values...");
449 if (
sc.isFailure() ) {
450 ATH_MSG_ERROR(
"Couldn't get TRT Detector Manager. Can't ouput text file for monitoring.");
453 std::map< std::string, std::vector<Identifier> > chanNameStrawMap;
461 std::map< std::string, std::vector<Identifier> >
::iterator mapItr;
462 mapItr = chanNameStrawMap.find(HVchanName);
463 if ( mapItr == chanNameStrawMap.end() ) {
465 std::vector<Identifier>
vec;
466 vec.push_back(strawID);
467 chanNameStrawMap.insert( std::make_pair(HVchanName,
vec) );
470 (*mapItr).second.push_back(strawID);
474 std::fstream outFile(
"TRT_HVmap.txt", std::ios::out );
475 std::map< std::string, std::vector<Identifier> >
::iterator mapItr;
476 for ( mapItr = chanNameStrawMap.begin(); mapItr != chanNameStrawMap.end(); ++mapItr ) {
477 std::vector<Identifier>::const_iterator idItr;
479 for ( idItr = (*mapItr).second.begin(); idItr != (*mapItr).second.end(); ++idItr ) {
485 ATH_MSG_INFO( det <<
" " <<
phi <<
" " << lay <<
" " << sLay <<
" " << strawInLay );
489 if ( abs(det) == 1 ) outFile << det <<
" " << (*mapItr).first <<
" " << detElem->
strawCenter(strawInLay)[0] <<
" " << detElem->
strawCenter(strawInLay)[1] <<
"\n";
490 if ( abs(det) == 2 ) outFile << det <<
" " << (*mapItr).first <<
" " << detElem->
strawCenter(strawInLay).phi() <<
" " << detElem->
strawCenter(strawInLay)[2] <<
"\n";
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
Abstract interface to information on straws electronic grouping.
This is an Identifier helper class for the TRT subdetector.
Virtual base class of TRT readout elements.
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
const std::vector< std::string > * get_EndcapA_HV_Names() const
const std::vector< int > * get_Barrel_HV_Nums() const
const std::vector< std::string > * get_EndcapC_HV_Names() const
const std::vector< std::string > * get_Barrel_HV_Names() const
const std::vector< int > * get_EndcapA_HV_Nums() const
const std::vector< int > * get_EndcapC_HV_Nums() const
std::string get_HV_CoolChanName(const Identifier)
Returns the HV line logical name in COOL channel format (":","/" -> "_")
int get_HV_CoolChanNum(const Identifier)
Returns the COOL channel number for an identifier.
int hashThisEndcapCell(int, int, int, int)
Hashes an Endcap HV cell by sector/wheel/layer/cell#.
int get_HV_EndcapFuseNum(const Identifier)
Returns the fuse number (0-3) for an endcap identifier.
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
virtual ~TRT_HWMappingSvc()
Destructor //.
int get_HV_BarrelPadNum(const Identifier)
Returns the HV pad for a barrel identifier.
virtual StatusCode initialize()
Initialize //.
const TRT_ID * m_TRT_ID_Helper
Straw Helpers.
std::string m_EndcapA_HV_COOLFolderName
int get_HV_Endcap4PlaneNum(const Identifier)
Returns the 4-plane wheel number for an endcap identifier.
ServiceHandle< StoreGateSvc > m_detStore
SG::ReadCondHandleKey< TRTCond::HWMap > m_HWMapReadKey
TRT_HWMappingSvc(const std::string &, ISvcLocator *)
Constructor //.
virtual StatusCode finalize()
Finalize //.
std::string m_Barrel_HV_COOLFolderName
jobOptions properties
void DumpMaps()
Dump HV-line/pad maps.
int hashThisBarrelPad(int, int, int)
Hashes a Barrel HV pad by sector/module/pad#.
std::string m_EndcapC_HV_COOLFolderName
int get_HV_EndcapCellNum(const Identifier)
Returns the HV cell for an endcap identifier.
MultiRange::const_identifier_factory const_expanded_id_iterator