]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDReconstructor.h
AliEveEventManager
[u/mrichter/AliRoot.git] / FMD / AliFMDReconstructor.h
index 3108abc742d3cd2f8f2a917f9dcac19f5a108e4e..a39ab01083aeaa532d57d84c8303dd4fceb0751b 100644 (file)
 #ifndef ALIRECONSTRUCTOR_H
 # include <AliReconstructor.h>
 #endif
+#include "AliLog.h"
 
 //____________________________________________________________________
 class TTree;
 class TClonesArray;
 class AliFMDDigit;
 class AliRawReader;
-class AliRunLoader;
-class AliESD;
+class AliESDEvent;
 class AliESDFMD;
+class TH1;
+
 
 /** @defgroup FMD_rec Reconstruction */
 //____________________________________________________________________
@@ -56,11 +58,9 @@ public:
       manager, and finds the local to global transformations from the
       geometry.   The calibration parameter manager is also
       initialized (meaning that the calibration parameters is read
-      from CDB).   Next, we try to get some information about the run
-      from the run loader passed. 
-      @param runLoader Run loader to use to load and store data. 
+      from CDB).
   */
-  virtual void   Init(AliRunLoader* runLoader);
+  virtual void   Init();
   /** Flag that we can convert raw data into digits. 
       @return always @c true */
   virtual Bool_t HasDigitConversion() const { return kTRUE; }
@@ -71,9 +71,6 @@ public:
       @param reader     Raw reader. 
       @param digitsTree Tree to store read digits in. */
   virtual void   ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
-  /** Flag that we can do one-event reconstruction. 
-      @return always @c true  */
-  virtual Bool_t HasLocalReconstruction() const { return kTRUE; }
   /** Reconstruct one event from the digits passed in @a digitsTree.
       The member function creates AliFMDRecPoint objects and stores
       them on the output tree @a clusterTree.  An FMD ESD object is
@@ -82,6 +79,8 @@ public:
       @param digitsTree  Tree holding the digits of this event
       @param clusterTree Tree to store AliFMDRecPoint objects in. */
   virtual void   Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
+  /** Not used */
+  virtual void   Reconstruct(AliRawReader *, TTree*) const;
   /** Put in the ESD data, the FMD ESD data.  The object created by
       the Reconstruct member function is copied to the ESD object. 
       @param digitsTree   Tree of digits for this event - not used
@@ -90,15 +89,31 @@ public:
       @param esd ESD object to store data in. 
   */
   virtual void   FillESD(TTree* digitsTree, TTree* clusterTree, 
-                        AliESD* esd) const;
+                        AliESDEvent* esd) const;
+  /** Forwards to above member function */
+  virtual void   FillESD(AliRawReader*, TTree* clusterTree, 
+                        AliESDEvent* esd) const;
   /** Not used */
-  virtual void   SetESD(AliESD* esd) { fESD = esd; }
+  virtual void   SetESD(AliESDEvent* esd) { fESD = esd; }
   /** Set the noise factor 
       @param f Factor to use */
   virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
   /** Set whether we should do angle correction or nor 
       @param use If true, do angle correction */
   virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
+  /** Set whether we want to do diagnostics.  If this is enabled, a
+      file named @c FMD.Diag.root will be made.  It contains a set of
+      histograms for each event, filed in separate directories in the
+      file.  The histograms are 
+      @verbatim 
+      diagStep1   Read ADC vs. Noise surpressed ADC 
+      diagStep2   Noise surpressed ADC vs. calculated Energy dep.
+      diagStep3   Energy deposition vs. angle corrected Energy dep.
+      diagStep4   Energy deposition vs. calculated multiplicity
+      diagAll     Read ADC vs. calculated multiplicity
+      @endverbatim 
+      @param use If true, make the diagnostics file */
+  void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
 protected:
   /** Copy CTOR 
       @param other Object to copy from. */
@@ -107,6 +122,10 @@ protected:
       @param other Object to assign from
       @return reference to this object */
   AliFMDReconstructor& operator=(const AliFMDReconstructor& other);
+  /** Try to get the vertex from either ESD or generator header.  Sets
+      @c fCurrentVertex to the found Z posistion of the vertex (if 
+      found), and sets the flag @c fVertexType accordingly */
+  virtual void GetVertex() const;
   /** Process AliFMDDigit objects in @a digits.  For each digit, find
       the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
       energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
@@ -153,30 +172,31 @@ protected:
   virtual void     PhysicalCoordinates(AliFMDDigit* digit, Float_t& eta, 
                                       Float_t& phi) const;
   
+  enum Vertex_t {
+    kNoVertex,   // Got no vertex
+    kGenVertex,  // Got generator vertex 
+    kESDVertex   // Got ESD vertex 
+  };
   mutable TClonesArray* fMult;          // Cache of RecPoints
   mutable Int_t         fNMult;         // Number of entries in fMult 
   mutable TTree*        fTreeR;         // Output tree 
   mutable Float_t       fCurrentVertex; // Z-coordinate of primary vertex
   mutable AliESDFMD*    fESDObj;        // ESD output object
-  mutable Float_t       fNoiseFactor;   // Factor of noise to check
-  mutable Bool_t        fAngleCorrect;  // Whether to angle correct
-  AliESD*               fESD;           // ESD object(?)
-  
+  Float_t               fNoiseFactor;   // Factor of noise to check
+  Bool_t                fAngleCorrect;  // Whether to angle correct
+  mutable Vertex_t      fVertexType;    // What kind of vertex we got
+  AliESDEvent*          fESD;           // ESD object(?)
+  Bool_t                fDiagnostics;   // Wheter to do diagnostics
+  TH1*                  fDiagStep1;    // Diagnostics histogram
+  TH1*                  fDiagStep2;    // Diagnostics histogram
+  TH1*                  fDiagStep3;    // Diagnostics histogram
+  TH1*                  fDiagStep4;    // Diagnostics histogram
+  TH1*                  fDiagAll;      // Diagnostics histogram
+  mutable Bool_t        fZS[3];         // Zero-suppredded?
+  mutable UShort_t      fZSFactor[3];   // Noise factor for Zero-suppression
 private:
-  /** Hide base classes unused function */
-  void Reconstruct(AliRawReader*, TTree*) const;
-  /** Hide base classes unused function */
-  void Reconstruct(AliRunLoader*) const;
-  /** Hide base classes unused function */
-  void Reconstruct(AliRunLoader*, AliRawReader*) const;
-  /** Hide base classes unused function */
-  void FillESD(AliRawReader*, TTree*, AliESD*) const;
-  /** Hide base classes unused function */
-  void FillESD(AliRunLoader*, AliESD*) const;
-  /** Hide base classes unused function */
-  void FillESD(AliRunLoader*, AliRawReader*, AliESD*) const;
-  
-  ClassDef(AliFMDReconstructor, 0)  // class for the FMD reconstruction
+   
+  ClassDef(AliFMDReconstructor, 3)  // class for the FMD reconstruction
 }; 
 #endif
 //____________________________________________________________________