69 return StatusCode::SUCCESS;
78 ATH_MSG_ERROR (
"Key list is empty! No containers to process!" );
79 return StatusCode::FAILURE;
83 for (
const std::string& key :
m_keylist) {
84 StatusCode
sc=
evtStore()->retrieve(larDigitContainer,key);
85 if (
sc.isFailure() || !larDigitContainer) {
86 ATH_MSG_DEBUG (
"Cannot read LArCalibDigitContainer from StoreGate! key=" << key );
89 if(larDigitContainer->
empty()) {
90 ATH_MSG_DEBUG (
"Got empty LArDigitContainer (key=" << key <<
")." );
93 for (
const LArDigit* digit : *larDigitContainer) {
100 ATH_MSG_ERROR (
"Found odd gain number ("<< (
int)gain <<
")" );
101 return StatusCode::FAILURE;
103 const std::vector<short> & samples = digit->samples();
106 std::vector<short>::const_iterator s_it=samples.begin();
107 std::vector<short>::const_iterator s_it_e=samples.end();
110 for (;s_it!=s_it_e && *s_it>=
min && *s_it<=
max;++s_it)
113 thisPed.
add(samples);
116 thisPed.
add(samples);
119 const double noise = thisPed.
get_rms();
129 return StatusCode::SUCCESS;
140 ATH_MSG_ERROR (
"Key list is empty! No containers processed!" );
141 return StatusCode::FAILURE;
145 auto larPedestalComplete = std::make_unique<LArPedestalComplete>();
148 ATH_CHECK( larPedestalComplete->initialize() );
158 int n_zero,n_min, n_max, n_cur;
159 n_zero=0; n_max=n_min=-1;
160 for (;cell_it!=cell_it_e;cell_it++) {
178 if(n_cur<n_min || n_min<0) n_min=n_cur;
179 if(n_cur>n_max || n_max<0) n_max=n_cur;
188 ATH_MSG_INFO (
"Gain " << gain <<
" Number of cells with 0 events to compute pedestal: " << n_zero );
189 ATH_MSG_INFO (
"Gain " << gain <<
" Minimum number of events|samples to compute pedestal: " << n_min );
190 ATH_MSG_INFO (
"Gain " << gain <<
" Maximum number of events|samples to compute pedestal: " << n_max );
193 ATH_MSG_INFO (
" Summary : Number of cells with a pedestal value computed : " << larPedestalComplete->totalNumberOfConditions() );
194 ATH_MSG_INFO (
" Summary : Number of Barrel PS cells side A or C (connected+unconnected): 4096 " );
195 ATH_MSG_INFO (
" Summary : Number of Barrel cells side A or C (connected+unconnected): 53248 " );
196 ATH_MSG_INFO (
" Summary : Number of EMEC cells side A or C (connected+unconnected): 35328 " );
197 ATH_MSG_INFO (
" Summary : Number of HEC cells side A or C (connected+unconnected): 3072 ");
198 ATH_MSG_INFO (
" Summary : Number of FCAL cells side A or C (connected+unconnected): 1792 " );
204 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
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
bool empty() const noexcept
Returns true if the collection is empty.
void set(const std::string &id)
build from a string form - hexadecimal
HWIdentifier channelId() const
ConditionsMap::iterator ConditionsMapIterator
Container class for LArDigit.
Liquid Argon digit base class.
LArPedestalMaker(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > m_rms
std::string m_groupingType
std::vector< float > m_mean
std::vector< std::string > m_keylist
void add(const std::vector< short > &samples)
const short & get_min() const
const short & get_max() const
void set_max(const short max)
unsigned get_nsamples() const
void set_min(const short min)
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")