#ifndef MyClass_H #define MyClass_H #include "TH1D.h" using namespace std; class MyClass : public TH1D { private: Float_t fLenghtFactor; Float_t fWidth; Float_t fFWHM_0; Float_t fFWHM_1; Float_t fFWHM_2; public: MyClass(TH1D *hist); ~MyClass(){;} void SetBackground(Float_t LenghtFactor, Float_t Width, Float_t FWHM_0, Float_t FWHM_1, Float_t FWHM_2); //*MENU* *ARGS={LenghtFactor=>fLenghtFactor,Width=>fWidth,FWHM_0=>fFWHM_0,FWHM_1=>fFWHM_1,FWHM_2=>fFWHM_2} Float_t GetLenghtFactor() { return fLenghtFactor; } Float_t GetWidth() { return fWidth; } Float_t GetFWHM_0() { return fFWHM_0; } Float_t GetFWHM_1() { return fFWHM_1; } Float_t GetFWHM_2() { return fFWHM_2; } ClassDef(MyClass,1); }; #endif MyClass::MyClass(TH1D *hist) : TH1D(*hist) { fLenghtFactor = 1.; fWidth = 6.; fFWHM_0 = 9.; fFWHM_1 = 0.004; fFWHM_2 = 0.; } void MyClass::SetBackground(Float_t LenghtFactor, Float_t Width, Float_t FWHM_0, Float_t FWHM_1, Float_t FWHM_2) { fLenghtFactor = LenghtFactor; fWidth = Width; fFWHM_0 = FWHM_0; fFWHM_1 = FWHM_1; fFWHM_2 = FWHM_2; } void test() { TH1D *h = new TH1D("h","h",100,-10,10); h->FillRandom("gaus",10000); MyClass *c = new MyClass(h); c->Draw(); }