44 if (content.empty()) {
45 return StatusCode::FAILURE;
59 std::ostringstream attrStr1;
60 coral::AttributeList::const_iterator itr = attrList.begin();
61 itr->toOutputStream(attrStr1);
62 std::string::size_type pos = attrStr1.str().find(
':');
63 if (pos == std::string::npos)
67 std::string Line = attrStr1.str().substr(pos);
75 ATH_MSG_WARNING(
" Cannot find /LAR/IdentifierOfl/HVLineToElectrodeMap from database, Use ASCII file indeed !!!");
77 if (tablename.empty()) {
78 ATH_MSG_FATAL(
"[fillHVMap] Could not locate HVLineToElectrode.data file as well");
82 ATH_MSG_DEBUG(
"[fillHVMap] have located HVLineToElectrode.data OK !");
84 const char * tablefile = tablename.c_str() ;
85 std::ifstream myfile(tablefile);
87 std::filebuf* pbuf = myfile.rdbuf();
88 int size = pbuf->pubseekoff (0,std::ios::end,std::ios::in);
89 pbuf->pubseekpos (0,std::ios::in);
92 buffer.resize (size,
' ');
94 pbuf->sgetn (buffer.data(),size);
110 electrodeMap.clear();
112 std::istringstream infile;
113 infile.str (content);
147 << dummy <<
") hvline=["
148 << hvpartition <<
"."
151 << hvline <<
"] electrode=["
162 std::vector<HWIdentifier> electrodeIdvec;
168 if (
min > 1000)
min = 1000;
169 for(
int ielec=
min; ielec<
max+1; ielec++){
171 << detect <<
" side="
176 << hvgap <<
" ielec="
179 electrodeHelper.
ElectrodeId(detect,side,mod,hvphi,hveta,hvgap,ielec);
180 electrodeIdvec.push_back(electrodeId);
183 hvlineMap.emplace (electrodeId, hvlineId);
188 electrodeIdvec.push_back(electrodeId);
191 hvlineMap.emplace (electrodeId, hvlineId);
194 std::vector<HWIdentifier>& l = electrodeMap[hvlineId];
195 l.insert (l.end(), electrodeIdvec.begin(), electrodeIdvec.end());
199 ATH_MSG_DEBUG(
"[fillHV] Mapping electrode-to-hvline : number of Ids= "<<hvlineMap.size());
200 ATH_MSG_DEBUG(
"[fillHV] Mapping hvline-to-electrode : number of Ids= "<<electrodeMap.size());
202 return StatusCode::SUCCESS;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Helper to read HV ID mapping data from a file or conditions.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
An AttributeList represents a logical row of attributes in a metadata table.
Helper for the Liquid Argon Calorimeter cell at the electrode level.
HWIdentifier ElectrodeId(int det, int side, int mod, int phi, int eta, int gap, int elec) const
Create an Electrode identifier from fields.
StatusCode fillHV(const std::string &content, const LArHVLineID &hvlineHelper, const LArElectrodeID &electrodeHelper, hvlineMap_t &hvlineMap, electrodeMap_t &electrodeMap) const
std::string fromFile() const
std::map< HWIdentifier, HWIdentifier > hvlineMap_t
StatusCode read(const AthenaAttributeList *attrList, const LArHVLineID &hvlineHelper, const LArElectrodeID &electrodeHelper, hvlineMap_t &hvlineMap, electrodeMap_t &electrodeMap) const
std::string fromAttrList(const AthenaAttributeList &attrList) const
std::map< HWIdentifier, std::vector< HWIdentifier > > electrodeMap_t
Helper for the Liquid Argon Calorimeter High-Voltage identifiers.
HWIdentifier HVLineId(int part, int canline, int cannode, int line) const
Create an HighVoltage line identifier from fields.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)