]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- bug fix for allowing the definition of histogram bins and range as part of the...
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Nov 2010 09:40:08 +0000 (09:40 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Nov 2010 09:40:08 +0000 (09:40 +0000)
HLT/BASE/AliHLTTTreeProcessor.cxx

index 65d44eb502e39186528c65efa961e93f4d8b291a..0ad257b2b46d50071742f00a25c9802d718987fb 100644 (file)
@@ -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<TH1*>(gDirectory->Get(d.GetName().Data()));
+  //Now, cut off the binning part of a name
+  histName = histName(0, histName.Index("("));
+  TH1 * hist = dynamic_cast<TH1*>(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