Commit fcf14ea5 authored by Muzalevsky I.A's avatar Muzalevsky I.A

CFD method was modified

parent 65a1372a
......@@ -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; i<fNPoints; i++) {
//CFD method
if(i>fCFtimeDelay) {
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
......
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