From 315620c1265d13da42c599e46b64c36ef62c15d4 Mon Sep 17 00:00:00 2001 From: Reka Korei Date: Thu, 2 Nov 2017 14:13:41 +0100 Subject: [PATCH] Modified Lattice.cc example in Lattice.hh --- include/Lattice.hh | 16 +++++++++++++--- src/Lattice.cc | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/include/Lattice.hh b/include/Lattice.hh index a364d59..5cab229 100644 --- a/include/Lattice.hh +++ b/include/Lattice.hh @@ -28,10 +28,10 @@ public: Lattice(); ~Lattice(); - void SetNop(Int_t num); - void SetPercent(Int_t num); + void SetNop(Int_t num); //set the width of the lattice + void SetPercent(Int_t num); //set the interval of mu, sigma - void SetLattice(Double_t mu_est, Double_t sigma_est); + void SetLattice(Double_t mu_est, Double_t sigma_est); //set the lattice around mu_est, sigma_est MuSigma GetMuSigma(Int_t index); @@ -46,4 +46,14 @@ private: }; +/*********************************************************************** + example in BM1D.cc + + Lattice *myLattice = new Lattice(); + myLattice->SetPercent(15); + myLattice->SetNop(10); + myLattice->SetLattice(myAnalyse->GetMu(), myAnalyse->GetSigma()); + +************************************************************************/ + #endif diff --git a/src/Lattice.cc b/src/Lattice.cc index 5a4f6b1..b214aff 100644 --- a/src/Lattice.cc +++ b/src/Lattice.cc @@ -52,14 +52,21 @@ void Lattice::SetLattice(Double_t mu_est, Double_t sigma_est){ while(loc_mu <= mumax){ - ms_vect.push_back(MuSigma()); + loc_sigma = sigmin; - ms_vect[i].mu = loc_mu; - ms_vect[i].sigma = loc_sigma; - - i++; + while(loc_sigma <= sigmax) { + + ms_vect.push_back(MuSigma()); + + ms_vect[i].mu = loc_mu; + ms_vect[i].sigma = loc_sigma; + + i++; + loc_sigma += ds; + } + loc_mu += dm; - loc_sigma += ds; + }