Execute method.
80 {
81
82
85
87 << eventInfo->runNumber() << ","
88 << eventInfo->eventNumber() << ":"
89 << eventInfo->timeStamp() << "]" );
90
91
92
93 if (1 != eventInfo->eventNumber()) {
94 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
95 return StatusCode::SUCCESS;
96 } else {
98 }
99
100
102
103
105
106
107 std::string
folder(
"/TILE/ONL01/FILTER/");
111
112
113 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
114 spec->extend(
"TileCalibBlobOfc",
"blob");
115
116
117 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
118
119 float zeroPhase(0.0);
123
124
129
130 std::vector<float>
phases;
132
133
134 coral::AttributeList ofcList(*spec);
135 coral::Blob&
blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
136
138
141 }
142
143 int nPhases =
phases.size();
145
147 coolChannelCreated[drawerIdx] = true;
149
151
154
155 for (float phase : phases) {
157 for (int isam = 0; isam < ndig; isam++) {
161 if (objVersion == 3) {
164 }
165 }
166
167
169
170 msg(MSG::DEBUG) <<
" N Samples " << ndig
172 << " drawerIdx " << drawerIdx
175
176 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_a, phase " <<
phase <<
" ";
177 for (int isam = 0; isam < ndig; ++isam)
180
181 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_b, phase " <<
phase <<
" ";
182 for (int isam = 0; isam < ndig; isam++)
185
187 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_c, phase " <<
phase <<
" ";
188 for (int isam = 0; isam < ndig; isam++)
191 }
192
193 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" g, phase " <<
phase <<
" ";
194 for (int isam = 0; isam < ndig; isam++)
197
198 }
199
200 }
201 }
202
203
204 }
205
206
207 attrListColl->
add(drawerIdx, ofcList);
208
209
210 attrListColl->
add(drawerIdx, range);
211
213
214 }
215
216
219 if (coolChannelCreated[coolChannel]) continue;
220
221 coral::AttributeList ofcList(*spec);
222
223 attrListColl->
add(coolChannel, ofcList);
224 attrListColl->
add(coolChannel, range);
225 }
226 }
227
228 } else {
229
231
232
233 coral::AttributeList ofcList(*spec);
234 coral::Blob&
blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
235
236
238
240 phases[channel] = (
float)
channel;
241
245 drawerOfc->setPhases(drawerIdx, 0, phases);
246
248
250
253 << " drawerIdx " << drawerIdx
254 << " channel " << channel
255 << " gain " << gain
256 << " phase " << phase );
257
260 << " ros " << ros
261 << " drawer " << drawer
262 << " channel " << channel
263 << " drawerIdx " << drawerIdx
264 << " gain " << gain
265 << " phase = " << phase );
266
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]
275
276 } else {
278 <<
" w_a " <<
weights.w_a[isam]
279 <<
" w_b " <<
weights.w_b[isam]
281
282 }
283
287
293 } else {
295 }
296 }
297
298 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
299
300 }
301 }
302
303
304 attrListColl->
add(drawerIdx, ofcList);
305
306
307 attrListColl->
add(drawerIdx, range);
308
309 }
310 }
312 }
313
314
315 coral::AttributeList attrList(*spec);
316 coral::Blob&
blob = attrList[
"TileCalibBlobOfc"].data<coral::Blob>();
322
324
326
327
329
330
331
332
334
336
337 return StatusCode::SUCCESS;
338}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
static const TileCalibDrawerCmt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerCmt.
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.
static const unsigned int MAX_DRAWERIDX
Maximal drawer index.
static const unsigned int MAX_ROS
Number of ROSs.
static const unsigned int MAX_GAIN
Number of gains per channel.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
static unsigned int getMaxDrawer(unsigned int ros)
Returns the maximal channel number for a given drawer.
static unsigned int getCommentChannel()
Returns the COOL channel number for the comment channel.
static const unsigned int MAX_CHAN
Number of channels in drawer.
std::set< std::string > m_folders
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
ToolHandle< TileCondToolTiming > m_tileToolTiming
std::vector< unsigned int > m_drawerIdxs
StatusCode printCondObjects()
const std::string weights
std::string getenv(const std::string &variableName)
get an environment variable