diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 3084f9a878cad373e41568c15e5f26fd513c70b7..e9d13e504b9ea570b0ea5c5766cd396739c37f72 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 4981cd63d91668f12f045fb9020812f19333119f..172c31105b7cb7f66c92250e683f60ef204997d6 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