Commit 6486ffd7 authored by Kostyleva D.A's avatar Kostyleva D.A

New method AEvent::SetToT to determine time-over-threshold is added. Threshold...

New method AEvent::SetToT to determine time-over-threshold is added. Threshold is value of ampl on 50% of rising edge
parent 23dea104
...@@ -65,6 +65,7 @@ void AEvent::ProcessEvent(Bool_t bSmooth) { ...@@ -65,6 +65,7 @@ void AEvent::ProcessEvent(Bool_t bSmooth) {
SetChargeCFD(); SetChargeCFD();
SetChargeLED(); SetChargeLED();
SetChargeTF(); SetChargeTF();
SetToT();
// SmoothGraphs(); // SmoothGraphs();
...@@ -86,6 +87,8 @@ void AEvent::Reset() { ...@@ -86,6 +87,8 @@ void AEvent::Reset() {
fTime10=0.; fTime10=0.;
fTime90=0.; fTime90=0.;
fTimeMid=0.; fTimeMid=0.;
fToT=-100.;
fAmpMid=0.;
fAmpMax = 0.; fAmpMax = 0.;
fTimeAmpMax = 0.; fTimeAmpMax = 0.;
fTimeCFD = -100.; fTimeCFD = -100.;
...@@ -249,6 +252,7 @@ void AEvent::FindFrontProperties() { ...@@ -249,6 +252,7 @@ void AEvent::FindFrontProperties() {
fEdgeXi = fit1->GetChisquare(); fEdgeXi = fit1->GetChisquare();
fTimeMid = (fTime90 -fTime10)*0.5 + fTime10; //time point between fTime90 and fTime10 fTimeMid = (fTime90 -fTime10)*0.5 + fTime10; //time point between fTime90 and fTime10
fAmpMid = fGraphSignal->Eval(fTimeMid);
//adding point where fit function crosses zero //adding point where fit function crosses zero
Double_t a = 0, b = 0; Double_t a = 0, b = 0;
...@@ -427,3 +431,29 @@ void AEvent::SetLED(Double_t threshold) { ...@@ -427,3 +431,29 @@ void AEvent::SetLED(Double_t threshold) {
// сделать через функцию getpoint и цикл по точкам от // сделать через функцию getpoint и цикл по точкам от
} }
void AEvent::SetToT() {
Double_t time = fTimeMid;
Double_t timeBack = 0;
const Double_t ns = 15.; //withing this interval signal should end for sure, in nanosec
const Double_t timeStep = 0.05;
//cout<<"fAmpMid "<<fAmpMid<<endl;
while( fGraphSignal->Eval(time) >= fAmpMid && time < fTimeMid + ns) {
//cout<<"timeback "<<timeBack<<endl;
//cout<<"fGraphSignal->Eval(time) "<<fGraphSignal->Eval(time)<<endl;
//cout<<endl;
//if(timeBack>150.) {return;}
timeBack = time;
time = time + timeStep;
}
//cout<<"timeback "<<timeBack<<endl;
fToT = timeBack - fTimeMid;
//cout<<"ftot "<<fToT<<endl;
}
...@@ -44,6 +44,8 @@ private: ...@@ -44,6 +44,8 @@ private:
Double_t fTime10; //time of 10% of rising edge amplitude in ns Double_t fTime10; //time of 10% of rising edge amplitude in ns
Double_t fTime90; //time of 10% of rising edge amplitude in ns Double_t fTime90; //time of 10% of rising edge amplitude in ns
Double_t fTimeMid; //time point between fTime90 and fTime10 Double_t fTimeMid; //time point between fTime90 and fTime10
Double_t fAmpMid; //amplitude in fTimeMid point. Used in ToT on 50% of rising edge determination
Double_t fToT;
TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed) TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed)
Double_t fTimeCFD; //zero-crossing time Double_t fTimeCFD; //zero-crossing time
...@@ -107,6 +109,10 @@ public: ...@@ -107,6 +109,10 @@ public:
void SetSmoothPoints(Int_t numofp) {fWinSize = numofp; }; void SetSmoothPoints(Int_t numofp) {fWinSize = numofp; };
//set number of smoothing points //set number of smoothing points
void SetToT();
//calculate time-over-threshold. the threshold value is fTimeMid - middle point of the rising edge
//ToT is calculated within 15 ns range in order to consider all the weirdness of the signal form
void Reset(); void Reset();
//Resets arrays to zeros //Resets arrays to zeros
......
...@@ -27,7 +27,7 @@ void testShowGraphs() ...@@ -27,7 +27,7 @@ void testShowGraphs()
// TFile fr("../data/dataTektronix/exp18.root"); // TFile fr("../data/dataTektronix/exp18.root");
TFile fr("../data/dataDSR4/analysis_08_2.root"); TFile fr("../data/dataDSR4/analysis_07_8.root");
// TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root"); // TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
// TFile fr("../data/dataTektronix/exp18.root"); // TFile fr("../data/dataTektronix/exp18.root");
...@@ -81,7 +81,7 @@ void testShowGraphs() ...@@ -81,7 +81,7 @@ void testShowGraphs()
//f1->SetRange(t10[k], t90[k]); //f1->SetRange(t10[k], t90[k]);
//gr[k]->Fit(f1, "RQ"); //gr[k]->Fit(f1, "RQ");
} }
c1->Print(Form("../macros/picsDRS4/file%s/signals%s", foldername, ext)); //c1->Print(Form("../macros/picsDRS4/file%s/signals%s", foldername, ext));
// c1->cd(2); // c1->cd(2);
// tr->Draw("gAmp.Draw()","","goff",1,124); // tr->Draw("gAmp.Draw()","","goff",1,124);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment