7 #include "GaudiKernel/SystemOfUnits.h"
26 const std::map<std::string, std::string>& asciiFileDBMap):
28 m_geoTag(geoTag), m_geoNode(geoNode), m_pRDBAccess(pRDBAccess) {
29 m_SCdbaccess = StatusCode::FAILURE;
32 ATH_MSG_INFO(
"Start retriving dbObjects with tag = <" << geoTag <<
"> node <" << geoNode <<
">");
35 m_dhatyp = std::make_unique<DblQ00Atyp>(m_pRDBAccess, geoTag, geoNode);
36 m_atyp = m_dhatyp->data();
39 m_dhasmp = std::make_unique<DblQ00Asmp>(m_pRDBAccess, geoTag, geoNode);
40 m_asmp = m_dhasmp->data();
43 m_dhalmn = std::make_unique<DblQ00Almn>(m_pRDBAccess, geoTag, geoNode);
44 m_almn = m_dhalmn->data();
47 m_dhaptp = std::make_unique<DblQ00Aptp>(m_pRDBAccess, geoTag, geoNode);
48 m_aptp = m_dhaptp->data();
51 m_dhacut = std::make_unique<DblQ00Acut>(m_pRDBAccess, geoTag, geoNode);
52 m_acut = m_dhacut->data();
54 m_dhalin = std::make_unique<DblQ00Alin>(m_pRDBAccess, geoTag, geoNode);
55 m_alin = m_dhalin->data();
57 m_dhdbam = std::make_unique<DblQ00Dbam>(m_pRDBAccess, geoTag, geoNode);
58 m_dbam = m_dhdbam->data();
61 m_dhwrpc = std::make_unique<DblQ00Awln>(m_pRDBAccess, geoTag, geoNode);
62 m_wrpc = m_dhwrpc->data();
64 m_dhwtgc = std::make_unique<DblQ00Atln>(m_pRDBAccess, geoTag, geoNode);
65 m_wtgc = m_dhwtgc->data();
67 m_dhwmdt = std::make_unique<DblQ00Wmdt>(m_pRDBAccess, geoTag, geoNode);
68 m_wmdt = m_dhwmdt->data();
70 m_dhwcsc = std::make_unique<DblQ00Wcsc>(m_pRDBAccess, geoTag, geoNode);
71 m_wcsc = m_dhwcsc->data();
74 m_dhwrpcall = std::make_unique<DblQ00Wrpc>(m_pRDBAccess, geoTag, geoNode);
75 m_wrpcall = m_dhwrpcall->data();
77 m_dhwtgcall = std::make_unique<DblQ00Wtgc>(m_pRDBAccess, geoTag, geoNode);
78 m_wtgcall = m_dhwtgcall->data();
80 m_dhwspa = std::make_unique<DblQ00Wspa>(m_pRDBAccess, geoTag, geoNode);
81 m_wspa = m_dhwspa->data();
84 m_dhwded = std::make_unique<DblQ00Wded>(m_pRDBAccess, geoTag, geoNode);
85 m_wded = m_dhwded->data();
88 m_dhwsup = std::make_unique<DblQ00Wsup>(m_pRDBAccess, geoTag, geoNode);
89 m_wsup = m_dhwsup->data();
91 if (m_pRDBAccess->getRecordsetPtr(
"XtomoData", geoTag, geoNode)->size()!=0) {
92 m_dhxtomo= std::make_unique<DblQ00Xtomo>(pRDBAccess, geoTag, geoNode);
95 m_dhxtomo= std::make_unique<DblQ00Xtomo>();
100 m_xtomo = m_dhxtomo->data();
103 if (asciiFileDBMap.find(
"ASZT") != asciiFileDBMap.end()) {
104 ATH_MSG_INFO(
"getting aszt from ascii file - named <" << asciiFileDBMap.find(
"ASZT")->second <<
">");
105 ATH_MSG_INFO(
"Ascii aszt input has priority over A-lines in ORACLE; A-lines from Oracle will not be read");
107 m_dhaszt = std::make_unique<DblQ00Aszt>(asciiFileDBMap.find(
"ASZT")->second);
108 if (m_dhaszt->size() == 0) {
111 ATH_MSG_INFO(
"N. of lines read = " << m_dhaszt->size());
115 if (!m_dhaszt || m_dhaszt->size() == 0) {
116 ATH_MSG_INFO(
"No Ascii aszt input found: looking for A-lines in ORACLE");
117 if (m_pRDBAccess->getRecordsetPtr(
"ASZT",geoTag,geoNode)->size()==0) {
118 m_dhaszt = std::make_unique<DblQ00Aszt>();
122 m_dhaszt = std::make_unique<DblQ00Aszt>(m_pRDBAccess, geoTag, geoNode);
126 ATH_MSG_INFO(
"ASZT table in Oracle, if any, will not be read" );
129 m_aszt = m_dhaszt->data();
132 if (asciiFileDBMap.find(
"IACSC") != asciiFileDBMap.end()) {
134 ATH_MSG_INFO(
"getting iacsc from ascii file - named <" << asciiFileDBMap.find(
"IACSC")->second <<
">" );
135 ATH_MSG_INFO(
"Ascii iacsc input has priority over A-lines in ORACLE; A-lines from Oracle will not be read" );
137 m_dhiacsc = std::make_unique<DblQ00IAcsc>(asciiFileDBMap.find(
"IACSC")->second);
138 if (m_dhiacsc->size() == 0) {
141 ATH_MSG_INFO(
"N. of lines read = " << m_dhiacsc->size() );
144 if (!m_dhiacsc || m_dhiacsc->size() == 0) {
145 ATH_MSG_INFO(
"No Ascii iacsc input found: looking for A-lines in ORACLE" );
146 if (m_pRDBAccess->getRecordsetPtr(
"IZST", geoTag,geoNode)->size()==0) {
147 m_dhiacsc = std::make_unique<DblQ00IAcsc>();
151 m_dhiacsc = std::make_unique<DblQ00IAcsc>(m_pRDBAccess, geoTag, geoNode);
154 ATH_MSG_INFO(
"ISZT table in Oracle, if any, will not be read" );
157 m_iacsc = m_dhiacsc->data();
160 m_dhwchv = std::make_unique<DblQ00Wchv>(m_pRDBAccess, geoTag, geoNode);
161 m_wchv = m_dhwchv->data();
163 m_dhwcro = std::make_unique<DblQ00Wcro>(m_pRDBAccess, geoTag, geoNode);
164 m_wcro = m_dhwcro->data();
166 m_dhwcmi = std::make_unique<DblQ00Wcmi>(m_pRDBAccess, geoTag, geoNode);
167 m_wcmi = m_dhwcmi->data();
170 m_dhwlbi = std::make_unique<DblQ00Wlbi>(m_pRDBAccess, geoTag, geoNode);
171 m_wlbi = m_dhwlbi->data();
174 m_SCdbaccess = StatusCode::SUCCESS;
175 ATH_MSG_INFO(
"Access granted for all dbObjects needed by muon detectors" );
216 ATH_MSG_INFO(
"Intermediate Objects built from primary numbers" );
223 std::vector<std::string> slist;
224 slist.emplace_back(
"*");
232 Station *station = (*it).second;
237 const std::string &cname =
c->name;
239 if (cname.compare(0, 3,
"CSC") == 0)
241 else if (cname.compare(0, 3,
"MDT") == 0)
243 else if (cname.compare(0, 3,
"RPC") == 0)
245 else if (cname.compare(0, 3,
"TGC") == 0)
247 else if (cname.compare(0, 3,
"SPA") == 0)
249 else if (cname.compare(0, 3,
"DED") == 0)
251 else if (cname.compare(0, 3,
"SUP") == 0)
253 else if (cname.compare(0, 3,
"CHV") == 0 && have_spa_details)
255 else if (cname.compare(0, 3,
"CRO") == 0 && have_spa_details)
257 else if (cname.compare(0, 3,
"CMI") == 0 && have_spa_details)
259 else if (cname.compare(0, 2,
"LB") == 0 && have_spa_details)
264 ATH_MSG_INFO(
"nMDT " << nmdt <<
" nCSC " << ncsc <<
" nTGC " << ntgc <<
" nRPC " << nrpc );
265 ATH_MSG_INFO(
"nDED " << nded <<
" nSUP " << nsup <<
" nSPA " << nspa );
266 ATH_MSG_INFO(
"nCHV " << nchv <<
" nCRO " << ncro <<
" nCMI " << ncmi <<
" nLBI " << nlbi );
274 ATH_MSG_INFO(
"RDBReaderAtlas::ProcessTGCreadout GGSD, GGCD retrieven from Oracle" );
276 int version = (
int)(*ggsd)[0]->getDouble(
"VERS");
278 ATH_MSG_INFO(
" ProcessTGCreadout - version " <<
version <<
" wirespacing " << wirespacing );
285 for (
unsigned int ich = 0; ich < ggcd->size(); ++ich) {
286 int type = (
int)(*ggcd)[ich]->getDouble(
"ICHTYP");
291 int nchrng = (
int)(*ggcd)[ich]->getDouble(
"NCHRNG");
296 for (
int i = 0;
i < 3; ++
i) {
297 nwgs[
i] = (*ggcd)[ich]->getDouble(
"NWGS",
i);
298 nsps[
i] = (*ggcd)[ich]->getDouble(
"NSPS",
i);
301 for (
int i = 0;
i < nwgs[0]; ++
i) {
302 iwgs1[
i] = (*ggcd)[ich]->getDouble(
"IWGS1",
i);
304 for (
int i = 0;
i < nwgs[1]; ++
i) {
305 iwgs2[
i] = (*ggcd)[ich]->getDouble(
"IWGS2" ,
i);
308 for (
int i = 0;
i < nwgs[2]; ++
i) {
309 iwgs3[
i] = (*ggcd)[ich]->getDouble(
"IWGS3",
i);
312 std::make_unique<TgcReadoutParams>(
name,
type,
version, wirespacing, nchrng,
313 std::move(nwgs), std::move(iwgs1),
314 std::move(iwgs2), std::move(iwgs3),
326 float wirespacing(0);
327 unsigned int gglnSize(0);
329 gglnSize = ggln->size();
331 ATH_MSG_WARNING(
" ProcessTGCreadout - IRDBRecordset_ptr GGLN is nullptr" );
338 ATH_MSG_INFO(
" ProcessTGCreadout - version " <<
version <<
" wirespacing " << wirespacing );
341 for (
unsigned int ich = 0; ich < gglnSize; ++ich) {
342 int type = (
int)(*ggln)[ich]->getInt(
"JSTA");
356 for (
int i = 0;
i < 3;
i++) {
357 nwgs[
i] = (*ggln)[ich]->getInt(
"NWGS",
i );
358 nsps[
i] = (*ggln)[ich]->getInt(
"NSPS",
i);
361 for (
int i = 0;
i < nwgs[0];
i++) {
362 iwgs1[
i] = (*ggln)[ich]->getInt(
"IWGS1",
i);
365 for (
int i = 0;
i < nwgs[1];
i++) {
366 iwgs2[
i] = (*ggln)[ich]->getInt(
"IWGS2",
i);
368 for (
int i = 0;
i < nwgs[2];
i++) {
369 iwgs3[
i] = (*ggln)[ich]->getInt(
"IWGS3",
i);
373 float pdist = (*ggln)[ich]->getFloat(
"PDIST");
375 for (
int i = 0;
i < nsps[0] + 1;
i++) {
376 slarge[
i] = (*ggln)[ich]->getFloat(
"SLARGE",
i);
377 sshort[
i] = (*ggln)[ich]->getFloat(
"SHORT",
i);
380 std::make_unique<TgcReadoutParams>(
name,
type,
version, wirespacing, nchrng,
381 std::move(nwgs), std::move(iwgs1), std::move(iwgs2), std::move(iwgs3),
383 std::move(slarge), std::move(sshort),
389 std::ostringstream Astr;
391 Astr <<
"0" << ich + 1;
395 std::string
A = Astr.str();
405 tgc->
pitchButton[0] = (*ggln)[ich]->getFloat(
"SP2BU");
406 tgc->
pitchButton[1] = (*ggln)[ich]->getFloat(
"SP3BU");
446 if (ichtyp < 1 || ichtyp > 19) {
447 ATH_MSG_ERROR(
" DBReader::TGCreadoutName - ichtype " << ichtyp <<
" out of range 1-19" );
487 if (ichtyp < 1 || ichtyp > 21) {
488 ATH_MSG_ERROR(
" DBReader::TGCreadoutName - ichtype " << ichtyp <<
" out of range 1-21" );