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");
107 while( fscanf(finput,
"%d %d %d %d %d %f",&bec,&pos_neg,&FT,&slot,&channel,&pedShift) != EOF ) {
108 ATH_MSG_INFO (
" read linbe " << bec <<
" " << pos_neg <<
" " << FT <<
" " << slot <<
" " << channel <<
" " << pedShift );
110 Identifier id = cabling->cnvToIdentifier( hwid);
112 int ii = (int) (idHash);
113 pedShiftValue[ii] = pedShift;
122 FILE* fp = fopen(
"calopedestal.txt",
"w");
124 ATH_MSG_ERROR(
"Cannot open file calopedestal.txt for writing");
125 return StatusCode::FAILURE;
127 ATH_MSG_INFO (
" start loop over Calo cells " << ncell );
128 for (
int i=0;i<ncell;i++) {
162 int ii = (int) (idSubHash);
165 if (subCalo<3) ngain=3;
168 for (
int igain=0;igain<ngain;igain++) {
184 unsigned int subHash2;
186 auto it = pedBlobMap.find(iCool);
187 if (it == pedBlobMap.end()) {
190 return StatusCode::FAILURE;
193 float ped1_old= flt->getData(subHash2,dbGain,0);
194 float ped2= flt->getData(subHash2,dbGain,1);
196 float ped1 = ped1_old + pedShiftValue[i];
198 if (iCool<48) fprintf(fp,
"%5u %5d %5d %8.3f %8.3f\n",iCool,ii,gain,ped1,ped2);
203 m_OffId=(int)(
id.get_identifier32().get_compact());
227 if (std::fabs(ped1-ped1_old)>1.)
235 return StatusCode::SUCCESS;