Execute method.
66 {
67
68
71
73 << eventInfo->runNumber() << ","
74 << eventInfo->eventNumber() << ":"
75 << eventInfo->timeStamp() << "]" );
76
77
78
79 if (1 != eventInfo->eventNumber()) {
80 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
81 return StatusCode::SUCCESS;
82 } else {
84 }
85
86
88
89
91
92
93 std::string
folder(
"/TILE/ONL01/FILTER/");
97
98
99 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
100 spec->extend(
"TileCalibBlobOfc",
"blob");
101
102
103 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
104
105 float zeroPhase(0.0);
106 TileOfcWeightsStruct weights;
109
110
115
116 std::vector<float>
phases;
118
119
120 coral::AttributeList ofcList(*spec);
121 coral::Blob&
blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
122
124
127 }
128
129 int nPhases =
phases.size();
131
133 coolChannelCreated[drawerIdx] = true;
135
137
140
141 for (float phase : phases) {
143 for (int isam = 0; isam < ndig; isam++) {
147 if (objVersion == 3) {
150 }
151 }
152
153
155
156 msg(MSG::DEBUG) <<
" N Samples " << ndig
158 << " drawerIdx " << drawerIdx
161
162 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_a, phase " <<
phase <<
" ";
163 for (int isam = 0; isam < ndig; ++isam)
164 msg(MSG::DEBUG) <<
" " << weights.
w_a[isam];
166
167 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_b, phase " <<
phase <<
" ";
168 for (int isam = 0; isam < ndig; isam++)
169 msg(MSG::DEBUG) <<
" " << weights.
w_b[isam];
171
173 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" w_c, phase " <<
phase <<
" ";
174 for (int isam = 0; isam < ndig; isam++)
175 msg(MSG::DEBUG) <<
" " << weights.
w_c[isam];
177 }
178
179 msg(MSG::DEBUG) <<
"gain " <<
gain <<
" g, phase " <<
phase <<
" ";
180 for (int isam = 0; isam < ndig; isam++)
181 msg(MSG::DEBUG) <<
" " << weights.
g[isam];
183
184 }
185
186 }
187 }
188
189
190 }
191
192
193 attrListColl->
add(drawerIdx, ofcList);
194
195
196 attrListColl->
add(drawerIdx, range);
197
199
200 }
201
202
205 if (coolChannelCreated[coolChannel]) continue;
206
207 coral::AttributeList ofcList(*spec);
208
209 attrListColl->
add(coolChannel, ofcList);
210 attrListColl->
add(coolChannel, range);
211 }
212 }
213
214 } else {
215
217
218
219 coral::AttributeList ofcList(*spec);
220 coral::Blob&
blob = ofcList[
"TileCalibBlobOfc"].data<coral::Blob>();
221
222
224
226 phases[channel] = (
float)
channel;
227
231 drawerOfc->setPhases(drawerIdx, 0, phases);
232
234
236
239 << " drawerIdx " << drawerIdx
240 << " channel " << channel
241 << " gain " << gain
242 << " phase " << phase );
243
246 << " ros " << ros
247 << " drawer " << drawer
248 << " channel " << channel
249 << " drawerIdx " << drawerIdx
250 << " gain " << gain
251 << " phase = " << phase );
252
253 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
254 for (int isam = 0; isam < ndig; isam++) {
257 <<
" w_a " << weights.
w_a[isam]
258 <<
" w_b " << weights.
w_b[isam]
259 <<
" w_c " << weights.
w_c[isam]
260 <<
" g " << weights.
g[isam] );
261
262 } else {
264 <<
" w_a " << weights.
w_a[isam]
265 <<
" w_b " << weights.
w_b[isam]
266 <<
" g " << weights.
g[isam] );
267
268 }
269
270 w_a_sum += weights.
w_a[isam];
271 w_b_sum += weights.
w_b[isam];
272 w_c_sum += weights.
w_c[isam];
273
274 drawerOfc->setOfc(0, drawerIdx, gain, channel, isam, weights.
w_a[isam]);
275 drawerOfc->setOfc(1, drawerIdx, gain, channel, isam, weights.
w_b[isam]);
277 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam, weights.
w_c[isam]);
278 drawerOfc->setOfc(3, drawerIdx, gain, channel, isam, weights.
g[isam]);
279 } else {
280 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam, weights.
g[isam]);
281 }
282 }
283
284 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
285
286 }
287 }
288
289
290 attrListColl->
add(drawerIdx, ofcList);
291
292
293 attrListColl->
add(drawerIdx, range);
294
295 }
296 }
298 }
299
300
301 coral::AttributeList attrList(*spec);
302 coral::Blob&
blob = attrList[
"TileCalibBlobOfc"].data<coral::Blob>();
308
310
312
313
315
316
317
318
320
322
323 return StatusCode::SUCCESS;
324}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#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.
Gaudi::Property< unsigned int > m_maxChan
std::set< std::string > m_folders
Gaudi::Property< unsigned int > m_runIOVSince
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Gaudi::Property< int > m_nFixedPhases
ToolHandle< TileCondToolTiming > m_tileToolTiming
Gaudi::Property< bool > m_fixedPhases
Gaudi::Property< unsigned int > m_runIOVUntil
Gaudi::Property< bool > m_creatAllModules
Gaudi::Property< double > m_phaseStep
Gaudi::Property< bool > m_of2
std::vector< unsigned int > m_drawerIdxs
Gaudi::Property< std::string > m_runType
StatusCode printCondObjects()
Gaudi::Property< unsigned int > m_lbnIOVUntil
Gaudi::Property< unsigned int > m_lbnIOVSince
std::string getenv(const std::string &variableName)
get an environment variable