From 76a5422f83058aa985af96eace7becd3a9f8a858 Mon Sep 17 00:00:00 2001 From: "Kostyleva D.A" Date: Tue, 7 Feb 2017 20:29:37 +0300 Subject: [PATCH] Number of points for smoothing are added in analyse.cpp --- convertRawToAnalyzed/analyse.cpp | 3 ++- dataClasses/AEvent.cpp | 8 ++++---- dataClasses/AEvent.h | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index 9fa88d3..d4fdcd1 100644 --- a/convertRawToAnalyzed/analyse.cpp +++ b/convertRawToAnalyzed/analyse.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) const Double_t cfTD = 1.5; //in ns Double_t noiseMin = 5; Double_t noiseMax = 25; - + Int_t nump = 5; //number of points for smoothing @@ -79,6 +79,7 @@ int main(int argc, char* argv[]) wevent[j]->SetCFratio(cfRatio); wevent[j]->SetCFtimeDelay(cfTD); wevent[j]->SetNoiseRange(noiseMin, noiseMax); + wevent[j]->SetSmoothPoints(nump); tw->Bronch(bName.Data(), "AEvent", &wevent[j]); // create branches in atree to hold analyzed data } //----event loop in tr input tree diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 247df98..86c24aa 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -131,10 +131,10 @@ void AEvent::SmoothGraphs() { //smoothing graph - fGraphSmooth->Set(fNPoints - 4); + fGraphSmooth->Set(fNPoints - fWinSize/2); - Int_t winSize = 5; //number of smoothing points - Int_t winMidSize = winSize / 2; + //Int_t winSize = 5; //number of smoothing points + Int_t winMidSize = fWinSize / 2; Double_t tmin, tmax, meanTime, meanAmp; for(Int_t i = winMidSize; i < fNPoints - winMidSize; ++i) { @@ -151,7 +151,7 @@ void AEvent::SmoothGraphs() { meanTime = (tmax - tmin)*0.5 + tmin; //cout<<"mean time "<SetPoint(i, meanTime, meanAmp); diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index ac1fa92..92b735b 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -65,6 +65,7 @@ private: Double_t fNoiseRangeMin; //! Double_t fNoiseRangeMax; //! + Int_t fWinSize; //! public: AEvent(); @@ -103,6 +104,9 @@ public: void SetNoiseRange(Double_t min, Double_t max) { fNoiseRangeMin = min; fNoiseRangeMax = max; }; //Set noise range to be used in FindZeroLevel() + void SetSmoothPoints(Int_t numofp) {fWinSize = numofp; }; + //set number of smoothing points + void Reset(); //Resets arrays to zeros -- 2.18.1