#include "TString.h" #include "TMultiGraph.h" #include "TGraphErrors.h" #include "TStyle.h" #include "TCanvas.h" #include "TLegend.h" #include "MParList.h" #include "MTaskList.h" #include "MReadMarsFile.h" #include "MGeomApply.h" #include "MEvtLoop.h" #include "MPedCalcPedRun.h" #include "MPedestalCam.h" #include "MPedestalPix.h" #include #include #include using namespace std; const UInt_t nmaxslice = 30; const UInt_t step = 2; void pedvsslices2(TString pedname); int main() //void pedvsslices() { pedvsslices2("~markus/Magic/Soft/Mars/20040303_20123_P_NewCalBoxTestLidOpen_E.root"); } void pedvsslices2(TString pedname) { const Int_t nbad = 22; Int_t bad[nbad]={0,10,47,54,124,125,159,162,222,300,388,395,464,558,559,543,89,510,576,459,550,561}; static const UInt_t rnmax = (nmaxslice/step)*step; static const UInt_t nslices = rnmax/step; static const UInt_t nloops = rnmax*(rnmax-step+2)/(2*step); cout << "nslices = " << nslices << endl; // general settings gStyle->SetCanvasColor(0); gStyle->SetStatColor(0); gStyle->SetStatBorderSize(1); gStyle->SetMarkerSize(0.6); gStyle->SetPadBorderMode(0); // Define the graphs and their atributes TGraphErrors grmeanIn[nslices]; TGraphErrors grrmsIn[nslices]; TGraphErrors grmeanOut[nslices]; TGraphErrors grrmsOut[nslices]; // Null graph to adjust plot limits Float_t nullx[rnmax+1]; Float_t nullyM[rnmax+1]; Float_t nullyR[rnmax+1]; for(UInt_t i=0;i<=rnmax;i++) { nullx[i]=(Float_t)i; nullyM[i]=9+2./rnmax*i; nullyR[i]=3.5+5./rnmax*i; } TGraph grnullM(rnmax+1,nullx,nullyM); TGraph grnullR(rnmax+1,nullx,nullyR); grnullM.SetMarkerSize(0); grnullR.SetMarkerSize(0); grnullM.SetMarkerColor(0); grnullR.SetMarkerColor(0); grnullM.GetXaxis()->SetTitle("First used time slice"); grnullR.GetXaxis()->SetTitle("First used time slice"); grnullM.GetYaxis()->SetTitle("Average Pedestal mean (ADC cnts)"); grnullR.GetYaxis()->SetTitle("Average Pedestal rms (ADC cnts)"); for(UInt_t i=0;i=nmaxslice) { fslice=fslice-islice+step; islice=0; } } TCanvas* myC = new TCanvas("myC","pedestal studies",900,1250); myC->Divide(2,2); TLegend* leg1 = new TLegend(.2,.2,.4,.5); TLegend* leg2 = new TLegend(.44,.2,.88,.5); leg1->SetEntrySeparation(0.1); leg1->SetHeader(""); leg2->SetEntrySeparation(0.1); leg2->SetHeader(""); myC->cd(1); grnullM.SetTitle("Average pedestal mean for inner pixels"); grnullM.DrawClone("AP"); for(UInt_t i=0;iAddEntry(&grmeanIn[i],leglab,"p"); else leg2->AddEntry(&grmeanIn[i],leglab,"p"); } leg1->SetFillColor(0); leg1->SetLineColor(0); leg1->SetBorderSize(0); leg1->Draw(); leg2->SetFillColor(0); leg2->SetLineColor(0); leg2->SetBorderSize(0); leg2->Draw(); myC->cd(2); grnullR.SetTitle("Average pedestal rms for inner pixels"); grnullR.DrawClone("AP"); for(UInt_t i=0;icd(3); grnullM.SetTitle("Average pedestal mean for outer pixels"); grnullM.DrawClone("AP"); for(UInt_t i=0;icd(4); grnullR.SetTitle("Average pedestal rms for outer pixels"); grnullR.DrawClone("AP"); for(UInt_t i=0;iPrint("pedestaSliceDependence.ps"); }