65 int ncell=
m_calo_id->calo_cell_hash_max();
67 std::vector<float> pedShiftValue;
68 pedShiftValue.resize(ncell,0.);
74 return StatusCode::FAILURE;
82 return StatusCode::FAILURE;
85 std::map<unsigned int, const CaloCondBlobFlt*> pedBlobMap;
86 for (
auto iColl=pedHdl->begin();iColl!=pedHdl->end();++iColl) {
88 unsigned int sysId =
static_cast<unsigned int>(iColl->first);
93 pedBlobMap[sysId] = flt;
99 FILE* finput = fopen(
m_fname.value().c_str(),
"r");
102 return StatusCode::FAILURE;
111 while( fscanf(finput,
"%d %d %d %d %d %f",&bec,&pos_neg,&FT,&slot,&channel,&pedShift) != EOF ) {
112 ATH_MSG_INFO (
" read linbe " << bec <<
" " << pos_neg <<
" " << FT <<
" " << slot <<
" " << channel <<
" " << pedShift );
114 Identifier id = cabling->cnvToIdentifier( hwid);
116 int ii = (int) (idHash);
117 pedShiftValue[ii] = pedShift;
126 FILE* fp = fopen(
"calopedestal.txt",
"w");
128 ATH_MSG_ERROR(
"Cannot open file calopedestal.txt for writing");
129 return StatusCode::FAILURE;
131 ATH_MSG_INFO (
" start loop over Calo cells " << ncell );
132 for (
int i=0;i<ncell;i++) {
166 int ii = (int) (idSubHash);
169 if (subCalo<3) ngain=3;
172 for (
int igain=0;igain<ngain;igain++) {
188 unsigned int subHash2;
190 auto it = pedBlobMap.find(iCool);
191 if (it == pedBlobMap.end()) {
194 return StatusCode::FAILURE;
197 float ped1_old= flt->getData(subHash2,dbGain,0);
198 float ped2= flt->getData(subHash2,dbGain,1);
200 float ped1 = ped1_old + pedShiftValue[i];
202 if (iCool<48) fprintf(fp,
"%5u %5d %5d %8.3f %8.3f\n",iCool,ii,gain,ped1,ped2);
207 m_OffId=(int)(
id.get_identifier32().get_compact());
231 if (std::fabs(ped1-ped1_old)>1.)
239 return StatusCode::SUCCESS;