CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
PFEnergyCalibration Class Reference

#include <PFEnergyCalibration.h>

Public Member Functions

double energyEm (const reco::PFCluster &clusterEcal, std::vector< double > &EclustersPS1, std::vector< double > &EclustersPS2, bool crackCorrection=true)
 
double energyEm (const reco::PFCluster &clusterEcal, double ePS1, double ePS2, bool crackCorrection=true)
 
double energyEm (const reco::PFCluster &clusterEcal, std::vector< double > &EclustersPS1, std::vector< double > &EclustersPS2, double &ps1, double &ps2, bool crackCorrection=true)
 
double energyEm (const reco::PFCluster &clusterEcal, double ePS1, double ePS2, double &ps1, double &ps2, bool crackCorrection=true)
 
void energyEmHad (double t, double &e, double &h, double eta, double phi) const
 
void initializeCalibrationFunctions ()
 
 PFEnergyCalibration ()
 
void setCalibrationFunctions (const PerformancePayloadFromTFormula *thePFCal)
 
 ~PFEnergyCalibration ()
 

Protected Attributes

TF1 * faBarrel
 
TF1 * faEndcap
 
TF1 * faEtaBarrel
 
TF1 * faEtaEndcap
 
TF1 * fbBarrel
 
TF1 * fbEndcap
 
TF1 * fbEtaBarrel
 
TF1 * fbEtaEndcap
 
TF1 * fcBarrel
 
TF1 * fcEndcap
 
const
PerformancePayloadFromTFormula
pfCalibrations
 

Private Member Functions

double aBarrel (double x) const
 
double aEndcap (double x) const
 
double aEtaBarrel (double x) const
 
double aEtaEndcap (double x) const
 
double Alpha (double eta)
 
double bBarrel (double x) const
 
double bEndcap (double x) const
 
double Beta (double E, double eta)
 
double bEtaBarrel (double x) const
 
double bEtaEndcap (double x) const
 
double cBarrel (double x) const
 
double cEndcap (double x) const
 
double CorrBarrel (double E, double eta)
 
double CorrEta (double eta)
 
double CorrPhi (double phi, double eta)
 
double dCrackPhi (double phi, double eta)
 
double Ecorr (double eEcal, double ePS1, double ePS2, double eta, double phi, bool crackCorrection=true)
 
double Ecorr (double eEcal, double ePS1, double ePS2, double eta, double phi, double &, double &, bool crackCorrection=true)
 
double EcorrBarrel (double E, double eta, double phi, bool crackCorrection=true)
 
double EcorrPS (double eEcal, double ePS1, double ePS2, double etaEcal)
 
double EcorrPS (double eEcal, double ePS1, double ePS2, double etaEcal, double &, double &)
 
double EcorrPS_ePSNil (double eEcal, double eta)
 
double EcorrZoneAfterPS (double E, double eta)
 
double EcorrZoneBeforePS (double E, double eta)
 
double Gamma (double etaEcal)
 
double minimum (double a, double b)
 

Private Attributes

double threshE
 
double threshH
 

Friends

std::ostream & operator<< (std::ostream &out, const PFEnergyCalibration &calib)
 

Detailed Description

Definition at line 40 of file PFEnergyCalibration.h.

Constructor & Destructor Documentation

PFEnergyCalibration::PFEnergyCalibration ( )

Definition at line 12 of file PFEnergyCalibration.cc.

References initializeCalibrationFunctions().

12  : pfCalibrations(0)
13 {
15 }
const PerformancePayloadFromTFormula * pfCalibrations
PFEnergyCalibration::~PFEnergyCalibration ( )

Definition at line 17 of file PFEnergyCalibration.cc.

References faBarrel, faEndcap, faEtaBarrel, faEtaEndcap, fbBarrel, fbEndcap, fbEtaBarrel, fbEtaEndcap, fcBarrel, and fcEndcap.

18 {
19 
20  delete faBarrel;
21  delete fbBarrel;
22  delete fcBarrel;
23  delete faEtaBarrel;
24  delete fbEtaBarrel;
25  delete faEndcap;
26  delete fbEndcap;
27  delete fcEndcap;
28  delete faEtaEndcap;
29  delete fbEtaEndcap;
30 
31 }

Member Function Documentation

double PFEnergyCalibration::aBarrel ( double  x) const
private

Definition at line 225 of file PFEnergyCalibration.cc.

References faBarrel, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfa_BARREL, and point.

Referenced by energyEmHad().

225  {
226 
227  if ( pfCalibrations ) {
228 
232 
233  } else {
234 
235  return faBarrel->Eval(x);
236 
237  }
238 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::aEndcap ( double  x) const
private

Definition at line 305 of file PFEnergyCalibration.cc.

References faEndcap, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfa_ENDCAP, and point.

Referenced by energyEmHad().

305  {
306 
307  if ( pfCalibrations ) {
308 
312 
313  } else {
314 
315  return faEndcap->Eval(x);
316 
317  }
318 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::aEtaBarrel ( double  x) const
private

Definition at line 273 of file PFEnergyCalibration.cc.

References faEtaBarrel, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfaEta_BARREL, and point.

Referenced by energyEmHad().

273  {
274 
275  if ( pfCalibrations ) {
276 
280 
281  } else {
282 
283  return faEtaBarrel->Eval(x);
284 
285  }
286 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::aEtaEndcap ( double  x) const
private

Definition at line 353 of file PFEnergyCalibration.cc.

References faEtaEndcap, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfaEta_ENDCAP, and point.

Referenced by energyEmHad().

353  {
354 
355  if ( pfCalibrations ) {
356 
360 
361  } else {
362 
363  return faEtaEndcap->Eval(x);
364 
365  }
366 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::Alpha ( double  eta)
private

Definition at line 668 of file PFEnergyCalibration.cc.

References constexpr, eta(), p1, p2, and query::result.

Referenced by EcorrPS().

668  {
669 
670  //Energy dependency
671  constexpr double p0 = 5.97621e-01;
672 
673  //Eta dependency
674  constexpr double p1 =-1.86407e-01;
675  constexpr double p2 = 3.85197e-01;
676 
677  //so that <feta()> = 1
678  constexpr double norm = (p1+p2*(2.6+1.656)/2);
679 
680  double result = p0*(p1+p2*eta)/norm;
681 
682  return result;
683 }
T eta() const
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double PFEnergyCalibration::bBarrel ( double  x) const
private

Definition at line 241 of file PFEnergyCalibration.cc.

References fbBarrel, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfb_BARREL, and point.

Referenced by energyEmHad().

241  {
242 
243  if ( pfCalibrations ) {
244 
248 
249  } else {
250 
251  return fbBarrel->Eval(x);
252 
253  }
254 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::bEndcap ( double  x) const
private

Definition at line 321 of file PFEnergyCalibration.cc.

References fbEndcap, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfb_ENDCAP, and point.

Referenced by energyEmHad().

321  {
322 
323  if ( pfCalibrations ) {
324 
328 
329  } else {
330 
331  return fbEndcap->Eval(x);
332 
333  }
334 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::Beta ( double  E,
double  eta 
)
private

Definition at line 686 of file PFEnergyCalibration.cc.

References constexpr, p1, p2, p3, p4, and query::result.

Referenced by EcorrPS().

686  {
687 
688  //Energy dependency
689  constexpr double p0 = 0.032;
690  constexpr double p1 = 9.70394e-02;
691  constexpr double p2 = 2.23072e+01;
692  constexpr double p3 = 100;
693 
694  //Eta dependency
695  constexpr double p4 = 1.02496e+00 ;
696  constexpr double p5 = -4.40176e-03 ;
697 
698  //so that <feta()> = 1
699  constexpr double norm = (p4+p5*(2.6+1.656)/2);
700 
701  double result = (1.0012+p0*TMath::Exp(-E/p3)+p1*TMath::Exp(-E/p2))*(p4+p5*eta)/norm;
702  return result;
703 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::bEtaBarrel ( double  x) const
private

Definition at line 289 of file PFEnergyCalibration.cc.

References fbEtaBarrel, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfbEta_BARREL, and point.

Referenced by energyEmHad().

289  {
290 
291  if ( pfCalibrations ) {
292 
296 
297  } else {
298 
299  return fbEtaBarrel->Eval(x);
300 
301  }
302 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::bEtaEndcap ( double  x) const
private

Definition at line 369 of file PFEnergyCalibration.cc.

References fbEtaEndcap, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfbEta_ENDCAP, and point.

Referenced by energyEmHad().

369  {
370 
371  if ( pfCalibrations ) {
372 
376 
377  } else {
378 
379  return fbEtaEndcap->Eval(x);
380 
381  }
382 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::cBarrel ( double  x) const
private

Definition at line 257 of file PFEnergyCalibration.cc.

References fcBarrel, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfc_BARREL, and point.

Referenced by energyEmHad().

257  {
258 
259  if ( pfCalibrations ) {
260 
264 
265  } else {
266 
267  return fcBarrel->Eval(x);
268 
269  }
270 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::cEndcap ( double  x) const
private

Definition at line 337 of file PFEnergyCalibration.cc.

References fcEndcap, PerformancePayloadFromTFormula::getResult(), BinningPointByMap::insert(), BinningVariables::JetEt, pfCalibrations, PerformanceResult::PFfc_ENDCAP, and point.

Referenced by energyEmHad().

337  {
338 
339  if ( pfCalibrations ) {
340 
344 
345  } else {
346 
347  return fcEndcap->Eval(x);
348 
349  }
350 }
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
const PerformancePayloadFromTFormula * pfCalibrations
bool insert(BinningVariables::BinningVariablesType, float)
Definition: DDAxes.h:10
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double PFEnergyCalibration::CorrBarrel ( double  E,
double  eta 
)
private

Definition at line 622 of file PFEnergyCalibration.cc.

References constexpr, p1, p2, p3, p4, and query::result.

Referenced by EcorrBarrel().

622  {
623 
624  //Energy dependency
625  /*
626  //YM Parameters 52XX:
627  constexpr double p0=1.00000e+00;
628  constexpr double p1=3.27753e+01;
629  constexpr double p2=2.28552e-02;
630  constexpr double p3=3.06139e+00;
631  constexpr double p4=2.25135e-01;
632  constexpr double p5=1.47824e+00;
633  constexpr double p6=1.09e-02;
634  constexpr double p7=4.19343e+01;
635  */
636  constexpr double p0 = 0.9944;
637  constexpr double p1 = 9.827;
638  constexpr double p2 = 1.503;
639  constexpr double p3 = 1.196;
640  constexpr double p4 = 0.3349;
641  constexpr double p5 = 0.89;
642  constexpr double p6 = 0.004361;
643  constexpr double p7 = 51.51;
644  //Eta dependency
645  constexpr double p8=2.705593e-03;
646 
647  double result = (p0+1/(p1+p2*TMath::Power(E,p3))+p4*TMath::Exp(-E/p5)+p6*TMath::Exp(-E*E/(p7*p7)))*(1+p8*eta*eta);
648 
649  return result;
650 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::CorrEta ( double  eta)
private

Definition at line 604 of file PFEnergyCalibration.cc.

References a, constexpr, i, m, query::result, and alignCSCRings::s.

Referenced by EcorrBarrel().

604  {
605 
606  // we use a gaussian with a screwness for each of the 5 |eta|-cracks
607  constexpr double a[] = {6.13349e-01, 5.08146e-01, 4.44480e-01, 3.3487e-01, 7.65627e-01}; // amplitude
608  constexpr double m[] = {-1.79514e-02, 4.44747e-01, 7.92824e-01, 1.14090e+00, 1.47464e+00}; // mean
609  constexpr double s[] = {7.92382e-03, 3.06028e-03, 3.36139e-03, 3.94521e-03, 8.63950e-04}; // sigma
610  constexpr double sa[] = {1.27228e+01, 3.81517e-02, 1.63507e-01, -6.56480e-02, 1.87160e-01}; // screwness amplitude
611  constexpr double ss[] = {5.48753e-02, -1.00223e-02, 2.22866e-03, 4.26288e-04, 2.67937e-03}; // screwness sigma
612  double result = 1;
613 
614  for(unsigned i=0;i<=4;i++) result+=a[i]*TMath::Gaus(eta,m[i],s[i])*(1+sa[i]*TMath::Sign(1.,eta-m[i])*TMath::Exp(-TMath::Abs(eta-m[i])/ss[i]));
615 
616  return result;
617 }
int i
Definition: DBlmapReader.cc:9
T eta() const
tuple result
Definition: query.py:137
double a
Definition: hdecay.h:121
#define constexpr
double PFEnergyCalibration::CorrPhi ( double  phi,
double  eta 
)
private

Definition at line 578 of file PFEnergyCalibration.cc.

References constexpr, dCrackPhi(), p1, p2, p3, p4, and query::result.

Referenced by EcorrBarrel().

578  {
579 
580  // we use 3 gaussians to correct the phi-cracks effect
581  constexpr double p1= 5.59379e-01;
582  constexpr double p2= -1.26607e-03;
583  constexpr double p3= 9.61133e-04;
584 
585  constexpr double p4= 1.81691e-01;
586  constexpr double p5= -4.97535e-03;
587  constexpr double p6= 1.31006e-03;
588 
589  constexpr double p7= 1.38498e-01;
590  constexpr double p8= 1.18599e-04;
591  constexpr double p9= 2.01858e-03;
592 
593 
594  double dminphi = dCrackPhi(phi,eta);
595 
596  double result = (1+p1*TMath::Gaus(dminphi,p2,p3)+p4*TMath::Gaus(dminphi,p5,p6)+p7*TMath::Gaus(dminphi,p8,p9));
597 
598  return result;
599 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double dCrackPhi(double phi, double eta)
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
Definition: DDAxes.h:10
double PFEnergyCalibration::dCrackPhi ( double  phi,
double  eta 
)
private

Definition at line 526 of file PFEnergyCalibration.cc.

References constexpr, gather_cfg::cout, i, m, M_PI, minimum(), and pi.

Referenced by CorrPhi().

526  {
527 
528  constexpr double pi= M_PI;// 3.14159265358979323846;
529 
530  //Location of the 18 phi-cracks
531  static std::vector<double> cPhi;
532  if(cPhi.size()==0)
533  {
534  cPhi.resize(18,0);
535  cPhi[0]=2.97025;
536  for(unsigned i=1;i<=17;++i) cPhi[i]=cPhi[0]-2*i*pi/18;
537  }
538 
539  //Shift of this location if eta<0
540  constexpr double delta_cPhi=0.00638;
541 
542  double m; //the result
543 
544  //the location is shifted
545  if(eta<0) phi +=delta_cPhi;
546 
547  if (phi>=-pi && phi<=pi){
548 
549  //the problem of the extrema
550  if (phi<cPhi[17] || phi>=cPhi[0]){
551  if (phi<0) phi+= 2*pi;
552  m = minimum(phi -cPhi[0],phi-cPhi[17]-2*pi);
553  }
554 
555  //between these extrema...
556  else{
557  bool OK = false;
558  unsigned i=16;
559  while(!OK){
560  if (phi<cPhi[i]){
561  m=minimum(phi-cPhi[i+1],phi-cPhi[i]);
562  OK=true;
563  }
564  else i-=1;
565  }
566  }
567  }
568  else{
569  m=0.; //if there is a problem, we assum that we are in a crack
570  std::cout<<"Problem in dminphi"<<std::endl;
571  }
572  if(eta<0) m=-m; //because of the disymetry
573  return m;
574 }
int i
Definition: DBlmapReader.cc:9
pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:70
T eta() const
#define M_PI
Definition: BFit3D.cc:3
tuple cout
Definition: gather_cfg.py:121
double pi
double minimum(double a, double b)
#define constexpr
Definition: DDAxes.h:10
double PFEnergyCalibration::Ecorr ( double  eEcal,
double  ePS1,
double  ePS2,
double  eta,
double  phi,
bool  crackCorrection = true 
)
private

Definition at line 878 of file PFEnergyCalibration.cc.

References constexpr, EcorrBarrel(), EcorrPS(), EcorrPS_ePSNil(), EcorrZoneAfterPS(), EcorrZoneBeforePS(), and query::result.

Referenced by energyEm().

880  {
881 
882  constexpr double endBarrel=1.48;
883  constexpr double beginingPS=1.65;
884  constexpr double endPS=2.6;
885  constexpr double endEndCap=2.98;
886 
887  double result=0;
888 
889  eta=TMath::Abs(eta);
890 
891  if(eEcal>0){
892  if(eta <= endBarrel) result = EcorrBarrel(eEcal,eta,phi,crackCorrection);
893  else if(eta <= beginingPS) result = EcorrZoneBeforePS(eEcal,eta);
894  else if((eta < endPS) && ePS1==0 && ePS2==0) result = EcorrPS_ePSNil(eEcal,eta);
895  else if(eta < endPS) result = EcorrPS(eEcal,ePS1,ePS2,eta);
896  else if(eta < endEndCap) result = EcorrZoneAfterPS(eEcal,eta);
897  else result =eEcal;
898  }
899  else result = eEcal;// useful if eEcal=0 or eta>2.98
900  //protection
901  if(result<eEcal) result=eEcal;
902  return result;
903 }
double EcorrZoneAfterPS(double E, double eta)
double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true)
double EcorrZoneBeforePS(double E, double eta)
double EcorrPS_ePSNil(double eEcal, double eta)
T eta() const
tuple result
Definition: query.py:137
double EcorrPS(double eEcal, double ePS1, double ePS2, double etaEcal)
#define constexpr
Definition: DDAxes.h:10
double PFEnergyCalibration::Ecorr ( double  eEcal,
double  ePS1,
double  ePS2,
double  eta,
double  phi,
double &  ps1,
double &  ps2,
bool  crackCorrection = true 
)
private

Definition at line 908 of file PFEnergyCalibration.cc.

References constexpr, EcorrBarrel(), EcorrPS(), EcorrPS_ePSNil(), EcorrZoneAfterPS(), EcorrZoneBeforePS(), and query::result.

908  {
909 
910  constexpr double endBarrel=1.48;
911  constexpr double beginingPS=1.65;
912  constexpr double endPS=2.6;
913  constexpr double endEndCap=2.98;
914 
915  double result=0;
916 
917  eta=TMath::Abs(eta);
918 
919  if(eEcal>0){
920  if(eta <= endBarrel) result = EcorrBarrel(eEcal,eta,phi,crackCorrection);
921  else if(eta <= beginingPS) result = EcorrZoneBeforePS(eEcal,eta);
922  else if((eta < endPS) && ePS1==0 && ePS2==0) result = EcorrPS_ePSNil(eEcal,eta);
923  else if(eta < endPS) result = EcorrPS(eEcal,ePS1,ePS2,eta,ps1,ps2);
924  else if(eta < endEndCap) result = EcorrZoneAfterPS(eEcal,eta);
925  else result =eEcal;
926  }
927  else result = eEcal;// useful if eEcal=0 or eta>2.98
928  // protection
929  if(result<eEcal) result=eEcal;
930  return result;
931 }
double EcorrZoneAfterPS(double E, double eta)
double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true)
double EcorrZoneBeforePS(double E, double eta)
double EcorrPS_ePSNil(double eEcal, double eta)
T eta() const
tuple result
Definition: query.py:137
double EcorrPS(double eEcal, double ePS1, double ePS2, double etaEcal)
#define constexpr
Definition: DDAxes.h:10
double PFEnergyCalibration::EcorrBarrel ( double  E,
double  eta,
double  phi,
bool  crackCorrection = true 
)
private

Definition at line 736 of file PFEnergyCalibration.cc.

References CorrBarrel(), CorrEta(), CorrPhi(), max(), and query::result.

Referenced by Ecorr().

737  {
738 
739  // double result = E*CorrBarrel(E,eta)*CorrEta(eta)*CorrPhi(phi,eta);
740  double correction = crackCorrection ? std::max(CorrEta(eta),CorrPhi(phi,eta)) : 1.;
741  double result = E * CorrBarrel(E,eta) * correction;
742 
743  return result;
744 }
double CorrEta(double eta)
T eta() const
double CorrPhi(double phi, double eta)
double CorrBarrel(double E, double eta)
const T & max(const T &a, const T &b)
tuple result
Definition: query.py:137
Definition: DDAxes.h:10
double PFEnergyCalibration::EcorrPS ( double  eEcal,
double  ePS1,
double  ePS2,
double  etaEcal 
)
private

Definition at line 775 of file PFEnergyCalibration.cc.

References Alpha(), Beta(), constexpr, alignCSCRings::e, Gamma(), p1, p2, p3, p4, and query::result.

Referenced by Ecorr().

775  {
776 
777  // gives the good weights to each subdetector
778  double E = Beta(1.0155*eEcal+0.025*(ePS1+0.5976*ePS2)/9e-5,etaEcal)*eEcal+Gamma(etaEcal)*(ePS1+Alpha(etaEcal)*ePS2)/9e-5 ;
779 
780  //Correction of the residual energy dependency
781  constexpr double p0 = 1.00;
782  constexpr double p1 = 2.18;
783  constexpr double p2 =1.94;
784  constexpr double p3 =4.13;
785  constexpr double p4 =1.127;
786 
787  double result = E*(p0+p1*TMath::Exp(-E/p2)-p3*TMath::Exp(-E/p4));
788 
789  return result;
790 }
double Beta(double E, double eta)
double Alpha(double eta)
double Gamma(double etaEcal)
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::EcorrPS ( double  eEcal,
double  ePS1,
double  ePS2,
double  etaEcal,
double &  outputPS1,
double &  outputPS2 
)
private

Definition at line 795 of file PFEnergyCalibration.cc.

References Alpha(), Beta(), constexpr, alignCSCRings::e, Gamma(), p1, p2, p3, p4, and query::result.

795  {
796 
797  // gives the good weights to each subdetector
798  double gammaprime=Gamma(etaEcal)/9e-5;
799  outputPS1=gammaprime*ePS1;
800  outputPS2=gammaprime*Alpha(etaEcal)*ePS2;
801  double E = Beta(1.0155*eEcal+0.025*(ePS1+0.5976*ePS2)/9e-5,etaEcal)*eEcal+outputPS1+outputPS2;
802 
803  //Correction of the residual energy dependency
804  constexpr double p0 = 1.00;
805  constexpr double p1 = 2.18;
806  constexpr double p2 =1.94;
807  constexpr double p3 =4.13;
808  constexpr double p4 =1.127;
809 
810  double corrfac=(p0+p1*TMath::Exp(-E/p2)-p3*TMath::Exp(-E/p4));
811  outputPS1*=corrfac;
812  outputPS2*=corrfac;
813  double result = E*corrfac;
814 
815  return result;
816 }
double Beta(double E, double eta)
double Alpha(double eta)
double Gamma(double etaEcal)
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::EcorrPS_ePSNil ( double  eEcal,
double  eta 
)
private

Definition at line 822 of file PFEnergyCalibration.cc.

References constexpr, p1, p2, p3, p4, and query::result.

Referenced by Ecorr().

822  {
823 
824  //Energy dependency
825  constexpr double p0= 1.02;
826  constexpr double p1= 0.165;
827  constexpr double p2= 6.5 ;
828  constexpr double p3= 2.1 ;
829 
830  //Eta dependency
831  constexpr double p4 = 1.02496e+00 ;
832  constexpr double p5 = -4.40176e-03 ;
833 
834  //so that <feta()> = 1
835  constexpr double norm = (p4+p5*(2.6+1.656)/2);
836 
837  double result = eEcal*(p0+p1*TMath::Exp(-TMath::Abs(eEcal-p3)/p2))*(p4+p5*eta)/norm;
838 
839  return result;
840 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::EcorrZoneAfterPS ( double  E,
double  eta 
)
private

Definition at line 845 of file PFEnergyCalibration.cc.

References constexpr, p1, p2, p3, p4, and query::result.

Referenced by Ecorr().

845  {
846 
847  //Energy dependency
848  constexpr double p0 =1;
849  constexpr double p1 = 0.058;
850  constexpr double p2 =12.5;
851  constexpr double p3 =-1.05444e+00;
852  constexpr double p4 =-5.39557e+00;
853  constexpr double p5 =8.38444e+00;
854  constexpr double p6 = 6.10998e-01 ;
855 
856  //Eta dependency
857  constexpr double p7 =1.06161e+00;
858  constexpr double p8 = 0.41;
859  constexpr double p9 =2.918;
860  constexpr double p10 =0.0181;
861  constexpr double p11= 2.05;
862  constexpr double p12 =2.99;
863  constexpr double p13=0.0287;
864 
865  //so that <feta()> = 1
866  constexpr double norm=1.045;
867 
868  double result = E*(p0+p1*TMath::Exp(-(E-p3)/p2)+1/(p4+p5*TMath::Power(E,p6)))*(p7+p8*TMath::Gaus(eta,p9,p10)+p11*TMath::Gaus(eta,p12,p13))/norm;
869  return result;
870 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::EcorrZoneBeforePS ( double  E,
double  eta 
)
private

Definition at line 749 of file PFEnergyCalibration.cc.

References constexpr, eta(), p1, p2, p3, p4, and query::result.

Referenced by Ecorr().

749  {
750 
751  //Energy dependency
752  constexpr double p0 =1;
753  constexpr double p1 =0.18;
754  constexpr double p2 =8.;
755 
756  //Eta dependency
757  constexpr double p3 =0.3;
758  constexpr double p4 =1.11;
759  constexpr double p5 =0.025;
760  constexpr double p6 =1.49;
761  constexpr double p7 =0.6;
762 
763  //so that <feta()> = 1
764  constexpr double norm = 1.21;
765 
766  double result = E*(p0+p1*TMath::Exp(-E/p2))*(p3+p4*TMath::Gaus(eta,p6,p5)+p7*eta)/norm;
767 
768  return result;
769 }
T eta() const
double p4[4]
Definition: TauolaWrapper.h:92
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
double p3[4]
Definition: TauolaWrapper.h:91
double PFEnergyCalibration::energyEm ( const reco::PFCluster clusterEcal,
std::vector< double > &  EclustersPS1,
std::vector< double > &  EclustersPS2,
bool  crackCorrection = true 
)

Definition at line 386 of file PFEnergyCalibration.cc.

Referenced by energyEm(), and ConvBremPFTrackFinder::runConvBremFinder().

389  {
390  double ePS1(std::accumulate(EclustersPS1.begin(), EclustersPS1.end(), 0.0));
391  double ePS2(std::accumulate(EclustersPS2.begin(), EclustersPS2.end(), 0.0));
392  return energyEm(clusterEcal, ePS1, ePS2, crackCorrection);
393 }
double energyEm(const reco::PFCluster &clusterEcal, std::vector< double > &EclustersPS1, std::vector< double > &EclustersPS2, bool crackCorrection=true)
double PFEnergyCalibration::energyEm ( const reco::PFCluster clusterEcal,
double  ePS1,
double  ePS2,
bool  crackCorrection = true 
)

Definition at line 396 of file PFEnergyCalibration.cc.

References reco::PFCluster::calculatePositionREP(), gather_cfg::cout, Ecorr(), reco::PFCluster::energy(), eta(), phi, and reco::PFCluster::positionREP().

399  {
400  double eEcal = clusterEcal.energy();
401  //temporaty ugly fix
402  reco::PFCluster myPFCluster=clusterEcal;
403  myPFCluster.calculatePositionREP();
404  double eta = myPFCluster.positionREP().eta();
405  double phi = myPFCluster.positionREP().phi();
406 
407  double calibrated = Ecorr(eEcal,ePS1,ePS2,eta,phi, crackCorrection);
408  if(eEcal!=0 && calibrated==0) std::cout<<"Eecal = "<<eEcal<<" eta = "<<eta<<" phi = "<<phi<<std::endl;
409  return calibrated;
410 }
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
T eta() const
void calculatePositionREP()
computes posrep_ once and for all
Definition: PFCluster.h:79
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Definition: PFCluster.h:76
double energy() const
cluster energy
Definition: PFCluster.h:73
double Ecorr(double eEcal, double ePS1, double ePS2, double eta, double phi, bool crackCorrection=true)
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
double PFEnergyCalibration::energyEm ( const reco::PFCluster clusterEcal,
std::vector< double > &  EclustersPS1,
std::vector< double > &  EclustersPS2,
double &  ps1,
double &  ps2,
bool  crackCorrection = true 
)

Definition at line 412 of file PFEnergyCalibration.cc.

References energyEm().

416  {
417  double ePS1(std::accumulate(EclustersPS1.begin(), EclustersPS1.end(), 0.0));
418  double ePS2(std::accumulate(EclustersPS2.begin(), EclustersPS2.end(), 0.0));
419  return energyEm(clusterEcal, ePS1, ePS2, ps1, ps2, crackCorrection);
420 }
double energyEm(const reco::PFCluster &clusterEcal, std::vector< double > &EclustersPS1, std::vector< double > &EclustersPS2, bool crackCorrection=true)
double PFEnergyCalibration::energyEm ( const reco::PFCluster clusterEcal,
double  ePS1,
double  ePS2,
double &  ps1,
double &  ps2,
bool  crackCorrection = true 
)

Definition at line 421 of file PFEnergyCalibration.cc.

References reco::PFCluster::calculatePositionREP(), gather_cfg::cout, Ecorr(), reco::PFCluster::energy(), eta(), phi, and reco::PFCluster::positionREP().

424  {
425  double eEcal = clusterEcal.energy();
426  //temporaty ugly fix
427  reco::PFCluster myPFCluster=clusterEcal;
428  myPFCluster.calculatePositionREP();
429  double eta = myPFCluster.positionREP().eta();
430  double phi = myPFCluster.positionREP().phi();
431 
432  double calibrated = Ecorr(eEcal,ePS1,ePS2,eta,phi,ps1,ps2,crackCorrection);
433  if(eEcal!=0 && calibrated==0) std::cout<<"Eecal = "<<eEcal<<" eta = "<<eta<<" phi = "<<phi<<std::endl;
434  return calibrated;
435 }
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
T eta() const
void calculatePositionREP()
computes posrep_ once and for all
Definition: PFCluster.h:79
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Definition: PFCluster.h:76
double energy() const
cluster energy
Definition: PFCluster.h:73
double Ecorr(double eEcal, double ePS1, double ePS2, double eta, double phi, bool crackCorrection=true)
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
void PFEnergyCalibration::energyEmHad ( double  t,
double &  e,
double &  h,
double  eta,
double  phi 
) const

Definition at line 108 of file PFEnergyCalibration.cc.

References a, aBarrel(), aEndcap(), aEtaBarrel(), aEtaEndcap(), b, bBarrel(), bEndcap(), bEtaBarrel(), bEtaEndcap(), cBarrel(), cEndcap(), alignCSCRings::e, h, max(), min, lumiQTWidget::t, GOODCOLL_filter_cfg::thresh, threshE, threshH, and groupFilesInBlocks::tt.

108  {
109 
110 
111  // Use calorimetric energy as true energy for neutral particles
112  double tt = t;
113  double ee = e;
114  double hh = h;
115  double a = 1.;
116  double b = 1.;
117  double etaCorrE = 1.;
118  double etaCorrH = 1.;
119  t = min(999.9,max(tt,e+h));
120  if ( t < 1. ) return;
121 
122  // Barrel calibration
123  if ( fabs(eta) < 1.48 ) {
124 
125  // The energy correction
126  a = e>0. ? aBarrel(t) : 1.;
127  b = e>0. ? bBarrel(t) : cBarrel(t);
128  double thresh = e > 0. ? threshE : threshH;
129 
130  // Protection against negative calibration - to be tuned
131  if ( a < -0.25 || b < -0.25 ) {
132  a = 1.;
133  b = 1.;
134  thresh = 0.;
135  }
136 
137  // The new estimate of the true energy
138  t = min(999.9,max(tt, thresh+a*e+b*h));
139 
140  // The angular correction for ECAL hadronic deposits
141  etaCorrE = 1. + aEtaBarrel(t) + bEtaBarrel(t)*fabs(eta)*fabs(eta);
142  etaCorrH = 1.;
143  // etaCorr = 1.;
144  t = max(tt, thresh+etaCorrE*a*e+etaCorrH*b*h);
145 
146  if ( e > 0. && thresh > 0. )
147  e = h > 0. ? threshE-threshH + etaCorrE * a * e : threshE + etaCorrE * a * e;
148  if ( h > 0. && thresh > 0. )
149  h = threshH + etaCorrH * b * h;
150 
151  /*
152  if ( e < 0. || h < 0. ) {
153  std::cout << "Warning : Energy correction ! " << std::endl
154  << "eta,tt,e,h,a,b = " << eta << " " << tt << " "
155  << ee << "/" << e << " " << hh << "/" << h << " " << a << " " << b << std::endl;
156  }
157 
158  if ( etaCorrE > 2. || etaCorrE < 0.5 ||
159  etaCorrH > 2. || etaCorrH < 0.5 )
160  std::cout << "Warning : Angular correction ! " << std::endl
161  << "etaCorrE,etaCorrH,eta,t = "
162  << etaCorrE << " " << etaCorrH << " " << eta << " " << t << std::endl;
163  */
164 
165  // Endcap calibration
166  } else {
167 
168  // The energy correction
169  a = e>0. ? aEndcap(t) : 1.;
170  b = e>0. ? bEndcap(t) : cEndcap(t);
171  double thresh = e > 0. ? threshE : threshH;
172 
173  if ( a < -0.25 || b < -0.25 ) {
174  a = 1.;
175  b = 1.;
176  thresh = 0.;
177  }
178 
179  // The new estimate of the true energy
180  t = min(999.9,max(tt, thresh+a*e+b*h));
181 
182  // The angular correction
183  double dEta = fabs ( fabs(eta) - 1.5 );
184  double etaPow = dEta * dEta * dEta * dEta;
185  //etaCorrE = 1. + aEtaEndcap(t) + 0.5*bEtaEndcap(t)*etaPow;
186  etaCorrE = 1. + aEtaEndcap(t) + bEtaEndcap(t)*etaPow;
187  etaCorrH = 1. + aEtaEndcap(t) + bEtaEndcap(t)*etaPow;
188  /*
189  if ( etaCorr > 2. || etaCorr < 0.5 )
190  std::cout << "Warning : Angular correction ! " << std::endl
191  << "etaCorr,eta,t = " << etaCorr << " " << eta << " " << tt
192  << " ee,hh,e,h = " << e << " " << h << " " << a*e << " " << b*h
193  << std::endl;
194  */
195 
196  t = min(999.9,max(tt, thresh + etaCorrE*a*e + etaCorrH*b*h));
197 
198  if ( e > 0. && thresh > 0. )
199  e = h > 0. ? threshE-threshH + etaCorrE * a * e : threshE + etaCorrE * a * e;
200  if ( h > 0. && thresh > 0. )
201  h = threshH + b * etaCorrH * h;
202 
203 
204  }
205 
206  // Protection
207  if ( e < 0. || h < 0. ) {
208  /*
209  std::cout << "Warning : Energy correction ! " << std::endl
210  << "eta,tt,e,h,a,b = " << eta << " " << tt << " "
211  << ee << "/" << e << " " << hh << "/" << h << " " << a << " " << b << std::endl;
212  */
213  // Some protection against crazy calibration
214  if ( e < 0. ) e = ee;
215  if ( h < 0. ) h = hh;
216  }
217 
218  // And that's it !
219 
220 
221 }
double bBarrel(double x) const
double aEndcap(double x) const
double bEndcap(double x) const
#define min(a, b)
Definition: mlp_lapack.h:161
T eta() const
const T & max(const T &a, const T &b)
double bEtaEndcap(double x) const
double cEndcap(double x) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
double b
Definition: hdecay.h:120
double aEtaBarrel(double x) const
double a
Definition: hdecay.h:121
double aEtaEndcap(double x) const
double bEtaBarrel(double x) const
double aBarrel(double x) const
double cBarrel(double x) const
double PFEnergyCalibration::Gamma ( double  etaEcal)
private

Definition at line 707 of file PFEnergyCalibration.cc.

References constexpr, p1, p2, and query::result.

Referenced by EcorrPS().

707  {
708 
709  //Energy dependency
710  constexpr double p0 = 2.49752e-02;
711 
712  //Eta dependency
713  constexpr double p1 = 6.48816e-02;
714  constexpr double p2 = -1.59517e-02;
715 
716  //so that <feta()> = 1
717  constexpr double norm = (p1+p2*(2.6+1.656)/2);
718 
719  double result = p0*(p1+p2*etaEcal)/norm;
720 
721  return result;
722 }
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
#define constexpr
void PFEnergyCalibration::initializeCalibrationFunctions ( )

Definition at line 34 of file PFEnergyCalibration.cc.

References faBarrel, faEndcap, faEtaBarrel, faEtaEndcap, fbBarrel, fbEndcap, fbEtaBarrel, fbEtaEndcap, fcBarrel, fcEndcap, threshE, and threshH.

Referenced by PFEnergyCalibration().

34  {
35 
36  // NEW NEW with HCAL pre-calibration
37 
38  threshE = 3.5;
39  threshH = 2.5;
40 
41  // Barrel (fit made with |eta| < 1.2)
42  faBarrel = new TF1("faBarrel","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
43  fbBarrel = new TF1("fbBarrel","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
44  fcBarrel = new TF1("fcBarrel","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
45  faEtaBarrel = new TF1("faEtaBarrel","[0]+[1]*exp(-x/[2])",1.,1000.);
46  fbEtaBarrel = new TF1("fbEtaBarrel","[0]+[1]*exp(-x/[2])+[3]*[3]*exp(-x*x/([4]*[4]))",1.,1000.);
47  faBarrel->SetParameter(0,1.15665);
48  fbBarrel->SetParameter(0,0.994603);
49  fcBarrel->SetParameter(0,0.956544);
50  faEtaBarrel->SetParameter(0,0.014664);
51  fbEtaBarrel->SetParameter(0,0.00975451);
52  faBarrel->SetParameter(1,0.165627);
53  fbBarrel->SetParameter(1,0.13632);
54  fcBarrel->SetParameter(1,0.0857207);
55  faEtaBarrel->SetParameter(1,-0.0426776);
56  fbEtaBarrel->SetParameter(1,0.102247);
57  faBarrel->SetParameter(2,0.827718);
58  fbBarrel->SetParameter(2,-0.758013);
59  fcBarrel->SetParameter(2,-0.44347);
60  faEtaBarrel->SetParameter(2,431.054);
61  fbEtaBarrel->SetParameter(2,436.21);
62  faBarrel->SetParameter(3,231.339);
63  fbBarrel->SetParameter(3,183.627);
64  fcBarrel->SetParameter(3,63.3479);
65  faBarrel->SetParameter(4,2.45332);
66  fbBarrel->SetParameter(4,1);
67  fcBarrel->SetParameter(4,1.24174);
68  faBarrel->SetParameter(5,29.6603);
69  fbBarrel->SetParameter(5,39.6784);
70  fcBarrel->SetParameter(5,12.322);
71 
72  // End-caps (fit made with eta
73  faEndcap = new TF1("faEndcap","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
74  fbEndcap = new TF1("fbEndcap","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
75  fcEndcap = new TF1("fcEndcap","[0]+([1]+[2]/sqrt(x))*exp(-x/[3])-[4]*exp(-x*x/[5])",1.,1000.);
76  faEtaEndcap = new TF1("faEtaEndcap","[0]+[1]*exp(-x/[2])",1.,1000.);
77  fbEtaEndcap = new TF1("fbEtaEndcap","[0]+[1]*exp(-x/[2])+[3]*[3]*exp(-x*x/([4]*[4]))",1.,1000.);
78  faEndcap->SetParameter(0,1.1272);
79  fbEndcap->SetParameter(0,0.982824);
80  fcEndcap->SetParameter(0,0.950244);
81  faEtaEndcap->SetParameter(0,-0.000582903);
82  fbEtaEndcap->SetParameter(0,0.0267319);
83  faEndcap->SetParameter(1,0.258536);
84  fbEndcap->SetParameter(1,0.0977533);
85  fcEndcap->SetParameter(1,0.00564779);
86  faEtaEndcap->SetParameter(1,-0.000482148);
87  fbEtaEndcap->SetParameter(1,-0.554552);
88  faEndcap->SetParameter(2,0.808071);
89  fbEndcap->SetParameter(2,0.155416);
90  fcEndcap->SetParameter(2,0.227162);
91  faEtaEndcap->SetParameter(2,209.466);
92  fbEtaEndcap->SetParameter(2,1.71188);
93  faEndcap->SetParameter(3,214.039);
94  fbEndcap->SetParameter(3,240.379);
95  fcEndcap->SetParameter(3,207.786);
96  fbEtaEndcap->SetParameter(3,0.235834);
97  faEndcap->SetParameter(4,2);
98  fbEndcap->SetParameter(4,1.2);
99  fcEndcap->SetParameter(4,1.32824);
100  fbEtaEndcap->SetParameter(4,-135.431);
101  faEndcap->SetParameter(5,47.2602);
102  fbEndcap->SetParameter(5,78.3083);
103  fcEndcap->SetParameter(5,22.1825);
104 
105 }
double PFEnergyCalibration::minimum ( double  a,
double  b 
)
private

Definition at line 518 of file PFEnergyCalibration.cc.

References a, and b.

Referenced by dCrackPhi().

518  {
519  if(TMath::Abs(b)<TMath::Abs(a)) a=b;
520  return a;
521 }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void PFEnergyCalibration::setCalibrationFunctions ( const PerformancePayloadFromTFormula thePFCal)
inline

Definition at line 73 of file PFEnergyCalibration.h.

References pfCalibrations.

73  {
74  pfCalibrations = thePFCal;
75  }
const PerformancePayloadFromTFormula * pfCalibrations

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFEnergyCalibration calib 
)
friend

Definition at line 438 of file PFEnergyCalibration.cc.

439  {
440 
441  if(!out ) return out;
442 
443  out<<"PFEnergyCalibration -- "<<endl;
444 
445  if ( calib.pfCalibrations ) {
446 
447  std::cout << "Functions taken from the global tags : " << std::endl;
448 
449  static std::map<std::string, PerformanceResult::ResultType> functType;
450 
451  functType["PFfa_BARREL"] = PerformanceResult::PFfa_BARREL;
452  functType["PFfa_ENDCAP"] = PerformanceResult::PFfa_ENDCAP;
453  functType["PFfb_BARREL"] = PerformanceResult::PFfb_BARREL;
454  functType["PFfb_ENDCAP"] = PerformanceResult::PFfb_ENDCAP;
455  functType["PFfc_BARREL"] = PerformanceResult::PFfc_BARREL;
456  functType["PFfc_ENDCAP"] = PerformanceResult::PFfc_ENDCAP;
457  functType["PFfaEta_BARREL"] = PerformanceResult::PFfaEta_BARREL;
458  functType["PFfaEta_ENDCAP"] = PerformanceResult::PFfaEta_ENDCAP;
459  functType["PFfbEta_BARREL"] = PerformanceResult::PFfbEta_BARREL;
460  functType["PFfbEta_ENDCAP"] = PerformanceResult::PFfbEta_ENDCAP;
461 
462  for(std::map<std::string,PerformanceResult::ResultType>::const_iterator
463  func = functType.begin();
464  func != functType.end();
465  ++func) {
466 
467  cout << "Function: " << func->first << endl;
468  PerformanceResult::ResultType fType = func->second;
469  calib.pfCalibrations->printFormula(fType);
470  }
471 
472  } else {
473 
474  std::cout << "Default calibration functions : " << std::endl;
475 
476  calib.faBarrel->Print();
477  calib.fbBarrel->Print();
478  calib.fcBarrel->Print();
479  calib.faEtaBarrel->Print();
480  calib.fbEtaBarrel->Print();
481  calib.faEndcap->Print();
482  calib.fbEndcap->Print();
483  calib.fcEndcap->Print();
484  calib.faEtaEndcap->Print();
485  calib.fbEtaEndcap->Print();
486  }
487 
488  return out;
489 }
const PerformancePayloadFromTFormula * pfCalibrations
tuple out
Definition: dbtoconf.py:99
tuple cout
Definition: gather_cfg.py:121
void printFormula(PerformanceResult::ResultType res) const

Member Data Documentation

TF1* PFEnergyCalibration::faBarrel
protected
TF1* PFEnergyCalibration::faEndcap
protected
TF1* PFEnergyCalibration::faEtaBarrel
protected
TF1* PFEnergyCalibration::faEtaEndcap
protected
TF1* PFEnergyCalibration::fbBarrel
protected
TF1* PFEnergyCalibration::fbEndcap
protected
TF1* PFEnergyCalibration::fbEtaBarrel
protected
TF1* PFEnergyCalibration::fbEtaEndcap
protected
TF1* PFEnergyCalibration::fcBarrel
protected
TF1* PFEnergyCalibration::fcEndcap
protected
const PerformancePayloadFromTFormula* PFEnergyCalibration::pfCalibrations
protected
double PFEnergyCalibration::threshE
private

Definition at line 131 of file PFEnergyCalibration.h.

Referenced by energyEmHad(), and initializeCalibrationFunctions().

double PFEnergyCalibration::threshH
private

Definition at line 131 of file PFEnergyCalibration.h.

Referenced by energyEmHad(), and initializeCalibrationFunctions().