26 #ifndef ROOT_TObjArray
27 #include <TObjArray.h>
62 std::vector<Float_t> fCumu;
63 std::vector<Float_t> fWeight;
73 virtual TObject *
Rand();
80 virtual TObject *
Rand(Int_t &);
97 virtual void Add(TObject *, Float_t);
100 virtual void Clear(Option_t *opt =
"");
102 virtual Int_t
GetSize()
const {
return fObj.GetEntries(); }
103 virtual TObject *
At(Int_t slot)
const {
return fObj.At(slot); }
106 virtual Float_t
WeightAt(Int_t slot)
const {
if ( 0 <= slot && slot < fObj.GetEntries() )
return fWeight[slot] ;
return 0.0; }
113 virtual void FillRandom(TH1 *h, Int_t ntimes = 5000);
115 virtual void ls(Option_t *)
const;
virtual TObject * Rand()
it returns a pointer to a randomly selected object from the collection
A class to select randomly an object in a TObjArray of objects.
virtual void Clear(Option_t *opt="")
clear everything (the objects in the collection are not deleted)
virtual TObject * At(Int_t slot) const
virtual void Add(TObject *, Float_t)
it adds an object with a weight to this collection.
virtual Int_t GetSize() const
ClassDef(RandObj, 0)
rootcint dictionary
To change the internal GammaWare random generator.
virtual Float_t WeightAt(Int_t slot) const
Intensity with which the object at slot is associated.
virtual void ls(Option_t *) const
virtual void FillRandom(TH1 *h, Int_t ntimes=5000)
Allocate and fill the histogram randomly.