diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index 9fa88d3c8de81db02968ecad65c5db95d3d14042..d4fdcd14b0f7a819ea90aebfb99cfc1ffbd1ad9d 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 247df9810c29b716ca9a47c85e8186c8f0c140d0..86c24aa8d46afe4bb9f7d307aa98e51d2a538755 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 ac1fa9257014efa76d2812045616213c28e2f9a4..92b735b7c83825c40e574aa38ed2d870afc9d73c 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