FairRoot/PandaRoot
PndEmcClusterCalibrationPar.cxx
Go to the documentation of this file.
1 // PndEmcClusterCalibrationPar
3 //
4 // Container class for parametrization of EMC cluster energy correction
5 // class is inherited from FairParGenericSet
6 //
7 // Parametrization of EMC energy correction is a function of energy and polar angle and has different parameters in each of 4 regions:
8 // barrel, forward and backward endcap, shashlyk. Two different parameters set are used in barrel for energy below and above 1 GeV
9 // For the barrel , forward and backward endcap the following function is used with 10 parameters
10 // eout1=e* exp(factor1);
11 // factor1=
12 // p0
13 // +p1*log(e1)
14 // +p2*log(e1)*log(e1)
15 // +p3*log(e1)*log(e1)*log(e1)
16 // +p4*cos(theta1)
17 // +p5*cos(theta1)*cos(theta1)
18 // +p6*cos(theta1)*cos(theta1)*cos(theta1)
19 // +p7*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)
20 // +p8*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)
21 // +p9*log(e1)*cos(theta1);
22 // For shashlyk the following parametrization is used with 5 parameters:
23 // eout=(3.31694-0.0183379/sqrt(e1)+0.0327113/e1+0.00040156/(e1*e1)
24 // -0.00641305/(e1*sqrt(e1)))*e1;
25 //
26 // The index for parameter set within
27 // map<Int_t,std::vector<Double_t> > fClusterCalibrationPars
28 // are: 1 - barrel (below 1 GeV), 2 - barrel (above 1 GeV)
29 // 3 - forward endcap, 4 -backward endcap, 5 - shashlyk
31 
33 #include <iostream>
34 #include "assert.h"
35 
37 
39  std::vector<Double_t> parvec;
40  if (iParSet==5)
41  parvec.assign(pars,pars+5);
42  else
43  parvec.assign(pars,pars+10);
44 
45  fClusterCalibrationPars[iParSet]=parvec;
46 }
47 
49  pars[0]=fClusterCalibrationPars[iParSet][0];
50  pars[1]=fClusterCalibrationPars[iParSet][1];
51  pars[2]=fClusterCalibrationPars[iParSet][2];
52  pars[3]=fClusterCalibrationPars[iParSet][3];
53  pars[4]=fClusterCalibrationPars[iParSet][4];
54  if (iParSet!=5)
55  {
56  pars[5]=fClusterCalibrationPars[iParSet][5];
57  pars[6]=fClusterCalibrationPars[iParSet][6];
58  pars[7]=fClusterCalibrationPars[iParSet][7];
59  pars[8]=fClusterCalibrationPars[iParSet][8];
60  pars[9]=fClusterCalibrationPars[iParSet][9];
61  }
62 }
63 
64 
66 
68  const char* context)
69  : FairParGenericSet(name,title,context), fParObject(new PndEmcClusterCalibrationParObject())
70 {
71  fParObject = NULL;
72 }
73 
75 {
76  if (fParObject == NULL) return false;
77 
78  return true;
79 }
80 
82 
83  if(fParObject !=0){
84  fParObject->GetCalibrationPar(iParSet,pars);
85  } else {
86  std::cout<<"Wrong parameter set in PndEmcClusterCalibrationPar"<<std::endl;
87  abort();
88  }
89 
90 }
91 
92 void PndEmcClusterCalibrationPar::putParams(FairParamList* list)
93 {
94  if(!list) return;
95  list->addObject("PndEmcClusterCalibration",fParObject);
96 }
97 
99 {
100  if (!list) return kFALSE;
101  if(!list->fillObject("PndEmcClusterCalibration",fParObject)) return kFALSE;
102  return kTRUE;
103 }
void GetClusterCalibrationParameters(Int_t iParSet, Double_t *pars)
Bool_t getParams(FairParamList *list)
std::map< Int_t, std::vector< Double_t > > fClusterCalibrationPars
void GetCalibrationPar(Int_t iParSet, Double_t *pars)
Double_t
TString name
void SetCalibrationPar(Int_t iParSet, Double_t *pars)
ClassImp(PndAnaContFact)
PndEmcClusterCalibrationParObject * fParObject