40 const Int_t nplanes = 10;
41 const Int_t ncounters = 100;
47 TH1F *hn[nplanes][ncounters];
48 TH1F *hs[nplanes][ncounters];
49 for (i=0;i<nplanes;i++) {
50 sprintf(dirname,
"plane%d",i);
51 cdplane[i] = cdtof->
mkdir(dirname);
54 for (j=0;j<ncounters;j++) {
55 sprintf(hname,
"h%d_%dN",i,j);
56 sprintf(htitle,
"hist for counter:%d in plane:%d North",j,i);
57 hn[i][j] =
new TH1F(hname,htitle,100,0,100);
58 sprintf(hname,
"h%d_%dS",i,j);
59 sprintf(htitle,
"hist for counter:%d in plane:%d South",j,i);
60 hs[i][j] =
new TH1F(hname,htitle,100,0,100);
67 for (i=0;i<nplanes;i++) {
69 for (j=0;j<ncounters;j++) {
71 hn[i][j]->
Fill(100*
r.Rndm(),i+j);
72 hs[i][j]->
Fill(100*
r.Rndm(),i+j+k);
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
Describe directory structure in memory.
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
1-D histogram with a float per channel (see TH1 documentation)}
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
This is the base class for the ROOT Random number generators.