]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bugfix: specifying number of bins in TTree::Project, sets the TTree status correctly...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Sep 2010 11:57:59 +0000 (11:57 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Sep 2010 11:57:59 +0000 (11:57 +0000)
HLT/BASE/AliHLTTTreeProcessor.cxx
HLT/BASE/AliHLTTTreeProcessor.h

index 7d2761a7d2c00dd0d774622b09ce4b8656aeae0d..65d44eb502e39186528c65efa961e93f4d8b291a 100644 (file)
@@ -257,7 +257,15 @@ TH1* AliHLTTTreeProcessor::CreateHistogram(const AliHLTHistogramDefinition& d)
     return 0;
   }
 
-  const Long64_t rez = fTree->Project(d.GetName().Data(), d.GetExpression().Data(), d.GetCut().Data(), d.GetDrawOption().Data()); 
+  TString histName(d.GetName());
+  if (!histName.Contains("(")) {
+    //Without number of bins, the histogram will be "fixed"
+    //and most of values can go to underflow/overflow bins,
+    //since kCanRebin will be false.
+    histName += TString::Format("(%d)", Int_t(kDefaultNBins));
+  }
+
+  const Long64_t rez = fTree->Project(histName.Data(), d.GetExpression().Data(), d.GetCut().Data(), d.GetDrawOption().Data());
 
   if (rez == -1) {
     HLTError("TTree::Project failed");
index e1b126495437028c0fc4ac7aef01b3c11179ec84..9c7caee3291af6277924f5218e84f4759f58ac4b 100644 (file)
@@ -44,6 +44,7 @@ class AliHLTTTreeProcessor : public AliHLTProcessor {
 private:
   enum EDefaults {
     kMaxEntries = 1000,
+    kDefaultNBins = 200,
     kInterval = 5
   };
 public: