]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New multiplicity cut framework. Allows for more dynamic definition
authorcholm <Christian.Holm.Christensen@cern.ch>
Wed, 29 Jan 2014 15:25:11 +0000 (16:25 +0100)
committercholm <Christian.Holm.Christensen@cern.ch>
Fri, 11 Apr 2014 15:09:33 +0000 (17:09 +0200)
of cuts.  Less is stored in the objects, but we have a flag that
says which method to use.

PWGLF/FORWARD/analysis2/AliFMDMultCuts.cxx
PWGLF/FORWARD/analysis2/AliFMDMultCuts.h
PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx

index 66b0ac256bee794103c7e05f7619914a92e6738a..8db2bb9aaef9732fb40896daaec3ddf6e0fc167c 100644 (file)
@@ -18,10 +18,7 @@ ClassImp(AliFMDMultCuts)
 //____________________________________________________________________
 AliFMDMultCuts::AliFMDMultCuts()
   : TObject(),
-    fMPVFraction(0), 
-    fNXi(0), 
-    fIncludeSigma(false),
-    fProbability(0)
+    fMethod(kFixed)
 {
   Reset();
 }
@@ -33,10 +30,7 @@ AliFMDMultCuts::AliFMDMultCuts(EMethod method,
                               Double_t cut4,
                               Double_t cut5)
   : TObject(),
-    fMPVFraction(0), 
-    fNXi(0), 
-    fIncludeSigma(false),
-    fProbability(0)
+    fMethod(method)
 {
   Set(method, cut1, cut2, cut3, cut4, cut5);
 }
@@ -44,72 +38,78 @@ AliFMDMultCuts::AliFMDMultCuts(EMethod method,
 //____________________________________________________________________
 AliFMDMultCuts::AliFMDMultCuts(const AliFMDMultCuts& o)
   : TObject(o),
-    fMPVFraction(o.fMPVFraction), 
-    fNXi(o.fNXi), 
-    fIncludeSigma(o.fIncludeSigma),
-    fProbability(o.fProbability)
+    fMethod(o.fMethod)
 {
-  for (Int_t i = 0; i < 5; i++) fMultCuts[i] = o.fMultCuts[i];
+  for (Int_t i = 0; i < 5; i++) fCuts[i] = o.fCuts[i];
 }
 //____________________________________________________________________
 AliFMDMultCuts&
 AliFMDMultCuts::operator=(const AliFMDMultCuts& o)
 {
   if (&o == this) return *this; 
-  fMPVFraction  = o.fMPVFraction;
-  fNXi          = o.fNXi;
-  fIncludeSigma = o.fIncludeSigma;
-  fProbability  = o.fProbability;
-  for (Int_t i = 0; i < 5; i++) fMultCuts[i] = o.fMultCuts[i];
+  fMethod  = o.fMethod;
+  for (Int_t i = 0; i < 5; i++) fCuts[i] = o.fCuts[i];
   return *this;
 }
 //____________________________________________________________________
 void
 AliFMDMultCuts::Reset()
 {
-  for (Int_t i = 0; i < 5; i++) fMultCuts[i] = -1;
-  fMPVFraction  = -1;
-  fNXi          = -1;
-  fIncludeSigma = false;
-  fProbability  = -1;
+  fMethod = kFixed;
+  for (Int_t i = 0; i < 5; i++) fCuts[i] = -1;
 }
 //____________________________________________________________________
 void
 AliFMDMultCuts::Set(EMethod method, 
-                   Double_t cut1
-                   Double_t cut2
-                   Double_t cut3
-                   Double_t cut4
-                   Double_t cut5)
+                   Double_t fmd1i
+                   Double_t fmd2i
+                   Double_t fmd2o
+                   Double_t fmd3i
+                   Double_t fmd3o)
 {
   // First, reset
   Reset();
+  fMethod      = method; 
+  Double_t oFac = 1;
+  if      (fMethod == kFixed)       oFac = 1.2;
+  else if (fMethod == kMPVFraction) oFac = 1.1;
+  fCuts[0] = fmd1i;
+  fCuts[1] = fmd2i >= 0 ? fmd2i : fmd1i;
+  fCuts[2] = fmd2o >= 0 ? fmd2o : fmd1i * oFac;
+  fCuts[3] = fmd3i >= 0 ? fmd3i : fmd1i;
+  fCuts[4] = fmd3o >= 0 ? fmd3o : fmd1i * oFac;
+}
+//____________________________________________________________________
+void
+AliFMDMultCuts::DepSet(const char* what,
+                      EMethod method, 
+                      Double_t fmd1i, 
+                      Double_t fmd2i, 
+                      Double_t fmd2o, 
+                      Double_t fmd3i, 
+                      Double_t fmd3o)
+{
+  Warning(what, "*** DEPRECATED - use AliFMDMultCuts::Set instead ***");
+  Set(method, fmd1i, fmd2i, fmd2o, fmd3i, fmd3o);
+}
   
-  // Then switch on method 
-  switch(method) { 
-  case kFixed:  
-    if (cut2 < 0) SetMultCuts(cut1, cut1, cut1*1.2, cut1*1.2, cut1);
-    else          SetMultCuts(cut1, cut2, cut3, cut4, cut5);
-    break;
-  case kMPVFraction: 
-    SetMPVFraction(cut1);
-    break;
-  case kFitRange:
-    break;
-  case kLandauWidth:
-    SetNXi(cut1);
-    SetIncludeSigma(cut2 > 0);
-    break;
-  case kProbability:
-    SetProbability(cut1);
-    break;
+//____________________________________________________________________
+void
+AliFMDMultCuts::SetIncludeSigma(Bool_t in) 
+{
+  Warning("SetIncludeSigma",  
+         "*** DEPRECATED - use AliFMDMultCuts::Set instead ***");
+  if (in) { 
+    if (fMethod == kLandauWidth) fMethod = kLandauSigmaWidth;
+  }
+  else {
+    if (fMethod == kLandauSigmaWidth) fMethod = kLandauWidth;
   }
 }
-  
 
 //____________________________________________________________________
 Double_t
-AliFMDMultCuts::GetFixedCut(UShort_t d, Char_t r) const
+AliFMDMultCuts::GetCutParam(UShort_t d, Char_t r) const
 {
   // Int_t    idx = (d == 1 ? 0 : 2*(d - 2) + 1 + ((r=='I' || r=='i') ? 0 : 1));
   Int_t idx = -1;
@@ -118,25 +118,9 @@ AliFMDMultCuts::GetFixedCut(UShort_t d, Char_t r) const
   case 2: idx = 1 + ((r == 'I' || r == 'i') ? 0 : 1); break;
   case 3: idx = 3 + ((r == 'I' || r == 'i') ? 0 : 1); break;
   }
-  if (idx < 0) return -1024;
-  return fMultCuts[idx];
-}
-
-//____________________________________________________________________
-void
-AliFMDMultCuts::SetMultCuts(Double_t fmd1i, 
-                           Double_t fmd2i, 
-                           Double_t fmd2o, 
-                           Double_t fmd3i, 
-                           Double_t fmd3o)
-{
-  fMultCuts[0] = fmd1i;
-  fMultCuts[1] = fmd2i >= 0 ? fmd2i : fmd1i;
-  fMultCuts[2] = fmd2o >= 0 ? fmd2o : fmd1i;
-  fMultCuts[3] = fmd3i >= 0 ? fmd3i : fmd1i;
-  fMultCuts[4] = fmd3o >= 0 ? fmd3o : fmd1i;
+  if (idx < 0) return -kBad;
+  return fCuts[idx];
 }
-
                            
 //____________________________________________________________________
 Double_t
@@ -151,37 +135,52 @@ AliFMDMultCuts::GetMultCut(UShort_t d, Char_t r, Int_t ieta,
   // Return:
   //    Lower cut on multiplicity
   //
-  UShort_t meth = GetMethod();
   DGUARD(fDebug, 5, "Get mult cut for FMD%d%c (method %d) @ etabin=%d", 
-        d, r, meth, ieta);
-  Double_t rcut = -1024;
-  if (meth == kFixed) rcut = GetFixedCut(d, r);
+        d, r, fMethod, ieta);
+  Double_t param = GetCutParam(d, r);
+  if (param < 0) {
+    Warning("GetMultCut", "Got bad cut parameter for FMD%d%c ieta=%d",
+           d, r, ieta);
+    return -kBad;
+  }
+
+  // If we're using a fixed cut, just return
+  if (fMethod == kFixed) {
+    DMSG(fDebug, 5, "-> %8.4f", param);
+    return param;
+  }
 
-  if (rcut < 0) {
-    // Get the energy loss fits 
-    AliForwardCorrectionManager&  fcm = 
-      AliForwardCorrectionManager::Instance();
-    const AliFMDCorrELossFit* fits = fcm.GetELossFit();
-    if (fits) {
-      switch (meth) { 
-      case kMPVFraction:
-       // Return fMPVFraction * mpv 
-       rcut = fits->GetLowerBound(d, r, ieta, fMPVFraction); break;
-      case kLandauWidth:
-       // Return MPV - fNXi * xi
-       rcut = fits->GetLowerBound(d, r, ieta, fNXi, errors,fIncludeSigma);
-       break;
-      case kProbability:
-       // Return probability cut 
-       rcut = fits->GetLowerBound(d, r, ieta, fProbability, true); break;
-      default:
-       // Return lower fit boundary
-       rcut = fits->GetLowCut(); break;
-      }
+  // Bad value 
+  Double_t rcut = -kBad;
+
+  // Get the energy loss fits 
+  AliForwardCorrectionManager&  fcm = 
+    AliForwardCorrectionManager::Instance();
+  const AliFMDCorrELossFit* fits = fcm.GetELossFit();
+  if (fits) {
+    switch (fMethod) { 
+    case kMPVFraction:
+      // Return fMPVFraction * mpv 
+      rcut = fits->GetLowerBound(d, r, ieta, param); break;
+    case kLandauWidth:
+      // Return MPV - fNXi * xi
+      rcut = fits->GetLowerBound(d, r, ieta, param, errors,false);
+      break;
+    case kLandauSigmaWidth:
+      // Return MPV - fNXi * xi
+      rcut = fits->GetLowerBound(d, r, ieta, param, errors,true);
+      break;
+    case kProbability:
+      // Return probability cut 
+      rcut = fits->GetLowerBound(d, r, ieta, param, true); break;
+    default:
+      // Return lower fit boundary
+      rcut = fits->GetLowCut(); break;
     }
-    else 
-      Warning("GetMultCut", "No energy loss fits obtained from manager");
   }
+  else 
+    Warning("GetMultCut", "No energy loss fits obtained from manager");
+
   DMSG(fDebug, 5, "-> %8.4f", rcut);
     
   return rcut;
@@ -209,27 +208,50 @@ AliFMDMultCuts::GetMultCut(UShort_t d, Char_t r, Double_t eta,
   return GetMultCut(d, r, iEta, errors);
 }
 //____________________________________________________________________
-UShort_t
-AliFMDMultCuts::GetMethod() const
+const char*
+AliFMDMultCuts::GetMethodString(Bool_t latex) const
 {
-  return (fMultCuts[0] >= 0 ? kFixed : // Fixed
-         fMPVFraction >  0 ? kMPVFraction : // Fraction MPV
-         fNXi         >  0 ? kLandauWidth :  // Width 
-         fProbability >  0 ? kProbability : 
-         kFitRange); // Fit range
+  return Method2String(fMethod, latex);
 }
+
 //____________________________________________________________________
 const char*
-AliFMDMultCuts::GetMethodString() const
+AliFMDMultCuts::Method2String(EMethod method, Bool_t latex)
 {
-  switch (GetMethod()) {
-  case kFixed:       return "fixed value";
-  case kMPVFraction: return "fraction of MPV";
-  case kFitRange:    return "fit range";
-  case kLandauWidth: return "landau width";
-  case kProbability: return "probability";
+  switch (method) {
+  case kFixed:            
+    return latex ? "c=X" : "fixed value";
+  case kMPVFraction:      
+    return latex ? "c=X#times#Delta_{p}":"fraction of MPV";
+  case kFitRange:         
+    return latex ? "range" : "c: lower fit bound";
+  case kLandauWidth:      
+    return latex ? "c=#Delta_{p}-X#times#xi" : "landau width";
+  case kLandauSigmaWidth: 
+    return latex ? "c=#Delta_{p}-X#times(#xi+#sigma)" : "landau+sigma width";
+  case kProbability:      
+    return latex ? "c:P(#Delta<c)<X" : "probability";
   }
-  return "unknown";
+  return latex ? "c:?" : "unknown";
+} 
+//____________________________________________________________________
+AliFMDMultCuts::EMethod
+AliFMDMultCuts::String2Method(const char* str)
+{
+  TString m(str);
+  if (m.EqualTo("fixed value")     || m.Contains("fix")) 
+    return kFixed;
+  else if (m.EqualTo("fraction of mpv") || m.Contains("mpv")) 
+    return kMPVFraction;
+  else if (m.EqualTo("fit range")       || m.Contains("fit")) 
+    return kFitRange;
+  else if (m.EqualTo("landau width")    || m.Contains("xi") || 
+          m.Contains("width")) return kLandauWidth;
+  else if (m.EqualTo("landau+sigma width") || m.Contains("sig")) 
+    return kLandauSigmaWidth;
+  else if (m.EqualTo("probability")        || m.Contains("prob")) 
+    return kProbability;
+  return kFixed;
  } 
   
 //____________________________________________________________________
@@ -237,7 +259,7 @@ void
 AliFMDMultCuts::FillHistogram(TH2* h) const
 {
   DGUARD(fDebug, 5, "Fill Histogram %s with cuts", h->GetName());
-  AliInfoF("Caching multiplicity cuts (%s)", h->GetName());
+  // AliInfoF("Caching multiplicity cuts (%s)", h->GetName());
   TAxis* yAxis = h->GetYaxis(); 
   for (Int_t iy = 1; iy <= yAxis->GetNbins(); iy++) { 
     TString lab(yAxis->GetBinLabel(iy));
@@ -245,11 +267,12 @@ AliFMDMultCuts::FillHistogram(TH2* h) const
     UShort_t det = lab.Atoi();
     Char_t   rng = lab[1];
     // Printf("Filling for FMD%d%c (bin # %d) %s", det, rng, iy, lab.Data());
-    AliInfoF("FMD%d%c", det, rng);
+    DMSG(fDebug, 5, "FMD%d%c", det, rng);
+    // AliInfoF("FMD%d%c", det, rng);
     for (Int_t ix = 1; ix <= h->GetNbinsX(); ix++) {
       Double_t eta = h->GetXaxis()->GetBinCenter(ix);
       Double_t c   = GetMultCut(det, rng, eta,  false);
-      DMSG(fDebug, 5, "FMD%s bin=%4d -> eta=%8.4f -> %8.4f", 
+      DMSG(fDebug, 10, "FMD%s bin=%4d -> eta=%8.4f -> %8.4f", 
           lab.Data(), ix, eta, c);
       // Double_t c = GetMultCut(det, rng, ix, false);
       if (c > 0) h->SetBinContent(ix, iy, c);
@@ -270,11 +293,12 @@ AliFMDMultCuts::Output(TList* l, const char* name) const
   }
     
 
-  ll->Add(AliForwardUtil::MakeParameter("nXi", fNXi));
-  ll->Add(AliForwardUtil::MakeParameter("frac", fMPVFraction));
-  ll->Add(AliForwardUtil::MakeParameter("sigma", fIncludeSigma));
-  ll->Add(AliForwardUtil::MakeParameter("probability", fProbability));
-  ll->Add(AliForwardUtil::MakeParameter("method", GetMethod()));
+  ll->Add(AliForwardUtil::MakeParameter("method", UShort_t(fMethod)));
+  ll->Add(AliForwardUtil::MakeParameter("fmd1i", fCuts[0]));
+  ll->Add(AliForwardUtil::MakeParameter("fmd2i", fCuts[1]));
+  ll->Add(AliForwardUtil::MakeParameter("fmd2o", fCuts[2]));
+  ll->Add(AliForwardUtil::MakeParameter("fmd3i", fCuts[3]));
+  ll->Add(AliForwardUtil::MakeParameter("fmd3o", fCuts[4]));
 }
 //____________________________________________________________________
 Bool_t
@@ -287,15 +311,30 @@ AliFMDMultCuts::Input(TList* l, const char* name)
   }
   if (!ll) return false;
   
-  TObject* nXi   = ll->FindObject("nXi");
-  TObject* frac  = ll->FindObject("frac");
-  TObject* sigma = ll->FindObject("sigma");
-  TObject* prob  = ll->FindObject("probability");
-  if (!nXi || !frac || !sigma) return false;
-  AliForwardUtil::GetParameter(nXi, fNXi);
-  AliForwardUtil::GetParameter(frac, fMPVFraction);
-  AliForwardUtil::GetParameter(sigma, fIncludeSigma);
-  AliForwardUtil::GetParameter(prob, fProbability);
+  TObject* meth    = ll->FindObject("method");
+  TObject* fmd1i   = ll->FindObject("fmd1i");
+  TObject* fmd2i   = ll->FindObject("fmd2i");
+  TObject* fmd2o   = ll->FindObject("fmd2o");
+  TObject* fmd3i   = ll->FindObject("fmd3i");
+  TObject* fmd3o   = ll->FindObject("fmd3o");
+  
+  UShort_t methNum = 0;
+  
+  AliForwardUtil::GetParameter(meth,  methNum);
+  switch (methNum) { 
+  case 0: fMethod = kFixed;            break;
+  case 1: fMethod = kMPVFraction;      break;
+  case 2: fMethod = kFitRange;         break;
+  case 3: fMethod = kLandauWidth;      break;
+  case 4: fMethod = kLandauSigmaWidth; break;
+  case 5: fMethod = kProbability;      break;
+  }
+
+  AliForwardUtil::GetParameter(fmd1i, fCuts[0]);
+  AliForwardUtil::GetParameter(fmd2i, fCuts[1]);
+  AliForwardUtil::GetParameter(fmd2o, fCuts[2]);
+  AliForwardUtil::GetParameter(fmd3i, fCuts[3]);
+  AliForwardUtil::GetParameter(fmd3o, fCuts[4]);
   
   return true;
 }
@@ -317,18 +356,13 @@ AliFMDMultCuts::Print(Option_t*) const
 {
   gROOT->IncreaseDirLevel();
   PFV("Method used", GetMethodString());
-  PF("Fixed cuts","");
   gROOT->IncreaseDirLevel();
-  PFV("FMD1i", GetFixedCut(1,'I'));
-  PFV("FMD2i", GetFixedCut(2,'I'));
-  PFV("FMD2o", GetFixedCut(2,'O'));
-  PFV("FMD3i", GetFixedCut(3,'I'));
-  PFV("FMD3o", GetFixedCut(3,'O'));
+  PFV("FMD1i", GetCutParam(1,'I'));
+  PFV("FMD2i", GetCutParam(2,'I'));
+  PFV("FMD2o", GetCutParam(2,'O'));
+  PFV("FMD3i", GetCutParam(3,'I'));
+  PFV("FMD3o", GetCutParam(3,'O'));
   gROOT->DecreaseDirLevel();
-  PFV("N xi factor",           fNXi);
-  PFB("Include sigma in cut",  fIncludeSigma);
-  PFV("MPV fraction",          fMPVFraction);
-  PFV("Probability",           fProbability);
   gROOT->DecreaseDirLevel();
 }
 //____________________________________________________________________
index 5898fa7095131c99af1a004294ddc11610448513..345e545bf82897ecd6710e4739f2ddfa9b04d685 100644 (file)
@@ -10,26 +10,15 @@ class TH2;
  *
  * - Using a fixed value @f$ v@f$- AliFMDMultCuts:: SetMultCuts
  * - Using a fraction @f$ f@f$ of the most probably value (@f$ \Delta_p@f$)
- *   from the energy loss fits - AliFMDMultCuts::SetMPVFraction
+ *   from the energy loss fits
  * - Using some number @f$ n@$ of widths (@f$ \xi@f$) below the most
- *   probable value (@f$ \Delta_p@f$) from the energy loss fits -
- *   possibly including the Gaussian variance (@f$ \sigma@f$) -
- *   AliFMDMultCuts::SetNXi and AliFMDMultCuts::SetIncludeSigma
+ *   probable value (@f$ \Delta_p@f$) from the energy loss fits 
+ * - Using some number @f$ n@$ of widths (@f$ \xi+\sigma@f$) below the
+ *   most probable value (@f$ \Delta_p@f$) from the energy loss fits 
  * - Using the @f$ x@f$ value for which @f$ P(x>p)@f$ given some cut
  *   value @f$ p@f$
  * - Using the lower fit range of the energy loss fits
  *
- * Which method used depends on the settings of @f$ v@f$, @f$ f@f$,
- * and @f$ n@f$:
- *
- * - if @f$ v > 0@f$ then give @f$ v@f$ 
- * - if @f$ f > 0@f$ then give @f$ f\Delta_p@f$ 
- * - if @f$ n > 0@f$ and @f$\sigma@f$ included then give 
- *   @f$ \Delta_p - n(\xi+\sigma)@f$ 
- * - if @f$ n > 0@f$ then give @f$ \Delta_p - n\xi@f$ 
- * - if @f$ p > 0@f$ then give @f$ x@f$ for which @f$ P(x>p)@f$ 
- * - otherwise, give lower bound on fit range 
- *
  * The member function AliFMDMultCuts::Reset resets all cut values,
  * meaning the lower bound on the fits will be used by default.  This
  * is useful to ensure a fresh start:
@@ -37,7 +26,7 @@ class TH2;
  * @code 
  AliFMDMultCuts c;
  c.Reset();
- c.SetNXi(2);
+ c.Set(AliFMDMultCuts::kLandauWidth,2);
  @endcode 
  *
  * The member function AliFMDMultCuts::GetMethod will return the
@@ -54,8 +43,13 @@ public:
     kMPVFraction, 
     kFitRange, 
     kLandauWidth,
+    kLandauSigmaWidth,
     kProbability
   };
+  enum {
+    kBad = 1024
+  };
+  
   /** 
    * CTOR
    */
@@ -63,19 +57,19 @@ public:
   /** 
    * Set the cut for specified method.
    * 
-   * @param method Method to use 
-   * @param cut1   1st cut value
-   * @param cut2   2nd cut value (ignored for method!=kFixed)
-   * @param cut3   3rd cut value (ignored for method!=kFixed)
-   * @param cut4   4th cut value (ignored for method!=kFixed
-   * @param cut5   5th cut value (ignored for method!=kFixed)
+   * @param method Cut method
+   * @param fmd1i  Value for FMD1i
+   * @param fmd2i  Value for FMD2i (if < 0, use fmd1i) 
+   * @param fmd2o  Value for FMD2o (if < 0, use fmd1i) 
+   * @param fmd3i  Value for FMD3i (if < 0, use fmd1i
+   * @param fmd3o  Value for FMD3o (if < 0, use fmd1i) 
    */
    AliFMDMultCuts(EMethod method, 
-                 Double_t cut1
-                 Double_t cut2=-1, 
-                 Double_t cut3=-1, 
-                 Double_t cut4=-1, 
-                 Double_t cut5=-1);
+                 Double_t fmd1i
+                 Double_t fmd2i=-1, 
+                 Double_t fmd2o=-1, 
+                 Double_t fmd3i=-1, 
+                 Double_t fmd3o=-1);
   /** 
    * Copy CTOR
    * 
@@ -106,7 +100,7 @@ public:
    */
   Double_t GetMultCut(UShort_t d, Char_t r, Double_t eta, Bool_t errors) const;
   /** 
-   * Get the multiplicity cuts for a specific ring and pseudo-rapidity 
+   * Get the multiplicity cuts for a specific ring and pseudo-rapidity bin
    * 
    * @param d      Detector 
    * @param r      Ring  
@@ -116,74 +110,88 @@ public:
    * @return Cut value 
    */
   Double_t GetMultCut(UShort_t d, Char_t r, Int_t etabin, Bool_t errors) const;
-  /** 
-   * Clear the cuts 
-   * 
-   */
-  void UnsetMultCuts() { SetMultCuts(-1); }
   /** 
    * Set the cuts
    * 
-   * @param fmd1i  Value for FMD1i 
-   * @param fmd2i  Value for FMD2i 
-   * @param fmd2o  Value for FMD2o 
-   * @param fmd3i  Value for FMD3i 
-   * @param fmd3o  Value for FMD3o 
+   * @param fmd1i  Value for FMD1i
+   * @param fmd2i  Value for FMD2i (if < 0, use fmd1i) 
+   * @param fmd2o  Value for FMD2o (if < 0, use fmd1i) 
+   * @param fmd3i  Value for FMD3i (if < 0, use fmd1i) 
+   * @param fmd3o  Value for FMD3o (if < 0, use fmd1i) 
+   *
+   * @deprecated Use AliFMDMultCuts::Set 
    */
   void SetMultCuts(Double_t fmd1i, 
                   Double_t fmd2i=-1, 
                   Double_t fmd2o=-1, 
                   Double_t fmd3i=-1, 
-                  Double_t fmd3o=-1);
+                  Double_t fmd3o=-1) 
+  { 
+    DepSet("SetMultCuts", kFixed,fmd1i,fmd2i,fmd2o,fmd3i,fmd3o); 
+  }
   /** 
    * Set the faction of most probable value 
    * 
    * @param frac Fraction
+   *
+   * @deprecated Use AliFMDMultCuts::Set 
    */
-  void SetMPVFraction(Double_t frac=0) { fMPVFraction = frac; }
+  void SetMPVFraction(Double_t frac=0) 
+  { 
+    DepSet("SetMPVFraction",kMPVFraction, frac); 
+  }
   /** 
    * Set the number times the Landau width
    * 
    * @param nXi Number of widths 
+   *
+   * @deprecated Use AliFMDMultCuts::Set 
    */
-  void SetNXi(Double_t nXi) { fNXi = nXi; }
+  void SetNXi(Double_t nXi) { DepSet("SetNXi", kLandauWidth, nXi); }
   /** 
    * Set wether to includle the Gaussian sigma in cut calculation
    * 
    * @param in If true, use Gaussian variance 
+   *
+   * @deprecated Use AliFMDMultCuts::Set with kLandauSigmaWidth
    */
-  void SetIncludeSigma(Bool_t in) { fIncludeSigma = in; }
+  void SetIncludeSigma(Bool_t in);
   /** 
    * Set probability cut.  See
    * AliFMDCorrELossFit::ELossFit::FindProbabilityCut
    * 
    * @param cut Cut value 
+   *
+   * @deprecated Use AliFMDMultCuts::Set 
    */
-  void SetProbability(Double_t cut=1e-5) { fProbability = cut; }
+  void SetProbability(Double_t cut=1e-5) 
+  { 
+    DepSet("SetProbability", kProbability, cut); 
+  }
   /** 
    * Set the cut for specified method.
    *
-   * Note, that if @a method is kFixed, and only @a cut1 is specified,
+   * Note, that if @a method is kFixed, and only @a fmd1i is specified,
    * then the outer rings cut value is increased by 20% relative to @a
-   * cut1.
+   * fmd1i.
    *
    * Also note, that if @a method is kLandauWidth, and @a cut2 is
    * larger than zero, then @f$\sigma@f$ of the fits are included in
    * the cut value.
    * 
    * @param method Method to use 
-   * @param cut1   1st cut value
-   * @param cut2   2nd cut value (ignored for method!=kFixed)
-   * @param cut3   3rd cut value (ignored for method!=kFixed)
-   * @param cut4   4th cut value (ignored for method!=kFixed
-   * @param cut5   5th cut value (ignored for method!=kFixed)
+   * @param fmd1i  Value for FMD1i
+   * @param fmd2i  Value for FMD2i (if < 0, use fmd1i) 
+   * @param fmd2o  Value for FMD2o (if < 0, use fmd1i) 
+   * @param fmd3i  Value for FMD3i (if < 0, use fmd1i
+   * @param fmd3o  Value for FMD3o (if < 0, use fmd1i) 
    */
   void Set(EMethod method, 
-          Double_t cut1
-          Double_t cut2=-1, 
-          Double_t cut3=-1, 
-          Double_t cut4=-1, 
-          Double_t cut5=-1);
+          Double_t fmd1i
+          Double_t fmd2i=-1, 
+          Double_t fmd2o=-1, 
+          Double_t fmd3i=-1, 
+          Double_t fmd3o=-1);
   /** 
    * Print information
    * 
@@ -213,35 +221,66 @@ public:
    * @return true on success
    */
   Bool_t Input(TList* l, const char* name);
-  /** 
-   * Get a fixed cut value 
-   * 
-   * @param d Detector
-   * @param r Ring 
-   * 
-   * @return Fixed cut value 
-   */
-  Double_t GetFixedCut(UShort_t d, Char_t r) const;
   /** 
    * Return methid Id
    * 
    * @return method number
    */
-  UShort_t GetMethod() const;
+  EMethod GetMethod() const { return fMethod; }
   /** 
    * Get a string descriping the method used
    * 
    * @return String 
    */
-  const char* GetMethodString() const;
+  const char* GetMethodString(Bool_t latex=false) const;
+  /** 
+   * helper function to translate a method into a string 
+   * 
+   * @param method Method identifier 
+   * 
+   * @return String 
+   */
+  static const char* Method2String(EMethod method, Bool_t latex);
+  /** 
+   * Helper function to translate a string into a method identifier 
+   * 
+   * @param str String
+   * 
+   * @return Method identifier 
+   */
+  static EMethod String2Method(const char* str);
 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 
-  Double_t fProbability;   // Probability cut
+  /** 
+   * Set the cut for specified method.
+   *
+   * @param method Cut method
+   * @param fmd1i  Value for FMD1i
+   * @param fmd2i  Value for FMD2i (if < 0, use fmd1i) 
+   * @param fmd2o  Value for FMD2o (if < 0, use fmd1i) 
+   * @param fmd3i  Value for FMD3i (if < 0, use fmd1i) 
+   * @param fmd3o  Value for FMD3o (if < 0, use fmd1i) 
+   */
+  void DepSet(const char* what, 
+             EMethod method, 
+             Double_t fmd1i, 
+             Double_t fmd2i=-1, 
+             Double_t fmd2o=-1, 
+             Double_t fmd3i=-1, 
+             Double_t fmd3o=-1);
+  /** 
+   * Get the cut parameter for a specific ring 
+   * 
+   * @param d Detector
+   * @param r Ring 
+   * 
+   * @return Cut parameter
+   */
+  Double_t GetCutParam(UShort_t d, Char_t r) const;
+
+  Double_t fCuts[5];   // Fixed cuts
+  EMethod  fMethod;
 
-  ClassDef(AliFMDMultCuts,4); // Cuts on ESD Mult 
+  ClassDef(AliFMDMultCuts,5); // Cuts on ESD Mult 
 };
 
 #endif
index 0ca1c60175b8d3d4d411646bb928eeab7cd0ed0e..fda63dd65c01a342c743c6c98a80c339c7d5f966 100644 (file)
@@ -115,9 +115,8 @@ AliFMDSharingFilter::AliFMDSharingFilter(const char* title)
   fRingHistos.Add(new RingHistos(3, 'I'));
   fRingHistos.Add(new RingHistos(3, 'O'));
 
-  fHCuts.SetNXi(1);
-  fHCuts.SetIncludeSigma(1);
-  fLCuts.SetMultCuts(.15);
+  fHCuts.Set(AliFMDMultCuts::kLandauSigmaWidth, 1);
+  fLCuts.Set(AliFMDMultCuts::kFixed, .15);
 
   // fExtraDead.Reset(-1);
 }