diff --git a/Software/BiasVoltageScan/BiasVoltageScan.C b/Software/BiasVoltageScan/BiasVoltageScan.C index 36486f9..de0dabf 100644 --- a/Software/BiasVoltageScan/BiasVoltageScan.C +++ b/Software/BiasVoltageScan/BiasVoltageScan.C @@ -154,14 +154,18 @@ const Float_t stepV = 10.; const Int_t steps = (Int_t)((maxV-minV)/stepV+1); Float_t V[steps]; + Float_t Ve[steps]; Float_t meanADC[steps]; + Float_t meanADCe[steps]; Float_t mean4ADC[steps]; + Float_t mean4ADCe[steps]; // Open output ROOT file. TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); for (Int_t step=0;stepGetMean(); + meanADCe[step] = hist->GetMeanError(); mean4ADC[step] = hist1->GetMean()+hist2->GetMean()+hist3->GetMean()+hist4->GetMean(); - + mean4ADCe[step] = hist1->GetMeanError()+hist2->GetMeanError()+hist3->GetMeanError()+hist4->GetMeanError(); + // Close input data ROOT files. input->Close(); } @@ -254,6 +260,15 @@ cbiasVoltageScan = new TCanvas(Form("cbiasVoltageScan-%s",filename),"",400,300); DrawGraph(cbiasVoltageScan,gbiasVoltageScan,"APC",path_to_figures); + TGraphErrors *gebiasVoltageScan = new TGraphErrors(steps,V,meanADC,Ve,meanADCe); + InitGraphErrors(gebiasVoltageScan,"Bias voltage scan - 1 strip","Bias voltage (V)","ADC counts"); + TCanvas *cebiasVoltageScan; + if (CMNSub == 1) + cebiasVoltageScan = new TCanvas(Form("cebiasVoltageScan-ComputeCMN-%s",filename),"",400,300); + else + cebiasVoltageScan = new TCanvas(Form("cebiasVoltageScan-%s",filename),"",400,300); + DrawGraphErrors(cebiasVoltageScan,gebiasVoltageScan,"APC",path_to_figures); + // Four adjacent strips. TGraph *gbiasVoltageScan4 = new TGraph(steps,V,mean4ADC); InitGraph(gbiasVoltageScan4,"Bias voltage scan - 4 adjacent strips","Bias voltage (V)","ADC counts"); @@ -264,6 +279,15 @@ cbiasVoltageScan4 = new TCanvas(Form("cbiasVoltageScan4-%s",filename),"",400,300); DrawGraph(cbiasVoltageScan4,gbiasVoltageScan4,"APC",path_to_figures); + TGraphErrors *gebiasVoltageScan4 = new TGraphErrors(steps,V,mean4ADC,Ve,mean4ADCe); + InitGraph(gebiasVoltageScan4,"Bias voltage scan - 4 adjacent strips","Bias voltage (V)","ADC counts"); + TCanvas *cebiasVoltageScan4; + if (CMNSub == 1) + cebiasVoltageScan4 = new TCanvas(Form("cebiasVoltageScan4-ComputeCMN-%s",filename),"",400,300); + else + cebiasVoltageScan4 = new TCanvas(Form("cebiasVoltageScan4-%s",filename),"",400,300); + DrawGraphErrors(cebiasVoltageScan4,gebiasVoltageScan4,"APC",path_to_figures); + // Write output ROOT file. output->Write();