87 << eventInfo->runNumber() <<
","
88 << eventInfo->eventNumber() <<
":"
89 << eventInfo->timeStamp() <<
"]" );
93 if (1 != eventInfo->eventNumber()) {
94 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
95 return StatusCode::SUCCESS;
101 unsigned int objVersion = 3;
107 std::string folder(
"/TILE/ONL01/FILTER/");
113 coral::AttributeListSpecification* spec =
new coral::AttributeListSpecification();
114 spec->extend(
"TileCalibBlobOfc",
"blob");
119 float zeroPhase(0.0);
130 std::vector<float> phases;
134 coral::AttributeList ofcList(*spec);
135 coral::Blob& blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
143 int nPhases = phases.size();
147 coolChannelCreated[drawerIdx] =
true;
150 drawerOfc->setPhases(0, 0, phases);
152 for (
unsigned int channel = 0; channel <
m_maxChan; ++channel) {
155 for (
float phase : phases) {
157 for (
int isam = 0; isam < ndig; isam++) {
161 if (objVersion == 3) {
170 msg(MSG::DEBUG) <<
" N Samples " << ndig
171 <<
" channel " << channel
172 <<
" drawerIdx " << drawerIdx
174 <<
" phase = " << phase <<
endmsg;
176 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_a, phase " << phase <<
" ";
177 for (
int isam = 0; isam < ndig; ++isam)
181 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_b, phase " << phase <<
" ";
182 for (
int isam = 0; isam < ndig; isam++)
187 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_c, phase " << phase <<
" ";
188 for (
int isam = 0; isam < ndig; isam++)
193 msg(MSG::DEBUG) <<
"gain " << gain <<
" g, phase " << phase <<
" ";
194 for (
int isam = 0; isam < ndig; isam++)
207 attrListColl->
add(drawerIdx, ofcList);
210 attrListColl->
add(drawerIdx, range);
219 if (coolChannelCreated[coolChannel])
continue;
221 coral::AttributeList ofcList(*spec);
223 attrListColl->
add(coolChannel, ofcList);
224 attrListColl->
add(coolChannel, range);
233 coral::AttributeList ofcList(*spec);
234 coral::Blob& blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
240 phases[channel] = (
float) channel;
245 drawerOfc->setPhases(drawerIdx, 0, phases);
253 <<
" drawerIdx " << drawerIdx
254 <<
" channel " << channel
256 <<
" phase " << phase );
261 <<
" drawer " << drawer
262 <<
" channel " << channel
263 <<
" drawerIdx " << drawerIdx
265 <<
" phase = " << phase );
267 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
268 for (
int isam = 0; isam < ndig; isam++) {
271 <<
" w_a " <<
weights.w_a[isam]
272 <<
" w_b " <<
weights.w_b[isam]
273 <<
" w_c " <<
weights.w_c[isam]
278 <<
" w_a " <<
weights.w_a[isam]
279 <<
" w_b " <<
weights.w_b[isam]
288 drawerOfc->setOfc(0, drawerIdx, gain, channel, isam,
weights.w_a[isam]);
289 drawerOfc->setOfc(1, drawerIdx, gain, channel, isam,
weights.w_b[isam]);
291 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam,
weights.w_c[isam]);
292 drawerOfc->setOfc(3, drawerIdx, gain, channel, isam,
weights.g[isam]);
294 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam,
weights.g[isam]);
298 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
304 attrListColl->
add(drawerIdx, ofcList);
307 attrListColl->
add(drawerIdx, range);
315 coral::AttributeList attrList(*spec);
316 coral::Blob& blob = attrList[
"TileCalibBlobOfc"].data<coral::Blob>();
317 const char* user = getenv(
"USER");
337 return StatusCode::SUCCESS;
392 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
398 std::string blobName(
"TileCalibBlob");
399 if (iFolder->find(
"/TILE/ONL01/FILTER") != std::string::npos) {
409 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
410 return StatusCode::FAILURE;
414 std::string generalComment(
"");
416 if (iComment != attrListColl->
end()) {
417 const coral::Blob& blob = (iComment->second)[blobName].data<coral::Blob>();
419 generalComment = cmt->getFullComment();
426 for (; iColl != last; ++iColl) {
429 if (iColl == iComment)
continue;
432 const coral::Blob& blob = (iColl->second)[blobName].data<coral::Blob>();
439 std::ostringstream attrStr1;
440 (*iColl).second.toOutputStream(attrStr1);
441 ATH_MSG_DEBUG(
"ChanNum " << (*iColl).first <<
" Attribute list " << attrStr1.str() );
446 if (iovIt != attrListColl->
iov_end()) {
447 const IOVRange& range = (*iovIt).second;
448 if (range.start().isTimestamp()) {
450 <<
" since " << range.start().timestamp()
451 <<
" till " << range.stop().timestamp() );
455 <<
" since " << range.start().run() <<
" " << range.start().event()
456 <<
" till " << range.stop().run() <<
" " << range.stop().event() );
463 std::string comment = cmt->getFullComment();
464 if (comment.empty()) {
465 comment = generalComment;
473 return StatusCode::SUCCESS;
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, std::string_view author="", std::string_view comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.