FairRoot/PandaRoot
Functions | Variables
dedx_bands.C File Reference

Go to the source code of this file.

Functions

 if (limit!=flimit)
 
TFile infile ("dedx_out.root","READ")
 
 switch (ifile)
 
c cd ()
 
h Draw ()
 
c2 Divide (cx, cy)
 
 for (int i=0;i< nsteps;i++)
 
graphs Divide (2, 1)
 
fsum SetParameters (parcomp)
 
fsum Draw ("SAME")
 
cout<< "ifile "<< ifile<< endl;cout
<< " momentum sampled over "
<< nsteps<< " with step width "
<< 1.5/nsteps<< endl;cout
<< endl;cout<< "MEAN DEDX
PARAMETRIZATION"<< endl;cout
<< "mom limits "<< mean_inf
<< " "<< mean_sup<< endl;cout
<< "mu: ";for(int param=0;param
< npardedx;param++) cout
<< fdedx-> 
GetParameter (param)<< "
 

Variables

double mean_inf = 0.39
 
double mean_sup = 1.23
 
double sigma_inf = 0.39
 
double sigma_sup = 1.23
 
Double_t yup = 30.
 
double nsteps = 50
 
int cx = 5
 
int cy = 10
 
double limit = 100/nsteps
 
double flimit = floor(100/nsteps)
 
TString fundedx = "[0] * (1./x)**2 + [1] * TMath::Log(x) + [2]"
 
int npardedx = 3
 
TString funsig = "[0] * (1./x)**2 + [1] * TMath::Log(x) + [2]"
 
TString funsig_forsum = "([3] * (1./x)**2 + [4] * TMath::Log(x) + [5])"
 
int nparsig = 3
 
int npartot = npardedx + nparsig
 
TCanvas * c = new TCanvas("c", "dedx_p")
 
TH2F * h
 
TH1D * htemp [nsteps]
 
TF1 * fgaus [nsteps]
 
Double_t x [nsteps]
 
Double_t mean [nsteps]
 
Double_t sigma [nsteps]
 
Double_t meanerr [nsteps]
 
Double_t sigmaerr [nsteps]
 
TCanvas * c2 = new TCanvas("c2", "slices")
 
TCanvas * graphs = new TCanvas("graphs", "graphs")
 
Double_t masses [5] = {0.000510999, 0.1056584, 0.139570, 0.49368, 0.9382723 }
 
Double_t xerr [nsteps]
 
TString funsum = fundedx + " + " + funsig_forsum
 
TF1 * fsum = new TF1("fsum", funsum, 0., 1.5)
 
TString fundiff = fundedx + " - " + funsig_forsum
 
TF1 * fdiff = new TF1("fdiff", fundiff, 0., 1.5)
 

Function Documentation

c cd ( )
c2 Divide ( cx  ,
cy   
)
graphs Divide ( ,
 
)
h Draw ( )

Definition at line 64 of file NHitsPerEvent.C.

64  {
65 
66  std::cout << "mvdHitArray: " << mvdHitArray->GetEntries() << " projectedHitArray " << mvdProjectedArray->GetEntries() << std::endl;
67 
68 // gHitPoints->Clear();
71  //if (gHitPoints->GetN() != x.size()) gHitPoints->Expand(x.size());
72 
73  std::cout << "NHits: " << gHitPoints->GetN() << std::endl;
74  gHitPoints->Draw("apl");
75  gProjections->Draw("pl");
76 }
void ExtractData(TClonesArray *array, TGraph *g)
Definition: NHitsPerEvent.C:78
TGraph * gHitPoints
Definition: NHitsPerEvent.C:15
TClonesArray * mvdHitArray
Definition: NHitsPerEvent.C:12
TClonesArray * mvdProjectedArray
Definition: NHitsPerEvent.C:13
TGraph * gProjections
Definition: NHitsPerEvent.C:16
fsum Draw ( "SAME"  )
for ( )

Definition at line 71 of file dedx_bands.C.

References i, name, nsteps, and TString.

71  {
72  double stepsize = 1.5/nsteps;
73  x[i] = (i + 0.5) * stepsize;
74 
75  TString name = "htemp"; name += i;
76  TString title = "";
77  TString fname = name;
78  TString fgname = name;
79  switch(ifile) {
80  case 0: fname.Prepend("e_"); fgname.Prepend("fe_"); break;
81  case 1: fname.Prepend("mu_"); fgname.Prepend("fmu_"); break;
82  case 2: fname.Prepend("pi_"); fgname.Prepend("fpi_"); break;
83  case 3: fname.Prepend("k_"); fgname.Prepend("fk_"); break;
84  case 4: fname.Prepend("p_"); fgname.Prepend("fp_");
85  }
86  title = fname; title += "("; title += (x[i] - 0.5 * stepsize); title += ", "; title += (x[i] + 0.5 * stepsize); title += ") GeV"; title += ((i + 1) * limit - 1);
87 
88  htemp[i] = new TH1D(fname, title, 100, 0, yup);
89  h->ProjectionY(fname, limit * i, (i + 1) * limit - 1,"o");
90  c2->cd(i + 1);
91  htemp[i].Draw();
92 
93 
94  double tmpmu = htemp[i]->GetMean() ;
95  double tmpsig = htemp[i]->GetRMS();
96  double gaus_inf = tmpmu - 3 * tmpsig;
97  double gaus_sup = tmpmu + 3 * tmpsig;
98 
99  fgaus[i] = new TF1("fgname", "gaus(0)", gaus_inf, gaus_sup);
100  fgaus[i]->SetParameters(1, tmpmu, tmpsig);
101  htemp[i]->Fit("fgname", "R");
102  mean[i] = fgaus[i]->GetParameter(1);
103  sigma[i] = fgaus[i]->GetParameter(2);
104  meanerr[i] = fgaus[i]->GetParError(1);
105  sigmaerr[i] = fgaus[i]->GetParError(2);
106 }
TH2F * h
Definition: dedx_bands.C:48
Int_t i
Definition: run_full.C:25
Double_t sigma[nsteps]
Definition: dedx_bands.C:65
double nsteps
Definition: dedx_bands.C:15
TCanvas * c2
Definition: dedx_bands.C:68
Double_t meanerr[nsteps]
Definition: dedx_bands.C:65
Double_t x[nsteps]
Definition: dedx_bands.C:63
TString name
Double_t sigmaerr[nsteps]
Definition: dedx_bands.C:65
Double_t yup
Definition: dedx_bands.C:12
Double_t mean[nsteps]
Definition: dedx_bands.C:65
double limit
Definition: dedx_bands.C:18
TF1 * fgaus[nsteps]
Definition: dedx_bands.C:62
TH1D * htemp[nsteps]
Definition: dedx_bands.C:61
cout<< "ifile " << ifile << endl; cout << " momentum sampled over " << nsteps << " with step width " << 1.5/nsteps << endl; cout << endl; cout << "MEAN DEDX PARAMETRIZATION" << endl; cout << "mom limits " << mean_inf << " " << mean_sup << endl; cout << "mu: "; for(int param = 0; param < npardedx; param++) cout << fdedx-> GetParameter ( param  )
if ( limit!  = flimit)

Definition at line 20 of file dedx_bands.C.

References flimit.

20  {
21  nsteps = 100/flimit;
22  limit = flimit;
23  cout << "changing nsteps to " << nsteps << endl;
24  }
double nsteps
Definition: dedx_bands.C:15
double flimit
Definition: dedx_bands.C:19
double limit
Definition: dedx_bands.C:18
TFile infile ( "dedx_out.root"  ,
"READ"   
)
fdiff SetParameters ( parcomp  )
switch ( ifile  )

Definition at line 49 of file dedx_bands.C.

References infile().

49  {
50  case 0: h = (TH2F*) infile.Get("hdedx_p_e"); break;
51  case 1: h = (TH2F*) infile.Get("hdedx_p_mu"); break;
52  case 2: h = (TH2F*) infile.Get("hdedx_p_pi"); break;
53  case 3: h = (TH2F*) infile.Get("hdedx_p_k"); break;
54  case 4: h = (TH2F*) infile.Get("hdedx_p_p");
55  }
TH2F * h
Definition: dedx_bands.C:48
TFile infile("dedx_out.root","READ")

Variable Documentation

TCanvas* c = new TCanvas("c", "dedx_p")

Definition at line 44 of file dedx_bands.C.

TCanvas* c2 = new TCanvas("c2", "slices")

Definition at line 68 of file dedx_bands.C.

int cx = 5
int cy = 10
TF1* fdiff = new TF1("fdiff", fundiff, 0., 1.5)

Definition at line 152 of file dedx_bands.C.

TF1* fgaus[nsteps]

Definition at line 62 of file dedx_bands.C.

Referenced by QAmacro_stt_4().

double flimit = floor(100/nsteps)

Definition at line 19 of file dedx_bands.C.

Referenced by if().

TF1* fsum = new TF1("fsum", funsum, 0., 1.5)

Definition at line 149 of file dedx_bands.C.

TString fundedx = "[0] * (1./x)**2 + [1] * TMath::Log(x) + [2]"

Definition at line 26 of file dedx_bands.C.

TString fundiff = fundedx + " - " + funsig_forsum

Definition at line 151 of file dedx_bands.C.

TString funsig = "[0] * (1./x)**2 + [1] * TMath::Log(x) + [2]"

Definition at line 36 of file dedx_bands.C.

TString funsig_forsum = "([3] * (1./x)**2 + [4] * TMath::Log(x) + [5])"

Definition at line 37 of file dedx_bands.C.

TString funsum = fundedx + " + " + funsig_forsum

Definition at line 148 of file dedx_bands.C.

TCanvas* graphs = new TCanvas("graphs", "graphs")

Definition at line 109 of file dedx_bands.C.

Referenced by comp_multiFiles().

TH2F* h

Definition at line 48 of file dedx_bands.C.

TH1D* htemp[nsteps]

Definition at line 61 of file dedx_bands.C.

Referenced by drawMvdHistos(), and findLimits().

double limit = 100/nsteps
Double_t masses[5] = {0.000510999, 0.1056584, 0.139570, 0.49368, 0.9382723 }

Definition at line 112 of file dedx_bands.C.

Referenced by convolutionAnalysis(), and fittest().

double mean_inf = 0.39

Definition at line 6 of file dedx_bands.C.

double mean_sup = 1.23

Definition at line 7 of file dedx_bands.C.

Double_t meanerr[nsteps]

Definition at line 65 of file dedx_bands.C.

int npardedx = 3

Definition at line 30 of file dedx_bands.C.

int nparsig = 3

Definition at line 38 of file dedx_bands.C.

int npartot = npardedx + nparsig

Definition at line 41 of file dedx_bands.C.

double nsteps = 50
Double_t sigma[nsteps]
double sigma_inf = 0.39

Definition at line 8 of file dedx_bands.C.

double sigma_sup = 1.23

Definition at line 9 of file dedx_bands.C.

Double_t sigmaerr[nsteps]

Definition at line 65 of file dedx_bands.C.

Definition at line 63 of file dedx_bands.C.

Definition at line 114 of file dedx_bands.C.

Referenced by PndLmdStripClusterTask::AddMSErr().

Double_t yup = 30.

Definition at line 12 of file dedx_bands.C.