Hello,
I’m going through the exercises in nevis.columbia.edu/~seligman/root-class/, and I’m using 6.06/04 on MacOSX 10.11.2
One of the exercises (Analyze.C, if you’re familiar with the exercises) read in a n tuple with float data in there.
[] TFile myFile(“experiment.root”)
[] tree1->Scan()
- Row * event * ebeam * px * py * pz * zv * chi2 *
-
0 * 0 * 150.14041 * 14.333598 * -4.021043 * 143.54425 * 22.264110 * 0.9405828 *
…
…
Then it puts the data in a new TH1F (or TH1D).
[] TH1* chi2Hist = NULL;
[] chi2Hist = new TH1D(“chi2”,“Histogram of Chi2”,100,0,20);
[] tree1->GetEntry(entry);
[] chi2Hist->Fill(chi2);
However, the Fill function won’t accept float arguments it seems.
Analyze.C:80:14: error: no matching member function for call to 'Fill’
chi2Hist->Fill(chi2);
~~~~~~~~^~
/Applications/root/include/TH1.h:220:21: note: candidate function not viable: no known conversion from ‘TTreeReaderValue<Float_t>’ to ‘Double_t’ (aka ‘double’) for 1st argument
virtual Int_t Fill(Double_t x);
I’ve tried many different things, but I can’t get past this. Can anybody help.
Thanks,
Faisal