BinFluctuationEM Class Reference

#include <BinFluctuationEM.h>

List of all members.

Public Member Functions

 BinFluctuationEM (Double_t inputEnergy=0)
 ~BinFluctuationEM ()
void ReInit (Double_t)
double CalcFluctuation (Double_t, Double_t)

Private Member Functions

void Init ()

Private Attributes

TF1 * fPol4a
TF1 * fPol4b
Double_t * fUppPars_a
Double_t * fLowPars_a
Double_t * fUppPars_b
Double_t * fLowPars_b
Double_t fUppEn
Double_t fLowEn
Double_t fInputEnergy

Detailed Description

Definition at line 7 of file BinFluctuationEM.h.


Constructor & Destructor Documentation

BinFluctuationEM::BinFluctuationEM ( Double_t  inputEnergy = 0  ) 

Definition at line 9 of file BinFluctuationEM.cxx.

References fInputEnergy, fLowEn, fLowPars_a, fLowPars_b, fPol4a, fPol4b, fUppEn, fUppPars_a, fUppPars_b, and Init().

00009                                                       {
00010 
00011   fPol4a = new TF1("Pol4a","pol4",0,20);
00012   fPol4b = new TF1("Pol4b","pol4",0,20);
00013   fUppPars_a = new double[5];
00014   fLowPars_a = new double[5];
00015   fUppPars_b = new double[5];
00016   fLowPars_b = new double[5];
00017   fUppEn = 0;
00018   fLowEn = 0;
00019   fInputEnergy = inputEnergy;
00020 
00021   if(fInputEnergy>0) Init();
00022 
00023 }

BinFluctuationEM::~BinFluctuationEM (  ) 

Definition at line 25 of file BinFluctuationEM.cxx.

References fLowPars_a, fLowPars_b, fPol4a, fPol4b, fUppPars_a, and fUppPars_b.

00025                                    {
00026   delete fPol4a;
00027   delete fPol4b;
00028   delete [] fUppPars_a;
00029   delete [] fLowPars_a;
00030   delete [] fUppPars_b;
00031   delete [] fLowPars_b;
00032 }


Member Function Documentation

Double_t BinFluctuationEM::CalcFluctuation ( Double_t  t,
Double_t  r 
)

Definition at line 109 of file BinFluctuationEM.cxx.

References fInputEnergy, fLowEn, fLowPars_a, fLowPars_b, fPol4a, fPol4b, fUppEn, fUppPars_a, and fUppPars_b.

Referenced by RTCalc(), and StpFluctuaionAng().

00109                                                                 {
00110   
00111   for(int i=0;i<5;i++){
00112     fPol4a->SetParameter(i,fLowPars_a[i]);
00113     fPol4b->SetParameter(i,fLowPars_b[i]);
00114   }
00115   double p0_low = fPol4a->Eval(t);
00116   double p2_low = fPol4b->Eval(t);
00117   double fracErr_low = p0_low + r*r*p2_low;  
00118 
00119   if(fUppEn==fLowEn) return fracErr_low;
00120   
00121   for(int i=0;i<5;i++){
00122     fPol4a->SetParameter(i,fUppPars_a[i]);
00123     fPol4b->SetParameter(i,fUppPars_b[i]);
00124   }
00125   double p0_upp = fPol4a->Eval(t);
00126   double p2_upp = fPol4b->Eval(t);
00127   double fracErr_upp = p0_upp + r*r*p2_upp;
00128   
00129   double fracErr = fracErr_low
00130     + (fInputEnergy - fLowEn)*(fracErr_upp-fracErr_low)/(fUppEn-fLowEn);
00131   
00132   return fracErr;
00133 
00134 }

void BinFluctuationEM::Init ( void   )  [private]

Definition at line 46 of file BinFluctuationEM.cxx.

References MuELoss::a, fInputEnergy, fLowEn, fLowPars_a, fLowPars_b, fUppEn, fUppPars_a, fUppPars_b, and max.

Referenced by BinFluctuationEM(), and ReInit().

00046                            {
00047   
00049   int max = 9;
00050   double EnergyArray[9] = {1.0,2.0,4.0,5.0,6.0,7.0,8.0,10.0,15.0};
00051   
00052   double a[9][5] = {{1.815,-0.8182,0.259,-0.02858,0.001549},     //1GeV
00053                     {1.971,-1.047,0.2918,-0.03065,0.001351},     //2GeV
00054                     {1.736,-0.8027,0.1856,-0.01704,0.0007054},   //4 GeV
00055                     {1.775,-0.8145,0.182,-0.01619,0.0006334},    //5GeV
00056                     {1.82,-0.8121,0.1768,-0.01586,0.0006187},    //6GeV
00057                     {1.642,-0.7629,0.1722,-0.01585,0.0006154},   //7 GeV
00058                     {1.888,-0.889,0.1883,-0.01597,0.0005586},    //8GeV
00059                     {1.889,-0.9553,0.2084,-0.01823,0.0006304},   //10GeV
00060                     {1.808,-0.8572,0.1682,-0.01332,0.0004303}};  //15GeV
00061   
00062   double b[9][5] = {{1.276,-0.5111,0.1116,-0.01024,0.0003537},   //1GeV
00063                     {1.112,-0.4453,0.08835,-0.007366,0.0002318}, //2GeV
00064                     {0.8736,-0.3052,0.04869,-0.003169,8.005e-5}, //4 GeV  
00065                     {0.8617,-0.3493,0.06396,-0.004886,0.0001392},//5GeV
00066                     {0.7246,-0.2662,0.04372,-0.002875,6.989e-5}, //6GeV
00067                     {0.824,-0.3194,0.05317,-0.003619,9.042e-5},  //7 GeV
00068                     {0.6148,-0.1982,0.02825,-0.001624,3.785e-5}, //8GeV
00069                     {0.6669,-0.2314,0.03431,-0.002067,4.71e-5},  //10GeV
00070                     {0.5692,-0.2021,0.03125,-0.002036,5.037e-5}}; //15GeV
00072   
00073   
00074   //choose Pol4's  
00075   int LowVal = -1;
00076   for(int i=0;i<max;i++){
00077     if(fInputEnergy>EnergyArray[i]) LowVal = i;
00078     else break;
00079   }
00080   
00081   for(int i=0;i<5;i++){
00082     if(LowVal == -1) {
00083       fLowPars_a[i] = a[0][i];
00084       fUppPars_a[i] = a[0][i];
00085       fLowPars_b[i] = b[0][i];
00086       fUppPars_b[i] = b[0][i];
00087       fLowEn = EnergyArray[0];
00088       fUppEn = EnergyArray[0];
00089     }
00090     else if(LowVal == max-1) {
00091       fLowPars_a[i] = a[LowVal][i];
00092       fUppPars_a[i] = a[LowVal][i];
00093       fLowPars_b[i] = b[LowVal][i];
00094       fUppPars_b[i] = b[LowVal][i];
00095       fLowEn = EnergyArray[LowVal];
00096       fUppEn = EnergyArray[LowVal];
00097     }
00098     else {
00099       fLowPars_a[i] = a[LowVal][i];
00100       fUppPars_a[i] = a[LowVal+1][i];
00101       fLowPars_b[i] = b[LowVal][i];
00102       fUppPars_b[i] = b[LowVal+1][i];
00103       fLowEn = EnergyArray[LowVal];
00104       fUppEn = EnergyArray[LowVal+1];
00105     }
00106   }
00107 }

void BinFluctuationEM::ReInit ( Double_t  inputEnergy  ) 

Definition at line 34 of file BinFluctuationEM.cxx.

References fInputEnergy, Init(), Msg::kWarning, and MSG.

00034                                                  {
00035   
00036   if(inputEnergy>0){
00037     fInputEnergy = inputEnergy;
00038     Init();
00039   }
00040   else MSG("FitShowerEM",Msg::kWarning)
00041     <<"Trying to ReInit with energy <=0 ... Sticking with previous energy "
00042     << fInputEnergy << endl;
00043   
00044 }


Member Data Documentation

Double_t BinFluctuationEM::fInputEnergy [private]

Definition at line 27 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), Init(), and ReInit().

Double_t BinFluctuationEM::fLowEn [private]

Definition at line 25 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), and Init().

Double_t* BinFluctuationEM::fLowPars_a [private]

Definition at line 21 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), Init(), and ~BinFluctuationEM().

Double_t* BinFluctuationEM::fLowPars_b [private]

Definition at line 23 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), Init(), and ~BinFluctuationEM().

TF1* BinFluctuationEM::fPol4a [private]

Definition at line 18 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), and ~BinFluctuationEM().

TF1* BinFluctuationEM::fPol4b [private]

Definition at line 19 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), and ~BinFluctuationEM().

Double_t BinFluctuationEM::fUppEn [private]

Definition at line 24 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), and Init().

Double_t* BinFluctuationEM::fUppPars_a [private]

Definition at line 20 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), Init(), and ~BinFluctuationEM().

Double_t* BinFluctuationEM::fUppPars_b [private]

Definition at line 22 of file BinFluctuationEM.h.

Referenced by BinFluctuationEM(), CalcFluctuation(), Init(), and ~BinFluctuationEM().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1