From 953ad7b015bf8757376f06dbb7cd3c32f8b34409 Mon Sep 17 00:00:00 2001 From: kkanaki Date: Tue, 2 Nov 2010 09:40:08 +0000 Subject: [PATCH] - bug fix for allowing the definition of histogram bins and range as part of the GlobalHisto configuration (Timur) --- HLT/BASE/AliHLTTTreeProcessor.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/HLT/BASE/AliHLTTTreeProcessor.cxx b/HLT/BASE/AliHLTTTreeProcessor.cxx index 65d44eb502e..0ad257b2b46 100644 --- a/HLT/BASE/AliHLTTTreeProcessor.cxx +++ b/HLT/BASE/AliHLTTTreeProcessor.cxx @@ -251,6 +251,7 @@ int AliHLTTTreeProcessor::ScanConfigurationArgument(int argc, const char** argv) TH1* AliHLTTTreeProcessor::CreateHistogram(const AliHLTHistogramDefinition& d) { + // create a histogram from the tree if (!fTree) { HLTError("fTree is a null pointer, try to call AliHLTTTreeProcessor::DoInit first."); @@ -272,7 +273,16 @@ TH1* AliHLTTTreeProcessor::CreateHistogram(const AliHLTHistogramDefinition& d) return 0; } - return dynamic_cast(gDirectory->Get(d.GetName().Data())); + //Now, cut off the binning part of a name + histName = histName(0, histName.Index("(")); + TH1 * hist = dynamic_cast(gDirectory->Get(histName.Data())); + if (!hist) { + //const TString msg(TString::Form("Hist %s is a null pointer, selection was %s, strange name or hist's type\n", histName.Data(), d.GetExpression().Data())); + const TString msg(Form("Hist %s is a null pointer, selection was %s, strange name or hist's type\n", histName.Data(), d.GetExpression().Data())); + HLTError(msg.Data()); + } + + return hist; } int AliHLTTTreeProcessor::ParseHistogramDefinition(int argc, const char** argv, int pos, AliHLTHistogramDefinition& dst)const -- 2.43.0