31 int iBin =
getBin(n_area, cls_emfrac, cls_ener, cls_eta);
38 if(n_area >= 0 && n_area<(
int)
m_DMAreaSet.size() ) {
76 if(cls_emfrac < dmArea->m_MinFrac || cls_emfrac >= dmArea->
m_MaxFrac)
return -1;
79 for (ifrac=0; ifrac<nfrac; ifrac++) {
80 if( cls_emfrac < dmArea->m_FracBins[ifrac] )
break;
81 if( cls_emfrac >= dmArea->
m_FracBins[ifrac] && (ifrac == nfrac-1 || cls_emfrac < dmArea->m_FracBins[ifrac+1]) )
break;
93 if(cls_ener < dmArea->m_MinEner || cls_ener >= dmArea->
m_MaxEner)
return (-1);
96 for (iener=0; iener<nener; iener++) {
97 if( cls_ener < dmArea->m_EnerBins[iener] )
break;
98 if( cls_ener >= dmArea->
m_EnerBins[iener] && (iener == nener-1 || cls_ener < dmArea->m_EnerBins[iener+1]) )
break;
110 if(cls_eta < dmArea->m_MinEta || cls_eta >= dmArea->
m_MaxEta)
return (-1);
120 int CaloHadDMCoeff::getBin(
const int & n_dm_area,
const float & cls_emfrac,
const float & cls_ener,
const float & cls_eta)
const
122 if(n_dm_area < 0 || n_dm_area >= (
int)
m_DMAreaSet.size()) {
123 std::cout <<
" WARNING CaloHadDMCoeff::getBin -> wrong n_area: " << n_dm_area << std::endl;
126 int ifrac =
getBinFrac(n_dm_area, cls_emfrac);
128 int ieta =
getBinEta(n_dm_area, cls_eta);
129 int iBin =
getBin(n_dm_area, ifrac, iener, ieta);
138 if(ifrac!=-1 && iener !=-1 && ieta!=-1) {
149 "# Coeffs for Dead Material corrections in CaloClusterLocalCalib algorithm.\n"
150 "# Author: Guennadi Pospelov <pospelov@mppmu.mpg.de>\n"
153 "# dm_id is_ON dm_title\n"
154 "# nFrac FracMin FracMax\n"
155 "# nEner EnerMin EnerMax\n"
156 "# nEta EtaMin EtaMax\n"
158 "# indx ifrac iener ieta frac ener eta pars[]\n"
164 fprintf(
fout,
" %d %d %s\n",
area->m_indx,
area->m_is_on,
area->m_title.data());
165 fprintf(
fout,
"%2d %6.3f %6.3f\n", (
int)
area->m_FracBins.size(),
area->m_MinFrac,
area->m_MaxFrac);
166 fprintf(
fout,
"%2d %6.3g %6.3g\n", (
int)
area->m_EnerBins.size(),
area->m_MinEner,
area->m_MaxEner);
167 fprintf(
fout,
"%2d %6.3f %6.3f\n", (
int)
area->m_EtaBins.size(),
area->m_MinEta,
area->m_MaxEta);
168 fprintf(
fout,
"%2d\n",
area->m_nPars);
169 for(
int i_frac=0; i_frac<(
int)
area->m_FracBins.size(); i_frac++){
170 for(
int i_ener=0; i_ener<(
int)
area->m_EnerBins.size(); i_ener++){
171 for(
int i_eta=0; i_eta<(
int)
area->m_EtaBins.size(); i_eta++){
172 float cls_emfrac =
area->m_FracBins[i_frac];
173 float cls_ener =
area->m_EnerBins[i_ener];
174 float cls_eta =
area->m_EtaBins[i_eta]+0.01;
176 fprintf(
fout,
"%4d %2d %2d %2d %6.3f %6.3g %6.3f ",
177 indx, i_frac,i_ener, i_eta,
area->m_FracBins[i_frac],
area->m_EnerBins[i_ener],
area->m_EtaBins[i_eta]);
178 for(
int i_par=0; i_par<
area->m_nPars; i_par++){
179 if(
area->m_indx!=10) {
180 fprintf(
fout,
"%10.4f ",(*
vv)[i_par]);
182 fprintf(
fout,
"%10.7f ",(*
vv)[i_par]);