From c4aaa9d6b118cbdfcb5f343cbf110f7124a61dac Mon Sep 17 00:00:00 2001 From: "Muzalevsky I.A" Date: Mon, 23 Jan 2017 15:34:37 +0300 Subject: [PATCH] script for observing noise sigma added --- macros/NoiseSigma.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 macros/NoiseSigma.cpp diff --git a/macros/NoiseSigma.cpp b/macros/NoiseSigma.cpp new file mode 100644 index 0000000..ca47f1d --- /dev/null +++ b/macros/NoiseSigma.cpp @@ -0,0 +1,43 @@ +{ + gSystem->Load("../libData.so"); + + const Long64_t kFirstEvent = 128; + + TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root"); +// TFile fr("../data/dataDSR4/analysis_07_8.root"); +// TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root"); +// TFile fr("../data/dataTektronix/exp18.root"); +// TFile fr("../data/dataTektronix/analysisExp7.root"); + TTree *tr = (TTree*)fr.Get("atree"); + + AEvent *event = new AEvent(); + tr->SetBranchAddress("Ach0.",&event); + + + TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600); + c1->Divide(2,2); + + + Double_t Noise[500]; + TH1F *histNoise[4]; + TString var,con,histName; + + //TH1F *h1 = new TH1F("h1", "h1 title", 100, 0, 4.4); + for (Int_t i=0;i<4;i++) { + histName.Form("histNoise%d",i); + histNoise[i] = new TH1F(histName.Data(),"Noise distribution",500,-0.003,0.003); + + tr->GetEntry(i+kFirstEvent); + for(Int_t j = 100;j<600; j++) { // filling array with AmpPos + Noise[j-100] = event->GetOnefAmpPos(j); + histNoise[i]->Fill(Noise[j-100]); + } + + c1->cd(i+1); + histNoise[i]->Draw(); + c1->Update(); + } + + + +} -- 2.18.1