make sure that exported MusrRoot files have proper stats in the histo objects.
This commit is contained in:
parent
5a0077f51b
commit
bcbe945d84
@ -4647,9 +4647,13 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
|
||||
str.Form("hDecay%03d", dataSet->GetHistoNo());
|
||||
length = dataSet->GetData()->size();
|
||||
histo = new TH1F(str.Data(), str.Data(), length+1, -0.5, static_cast<Double_t>(length)+0.5);
|
||||
Int_t sum=0, entries=0;
|
||||
for (UInt_t j=0; j<length; j++) {
|
||||
histo->SetBinContent(j+1, dataSet->GetData()->at(j));
|
||||
entries = dataSet->GetData()->at(j);
|
||||
histo->SetBinContent(j+1, entries);
|
||||
sum += entries;
|
||||
}
|
||||
histo->SetEntries(sum);
|
||||
histos.push_back(histo);
|
||||
}
|
||||
} else { // rebin > 1
|
||||
@ -4666,14 +4670,18 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
|
||||
length = dataSet->GetData()->size();
|
||||
histo = new TH1F(str.Data(), str.Data(), static_cast<Int_t>(length/fAny2ManyInfo->rebin)+1, -0.5, static_cast<Double_t>(static_cast<Int_t>(length/fAny2ManyInfo->rebin))+0.5);
|
||||
dataCount = 0;
|
||||
Int_t sum=0, entries=0;
|
||||
for (UInt_t j=0; j<length; j++) {
|
||||
if ((j > 0) && (j % fAny2ManyInfo->rebin == 0)) {
|
||||
dataCount++;
|
||||
histo->SetBinContent(dataCount, dataRebin);
|
||||
dataRebin = 0;
|
||||
}
|
||||
dataRebin += static_cast<UInt_t>(dataSet->GetData()->at(j));
|
||||
entries = dataSet->GetData()->at(j);
|
||||
sum += entries;
|
||||
dataRebin += static_cast<UInt_t>(entries);
|
||||
}
|
||||
histo->SetEntries(sum);
|
||||
histos.push_back(histo);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user