From 09d9ad17f40ac0af9d228137f715f25ee9ea15ae Mon Sep 17 00:00:00 2001 From: "Muzalevsky I.A" Date: Tue, 24 Jan 2017 14:23:36 +0300 Subject: [PATCH] method for fcharge in AEvent was modified --- dataClasses/AEvent.cpp | 43 +++++++++++++++++++++---- dataClasses/AEvent.h | 13 +++++--- macros/histCorr.C | 73 ++++++++++++++++++++++++++++++++---------- 3 files changed, 101 insertions(+), 28 deletions(-) diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index d3153b7..368374c 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -55,7 +55,8 @@ void AEvent::ProcessEvent() { SetLED(); // SetGraphs(); SetCFD(); - SetChargeCFD(); +// SetChargeCFD(); + SetChargeLED(); return; @@ -68,7 +69,7 @@ void AEvent::Reset() { fTime[i] = 0; fAmpCFD[i] = 0; } - + fTimeLED = 0.; fEdgeSlope=0.; fEdgeXi=0.; fEdgeSlope=-100.; @@ -79,6 +80,7 @@ void AEvent::Reset() { fTimeCFD = 0.; fZeroLevel = 0.; fChargeCFD = 0.; + fChargeLED = 0.; } void AEvent::SetInputEvent(RawEvent** event) { @@ -219,7 +221,7 @@ Double_t AEvent::FindZeroLevel() { return correction; } -void AEvent::SetChargeCFD(Int_t tmin, Int_t tmax) { +void AEvent::SetChargeCFD(Int_t tmin, Int_t tmax) { // tmin = -3, tmax = 17 Double_t integral = 0.; //voltage Double_t time_sig = 0; //approximate signal duration in seconds @@ -237,6 +239,34 @@ void AEvent::SetChargeCFD(Int_t tmin, Int_t tmax) { } +void AEvent::SetChargeLED(Int_t tmin, Int_t tmax) { // tmin = -3, tmax = 17 + + Double_t integral = 0.; //voltage + Double_t time_sig = 0; //approximate signal duration in seconds + const Double_t res = 50.; //resistance 50 Om + time_sig = (double)(-tmin + tmax)*(1e-9); + +/* for(Int_t i = 0; i < fNPoints; i++) { + if( fTime[i] > (fTimeLED + tmin) && fTime[i] < (fTimeLED + tmax) ) { + integral = integral + fAmpPos[i]; + } + }*/ + + Int_t imin = 0, imax = 0; + + Int_t i = 0; + while ( fTime[i] < (fTimeLED + tmin) && (i < (fGraphSignal->GetN()-1)) ) { imin = i; i++; } + i = 0; + while ( fTime[i] < (fTimeLED + tmax) && (i < (fGraphSignal->GetN()-1)) ) { imax = i; i++; } + + integral = fGraphSignal->Integral(imin, imax); + + fChargeLED = integral*time_sig/res; + + return; + +} + Double_t AEvent::GetfCFD() { return fTimeCFD; } @@ -284,11 +314,12 @@ void AEvent::SetMaxAmplitudes() { void AEvent::SetLED(Double_t threshold) { Double_t time = 0; - const Double_t timeStep = 0.1; - while( time < 200. && fGraphSignal->Eval(time) <= threshold ) { + const Double_t timeStep = 0.05; + while( time < fTimeAmpMax && fGraphSignal->Eval(time) <= threshold ) { fTimeLED = time; time = time + timeStep; } - //fTimeLED = time; + //fTimeLED = time; найти номера точек которые лежат на 3 нс раньше и на 20 нс позже чем точка с временем timeled (искать точки в пределах условных) + // сделать через функцию getpoint и цикл по точкам от } diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index 22e39b6..b0c3363 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -46,7 +46,8 @@ private: TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed) Double_t fTimeCFD; //zero-crossing time - Double_t fChargeCFD; //charge of the signal in Coulomb + Double_t fChargeCFD; //! + Double_t fChargeLED; //charge of the signal in Coulomb Double_t fTimeLED; //time of LED threshold crossing @@ -122,11 +123,13 @@ public: //in range of (tmin,tmax) in ns) //CFD time is taken as a start point -<<<<<<< HEAD + void SetChargeLED(Int_t tmin = -3, Int_t tmax = 17); + + //void SetLED(Double_t threshold = 0.001); -======= - void SetLED(Double_t threshold = 0.015); ->>>>>>> e3dcb40f5675931d81a3f0e102fd53689f30c581 + + void SetLED(Double_t threshold = 0.002); + //leading edge discriminator private: diff --git a/macros/histCorr.C b/macros/histCorr.C index 41846dc..3ac72af 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -1,14 +1,14 @@ //#include "TCanvas.h" void histCorr( -// const char *filename = "analysis_07_8.root", +// const char *filename = "Neurad_7_08_NEW.root", const char *filename = "analysis_08_2.root", -// const char *foldername = "7_8", - const char *foldername = "8_2", + const char *foldername = "7_8", +// const char *foldername = "8_2", // const char *ext = ".eps", const char *ext = ".gif", - const Bool_t can1 = 0, const Bool_t can2 = 0, const Bool_t can3 = 0, const Bool_t can4 = 0, const Bool_t can5 = 1) + const Bool_t can1 = 0, const Bool_t can2 = 0, const Bool_t can3 = 0, const Bool_t can4 = 0, const Bool_t can5 = 0, const Bool_t can6 = 1) { gSystem->Load("../libData.so"); TFile *f = new TFile(Form("../data/dataDSR4/%s", filename)); @@ -156,7 +156,7 @@ void histCorr( TCanvas *c4 = new TCanvas("c4", "Correlation pictures: XiSquares"); TH2F *h11 = new TH2F("h11", "Time difference between two channels vs XiSquare of edge",100, -0., 5., 100, 0., 0.005); - t->Draw("Ach1.fEdgeXi : (Ach1.fTime90 - Ach1.fTime10) >> h11","","col"); + t->Draw("Ach0.fEdgeXi : (Ach0.fTime90 - Ach0.fTime10) >> h11","","col"); //t->Draw("Ach1.fEdgeXi : (Ach1.fTime90 - Ach1.fTime10) >> h11","(Ach1.fTime90 - Ach1.fTime10)>0","col"); //x h11->GetXaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]"); @@ -201,24 +201,63 @@ void histCorr( c5->Update(); //c5->Print(Form("../macros/picsDRS4/file%s/TimeDiffCFD_0.7_3%s", foldername, ext)); - } - if (can5) { - TCanvas *c5 = new TCanvas("c5", "Sigma"); - c5->cd(); - TH1F *h11 = new TH1F("h11", "sigma", 1023, -10, 10); + if (can6) { + TCanvas *c6 = new TCanvas("c6", "leading edge vs charge"); + c6->Divide(2,2); - t->Draw("Ach1.fAmpPos >> h11","Ach1.fTime >0","col"); + c6->cd(1); + //TH2F *h13 = new TH2F("h13", "leading edge vs charge",100, 130., 145., 100, -2e-9, 6e-9); + TH1F *h20 = new TH1F("h20", "hist led - cfd", 100, -5, 200.); + //t->Draw("Ach0.fTimeCFD - Ach0.fTimeLED >> h20","Ach0.fTimeCFD - Ach0.fTimeLED > 0.3 && Ach0.fTimeCFD - Ach0.fTimeLED <1.3",""); + t->Draw("Ach0.fTimeLED >> h20","Ach0.fTimeLED > 120 && Ach0.fTimeLED < 150"); + //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; //x - //h10->GetXaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]"); - //h10->GetXaxis()->CenterTitle(); + /* h13->GetYaxis()->SetTitle("fChargeCFD"); + h13->GetYaxis()->CenterTitle(); //y - //h10->GetYaxis()->SetTitle("fEdgeXi"); - //h10->GetYaxis()->CenterTitle(); - c5->Update(); + h13->GetXaxis()->SetTitle("fTimeLED"); + h13->GetXaxis()->CenterTitle();*/ + c6->Update(); + + c6->cd(3); + TH2F *h14 = new TH2F("h14", "fTIMECFD vs fTIMELED",100, 110., 140., 100, 110, 160); + t->Draw("Ach0.fTimeCFD : Ach0.fTimeLED >> h14","","col"); + //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; + //x + h14->GetYaxis()->SetTitle("fTimeCFD"); + h14->GetYaxis()->CenterTitle(); + //y + h14->GetXaxis()->SetTitle("fTimeLED"); + h14->GetXaxis()->CenterTitle(); + c6->Update(); + + c6->cd(2); + TH2F *h15 = new TH2F("h15", "leading edge vs charge",100, 100., 180.,100, -0.02e-10, 1e-10); + t->Draw("Ach1.fChargeCFD : Ach1.fTimeLED >> h15","Ach1.fChargeCFD>0","col"); + //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; + //x + h15->GetYaxis()->SetTitle("fChargeCFD"); + h15->GetYaxis()->CenterTitle(); + //y + h15->GetXaxis()->SetTitle("fTimeLED"); + h15->GetXaxis()->CenterTitle(); + c6->Update(); + + c6->cd(4); + TH2F *h16 = new TH2F("h16", "FtimeCFD vs charge", 100, 100., 180.,100, 0, 1e-10); + t->Draw("Ach1.fChargeCFD : Ach1.fTimeCFD >> h16","Ach1.fChargeCFD>3e-12","col"); + //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; + //x + h16->GetYaxis()->SetTitle("fChargeCFD"); + h16->GetYaxis()->CenterTitle(); + //y + h16->GetXaxis()->SetTitle("fTimeCFD"); + h16->GetXaxis()->CenterTitle(); + c6->Update(); //c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext)); - } + } -- 2.18.1