GetEntry Segmentation Voilation for a Particular Object of Root Tree

I have an issue while calling the GetEntry function for a particular input file. This function works perfectly fine when I change the input file to another one. It seems the concerned file has some issue, but I can Tbrows the file to be see normal branches and leafs. So my question is, how can I know the problem in the input file ?


ROOT Version:
Platform: Lxplus
Compiler: Not Provided


Hi,

can you put us in condition to reproduce the issue?

Cheers,
D

Hi dpiparo,

Actually meanwhile I have narrowed down the issue. It’s not about the whole file but a few leaves that cause this crash. And I am not able to sort this out.

void mycode()

{

TFile *readFile = new TFile (inputfile.root) ;

vector *ph_drlph;
Float_t event_mwt;

t->SetBranchAddress(“ph_drlph”,&ph_drlph);

//t->SetBranchAddress(“event_mwt”,&event_mwt); // crash causing leaf
Int_t nentries = (Int_t)t -> GetEntries();

       for (Int_t ievent  =  0 ; ievent <  nentries; ievent++  )
            {
            cout << "nentries = " << nentries << endl;
            t->GetEntry(ievent) ;
            
            }

So If I uncomment the //t->SetBranchAddress(“event_mwt”,&event_mwt); whenever compiler tries to get in event loop, it cause Segmentation Violation crash.

In root file the bug causing exits and it is not zero at all either.

COuld you think of any solution ? Please

At least: std::vector<float> *ph_drlph = 0;

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