I would like to create a vector of histograms. I would like to have the histograms not having any keys in gDirectory. Because it would be unneccesary mess if I would have to create different names for hundreds of histograms, and taking care of that there can be multiple vectors of histograms which as well should have then different names. And If I would create all histograms with the same name, I would get a bunch of warning messages, that there might be leakage.
I tried to create a histogram with the default constructor and then set the properties of the x-axis, but when I do so, I cannot draw the histogram then.
First the code where the histogram gets drawn without problems, but a key is put into the directory:
root  hist = new TH1F("temp","temp",5,0.,5. ); root  .ls TROOT* Rint The ROOT of EVERYTHING OBJ: TH1F temp temp : 0 at: 0xaac6af8 root  hist->Fill( 3 ) root  hist->Draw()
Here is the code where I tried to get rid of the key:
root  h2 = new TH1F() root  h2->GetXaxis()->Set(5,0.,5.) root  h2->Fill( 3. ) root  h2->Draw() <TCanvas>: created default TCanvas with name c1
in this case a histogram is drawn, even with the right axis-demension, but its empty.
I dont quite understand why the histogram is drawn empty at the second example. How could I solve this problem?
But maybe there is even another more appropiate method to prevent root from setting the key in the directory.
I tried to simply
hist->SetDirectory(0), but this didn’t change anything about the key itself.