Modified Lattice.cc example in Lattice.hh

This commit is contained in:
Reka Korei 2017-11-02 14:13:41 +01:00
parent eeca7819af
commit 315620c126
2 changed files with 26 additions and 9 deletions

View File

@ -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

View File

@ -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;
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;
}
i++;
loc_mu += dm;
loc_sigma += ds;
}