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() { ...@@ -133,17 +133,19 @@ void AEvent::SetGraphs() {
void AEvent::SetCFD() { void AEvent::SetCFD() {
Double_t level = 100.; //is necessary to find cfd amplitude value closest to zero Double_t level = 100.; //is necessary to find cfd amplitude value closest to zero
Double_t time = 0;
fGraphCFD->Set(fNPoints); fGraphCFD->Set(fNPoints);
//working variables //working variables
Double_t maxCFD = 0., minCFD = 0.; Double_t maxCFD = 0., minCFD = 0.;
Double_t TmaxCFD = 0., TminCFD = 0.;
Int_t imax = 0, imin = 0; Int_t imax = 0, imin = 0;
const Double_t timeStep = 0.05;
for (Int_t i=0; i<fNPoints; i++) { for (Int_t i=0; i<fNPoints; i++) {
//CFD method //CFD method
if(i>fCFtimeDelay) { if(i>fCFtimeDelay) { // условие, чтобы не выскочить из размера массива ( обрезает границы на fCFtimeDelay)
fAmpCFD[i] = fAmpPos[i]*fCFratio*(-1); fAmpCFD[i] = fAmpPos[i]*fCFratio*(-1);
fAmpCFD[i] = fAmpCFD[i] + fAmpPos[i - fCFtimeDelay]; fAmpCFD[i] = fAmpCFD[i] + fAmpPos[i - fCFtimeDelay];
fGraphCFD->SetPoint(i, fTime[i], fAmpCFD[i]); fGraphCFD->SetPoint(i, fTime[i], fAmpCFD[i]);
...@@ -152,26 +154,36 @@ void AEvent::SetCFD() { ...@@ -152,26 +154,36 @@ void AEvent::SetCFD() {
//point for max CFD amplitude //point for max CFD amplitude
if(fAmpCFD[i] > maxCFD) { if(fAmpCFD[i] > maxCFD) {
maxCFD = fAmpCFD[i]; maxCFD = fAmpCFD[i];
TmaxCFD = fTime[i];
imax = i; imax = i;
} }
//point for min CFD amplitude //point for min CFD amplitude
if(fAmpCFD[i] < minCFD) { if(fAmpCFD[i] < minCFD) {
minCFD = fAmpCFD[i]; minCFD = fAmpCFD[i];
TminCFD = fTime[i];
imin = i; imin = i;
} }
} }
//finding "zero" of CFD amplitude /* //finding "zero" of CFD amplitude
for(Int_t j = imin; j < imax; j++) { for(Int_t j = imin; j < imax; j++) {
if(abs(fAmpCFD[j]) < level) { if(abs(fAmpCFD[j]) < level) {
level = abs(fAmpCFD[j]); level = abs(fAmpCFD[j]);
fTimeCFD = fTime[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() { void AEvent::FindFrontProperties() {
//in percents //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