9#include "CLHEP/Units/SystemOfUnits.h"
36 sc =
detStore()->retrieve(scid,
"LArOnline_SuperCellID");
38 ATH_MSG_ERROR(
"Could not get LArOnline_SuperCellID helper !" );
57 return StatusCode::SUCCESS;
76 for (
const std::string& key :
m_keylist) {
82 if(vAccum.empty()) vAccum.resize(
m_onlineHelper->channelHashMax());
86 if(DigitContainer->
empty()) {
87 ATH_MSG_DEBUG(
"LArDigitContainer with key=" << key <<
" is empty " );
89 ATH_MSG_DEBUG(
"LArDigitContainer with key=" << key <<
" has size = " << DigitContainer->
size() );
95 auto larAccuDigitContainer = std::make_unique<LArAccumulatedDigitContainer>(
SG::VIEW_ELEMENTS);
97 for (
const LArDigit* digit : *DigitContainer) {
105 bool hasInvalid=
false;
106 for(
auto s : digit->samples()){
112 if(hasInvalid)
continue;
119 ATH_MSG_ERROR(
"Found not-matching gain number ("<< (
int)gain <<
")" );
120 return StatusCode::FAILURE;
133 unsigned int sizeSamples = digit->samples().size();
140 vAccum[hashid]=accuDigit;
148 cellAccumulated.
m_matrix.resize(sizeSamples,0);
153 for(
unsigned int j=0;j<sizeSamples;j++){
154 cellAccumulated.
m_samplesum[j] += digit->samples()[j];
155 for(
unsigned int k=j;k<sizeSamples;k++)
158 cellAccumulated.
m_matrix[l] += digit->samples()[j]*digit->samples()[k];
181 larAccuDigitContainer->push_back(accuDigit);
194 ATH_MSG_INFO(
"Recorded succesfully LArAccumulatedDigitContainer with key " << SGkey );
198 return StatusCode::SUCCESS;
204 if ( !
m_isSC )
return StatusCode::SUCCESS;
207 if(
sc.m_onlineId &&
sc.m_nused != ntrigUsed){
208 ATH_MSG_WARNING(
"Not enough triggers for channel OnlineID " <<
sc.m_onlineId <<
" ntriggers " <<
sc.m_ntrigger );
212 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Data class for ADC samples and autocorr preprocessed by the DSP.
bool setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, const std::vector< uint64_t > &sampleSum, const std::vector< uint64_t > &sampleSquare, const unsigned nTrigger)
Accumulate new values.
Container class for LArDigit.
Liquid Argon digit base class.
Class of intermediate accumulations.
std::vector< uint64_t > m_samplesum
std::vector< uint64_t > m_matrix
std::vector< std::string > m_keylist
list of key for input digit container (=gain)
std::vector< LArAccumulated > m_Accumulated
Vector (index=hash ID) of accumulation quantities.
LArDigitsAccumulator(const std::string &name, ISvcLocator *pSvcLocator)
bool m_isSC
Tells you wether you run on SuperCells or Cells.
std::string m_AccuDigitContainerName
LArAccumulatedDigitContainer name.
unsigned int m_event_counter
Event counter.
unsigned int m_NtriggersPerStep
Number of triggers per step.
const LArOnlineID_Base * m_onlineHelper
unsigned int m_nStepTrigger
Number of steps.
double m_DropPercentTrig
Percentage of the used triggers that we will skip over at the end, in order ot ensure that the accumu...
std::vector< LArAccumulatedDigit * > ACCUMDIGIT_VEC
Helper for the Liquid Argon Calorimeter cell identifiers.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts