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++) {
126 if (hvlist[i].hv<-10000) notfound=
true;
130 msg << MSG::WARNING <<
" At least one HV value not found in database for cell " <<
m_larem_id->show_to_string(offid) <<
endmsg;
135 for (
unsigned int i=0;i<hvlist.size();i++) {
136 double E =
champ_e(hvlist[i].hv,d);
139 if (std::abs(E_nominal)>1e-3) {
140 const double deviation = std::abs((E-E_nominal)/E_nominal);
141 if (deviation<1e-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>1e-2) mycorr = mynorm/mycorr;
168 msg << MSG::DEBUG <<
"Correction factor > 10, ignore it... for cell " <<
m_larem_id->show_to_string(offid) <<
" " << mycorr <<
endmsg;;
173 for (
unsigned int ii=0;ii<
m_HVfix.size();ii++) {
174 if (subdet ==
m_HVfix[ii].subdet && layer >=
m_HVfix[ii].layer_min && layer <=
m_HVfix[ii].layer_max &&
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 ) {
177 msg << MSG::DEBUG <<
"Overwrite correction for cell " <<
m_larem_id->show_to_string(offid) <<
" " <<
m_HVfix[ii].corr <<
endmsg;;
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++) {
304 const float b=(std::log(facteur[i2])-std::log(facteur[i1]))/(std::log(hvref[i2])-std::log(hvref[i1]));
305 const float a=std::log(facteur[i2])-b*std::log(hvref[i2]);
306 resp = std::exp(
a+b*std::log(hv));
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 "