Error: histogram is not fill


ROOT 6.15/01
From heads/master@v6-13-04-536-g67ea09a


Hi,

I have a problem in fill the histogram, maybe the problem
is memory.

Let me explain, the code below description how I did:

TH1D * hNPartOrigin= new TH1D("hNPartOrigin", "", lNPtBins, lPtMin, lPtMax);
TH1D *hEventCounter = new TH1D("hEventCounter","",1,-0.5,0.5);

TTree* Thist = new TTree("Thist", "");

Thist->Branch("hNPartOrigin", "TH1D", &hNPartOrigin);

// Number of events
hEventCounter -> Fill(0);

// Loop over all particles in a single event
 for(Long_t j=0; j<nparticles; j++) {
       hNPartOrigin-> Fill( pt );
}

// fills Tree
Thist->Fill();

In the TBrowser (hNPartOrigin):

In the TBrowser (hEventCounter):

Thist->Print();

******************************************************************************
*Tree    :Thist     : Baseline Flow Event                                    *
*Entries :    10244 : Total =       224441783 bytes  File  Size =   87728097 *
*        :          : Tree compression factor =   2.32                       *
******************************************************************************
*Br    0 :hNPartOrigin : TH1D                                                *
*Entries :    10244 : Total  Size=   10563933 bytes  File Size  =    1212704 *
*Baskets :      108 : Basket Size=    2284032 bytes  Compression=   7.91     *
*............................................................................*

Someone can help me?

Cheers,
Andre

I see you are filling the histogram hNPartOrigin with “pt” . But what is pt ?

also what is the purpose of:

Thist->Branch("hNPartOrigin", "TH1D", &hNPartOrigin);

Hi, @couet thanks for the reply.

pt is transverse momentum. I fix this problem a few weeks ago,
the histogram Thist is not used in what I need to do and
now everything in my code is working very well.

Thanks for the help!
Cheers,
André

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.