Difference between revisions of "HRRL Pos Test 27Jul2012 Data Ana 3 MeV"

From New IAC Wiki
Jump to navigation Jump to search
Line 10: Line 10:
 
         Long64_t ne;
 
         Long64_t ne;
 
         printf("%d \n", ne);
 
         printf("%d \n", ne);
//method 1 is reprate times single pulse charge
+
      //method 1 is reprate times single pulse charge
 
 
 
 
 
         Double_t Qp1=0,Qp2=0;
 
         Double_t Qp1=0,Qp2=0;
 
         if(calc_meth == 1){
 
         if(calc_meth == 1){
//ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1");  
+
        //ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1");  
ntuple->Draw("ADC9>>f9");  
+
        ntuple->Draw("ADC9>>f9");  
//Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2.
+
        //Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2.
//f9->Fit("gaus");
+
        //f9->Fit("gaus");
ADC9_fit_mean = f9->GetMean(1);  
+
        ADC9_fit_mean = f9->GetMean(1);  
//ADC9_fit_mean = ADC9->GetMean(1);  
+
        //ADC9_fit_mean = ADC9->GetMean(1);  
printf("ADC9_fit_mean = %d \n",ADC9_fit_mean);
+
        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.
+
        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("QP1=%g\n\n",Qp1);
 
         printf("e- charge per pulse with method 1: %g\n",Qp1);
 
         printf("e- charge per pulse with method 1: %g\n",Qp1);
//printf("Reprate: %d\n",Reprate);
+
        //printf("Reprate: %d\n",Reprate);
Qs=Reprate*Qp1; //Qs: Charge per second.
+
        Qs=Reprate*Qp1; //Qs: Charge per second.
//printf("e- charge per second: %g\n",Qs);
+
        //printf("e- charge per second: %g\n",Qs);
ne=Qs/Q_e; //Ne: number of electrons per second.
+
        ne=Qs/Q_e; //Ne: number of electrons per second.
}
+
                }
 
 
 
 
if(calc_meth == 2){  
+
        if(calc_meth == 2){  
//ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1");  
+
        //ntuple->Draw("ADC9*(1.22*1e-9)/50>>f9","1");  
ntuple->Draw("ADC9>>f9");  
+
        ntuple->Draw("ADC9>>f9");  
printf("%bin# Bin Content%d\n");
+
        printf("%bin# Bin Content%d\n");
for(i=1; i<=4000; i++){
+
        for(i=1; i<=4000; i++){
//for(i=0; i<=600; i++){
+
        //for(i=0; i<=600; i++){
bin_content[i] = f9->GetBinContent(i);
+
        bin_content[i] = f9->GetBinContent(i);
//Qp2+=(i*(1.22*1e-9)/50)*bin_content[i];
+
        //Qp2+=(i*(1.22*1e-9)/50)*bin_content[i];
Qp2+=i*bin_content[i]*(1.22*1e-9)/50;
+
        Qp2+=i*bin_content[i]*(1.22*1e-9)/50;
//printf("%d  %d  %g \n",i,bin_content[i],Qp2);
+
        //printf("%d  %d  %g \n",i,bin_content[i],Qp2);
}
+
        }
 
 
 
 
//printf("Integral = %d \n",f9->Integral());
+
        //printf("Integral = %d \n",f9->Integral());
//Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2.     
+
        //Qp2 = (f9->Integral())*(1.22*1e-9)/50; //charge calculate with method 2.     
printf("QP2=%g\n\n",Qp2);
+
        printf("QP2=%g\n\n",Qp2);
printf("total e- charge in this run with method 2: %g\n",Qp2);
+
        printf("total e- charge in this run with method 2: %g\n",Qp2);
 
//printf("Reprate: %d\n",Reprate);
 
//printf("Reprate: %d\n",Reprate);
 
Qs=Qp2; //Qs: Charge per second.
 
Qs=Qp2; //Qs: Charge per second.

Revision as of 04:04, 24 August 2012

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); }




runs NaI left NaI right
run in run out NaI Left NaI Right NaI Left around 511 keV NaI Right around 511 keV e- rate (Hz) e+ rate (Hz) e+/e+ ratop
3735 3736 Hrrl pos 27jul2012 data ana with Cuts r3735 sub r3736 DL.png 1.30499e+013 0.282966 2.16833e-014 Hrrl pos 27jul2012 data ana with Cuts r3735 sub r3736 DR.png 1.30499e+013 0.282966 2.16833e-014 100 px 1.30499e+013 0.282966 2.16833e-014 100 px 1.30499e+013 0.282966 2.16833e-014
3737 3736 Hrrl pos 27jul2012 data ana with Cuts r3737 sub r3736 DL.png 1.38182e+013 0.284036 2.05553e-014 Hrrl pos 27jul2012 data ana with Cuts r3737 sub r3736 DR.png 1.38182e+013 0.284036 2.05553e-014 100 px 1.38182e+013 0.284036 2.05553e-014 100 px 1.38182e+013 0.284036 2.05553e-014