208{
210
211 static std::atomic<bool>
first =
true;
212 if (!first) {
214 return StatusCode::SUCCESS;
215 }
217
219 typedef CONTAINER::chan_const_iterator chan_const_iterator;
220 typedef CONTAINER::iov_const_iterator iov_const_iterator;
221
224
225 const LArRampMC* ramps = 0;
226
227
229 const ILArRamp* iramps = 0;
230 ATH_CHECK(
detStore()->retrieve(iramps,
"/LArCalorimeter/LArTests/LArRampsSingleGroup") );
231 ATH_MSG_INFO (
"Retrieved ramps for LArRampsSingleGroup " );
232 ramps = dynamic_cast<const LArRampMC*>(iramps);
233 if (!ramps) {
234 ATH_MSG_ERROR (
"Could not dynamic cast ILArRamp to LArRampMC" );
235 return( StatusCode::FAILURE);
236 }
237 }
238 else {
239 LArRampMC* ramps_rw = new LArRampMC;
240 ramps = ramps_rw;
241 ATH_MSG_INFO (
"Created ramps for LArRampsSingleGroup " );
244 }
245
248
250
251 ATH_CHECK(
detStore()->record(ramps,
"/LArCalorimeter/LArTests/LArRampsSingleGroup") );
252 const ILArRamp* iramps = 0;
254
256 if (ramps) {
259 }
261
262 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
263 if (!ramps_rw) {
265 return StatusCode::FAILURE;
266 }
269 }
274 }
275
276
278 const ILArRamp* iramps = 0;
279 ATH_CHECK(
detStore()->retrieve(iramps,
"/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
280 ATH_MSG_INFO (
"Retrieved ramps for LArRampsSubDetectorGrouping " );
281 ramps = dynamic_cast<const LArRampMC*>(iramps);
282 if (!ramps) {
283 ATH_MSG_ERROR (
"Could not dynamic cast ILArRamp to LArRampMC" );
284 return( StatusCode::FAILURE);
285 }
286 }
287 else {
288 LArRampMC* ramps_rw = new LArRampMC;
289 ramps = ramps_rw;
290
292 }
293
296
298
299 ATH_CHECK(
detStore()->record(ramps,
"/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
300 const ILArRamp* iramps = 0;
303 if (ramps) {
306 }
308
309 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
310 if (!ramps_rw) {
312 return StatusCode::FAILURE;
313 }
316 }
321 }
322
323
325 const ILArRamp* iramps = 0;
326 ATH_CHECK(
detStore()->retrieve(iramps,
"/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
327 ATH_MSG_INFO (
"Retrieved ramps for LArRampsFeedThroughGrouping " );
328 ramps = dynamic_cast<const LArRampMC*>(iramps);
329 if (!ramps) {
330 ATH_MSG_ERROR (
"Could not dynamic cast ILArRamp to LArRampMC" );
331 return( StatusCode::FAILURE);
332 }
333 }
334 else {
335 LArRampMC* ramps_rw = new LArRampMC;
336 ramps = ramps_rw;
339 }
340
343
345
346 ATH_CHECK(
detStore()->record(ramps,
"/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
347 const ILArRamp* iramps = 0;
350 if (ramps) {
353 }
355
356 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
357 if (!ramps_rw) {
359 return StatusCode::FAILURE;
360 }
363 }
368 }
369
370 ATH_MSG_DEBUG (
"Statistics for LArRampsFeedThroughGrouping " );
373
374 iov_const_iterator iovIt = ramps->
iov_begin();
375 iov_const_iterator iovEnd = ramps->
iov_end ();
376 msg() << MSG::DEBUG <<
"IOVs found: ";
377 for (; iovIt != iovEnd; ++iovIt) {
378 msg() << MSG::DEBUG << (*iovIt) <<
", ";
379 }
381
382 chan_const_iterator chIt = ramps->
chan_begin();
383 chan_const_iterator chEnd = ramps->
chan_end ();
384 for (; chIt != chEnd; ++chIt) {
387 }
388
389 for (
unsigned int i = 0;
i < ramps->
nGroups(); ++
i) {
392 }
394
395 for (
unsigned int i = 0;
i < ramps->
nGains(); ++
i) {
398 }
403
404
406
407 return StatusCode::SUCCESS;
408}
void setGroupingType(GroupingType type)
allow group type to be set externally - need to (re)initialize after setting grouping type
void removeConditions()
Remove conditions leaving the corrections - may be needed to only write out the corrections when both...
iov_const_iterator iov_begin() const
Access to IOVs via iterators - from MultChanCollection.
unsigned int nGroups() const
Number of groups - minimum is 2 (1 correction group, 1 FEB ID group)
chan_const_iterator chan_begin() const
Access to Channel numbers via iterators - from MultChanCollection.
iov_const_iterator iov_end() const
unsigned int conditionsPerGain(unsigned int gain) const
Statistics: number of conditions per gain.
unsigned int conditionsPerChannel(unsigned int coolChannel) const
Statistics: number of conditions per COOL channel.
chan_size_type chan_size() const
number of channels - from MultChanCollection
unsigned int conditionsPerGroup(unsigned int group) const
Statistics: number of conditions per group.
iov_size_type iov_size() const
number of IOVs - from MultChanCollection
unsigned int totalNumberOfCorrections() const
Statistics: total number of corrections.
unsigned int totalNumberOfConditions() const
Statistics: total number of conditions.
chan_const_iterator chan_end() const
unsigned int nGains() const
Number of gain values.
StatusCode testChannelSet()
StatusCode createCompareObjects()
LArRampComplete::CONTAINER CONTAINER
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.