6 #include "CaloDetDescr/CaloDetDescrElement.h" 
    8 #include "CLHEP/Units/SystemOfUnits.h" 
   16                        const std::vector<std::string>& fixHVStrings) :
 
   17   m_larem_id(calocell_id->em_idHelper()),
 
   18   m_larhec_id(calocell_id->hec_idHelper()),
 
   19   m_larfcal_id(calocell_id->fcal_idHelper()),
 
   27                                      MsgStream& 
msg)
 const {
 
   33   bool isbarrelEM=
false;
 
   36   unsigned int subdet=99;
 
   37   unsigned int layer=99;
 
   40   const float eta_raw = calodde->
eta_raw();
 
   41   const float phi_raw = calodde->
phi_raw();
 
   62     if (ieta>=0 && ieta<16)        
d = 0.196; 
 
   63     else if (ieta>=16 && ieta<32)  
d = 0.193; 
 
   64     else if (ieta>=32 && ieta<48)  
d = 0.2; 
 
   81     float aeta_raw = std::abs(eta_raw);
 
   85     else if(aeta_raw< 2.) Zsamp=4200.-40.*(aeta_raw-1.5);
 
   86     else Zsamp = 4180. - 160.*(aeta_raw-2.);
 
  121   const double E_nominal = 
champ_e(nominal,
d);
 
  125   for (
unsigned int i=0;
i<hvlist.size();
i++) {
 
  135   for (
unsigned int i=0;
i<hvlist.size();
i++) {
 
  139     if (std::abs(E_nominal)>1
e-3) {
 
  140       const double deviation = std::abs((
E-E_nominal)/E_nominal);
 
  141       if (deviation<1
e-3) 
E = E_nominal;
 
  146       const double corr = this->
Scale_barrel(hvlist[
i].hv)*hvlist[
i].weight;
 
  151       const double corr = this->
Scale_FCAL1(hvlist[
i].hv) * hvlist[
i].weight;
 
  156       const double corr = 
Respo(
E,E_nominal,
T)*hvlist[
i].weight;
 
  159     mynorm += hvlist[
i].weight;
 
  163   if (mycorr>1
e-2) mycorr = mynorm/mycorr;
 
  173   for (
unsigned int ii=0;ii<
m_HVfix.size();ii++) {
 
  175     eta_raw >= 
m_HVfix[ii].eta_min && eta_raw < 
m_HVfix[ii].eta_max &&
 
  176     phi_raw >= 
m_HVfix[ii].phi_min && phi_raw < 
m_HVfix[ii].phi_max ) {
 
  192     e1 = std::abs(hv)/(
d*1
e3);
 
  193   if ( 
e1 < 0.01 ) 
e1 = 0.01;
 
  199   const float T = tempe;                
 
  200   static const float P[6] = {-0.01481,-0.0075,0.141,12.4,1.627,0.317};
 
  201   if ( 
e < -999.) 
return 0.;
 
  210   if ( 
e > 2.) 
q=(1.+0.36/
e);
 
  211   else if (
e>1
e-6) 
q =(1.04+0.25/
e);
 
  217   if (
e < -999.) 
return 1.;
 
  218   if (
e < 0.01) 
return 0;
 
  219   if ( 
e > e_nominal ) 
return 1;
 
  228     float den = 
vdrift(e_nominal, tempe);
 
  229     return den==0 ? 0 : (
d*1
e4)/den;
 
  231   if (
e > e_nominal ) 
e = e_nominal;
 
  233   return den==0 ? 0 : (
d*1
e4)/den; 
 
  238   if ( aeta<1.5 ) 
return 2500.;
 
  239   else if (aeta<1.6) 
return 2300.;
 
  240   else if (aeta<1.8 ) 
return 2100.;
 
  241   else if (aeta < 2.0 ) 
return 1700.;
 
  242   else if (aeta < 2.1 ) 
return 1500.;
 
  243   else if (aeta < 2.3 ) 
return 1250.;
 
  244   else if (aeta < 2.5 ) 
return 1000.;
 
  245   else if (aeta < 2.8 ) 
return 2300.;
 
  252   if (aeta<=2.5 ) EMECg = 0.9 +1.9*(  ( Zeta - 40. )/(10*std::sinh(aeta)) - 60.)/140.;
 
  253   else EMECg = 1.8 + 1.3*(  ( Zeta - 40. )/(10*std::sinh(aeta)) - 30.)/40.;
 
  259   if (hv<5.0) 
return 0;
 
  260   const float R0=-2.612;
 
  261   const float alpha=2.336;
 
  262   const float beta=0.079;
 
  271    const float hvref[18]={1.,50.,100.,150.,200.,300.,400.,500.,600.,700.,800.,900.,1000.,1200.,1400.,1600.,1800.,2000.};
 
  272    const float hvmax = 1998.;
 
  273    const float facteur[18]={0.,0.1209,0.2135,0.2829,0.3390,0.4270,0.4961,0.5556,0.6065,0.6527,0.6906,
 
  274                 0.7290,0.7626,0.8224,0.8754,0.9190,0.9606,1.};
 
  280    else if (hv<hvref[0]) {
 
  281       float resp=facteur[0];
 
  286       float resp=facteur[17];
 
  293    for (
int i=0;
i<18;
i++) {
 
  310      resp=facteur[0]*(hv/hvref[0]);
 
  318     const std::vector<std::string>& fixHVStrings, MsgStream& 
msg) {
 
  321   for (
const std::string& theString : fixHVStrings) {
 
  322     std::stringstream is;
 
  323     is << theString << std::endl;
 
  325     unsigned int iDetector, ilayer_min, ilayer_max;
 
  326     float eta_min, eta_max, phi_min, phi_max, corr;
 
  327     is >> iDetector >> ilayer_min >> ilayer_max >> eta_min >> eta_max >>
 
  328         phi_min >> phi_max >> corr;
 
  330     m_HVfix.push_back({.subdet = iDetector,
 
  331                        .layer_min = ilayer_min,
 
  332                        .layer_max = ilayer_max,
 
  341       << 
"  Number of regions with overwritten HV corrections from jobOptions "