]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add method as parameter output
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Nov 2012 09:22:51 +0000 (09:22 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Nov 2012 09:22:51 +0000 (09:22 +0000)
PWGLF/FORWARD/analysis2/AliFMDMultCuts.cxx
PWGLF/FORWARD/analysis2/AliFMDMultCuts.h

index b2e3b894ee96eccc3332795e4288ca7b438145fd..d95321401713e2a86e6762330b2e2514b2499a02 100644 (file)
@@ -118,6 +118,28 @@ AliFMDMultCuts::GetMultCut(UShort_t d, Char_t r, Double_t eta,
   
   return GetMultCut(d, r, iEta, errors);
 }
+//____________________________________________________________________
+UShort_t
+AliFMDMultCuts::GetMethod() const
+{
+  return (fMultCuts[0] >= 0 ? kFixed : // Fixed
+         fMPVFraction >  0 ? kMPVFraction : // Fraction MPV
+         fNXi         <  0 ? kFitRange : // Fit range
+         kLandauWidth);
+}
+//____________________________________________________________________
+const char*
+AliFMDMultCuts::GetMethodString() const
+{
+  switch (GetMethod()) {
+  case kFixed:       return "fixed value";
+  case kMPVFraction: return "fraction of MPV";
+  case kFitRange:    return "fit range";
+  case kLandauWidth: return "landau width";
+  }
+  return "unknown";
+} 
+
 //____________________________________________________________________
 void
 AliFMDMultCuts::Output(TList* l, const char* name) const
@@ -130,9 +152,11 @@ AliFMDMultCuts::Output(TList* l, const char* name) const
     l->Add(ll);
   }
     
+
   ll->Add(AliForwardUtil::MakeParameter("nXi", fNXi));
   ll->Add(AliForwardUtil::MakeParameter("frac", fMPVFraction));
   ll->Add(AliForwardUtil::MakeParameter("sigma", fIncludeSigma));
+  ll->Add(AliForwardUtil::MakeParameter("method", GetMethod()));
 }
 //____________________________________________________________________
 Bool_t
@@ -164,11 +188,7 @@ AliFMDMultCuts::Print(Option_t*) const
   for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
   ind[gROOT->GetDirLevel()] = '\0';
   std::cout << std::boolalpha 
-           << ind << "  Method used:           " 
-           << (fMultCuts[0] >= 0 ? "fixed value" : 
-               fMPVFraction > 0 ? "fraction of MPV" : 
-               fNXi < 0 ? "fit range" : 
-               "landau width") << '\n'
+           << ind << "  Method used:           " << GetMethodString() << '\n'
            << ind << "  Fixed cuts:            "
            << "FMD1i=" << GetFixedCut(1,'I') << " "
            << "FMD2i=" << GetFixedCut(2,'I') << " "
index d000465b157c38b5b9df13cabe6132ed151447ba..b55fdbcf35bfe2b532611e60c9c0d9274c4733ec 100644 (file)
@@ -9,6 +9,12 @@
 class AliFMDMultCuts : public TObject 
 {
 public:
+  enum { 
+    kFixed, 
+    kMPVFraction, 
+    kFitRange, 
+    kLandauWidth 
+  };
   /** 
    * CTOR
    */
@@ -117,13 +123,25 @@ public:
    * @return Fixed cut value 
    */
   Double_t GetFixedCut(UShort_t d, Char_t r) const;
+  /** 
+   * Return methid Id
+   * 
+   * @return method number
+   */
+  UShort_t GetMehod() const;
+  /** 
+   * Get a string descriping the method used
+   * 
+   * @return String 
+   */
+  const char* GetMehodString() const;
 protected:
   Double_t fMultCuts[5];   // Fixed cuts
   Double_t fMPVFraction;   // Most probably value fraction
   Double_t fNXi;           // Times of Landau width
   Bool_t   fIncludeSigma;  // Include Gaussian variance 
    
-  ClassDef(AliFMDMultCuts,1); // Cuts on ESD Mult 
+  ClassDef(AliFMDMultCuts,2); // Cuts on ESD Mult 
 };
 
 #endif