TDirectory

Hello,

I am relatively new to ROOT, and using it embedded within the CMSSW Framework. I was attempting to use TDirectory to create several different directories, as I have created thus far around 20 different 1-D histograms, and I wanted to create some order.

In the “private” area of my code I have TDirectory #cdDump3; and then above the first TFile declaration I have cdDump3 = myFile ->mkdir(“Dump3”);-this works, as when I run the program I now have a directory “Dump3”.

The problem occurs in the next line, with cdDump3->cd();. Once I add that line, although the program compiles, it crashes.

I do have included in the top *include …/TDirectory".

Can anyone suggest something? Thank you, Nicole.

Hi,

there’s probably a side effect - some other part of the program might rely on being in a certain directory, and due to your cdDump3->cd() it’s not. The only way to find out is by using a debugger.

Cheers, Axel.

Hi,
could you post the script are you writing?

Amir