diff --git a/CALIBRATION/shms_hgcer_calib/calibration.C b/CALIBRATION/shms_hgcer_calib/calibration.C index 311380969f2cf67c5168444069b1ab6a6529cb8a..b91134229d28bc9c9354484552cd97e4aa07f46f 100644 --- a/CALIBRATION/shms_hgcer_calib/calibration.C +++ b/CALIBRATION/shms_hgcer_calib/calibration.C @@ -106,8 +106,8 @@ void calibration::SlaveBegin(TTree * /*tree*/) if (!fNGC) //Set up histograms for HGC { - ADC_min = 0; - ADC_max = 7000; + ADC_min = -4000; + ADC_max = 12000; bins = abs(ADC_min) + abs(ADC_max); } @@ -128,11 +128,11 @@ void calibration::SlaveBegin(TTree * /*tree*/) } } - fCut_everything = new TH2F("Cut_everything", "Visualization of no cuts; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 1000, 0, 4.0, 1000, 0, 4.0); + fCut_everything = new TH2F("Cut_everything", "Visualization of no cuts; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 200, 0, 1.0, 200, 0, 1.0); GetOutputList()->Add(fCut_everything); - fCut_electron = new TH2F("Cut_electron", "Visualization of electron cut; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 1000, 0, 4.0, 1000, 0, 4.0); + fCut_electron = new TH2F("Cut_electron", "Visualization of electron cut; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 200, 0, 1.0, 200, 0, 1.0); GetOutputList()->Add(fCut_electron); - fCut_pion = new TH2F("Cut_pion", "Visualization of pion cut; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 1000, 0, 4.0, 1000, 0, 4.0); + fCut_pion = new TH2F("Cut_pion", "Visualization of pion cut; Calorimeter Energy (GeV); Pre-Shower Energy (GeV)", 200, 0, 1.0, 200, 0, 1.0); GetOutputList()->Add(fCut_pion); printf("\n\n"); @@ -396,7 +396,7 @@ Bool_t calibration::Process(Long64_t entry) Float_t p = ((P_gtr_dp/100.0)*central_p) + central_p; //Fill histogram visualizaing the electron selection - fCut_everything->Fill(P_cal_fly_earray, P_cal_pr_eplane); + fCut_everything->Fill(P_cal_fly_earray/p, P_cal_pr_eplane/p); //Cut on Shower vs preshower is a tilted ellipse, this requires an angle of rotation (in radians), x/y center, semimajor and semiminor axis Float_t piangle = 0.0; @@ -408,7 +408,7 @@ Bool_t calibration::Process(Long64_t entry) pow((P_cal_fly_earray/p - pix_center)*sin(piangle) - (P_cal_pr_eplane/p - piy_center)*cos(piangle),2)/pow(pisemiminor_axis,2) < 1) { //Fill histogram visualizing the electron selection - fCut_pion->Fill(P_cal_fly_earray, P_cal_pr_eplane); + fCut_pion->Fill(P_cal_fly_earray/p, P_cal_pr_eplane/p); //Fill histogram of the full PulseInt spectra for each PMT fNGC ? fPulseInt[ipmt]->Fill(P_ngcer_goodAdcPulseInt[ipmt]) : fPulseInt[ipmt]->Fill(P_hgcer_goodAdcPulseInt[ipmt]); @@ -472,9 +472,9 @@ void calibration::Terminate() { for (Int_t iquad=0; iquad<4; iquad++) { - fNGC ? PulseInt_quad[iquad][ipmt]->Rebin(25) : PulseInt_quad[iquad][ipmt]->Rebin(25); + fNGC ? PulseInt_quad[iquad][ipmt]->Rebin(20) : PulseInt_quad[iquad][ipmt]->Rebin(20); } - fNGC ? PulseInt[ipmt]->Rebin(25) : PulseInt[ipmt]->Rebin(25); + fNGC ? PulseInt[ipmt]->Rebin(20) : PulseInt[ipmt]->Rebin(20); } @@ -489,57 +489,8 @@ void calibration::Terminate() fPions ? fCut_pion->Draw("Colz") : fCut_electron->Draw("Colz"); } - //Single Gaussian to find mean/std. dev. of peaks - TF1 *Gauss1 = new TF1("Gauss1",gauss,-500,7000,3); - Gauss1->SetParNames("Amplitude","Mean","Std. Dev."); - - //Quantities to keep track of - - Float_t scale = 0.0; //average amplitude of SPE signals (channels ADC) - Float_t sigma = 0.0; //standard dev. of the pedistal fir (channels ADC) - gStyle->SetOptFit(111); - Int_t passes = 0; //Used to tell # of entries is scale - //Main loop for calibration - for (Int_t ipmt=0; ipmt < (fNGC ? fngc_pmts : fhgc_pmts); ipmt++) - { - //TSpectrum class is used to find the SPE peak using the search method - TSpectrum *s = new TSpectrum(2); - - //Create Canvas to see the search result for the SPE - quad_cuts_ipmt = new TCanvas(Form("quad_cuts_%d",ipmt), Form("First Photoelectron peaks PMT%d",ipmt+1)); - quad_cuts_ipmt->Divide(2,2); - - for (Int_t iquad=0; iquad<4; iquad++) - { - quad_cuts_ipmt->cd(iquad+1); - s->Search(PulseInt_quad[iquad][ipmt], 2.5, "nobackground", 0.001); - TList *functions = PulseInt_quad[iquad][ipmt]->GetListOfFunctions(); - TPolyMarker *pm = (TPolyMarker*)functions->FindObject("TPolyMarker"); - Double_t *xpeaks = pm->GetX(); - if (iquad != ipmt) - { - Gauss1->SetRange(xpeaks[0]-150, xpeaks[0]+150); - Gauss1->SetParameter(1, xpeaks[0]); - Gauss1->SetParameter(2, 200.); - Gauss1->SetParLimits(0, 0., 2000.); - Gauss1->SetParLimits(1, xpeaks[0]-150, xpeaks[0]+150); - Gauss1->SetParLimits(2, 10., 500.); - PulseInt_quad[iquad][ipmt]->Fit("Gauss1","RQ"); - - //Store std. dev. of pedistal and mean of SPE - scale += xpeaks[1]; - sigma += Gauss1->GetParameter(2); - } - } - scale = scale/3; - sigma = sigma/3; - cout << Form("The values for 'scale' and 'sigma' for PMT%d are:\n", ipmt+1) << scale << " " << sigma << "\n"; - } - - - /* //Single Gaussian to find mean of SPE TF1 *Gauss1 = new TF1("Gauss1",gauss,-500,7000,3); Gauss1->SetParNames("Amplitude","Mean","Std. Dev."); @@ -559,16 +510,6 @@ void calibration::Terminate() //Linear function used to determine goodness-of-fit for NPE spacing TF1 *Linear = new TF1("Linear",linear,0,4,2); Linear->SetParNames("Slope", "Intercept"); - - //Rebin the histograms into something more sensible, add functionality to bin HGC & NGC independently - for (Int_t ipmt=0; ipmt < (fNGC ? fngc_pmts : fhgc_pmts); ipmt++) - { - for (Int_t iquad=0; iquad<4; iquad++) - { - fNGC ? PulseInt_quad[iquad][ipmt]->Rebin(25) : PulseInt_quad[iquad][ipmt]->Rebin(25); - } - fNGC ? PulseInt[ipmt]->Rebin(25) : PulseInt[ipmt]->Rebin(25); - } //An array is used to store the means for the SPE, and to determine NPE spacing Double_t mean[3]; @@ -1018,5 +959,4 @@ void calibration::Terminate() calibration.close(); } - */ } diff --git a/CALIBRATION/shms_hgcer_calib/run_cal.C b/CALIBRATION/shms_hgcer_calib/run_cal.C index b363f7565b2b524fa90de5302dbf332cde8bf0cc..ffda4ca830e7430f11a184baf7888ae7c9d5bc89 100644 --- a/CALIBRATION/shms_hgcer_calib/run_cal.C +++ b/CALIBRATION/shms_hgcer_calib/run_cal.C @@ -25,11 +25,10 @@ void run_cal(Int_t RunNumber = 0, Int_t NumEvents = 0) getline(std::cin, calib_raw); TString calib_option = calib_raw; - /* string eff_raw; cout << "\nEnter options for efficiency (enter NA to skip): "; getline(std::cin, eff_raw); - TString eff_option = eff_raw;*/ + TString eff_option = eff_raw; TChain ch("T"); ch.Add(Form("../../ROOTfiles/shms_replay_%d_%d.root", RunNumber, NumEvents)); @@ -66,5 +65,5 @@ void run_cal(Int_t RunNumber = 0, Int_t NumEvents = 0) } } - //if (eff_option != "NA") ch.Process("efficiencies.C+",eff_option); + if (eff_option != "NA") ch.Process("efficiencies.C+",eff_option); }