30 TH1F *hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
33 std::vector<float> vpx;
34 std::vector<float> vpy;
35 std::vector<float> vpz;
36 std::vector<float> vrand;
39 TTree *t =
new TTree(
"tvec",
"Tree with vectors");
50 for (
Int_t i = 0; i < 25000; i++) {
58 for (
Int_t j = 0; j < npx; ++j) {
70 vrand.emplace_back(random);
73 if (i && (i%kUPDATE) == 0) {
74 if (i == kUPDATE) hpx->
Draw();
97 std::vector<float> *vpx = 0;
100 TCanvas *c1 =
new TCanvas(
"c1",
"Dynamic Filling Example",200,10,700,500);
102 const Int_t kUPDATE = 1000;
109 TH1F *
h =
new TH1F(
"h",
"This is the px distribution",100,-4,4);
112 for (
Int_t i = 0; i < 25000; i++) {
117 for (
UInt_t j = 0; j < vpx->size(); ++j) {
122 if (i && (i%kUPDATE) == 0) {
123 if (i == kUPDATE) h->
Draw();
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual Int_t Fill()
Fill all branches.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
1-D histogram with a float per channel (see TH1 documentation)}
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void Start(const char *name)
Starts Benchmark with the specified name.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
void GetObject(const char *namecycle, T *&ptr)
virtual Double_t Rndm()
Machine independent random number generator.
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
R__EXTERN TBenchmark * gBenchmark
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
R__EXTERN TRandom * gRandom
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
A TTree object has a header with a name and a title.
virtual void Update()
Update canvas pad buffers.
A TTree is a list of TBranches.
void Modified(Bool_t flag=1)