52 if(n_area >= 0 && n_area<(
int)
m_DMAreaSet.size() ) {
91 if(cls_emfrac < dmArea->m_dimFrac.m_vMin || cls_emfrac >= dmArea->
m_dimFrac.
m_vMax)
return (-1);
99 if( cls_ener < dmArea->m_dimEner.m_vMin || cls_ener >= dmArea->
m_dimEner.
m_vMax )
return (-1);
102 if( cls_ener < dmArea->m_dimEner.m_vBins[iener] )
break;
112 if(cls_lambda < dmArea->m_dimLambda.m_vMin || cls_lambda >= dmArea->
m_dimLambda.
m_vMax)
return (-1);
120 float cls_abseta = std::abs(cls_eta);
121 if(cls_abseta < dmArea->m_dimEta.m_vMin || cls_abseta >= dmArea->
m_dimEta.
m_vMax)
return (-1);
126 int CaloHadDMCoeff2::getBin(
const int n_dm_area,
const float &cls_emfrac,
const float &cls_ener,
const float &cls_lambda,
const float &cls_eta)
const
128 if(n_dm_area < 0 || n_dm_area >= (
int)
m_DMAreaSet.size()) {
129 std::cout <<
" WARNING CaloHadDMCoeff::getBin -> wrong n_area: " << n_dm_area << std::endl;
134 int ifrac = -1, iener = -1, ilambda = -1, ieta = -1;
140 if( ilambda != -1 ) {
157 int iBin =
getBin(n_area, cls_emfrac, cls_ener, cls_lambda, cls_eta);
172 for(i_area=0; i_area<narea; i_area++) {
177 std::vector<HadDMDimension > v_dims;
183 int ndim = (
int) v_dims.size();
184 v_dim_indx.resize(ndim,0);
185 for(
int i_dim=0; i_dim<ndim; i_dim++){
187 for(
int j=0; j<i_dim; j++){
188 x0 += v_dim_indx[j]*v_dims[j].xloc;
190 v_dim_indx[i_dim] = (iBin-theArea->
m_offset-x0)/v_dims[i_dim].xloc;
203 "# Coeffs for Dead Material corrections in DeadMaterialCorrectionTool2 tool.\n\n"
211 fout <<
"zone " <<
area->m_indx <<
" " <<
area->m_is_on <<
" " <<
area->m_title << std::endl;
212 std::vector<CaloHadDMCoeff2::HadDMDimension > v_dims;
214 v_dims[0] =
area->m_dimFrac;
215 v_dims[1] =
area->m_dimEner;
216 v_dims[2] =
area->m_dimLambda;
217 v_dims[3] =
area->m_dimEta;
218 for(
unsigned int i_dim=0; i_dim<v_dims.size(); i_dim++){
220 sprintf(
line,
"%-6s %2d %6.3f %12.3f ",
dim.m_title.c_str(),
dim.m_nbins,
dim.m_vMin,
dim.m_vMax);
221 std::string sline(
line);
227 std::cout <<
"CaloHadDMCoeff2::PrintData2() -> Error! p1." << std::endl;
231 for(
unsigned int i=0;
i<
dim.m_vBins.size();
i++){
237 fout <<
"npars " <<
area->m_nPars << std::endl;
239 for(
int i_data=0; i_data<
area->m_length; i_data++) {
240 int indx =
area->m_offset + i_data;
242 fout << std::setw(5) << indx <<
" ";
243 std::vector<int > v_dim_indexes;
245 for(
unsigned int i_dim=0; i_dim<v_dim_indexes.size(); i_dim++){
246 fout << std::setw(4) << v_dim_indexes[i_dim] <<
" ";
249 for(
int i_par=0; i_par<
area->m_nPars; i_par++){
250 std::stringstream foutx;
251 foutx << std::fixed << std::setprecision(5) << std::setw(12) << (*pars)[i_par] <<
" ";