calbet
May 12, 2018, 4:21pm
#1
Dear experts,
I have a root file with several different histograms with the same name (1), they differ with only a number at the end of the name (1). How can I specify a specific histogram? If I open this root file and get an histogram, which one it will take by default?
Regards
(1)
sbinet
May 12, 2018, 5:45pm
#2
That number is the ‘cycle’ of the object.
Think of it as a revision.
If you don’t specify any cycle, the last one (the largest) will be automatically selected.
Either:
or:
An expert’s advice is needed, why there is a “segmentation violation” in the code below. [8-[]
{
TFile *TPCTOFEfffile = TFile::Open("EFFTPCTOF.root", "read");
#if 1 /* 0 or 1 */
// This method works well.
TH1F *TPCTOFEFFDeltapp = (TH1F*)(TPCTOFEfffile->FindObjectAny("hEff;1"));
TH1F *TPCTOFEFFDeltamm = (TH1F*)(TPCTOFEfffile->FindObjectAny("hEff;2"));
TH1F *TPCTOFEFFAverage = (TH1F*)(TPCTOFEfffile->FindObjectAny("hEff;3"));
#else /* 0 or 1 */
// This method should also work, I get…
system
closed
May 26, 2018, 7:29pm
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.