HRRL Pos Test 27Jul2012 Data Ana 3 MeV
Revision as of 08:48, 24 August 2012 by Setisadi (talk | contribs) (→results on 3 MeV with Method 1)
3 MeV
2 ways to calculate electron charge
NE(Int_t ri, Int_t Reprate, Int_t calc_meth){ printf("%d %d \n",ri, Reprate); if(ri==1) TFile *f = new TFile("C:/Users/sadiq/Documents/phd/Runs_Jul_2012/rootfiles/7-27-12/r3735.root"); else if(ri==2) TFile *f = new TFile("C:/Users/sadiq/Documents/phd/Runs_Jul_2012/rootfiles/7-27-12/r3737.root"); TTree *ntuple = (TTree*)f->Get("ntuple"); TH1F *f9=new TH1F("f9","ADC9",4000,0,4000); TCanvas * c2 = new TCanvas("c2", "c2",600 ,500); c2->cd(); Long64_t ne; printf("%d \n", ne); //method 1 is reprate times single pulse charge
Double_t Qp1=0,Qp2=0; if(calc_meth == 1){ //ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1"); ntuple->Draw("ADC9>>f9"); //Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2. //f9->Fit("gaus"); ADC9_fit_mean = f9->GetMean(1); //ADC9_fit_mean = ADC9->GetMean(1); printf("ADC9_fit_mean = %d \n",ADC9_fit_mean); Qp1 = ADC9_fit_mean*(1.22*1e-9)/50; //Qp: charge per pulse. The calibration: 1.22 (9nV s)/(ADC channel), 50 ohm Terminal. printf("QP1=%g\n\n",Qp1); printf("e- charge per pulse with method 1: %g\n",Qp1); //printf("Reprate: %d\n",Reprate); Qs=Reprate*Qp1; //Qs: Charge per second. //printf("e- charge per second: %g\n",Qs); ne=Qs/Q_e; //Ne: number of electrons per second. }
if(calc_meth == 2){ //ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1"); ntuple->Draw("ADC9>>f9"); printf("%bin# Bin Content%d\n"); for(i=1; i<=4000; i++){ //for(i=0; i<=600; i++){ bin_content[i] = f9->GetBinContent(i); //Qp2+=(i*(1.22*1e-9)/50)*bin_content[i]; Qp2+=i*bin_content[i]*(1.22*1e-9)/50; //printf("%d %d %g \n",i,bin_content[i],Qp2); }
//printf("Integral = %d \n",f9->Integral()); //Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2. printf("QP2=%g\n\n",Qp2); printf("total e- charge in this run with method 2: %g\n",Qp2); //printf("Reprate: %d\n",Reprate); Qs=Qp2; //Qs: Charge per second. printf("e- charge per second: %g\n",Qs); printf("e- charge: %g\n",Q_e); ne=Qs/Q_e; //Ne: number of electrons per second. printf("1. total number of electrons in this run: %g\n",ne); } printf("2. total number of electrons in this run: %g\n",ne); c2->Close(); f->Close(); return(ne); }
results on 3 MeV with Method 1
results on 3 MeV with Method 2
3735 | 3736 | 1.18161e+015 | 0.25656 | 2.16258e-013 | ||
3737 | 3736 | 2.16202e+015 | 0.251457 | 1.27239e-013 |