From 0ca0b60d2db8c8ec4400291d431221eda20c0309 Mon Sep 17 00:00:00 2001 From: "Muzalevsky I.A" Date: Mon, 16 Jan 2017 16:40:58 +0300 Subject: [PATCH] method for obtaining EdgeSlope and EdgeBorders added for class AEvent --- dataClasses/AEvent.cpp | 43 +++++++++++++++++++++++++++++++++++++++++- dataClasses/AEvent.h | 9 +++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 3084f9a..e9d13e5 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -74,7 +74,7 @@ void AEvent::ProcessEvent() { fTimeAmpMax = maxAmpT; SetGraphs(); - + FindFrontProperties(); SetCFD(); SetChargeCFD(); @@ -90,6 +90,9 @@ void AEvent::Reset() { fAmpCFD[i] = 0; } + EdgeSlope=0.; + t_10=0.; + t_90=0.; fAmpMax = 0.; fTimeAmpMax = 0.; fTimeCFD = 0.; @@ -176,7 +179,33 @@ void AEvent::SetCFD() { } } } +/////// trying to create method +void AEvent::FindFrontProperties() { + + if (!fGraphSignal) { + Warning("AEvent::FindZeroLevel", "Graph was not set"); + return; + } + + Int_t NumM = fTimeAmpMax*10; + + for(Int_t i=NumM;i>0;i--) + { + if( fAmpPos[i]<0.1*fAmpMax ) {t_10 = fTime[i+1];break;} + } + for(Int_t i=NumM;i>0;i--) + { + if( fAmpPos[i]<0.9*fAmpMax ) {t_90 = fTime[i+1];break;} + } + TF1 *fit1 = new TF1("fit1","[1]*x+[0]"); //function for one parameter fitting in the range of pmin-pmax + fit1->SetRange(t_10,t_90); + fGraphSignal->Fit(fit1,"R","goff"); + EdgeSlope = fit1->GetParameter(1); + + delete fit1; +} +//////// Double_t AEvent::FindZeroLevel() { SetGraphs(); @@ -227,3 +256,15 @@ Double_t AEvent::GetOnefTime(Int_t i) { Double_t AEvent::GetOnefAmpPos(Int_t i) { return fAmpPos[i]; } + +Double_t AEvent::GetT_10() { + return t_10; +} + +Double_t AEvent::GetT_90() { + return t_90; +} + +Double_t AEvent::GetEdgeSlope() { + return EdgeSlope; +} diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index 4981cd6..172c311 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -39,6 +39,9 @@ private: Double_t fAmpMax; Double_t fTimeAmpMax; Double_t fZeroLevel; + Double_t EdgeSlope; + Double_t t_10; + Double_t t_90; TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed) Double_t fTimeCFD; //zero-crossing time @@ -60,6 +63,10 @@ public: AEvent(const Int_t npoints); virtual ~AEvent(); ClassDef(AEvent,1); + + Double_t GetT_10(); + Double_t GetT_90(); + Double_t GetEdgeSlope(); Double_t GetfCFD(); Double_t GetOnefTime(Int_t i); Double_t GetOnefAmpPos(Int_t i); @@ -91,6 +98,8 @@ public: } //draws signal shape graphs + void FindFrontProperties(); + Double_t FindZeroLevel(); //for zero level correction. one parameter fit between pmin and pmax //returns fit parameter i.e. number on which amplitude should be corrected -- 2.18.1