30 ISvcLocator* pSvcLocator ) :
31 base_class(
name, pSvcLocator ),
32 m_detStore(
"DetectorStore",
name),
33 m_TRT_ID_Helper(nullptr),
34 m_TRTStrawNeighbourSvc(
"TRT_StrawNeighbourSvc",
name)
41 declareProperty(
"DetectorStore",
m_detStore );
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 ) {
111 if ( hashedPad >= (
int)theMap->get_Barrel_HV_Names()->size() || hashedPad<0) {
114 }
else chanName = theMap->get_Barrel_HV_Names()->at(hashedPad);
116 }
else if ( barrel_ec == 2 ) {
120 int hashedCell =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
122 if ( hashedCell >= (
int)theMap->get_EndcapA_HV_Names()->size() || hashedCell<0 ) {
125 }
else chanName = theMap->get_EndcapA_HV_Names()->at(hashedCell);
127 }
else if ( barrel_ec == -2 ) {
131 int hashedCell =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
133 if ( hashedCell >= (
int)theMap->get_EndcapC_HV_Names()->size() || hashedCell<0) {
136 }
else chanName = theMap->get_EndcapC_HV_Names()->at(hashedCell);
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 ) {
175 if ( hashedPad >= (
int)theMap->get_Barrel_HV_Nums()->size() || hashedPad<0) {
178 }
else chanNum = theMap->get_Barrel_HV_Nums()->at(hashedPad);
180 }
else if ( barrel_ec == 2 ) {
184 int hashedPad =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
186 if ( hashedPad >= (
int)theMap->get_EndcapA_HV_Nums()->size() || hashedPad<0) {
189 }
else chanNum = theMap->get_EndcapA_HV_Nums()->at(hashedPad);
192 }
else if ( barrel_ec == -2 ) {
196 int hashedPad =
hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
198 if ( hashedPad >= (
int)theMap->get_EndcapC_HV_Nums()->size() || hashedPad<0) {
201 }
else chanNum = theMap->get_EndcapC_HV_Nums()->at(hashedPad);
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: "
252 hashedPad += sector*nPadsPerSector;
253 hashedPad += padNum + padOffset;
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;
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?");
415 for (
int mapItr = 0; mapItr < (
int)theMap->get_Barrel_HV_Names()->size(); ++mapItr ) {
416 ATH_MSG_INFO( mapItr <<
" " << theMap->get_Barrel_HV_Names()->at(mapItr));
420 for (
int mapItr = 0; mapItr < (
int)theMap->get_EndcapA_HV_Names()->size(); ++mapItr ) {
421 ATH_MSG_INFO( mapItr <<
" " << theMap->get_EndcapA_HV_Names()->at(mapItr));
425 for (
int mapItr = 0; mapItr < (
int)theMap->get_EndcapC_HV_Names()->size(); ++mapItr ) {
426 ATH_MSG_INFO( mapItr <<
" " << theMap->get_EndcapC_HV_Names()->at(mapItr));
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 ) {
431 ATH_MSG_INFO( mapItr <<
" " << theMap->get_Barrel_HV_Nums()->at(mapItr));
434 ATH_MSG_INFO(
"Dumping TRT EndcapA HV-line/pad channel values...");
435 for (
int mapItr = 0; mapItr < (
int)theMap->get_EndcapA_HV_Nums()->size(); ++mapItr ) {
436 ATH_MSG_INFO( mapItr <<
" " << theMap->get_EndcapA_HV_Nums()->at(mapItr));
439 ATH_MSG_INFO(
"Dumping TRT EndcapA HV-line/pad channel values...");
440 for (
int mapItr = 0; mapItr < (
int)theMap->get_EndcapC_HV_Nums()->size(); ++mapItr ) {
441 ATH_MSG_INFO( mapItr <<
" " << theMap->get_EndcapC_HV_Nums()->at(mapItr));
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);
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 ) {