74 return StatusCode::FAILURE;
80 ATH_MSG_ERROR(
"Failed initialize intermediate AutoCorr object" );
84 return StatusCode::SUCCESS;
101 return StatusCode::FAILURE;
104 uint32_t bcid = eventInfo->
bcid();
108 <<
", type= " << bunchCrossing->
bcType(bcid) <<
")" );
109 return StatusCode::SUCCESS;
117 for (
const std::string& key :
m_keylist) {
118 ATH_MSG_DEBUG(
"Reading LArDigitContainer from StoreGate! key=" << key);
119 sc=
evtStore()->retrieve(larDigitContainer,key);
120 if (
sc.isFailure() || !larDigitContainer) {
121 ATH_MSG_DEBUG(
"Cannot read LArDigitContainer from StoreGate! key=" << key);
124 if(larDigitContainer->
empty()) {
125 ATH_MSG_DEBUG(
"Got empty LArDigitContainer (key=" << key <<
").");
128 ATH_MSG_DEBUG(
"Got LArDigitContainer with key " << key <<
", size=" << larDigitContainer->
size());
133 for (
const LArDigit* digit : *larDigitContainer) {
137 ATH_MSG_ERROR(
"Found odd gain number ("<< (
int)gain <<
")" );
138 return StatusCode::FAILURE;
140 const std::vector<short> & samples = digit->samples();
145 std::vector<short>::const_iterator s_it=samples.begin();
146 std::vector<short>::const_iterator s_it_e=samples.end();
150 for (;s_it!=s_it_e && *s_it>=
min && *s_it<=
max;++s_it)
161 const double noise = thisAC.
get_rms();
171 return StatusCode::SUCCESS;
183 ATH_MSG_ERROR(
"Key list is empty! No containers processed!" );
184 return StatusCode::FAILURE;
188 auto larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>();
191 if (
sc.isFailure()) {
192 ATH_MSG_ERROR(
"Failed to set groupingType for LArAutoCorrComplete object" );
196 sc=larAutoCorrComplete->initialize();
197 if (
sc.isFailure()) {
198 ATH_MSG_ERROR(
"Failed initialize LArAutoCorrComplete object" );
207 for (;cell_it!=cell_it_e;cell_it++) {
219 std::vector<float> cov_flt;
220 cov_flt.reserve(cov.size());
221 std::vector<double>::const_iterator it=cov.begin();
222 std::vector<double>::const_iterator it_e=cov.end();
224 cov_flt.push_back((
float)*it);
229 larAutoCorrComplete->set(ch_id,gain,cov_flt);
235 ATH_MSG_INFO(
" Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions() );
236 ATH_MSG_INFO(
" Summary : Number of Barrel PS cells side A or C (connected+unconnected): 4096 " );
237 ATH_MSG_INFO(
" Summary : Number of Barrel cells side A or C (connected+unconnected): 53248 " );
238 ATH_MSG_INFO(
" Summary : Number of EMEC cells side A or C (connected+unconnected): 35328 " );
239 ATH_MSG_INFO(
" Summary : Number of HEC cells side A or C (connected+unconnected): 3072 ");
240 ATH_MSG_INFO(
" Summary : Number of FCAL cells side A or C (connected+unconnected): 1792 " );
244 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
int distanceFromFront(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
@ BunchCrossings
Distance in units of 25 nanoseconds.
BunchCrossingType bcType(const bcid_type bcid) const
Convenience function for the type of the specific bunch crossing.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
std::vector< std::string > m_keylistproperty
std::string m_groupingType
std::vector< std::string > m_keylist
LArAutoCorrMaker(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
int m_bunchCrossingsFromFront
const short & get_max() const
void set_max(const short max)
const std::vector< double > & get_cov(int m_normalize, int m_phys)
const short & get_min() const
void set_min(const short min)
void add(const std::vector< short > &samples, size_t maxnsamples)
HWIdentifier channelId() const
ConditionsMap::iterator ConditionsMapIterator
Container class for LArDigit.
Liquid Argon digit base class.
uint32_t bcid() const
The bunch crossing ID of the event.
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="")
EventInfo_v1 EventInfo
Definition of the latest event info version.