57 {
60
61 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readCdo.
fullKey() <<
" readCdo->size()= " << readCdo->size());
62
64 unsigned int chan_index = 0;
65 unsigned int iFracDeadStrip = 0;
66 for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
67 const coral::AttributeList& atr = itr->second;
69 Identifier chamberId = Identifier(channum);
70
72
73 eff_panel = *(
static_cast<const std::string*
>((atr[
"PanelRes"]).addressOfData()));
74 striplist = *(static_cast<const std::string*>((atr["StripStatus"]).addressOfData()));
75
76 ATH_MSG_DEBUG(
"-----------------------------entry #" << chan_index);
79 ATH_MSG_DEBUG(
"striplist load is " << striplist <<
" " << striplist.size());
80
81
82 constexpr std::string_view
delimiter{
" "};
84
86
88
90 writeCdo.setProjectedTrack(chamberId, ProjectedTracks);
91
93 writeCdo.setEfficiency(chamberId, Efficiency);
94
95
97 writeCdo.setGapEfficiency(chamberId, GapEfficiency);
98
100 writeCdo.setMeanClusterSize(chamberId, MeanClusterSize);
101
102 if (DBversion > 2) {
104 writeCdo.setFracClusterSize1(chamberId, FracClusterSize1);
105
107 writeCdo.setFracClusterSize2(chamberId, FracClusterSize2);
108 } else {
109 if (info_panel.size() > 20) {
111 writeCdo.setFracClusterSize1(chamberId, FracClusterSize1);
112
114 writeCdo.setFracClusterSize2(chamberId, FracClusterSize2);
115 } else {
116 writeCdo.setFracClusterSize1(chamberId, 0.6);
117 writeCdo.setFracClusterSize2(chamberId, 0.2);
118 ATH_MSG_DEBUG(
"Panel with incomplete info in the DB, size = " << info_panel.size() <<
" instead of required >20");
120 ATH_MSG_DEBUG(
"Cluster Size 1 and 2 fractions are set to 0.6 and 0.2 for this chamber.");
121 }
122 }
123
124
125
126 int countdeadstrip = 0;
127 int countdeadstripinfidarea = 0;
128 int countpanelstrip = 0;
129
130
131
132 constexpr std::string_view delimiter_strip{"|"};
133
134
136 if (info_strip.size() > 1) {
137 for (
unsigned int i = 0;
i < info_strip.size(); ++
i) {
138 const std::string &ch_strip2 = info_strip[
i];
139
140 constexpr std::string_view delimiter_strip2{" "};
141
143
146 const auto &strip_status = info_strip2[0];
147
148
149 Identifier strip_id;
151 stripnum = channum +
i * 4;
152 strip_id = channum +
i * 4;
153
154 ATH_MSG_DEBUG(
"strip " << strip_id <<
" has time " << Time <<
" and " << SigmaTime);
155
156 writeCdo.setStripTime(strip_id, std::vector<double>{Time, SigmaTime});
157
158 ATH_MSG_VERBOSE(
"strip #" << i + 1 <<
" strip_id " << stripnum <<
" expanded "
160
161 ++countpanelstrip;
162
163 if (strip_status[0] == '0') {
164 ++countdeadstrip;
165 if (i > 1 && i < info_strip.size() - 2) {
166
167 ++countdeadstripinfidarea;
168 }
169 }
170 }
171 } else {
173
174 for (
unsigned int i = 0;
i < striplist.size();
i++) {
175 char part_strip = striplist[
i];
176
177 char ch_panel = part_strip;
178
179
181 Identifier strip_id{channum +
i * 4};
182
183 ATH_MSG_VERBOSE(
"strip #" << i + 1 <<
" info_strip " << part_strip <<
" strip_id " << stripnum <<
" expanded "
184 <<
m_idHelperSvc->toString(strip_id) <<
" panel = " << ch_panel);
185
186 ++countpanelstrip;
187
188 if (part_strip == '0') {
189 ++countdeadstrip;
190 if (i > 1 && i < striplist.size() - 2) {
191
192 ++countdeadstripinfidarea;
193 }
194 }
195 }
196 }
197
198 if (countpanelstrip != npanelstrip)
200 "WARNING (no side effects for this, just a reminder for a proper fix of the DB content) no matching strip number!!! "
201 << countpanelstrip << " != " << npanelstrip << " Identifier: " << channum);
202
203 float FracDeadStripMap = 0;
204 if (countpanelstrip - 4 > 0) FracDeadStripMap =
float(countdeadstripinfidarea) /
float(countpanelstrip - 4);
205
206
207 writeCdo.setFracDeadStrip(chamberId, FracDeadStripMap);
208 ++iFracDeadStrip;
209
210 std::stringstream
ss;
212 ss <<
"Size of RPC_PanelFracDeadStripMap " << iFracDeadStrip <<
"; in panel ";
213 ss << channum <<
" FracDeadStri(in fid.area) " << FracDeadStripMap <<
" (incl. borders) ";
214 if (countpanelstrip == 0)
215 ss <<
"DIVISION BY ZERO IMPOSSIBLE";
216 else
218 ss <<
" nDeadStrips,InFidArea/nStrips " << countdeadstrip <<
",";
219 ss << countdeadstripinfidarea <<
"/" << countpanelstrip;
221 }
222
223 ATH_MSG_DEBUG(
"Efficiency is " << Efficiency <<
" and fraction is " << FracDeadStripMap <<
" and thus "
224 << Efficiency - (0.99 - FracDeadStripMap));
225
226 if (
msgLvl(MSG::DEBUG) && Efficiency - (0.99 - FracDeadStripMap) > 0. &&
227 (Efficiency < 0.995 || FracDeadStripMap > 0.01) && (Efficiency > 0.005 || FracDeadStripMap < 0.99)) {
228 std::stringstream
msg;
229 msg <<
"WARNING: Inconsistent panel eff.=" << Efficiency <<
" and 0.99-dead_frac=" << 0.99 - FracDeadStripMap
230 << " nDeadStrips,InFidArea/nStrips " << countdeadstrip << "," << countdeadstripinfidarea << "/" << countpanelstrip
232 if (Efficiency - (0.99 - FracDeadStripMap) > 0.2)
233 msg <<
" difference >0.2";
234 else if (Efficiency - (0.99 - FracDeadStripMap) > 0.1)
235 msg <<
" difference >0.1";
236 else if (Efficiency - (0.99 - FracDeadStripMap) > 0.05)
237 msg <<
" difference >0.05";
238 else if (Efficiency - (0.99 - FracDeadStripMap) > 0.025)
239 msg <<
" difference >0.025";
240 else if (Efficiency - (0.99 - FracDeadStripMap) > 0.01)
241 msg <<
" difference >0.01";
242 else
243 msg <<
" difference >0 but <=0.01";
245 }
246
247 }
248 return StatusCode::SUCCESS;
249}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
bool msgLvl(const MSG::Level lvl) const
ChanAttrListMap::const_iterator const_iterator
const DataObjID & fullKey() const
std::string eff_panel[4][6]
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
double atof(std::string_view str)
Converts a string into a double / float.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...