]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnValue.h
Fixes for the FMD train
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnValue.h
index a43f40c6ad75636807609ccc73f4bf8ed3e090c4..8ed7a93cb47f9f28a249f40b43e501bc9b956c24 100644 (file)
@@ -1,83 +1,46 @@
-//
-// Class AliRsnValue
-//
-// Definition of a single value which can be computed
-// from any of the defined input objects implemented
-// in the resonance package.
-//
-
 #ifndef ALIRSNVALUE_H
 #define ALIRSNVALUE_H
 
-#include "TNamed.h"
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Collection of all values which can be computed within the package
+//
+////////////////////////////////////////////////////////////////////////////////
+
 #include "TArrayD.h"
 
-class AliRsnPairDef;
-class AliRsnMother;
+#include "AliRsnTarget.h"
+
+class AliRsnValue : public AliRsnTarget {
+public:
+
+   AliRsnValue(const char *name = "", AliRsnTarget::ETargetType type = AliRsnTarget::kTargetTypes);
+   AliRsnValue(const AliRsnValue& copy);
+   AliRsnValue& operator=(const AliRsnValue& copy);
+   virtual ~AliRsnValue() { }
 
-class AliRsnValue : public TNamed
-{
-  public:
+   TArrayD&        GetArray()               {return fBinArray;}
+   const Double_t* GetArrayValues() const   {return fBinArray.GetArray();}
+   Double_t        GetComputedValue() const {return fComputedValue;}
 
-    enum EValueType
-    {
-      kTrack1P,
-      kTrack2P,
-      kTrack1Pt,
-      kTrack2Pt,
-      kTrack1Px,
-      kTrack1Py,
-      kTrack1Pz,
-      kTrack2Px,
-      kTrack2Py,
-      kTrack2Pz,
-      kPairInvMass,
-      kPairInvMassMC,
-      kPairInvMassRes,
-      kPairPt,
-      kPairEta,
-      kPairMt,
-      kPairY,
-      kPairCosThetaStar,
-      kPairCosThetaStar1,
-      kPairCosThetaStar2,
-      kPairCosThetaStarMC1,
-      kPairCosThetaStarMC2,
-      kAngleToLeading,
-      kLeadingPt,
-      kQInv,
-      kEventMult,
-      kValueTypes
-    };
+   void            SetUseMCInfo(Bool_t yn = kTRUE) {fUseMCInfo = yn;}
+   void            SetBins(Int_t n, Double_t min, Double_t max);
+   void            SetBins(Int_t n, Double_t *array);
+   void            SetBins(Double_t min, Double_t max, Double_t step);
 
-    AliRsnValue();
-    AliRsnValue(const char *name, EValueType type, Int_t n = 0, Double_t min = 0.0, Double_t max = 0.0);
-    AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
-    AliRsnValue(const char *name, EValueType type, Int_t n, Double_t *array);
-    AliRsnValue(const AliRsnValue& copy) : TNamed(copy),fType(copy.fType),fValue(copy.fValue),fArray(copy.fArray) {}
-    AliRsnValue& operator=(const AliRsnValue& copy) {SetName(copy.GetName());fType=copy.fType;fValue=copy.fValue;fArray=copy.fArray;return (*this);}
-    virtual ~AliRsnValue() { }
-    
-    TArrayD     GetArray() const {return fArray;}
-    Double_t    GetValue() const {return fValue;}
-    EValueType  GetValueType() {return fType;}
+   virtual Bool_t  Eval(TObject *object);
+   virtual void    Print(Option_t *option = "") const;
 
-    void        SetValueType(EValueType type) {fType = type;}
-    void        SetBins(Int_t n, Double_t min, Double_t max);
-    void        SetBins(Double_t min, Double_t max, Double_t step);
-    void        SetBins(Int_t n, Double_t *array);
-    
-    Bool_t      Eval(AliRsnMother * const mother, AliRsnPairDef * const pairDef, AliRsnEvent * const event);
-    void        Print(Option_t *option = "") const;
+protected:
 
-  private:
+   Bool_t   fUseMCInfo;      // flag to choose MC info when choice is possible
+   Double_t fComputedValue;  // computed value
+   TArrayD  fBinArray;       // array of bins (when used for a histogram axis)
 
-    EValueType fType;    // value type
-    Double_t   fValue;   // computed value
-    TArrayD    fArray;   // array of bins (when necessary)
-    
-    // ROOT dictionary
-    ClassDef(AliRsnValue, 1)
+   ClassDef(AliRsnValue, 3)  // AliRsnValue base class
 };
 
 #endif