From fcf14ea5de04e8e522186ec9fad577f82c5ba678 Mon Sep 17 00:00:00 2001 From: "Muzalevsky I.A" Date: Wed, 18 Jan 2017 17:11:38 +0300 Subject: [PATCH] CFD method was modified --- dataClasses/AEvent.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 972e610..f0e745c 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -133,17 +133,19 @@ void AEvent::SetGraphs() { void AEvent::SetCFD() { Double_t level = 100.; //is necessary to find cfd amplitude value closest to zero - + Double_t time = 0; fGraphCFD->Set(fNPoints); //working variables Double_t maxCFD = 0., minCFD = 0.; + Double_t TmaxCFD = 0., TminCFD = 0.; Int_t imax = 0, imin = 0; + const Double_t timeStep = 0.05; for (Int_t i=0; ifCFtimeDelay) { + if(i>fCFtimeDelay) { // условие, чтобы не выскочить из размера массива ( обрезает границы на fCFtimeDelay) fAmpCFD[i] = fAmpPos[i]*fCFratio*(-1); fAmpCFD[i] = fAmpCFD[i] + fAmpPos[i - fCFtimeDelay]; fGraphCFD->SetPoint(i, fTime[i], fAmpCFD[i]); @@ -152,26 +154,36 @@ void AEvent::SetCFD() { //point for max CFD amplitude if(fAmpCFD[i] > maxCFD) { maxCFD = fAmpCFD[i]; + TmaxCFD = fTime[i]; imax = i; } //point for min CFD amplitude if(fAmpCFD[i] < minCFD) { minCFD = fAmpCFD[i]; + TminCFD = fTime[i]; imin = i; } } - //finding "zero" of CFD amplitude +/* //finding "zero" of CFD amplitude for(Int_t j = imin; j < imax; j++) { if(abs(fAmpCFD[j]) < level) { level = abs(fAmpCFD[j]); fTimeCFD = fTime[j]; } } +*/ + //I want to find zero of CFD using graph and eval + time = TminCFD; + while( (fGraphCFD->Eval(time) <= 0) && (time <= TmaxCFD) && (time >= TminCFD) ) { + fTimeCFD = time; + time = time + timeStep; + } + } -/////// trying to create method + void AEvent::FindFrontProperties() { //in percents -- 2.18.1