diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index 174cef2b38aadeb994f8b4316e7d97306f988309..9fa88d3c8de81db02968ecad65c5db95d3d14042 100644 --- a/convertRawToAnalyzed/analyse.cpp +++ b/convertRawToAnalyzed/analyse.cpp @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) for(Long64_t i = 0; i < nentries; i++) { tr->GetEntry(i); - //cout<<" i "<Reset(); wevent[j]->ProcessEvent(); //here all the analysis is going on so far diff --git a/data/rawDataDSR4/LOGBOOK.md b/data/rawDataDSR4/LOGBOOK.md index 0bfe215678b77d2967a68411c68f4177806f71db..4e38a9ff8cd3753a064e006512ba5b0d98899f99 100644 --- a/data/rawDataDSR4/LOGBOOK.md +++ b/data/rawDataDSR4/LOGBOOK.md @@ -2,20 +2,22 @@ Raw data. Both in binary and root format. Logbook +PMT amplification: HV = -900 V, threshold ~ -10 mV + File name | Num of events | Comment -------------------------|---------------|---------------------------------------------------------------------| -NeuRad_test_071216_1.dat| 500 | collimated gamma source; ch0 and ch1 have coincidence; trigger ch0 | -NeuRad_test_071216_2.dat| 5000 | collimated gamma source; ch0 and ch1 have coincidence; trigger ch0 | -NeuRad_test_071216_3.dat| 1039 | neutron source Cf | -NeuRad_test_071216_4.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back | -NeuRad_test_071216_5.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back | -NeuRad_test_071216_6.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back | -NeuRad_test_071216_7.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back | -------------------------|---------------|---------------------------------------------------------------------| +------------------------|---------------|--------------------------------------------------------------------------------------------------------------------| +NeuRad_test_071216_1.dat| 500 | collimated gamma source; ch0 and ch1 have coincidence; trigger ch0; 2 PMT H9500; periphery PMT pixels | +NeuRad_test_071216_2.dat| 5000 | collimated gamma source; ch0 and ch1 have coincidence; trigger ch0; 2 PMT H9500; periphery PMT pixels | +NeuRad_test_071216_3.dat| 1039 | non-collimated neutron source Cf; 2 PMT H9500; periphery PMT pixels | +NeuRad_test_071216_4.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back; internal PMT pixels | +NeuRad_test_071216_5.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back; internal PMT pixels | +NeuRad_test_071216_6.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back; internal PMT pixels | +NeuRad_test_071216_7.dat| 2000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back; internal PMT pixels | +------------------------|---------------|--------------------------------------------------------------------------------------------------------------------| -Change of PMT amplification: increasing voltage up to 1100 mV, threshold 25 mV +Change of PMT amplification: increasing HV up to -1100 V, threshold -25 mV -------------------------|---------------|---------------------------------------------------------------------| -NeuRad_test_071216_8.dat| 10000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back | -NeuRad_test_081216_1.dat| 2204 | trigger ch2 ????? | -NeuRad_test_081216_2.dat| 10000 | collimated gamma source; two channels only: ch0 and ch1 | +------------------------|---------------|--------------------------------------------------------------------------------------------------------------------| +NeuRad_test_071216_8.dat| 10000 | source 60Co; trigger ch0; ch0-front, ch1,ch2,ch3 - back; internal PMT pixels !!!! | +NeuRad_test_081216_1.dat| 2204 | trigger ch2; internal PMT pixels ????? | +NeuRad_test_081216_2.dat| 10000 | collimated gamma source; two channels only: ch0 and ch1; changed PMT H9500 -ch0, H10966 - ch1 ; internal PMT pixels| diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 7f6aba118384cde6a7355f9beb5c72396ac43ae4..5056d2504a77d803f4191de542c27d58bce43dc0 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -57,6 +57,7 @@ void AEvent::ProcessEvent() { SetCFD(); SetChargeCFD(); SetChargeLED(); + SetChargeTF(); return; @@ -81,6 +82,7 @@ void AEvent::Reset() { fZeroLevel = 0.; fChargeCFD = -10.; fChargeLED = -10.; + fTimeFront = -100.; } void AEvent::SetInputEvent(RawEvent** event) { @@ -173,6 +175,7 @@ void AEvent::FindFrontProperties() { const Double_t timeStep = 0.05; //in ns Double_t time = 0; //in ns + Double_t mytime = 0.; if (!fGraphSignal) { Warning("AEvent::FindFrontProperties", "Graph was not set"); @@ -196,9 +199,28 @@ void AEvent::FindFrontProperties() { fit1->SetRange(fTime10,fTime90); fGraphSignal->Fit(fit1,"RQN","goff"); + fEdgeSlope = fit1->GetParameter(1); fEdgeXi = fit1->GetChisquare(); + //adding point where fit function crosses zero + Double_t a = 0, b = 0; + TF1 *line = new TF1("line","[1]*x + [0]"); + a = fit1->GetParameter(1); + b = fit1->GetParameter(0); + line->SetParameter(0,b); + line->SetParameter(1,a); + //cout<<"par 0 "<Eval(mytime) <= 0 && mytime <= 200.) { + //cout<< "mytime "<GetN()-1)) ) { imin = i; i++; } +// i = 0; + while ( fTime[i] < (fTimeFront + tmax) && (i < (fGraphSignal->GetN()-1)) ) { imax = i; i++; } + + integral = fGraphSignal->Integral(imin, imax); + + fChargeTF = integral*time_sig/res; + + return; + +} + Double_t AEvent::GetfCFD() { return fTimeCFD; } diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index 9d7627c2c8a9830091643da2b2196b2675ce99e9..1ca0c1dfa90f0d8518badbfebb69c3066501d497 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -48,8 +48,10 @@ private: Double_t fTimeCFD; //zero-crossing time Double_t fChargeCFD; //! Double_t fChargeLED; //charge of the signal in Coulomb + Double_t fChargeTF; // Double_t fTimeLED; //time of LED threshold crossing + Double_t fTimeFront; //time of front fit crossing zero level TGraph *fGraphSignal; TGraph *fGraphCFD; @@ -127,6 +129,10 @@ public: void SetChargeLED(Int_t tmin = -3, Int_t tmax = 17); + void SetChargeTF(Int_t tmin = -3, Int_t tmax = 17); + //calculates charge of the signal (i.e. its integral + //in range of (tmin,tmax) in ns) + //time of front fit crossing zero is taken as a start point //void SetLED(Double_t threshold = 0.001); diff --git a/macros/histCorr.C b/macros/histCorr.C index 0c42c157fe27901ad2245cf5a880d4d13fba0a13..8f7e008c8c79c0a1139311a2cba276e980302ecd 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -19,8 +19,6 @@ void histCorr( const Bool_t can3 = 0, const Bool_t can4 = 0, const Bool_t can5 = 0, const Bool_t can6 = 0) // tLEd and CFD for colollinated and NONcollimated data - - { Double_t rMin[4]; Double_t rMax[4]; diff --git a/macros/histCorrNew.C b/macros/histCorrNew.C new file mode 100644 index 0000000000000000000000000000000000000000..eea620929bdd129d704ea9e9e7ead6dfd81cd7b4 --- /dev/null +++ b/macros/histCorrNew.C @@ -0,0 +1,176 @@ +#include "TH2F.h" +#include "TH3F.h" +#include "TStyle.h" + +void histCorrNew ( + + const char *filename = "analysis_07_8.root", +// const char *foldername = "report", + 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 = 1, const Bool_t can4 = 0, + const Bool_t can5 = 0, const Bool_t can6 = 0) +{ + using std::cout; + using std::endl; + gSystem->Load("../libData.so"); + TFile *f = new TFile(Form("../data/dataDSR4/%s", filename)); + TTree *t = (TTree*)f->Get("atree"); + + //gStyle->SetCanvasDefH(900); + //gStyle->SetCanvasDefW(1500); + + if(can1){ + + TCanvas *c1 = new TCanvas("c1", "Correlation pictures for collimated data: Integrals and amplitudes"); + c1->Divide(2,2); + + c1->cd(1); + TH2F *h1 = new TH2F("h1", "front time tau vs charge TF 0 ", 200, 0 ,0.5e-9, 100, 5, 15 ); + t->Draw(" Ach0.fTimeFront - Ach1.fTimeFront : Ach0.fChargeTF >> h1","","col"); + //x + h1->GetXaxis()->SetTitle("Charge [C]"); + h1->GetXaxis()->CenterTitle(); + //y + h1->GetYaxis()->SetTitle("tau_TF [ns]"); + h1->GetYaxis()->CenterTitle(); + + c1->Update(); + + c1->cd(2); + TH2F *h2 = new TH2F("h2", "front time tau vs charge TF 1 ", 200, 0, 0.5e-9, 200, 5 ,15); + t->Draw(" Ach0.fTimeFront - Ach1.fTimeFront : Ach1.fChargeTF >> h2","","col"); + //x + h2->GetXaxis()->SetTitle("Charge [C]"); + h2->GetXaxis()->CenterTitle(); + //y + h2->GetYaxis()->SetTitle("tau_TF [V]"); + h2->GetYaxis()->CenterTitle(); + + c1->Update(); + + c1->cd(3); + TH2F *h3 = new TH2F("h3", "charge TF 1 vs charge TF 0", 200, 0 ,0.5e-9, 200, 0, 0.5e-9); + t->Draw(" Ach0.fChargeTF : Ach1.fChargeTF >> h3","","col"); + //x + h3->GetXaxis()->SetTitle("Charge_0 [C]"); + h3->GetXaxis()->CenterTitle(); + //y + h3->GetYaxis()->SetTitle("Charge_1 [C]"); + h3->GetYaxis()->CenterTitle(); + + c1->Update(); + + // c1->Print(Form("../macros/picsDRS4/file%s/time_front_corr1%s", foldername, ext)); + } + + if(can2) { + TCanvas *c2 = new TCanvas("c2", "Correlation pictures for collimated data: Integrals and amplitudes"); + c2->Divide(2,2); + + c2->cd(1); + TH2F *h4 = new TH2F("h4", "front time tau vs amplitude 0", 200, 0, 0.5, 200, 5 ,15); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront : Ach0.fAmpMax >> h4","","col"); + //x + h4->GetXaxis()->SetTitle("Max_ampl_{0} [V]"); + h4->GetXaxis()->CenterTitle(); + //y + h4->GetYaxis()->SetTitle("tau_TF"); + h4->GetYaxis()->CenterTitle(); + + c2->cd(2); + TH2F *h5 = new TH2F("h5", "front time tau vs amplitude 1", 200, 0, 0.5, 200, 5 ,15); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront : Ach1.fAmpMax >> h5","","col"); + //x + h5->GetXaxis()->SetTitle("Max_ampl_{1} [V]"); + h5->GetXaxis()->CenterTitle(); + //y + h5->GetYaxis()->SetTitle("tau_TF"); + h5->GetYaxis()->CenterTitle(); + + c2->Update(); + + c2->cd(3); + TH2F *h6 = new TH2F("h6", "amplitude 0 vs amplitude 1", 200, 0 ,0.1, 200, 0, 0.2); + t->Draw("Ach0.fAmpMax : Ach1.fAmpMax >> h6","","col"); + //x + h6->GetXaxis()->SetTitle("Max_ampl_{1} [V]"); + h6->GetXaxis()->CenterTitle(); + //y + h6->GetYaxis()->SetTitle("Max_ampl_{0} [V]"); + h6->GetYaxis()->CenterTitle(); + + // c2->Print(Form("../macros/picsDRS4/file%s/time_front_corr2%s", foldername, ext)); + } + + if(can3) { + TCanvas *c3 = new TCanvas ("c3", "Correlation pictures for collimated data: time difference"); + c3->Divide(2,2); + + c3->cd(1); + TH1F *h10 = new TH1F("h10", "delta t (front edge fit)", 100, -5 , 25); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h10","Ach0.fTimeFront>100. && Ach0.fTimeFront < 150 && Ach1.fTimeFront>100 && Ach1.fTimeFront < 150",""); + h10->Fit("gaus", "","",-5,5); + gStyle->SetOptFit(); + h10->GetXaxis()->SetTitle("delta t [ns]"); + h10->GetXaxis()->CenterTitle(); + + c3->cd(2); + TH1F *h7 = new TH1F("h7", "delta t (front edge fit) with edge slope correction", 100, -5 , 25); + // t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h7", + // "Ach0.fTimeFront>100. && Ach0.fTimeFront < 150 && Ach1.fTimeFront>100 && Ach1.fTimeFront < 150 && Ach0.fEdgeSlope > 0.01 && Ach1.fEdgeSlope > 0.01",""); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h7","Ach0.fTimeFront>100. && Ach0.fTimeFront < 150 && Ach1.fTimeFront>100 && Ach1.fTimeFront < 150 && Ach0.fEdgeSlope > 0.005 && Ach1.fEdgeSlope > 0.001",""); + h7->Fit("gaus", "","",-5,5); + gStyle->SetOptFit(); + h7->GetXaxis()->SetTitle("delta t [ns]"); + h7->GetXaxis()->CenterTitle(); + + c3->cd(3); + TH1F *h8 = new TH1F("h8", "delta t (front edge fit) with charge correction", 100, -5 , 25); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h8", + "Ach0.fTimeFront>100. && Ach0.fTimeFront < 150 && Ach1.fTimeFront>100 && Ach1.fTimeFront < 150 && Ach0.fChargeTF > 0.05e-9 && Ach1.fChargeTF > 0.025e-9",""); + h8->Fit("gaus","","",-5,5); + gStyle->SetOptFit(); + h8->GetXaxis()->SetTitle("delta t [ns]"); + h8->GetXaxis()->CenterTitle(); + + c3->cd(4); + TH1F *h9 = new TH1F("h9", "delta t (front edge fit) with rise time correction", 100, -5 , 25); + t->Draw("Ach0.fTimeFront - Ach1.fTimeFront >> h9", + "Ach0.fTimeFront> 100 && Ach0.fTimeFront<150 && Ach1.fTimeFront> 100 && Ach1.fTimeFront<150 && (Ach0.fTime90 - Ach0.fTime10) > 1.5 && (Ach0.fTime90 - Ach0.fTime10)<3 && (Ach1.fTime90 - Ach1.fTime10) > 1.5 && (Ach1.fTime90 - Ach1.fTime10)<3",""); + h9->Fit("gaus","","",-5,5); + gStyle->SetOptFit(); + h9->GetXaxis()->SetTitle("delta t [ns]"); + h9->GetXaxis()->CenterTitle(); + + // c3->Print(Form("../macros/picsDRS4/file%s/time_front_corr3%s", foldername, ext)); + } + + if(can4) { + TCanvas *c4 = new TCanvas ("c4", "Correlation pictures for collimated data: time difference"); + c4->Divide(2,2); + + c4->cd(1); + TH1F *h11 = new TH1F("h11", "rise time", 100, 0 , 5); + t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h11","",""); + //gStyle->SetLineColor(kRed); + + c4->cd(2); + TH1F *h12 = new TH1F("h12", "rise time", 100, 0 , 5); + t->Draw("Ach1.fTime90 - Ach1.fTime10 >> h12","",""); + // h10->Fit("gaus", "","",7,14); + // gStyle->SetOptFit(); + // h10->GetXaxis()->SetTitle("delta t [ns]"); + // h10->GetXaxis()->CenterTitle(); + + c4->cd(3); + TH1F *h13 = new TH1F("h13", "rise time", 100, -10, 10); + t->Draw("( Ach0.fTime10 + (Ach0.fTime90 - Ach0.fTime10)*0.5 ) - ( Ach1.fTime10 + (Ach1.fTime90 - Ach1.fTime10)*0.5 )>> h13","Ach0.fEdgeSlope > 0.03 && Ach1.fEdgeSlope > 0.006",""); + h13->Fit("gaus","","",-5,5); + gStyle->SetOptFit(); + + } +}