81 const EventContext &ctx = Gaudi::Hive::currentContext();
88 << eventInfo->runNumber() <<
","
89 << eventInfo->eventNumber() <<
":"
90 << eventInfo->timeStamp() <<
"]" );
94 if (1 != eventInfo->eventNumber()) {
95 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
96 return StatusCode::SUCCESS;
102 unsigned int objVersion = 3;
108 std::string folder(
"/TILE/ONL01/FILTER/");
114 coral::AttributeListSpecification* spec =
new coral::AttributeListSpecification();
115 spec->extend(
"TileCalibBlobOfc",
"blob");
120 float zeroPhase(0.0);
131 std::vector<float> phases;
135 coral::AttributeList ofcList(*spec);
136 coral::Blob& blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
144 int nPhases = phases.size();
148 coolChannelCreated[drawerIdx] =
true;
151 drawerOfc->setPhases(0, 0, phases);
153 for (
unsigned int channel = 0; channel <
m_maxChan; ++channel) {
156 for (
float phase : phases) {
158 for (
int isam = 0; isam < ndig; isam++) {
162 if (objVersion == 3) {
171 msg(MSG::DEBUG) <<
" N Samples " << ndig
172 <<
" channel " << channel
173 <<
" drawerIdx " << drawerIdx
175 <<
" phase = " << phase <<
endmsg;
177 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_a, phase " << phase <<
" ";
178 for (
int isam = 0; isam < ndig; ++isam)
182 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_b, phase " << phase <<
" ";
183 for (
int isam = 0; isam < ndig; isam++)
188 msg(MSG::DEBUG) <<
"gain " << gain <<
" w_c, phase " << phase <<
" ";
189 for (
int isam = 0; isam < ndig; isam++)
194 msg(MSG::DEBUG) <<
"gain " << gain <<
" g, phase " << phase <<
" ";
195 for (
int isam = 0; isam < ndig; isam++)
208 attrListColl->
add(drawerIdx, ofcList);
211 attrListColl->
add(drawerIdx, range);
220 if (coolChannelCreated[coolChannel])
continue;
222 coral::AttributeList ofcList(*spec);
224 attrListColl->
add(coolChannel, ofcList);
225 attrListColl->
add(coolChannel, range);
234 coral::AttributeList ofcList(*spec);
235 coral::Blob& blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
241 phases[channel] = (
float) channel;
246 drawerOfc->setPhases(drawerIdx, 0, phases);
254 <<
" drawerIdx " << drawerIdx
255 <<
" channel " << channel
257 <<
" phase " << phase );
262 <<
" drawer " << drawer
263 <<
" channel " << channel
264 <<
" drawerIdx " << drawerIdx
266 <<
" phase = " << phase );
268 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
269 for (
int isam = 0; isam < ndig; isam++) {
272 <<
" w_a " <<
weights.w_a[isam]
273 <<
" w_b " <<
weights.w_b[isam]
274 <<
" w_c " <<
weights.w_c[isam]
279 <<
" w_a " <<
weights.w_a[isam]
280 <<
" w_b " <<
weights.w_b[isam]
289 drawerOfc->setOfc(0, drawerIdx, gain, channel, isam,
weights.w_a[isam]);
290 drawerOfc->setOfc(1, drawerIdx, gain, channel, isam,
weights.w_b[isam]);
292 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam,
weights.w_c[isam]);
293 drawerOfc->setOfc(3, drawerIdx, gain, channel, isam,
weights.g[isam]);
295 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam,
weights.g[isam]);
299 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
305 attrListColl->
add(drawerIdx, ofcList);
308 attrListColl->
add(drawerIdx, range);
316 coral::AttributeList attrList(*spec);
317 coral::Blob& blob = attrList[
"TileCalibBlobOfc"].data<coral::Blob>();
318 const char* user = getenv(
"USER");
338 return StatusCode::SUCCESS;
393 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
399 std::string blobName(
"TileCalibBlob");
400 if (iFolder->find(
"/TILE/ONL01/FILTER") != std::string::npos) {
410 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
411 return StatusCode::FAILURE;
415 std::string generalComment(
"");
417 if (iComment != attrListColl->
end()) {
420 generalComment = cmt->getFullComment();
427 for (; iColl != last; ++iColl) {
430 if (iColl == iComment)
continue;
440 std::ostringstream attrStr1;
441 (*iColl).second.toOutputStream(attrStr1);
442 ATH_MSG_DEBUG(
"ChanNum " << (*iColl).first <<
" Attribute list " << attrStr1.str() );
447 if (iovIt != attrListColl->
iov_end()) {
448 const IOVRange& range = (*iovIt).second;
449 if (range.start().isTimestamp()) {
451 <<
" since " << range.start().timestamp()
452 <<
" till " << range.stop().timestamp() );
456 <<
" since " << range.start().run() <<
" " << range.start().event()
457 <<
" till " << range.stop().run() <<
" " << range.stop().event() );
464 std::string comment = cmt->getFullComment();
465 if (comment.empty()) {
466 comment = generalComment;
474 return StatusCode::SUCCESS;
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.