]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliFMDEnergyFitterTask.h
changed name of add task macro. git test.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDEnergyFitterTask.h
index 5e1a1c245d84df0a69f89248ef36cf45d71b466a..a04aef52fceb6dbb6308cc06bab9c3c0c68ea5d2 100644 (file)
  * 
  * @brief  
  * 
- * @ingroup pwg2_forward_eloss
+ * @ingroup pwglf_forward_eloss
  * 
  */
-#include <AliAnalysisTaskSE.h>
+#include "AliBaseESDTask.h"
 #include "AliFMDEventInspector.h"
 #include "AliFMDEnergyFitter.h"
-#include <AliESDFMD.h>
-#include <TH1I.h>
 class AliESDEvent;
 class TH2D;
 class TList;
@@ -38,11 +36,11 @@ class TTree;
  * @par Corrections used 
  *   - None
  * 
- * @ingroup pwg2_forward_tasks
- * @ingroup pwg2_forward_eloss
+ * @ingroup pwglf_forward_tasks
+ * @ingroup pwglf_forward_eloss
  * 
  */
-class AliFMDEnergyFitterTask : public AliAnalysisTaskSE
+class AliFMDEnergyFitterTask : public AliBaseESDTask
 {
 public:
   /** 
@@ -56,45 +54,48 @@ public:
    */
   AliFMDEnergyFitterTask();
   /** 
-   * Copy constructor 
-   * 
-   * @param o Object to copy from 
+   * @{ 
+   * @name Interface methods 
    */
-  AliFMDEnergyFitterTask(const AliFMDEnergyFitterTask& o);
   /** 
-   * Assignment operator 
+   * Called on master when setting up the train. 
    * 
-   * @param o Object to assign from 
-   * 
-   * @return Reference to this object 
-   */
-  AliFMDEnergyFitterTask& operator=(const AliFMDEnergyFitterTask& o);
-  /** 
-   * @{ 
-   * @name Interface methods 
+   * @return Always true 
    */
+  virtual Bool_t Setup();
   /** 
-   * Initialize the task 
+   * Book output objects. Derived class should define this to book
+   * output objects on the processing output list @c fList before the
+   * actual event processing.  This is called on the master and on
+   * each slave.
    * 
+   * If this member function returns false, the execution is stopped
+   * with a fatal signal.
+   *
+   * @return true on success. 
    */
-  virtual void Init();
+  virtual Bool_t Book();
   /** 
-   * Create output objects 
+   * Called after reading in the first event. Here we can setup stuff
+   * depending on the conditions we're running under.
    * 
+   * @return true on success.  If this returns false, then we turn the
+   * task into a zombie and we do no more processing.
    */
-  virtual void UserCreateOutputObjects();
+  virtual Bool_t PreData(const TAxis& vertex, const TAxis& eta);
   /** 
    * Process each event 
    *
-   * @param option Not used
+   * @param esd Event to analyse
+   * @return true on success
    */  
-  virtual void UserExec(Option_t* option);
+  virtual Bool_t Event(AliESDEvent& esd);
   /** 
    * End of job
    * 
-   * @param option Not used 
+   * @return true on success
    */
-  virtual void Terminate(Option_t* option);
+  virtual Bool_t Finalize();
   /** 
    * @} 
    */
@@ -114,6 +115,12 @@ public:
    * @return Reference to AliFMDEventInspector object 
    */
   AliFMDEventInspector& GetEventInspector() { return fEventInspector; }
+  /**
+   * Get reference to the EventInspector algorithm 
+   * 
+   * @return Reference to AliFMDEventInspector object 
+   */
+  const AliFMDEventInspector& GetEventInspector() const{return fEventInspector;}
   /**
    * Get reference to the EnergyFitter algorithm 
    * 
@@ -123,31 +130,68 @@ public:
   /** 
    * @} 
    */
+  /** 
+   * @{ 
+   * @name Settings 
+   */
   /** 
    * Set the debug level 
    * 
    * @param dbg Debug level
    */
   void SetDebug(Int_t dbg);
-
-  void SetBLow(Float_t b) {fbLow = b;}
-  void SetBHigh(Float_t b) {fbHigh = b;}
-
+  /** 
+   * Set whether to only look at MB (INEL) data, so as to avoid 
+   * bias from different trigger scalars. 
+   * 
+   * @param onlyMB if true, only analyse MB events
+   */
+  void SetOnlyMB(Bool_t onlyMB) { fOnlyMB = onlyMB; }
+  /* @} */
+  /** 
+   * @{ 
+   * @name Default axes 
+   */
+  /** 
+   * Set the default eta axis to use in case we didn't get one from
+   * the read-in corretions.  Override this if the sub class should go
+   * on even without a valid eta axis from the corrections (e.g. QA
+   * task)
+   * 
+   * @return null
+   */
+  virtual TAxis* DefaultEtaAxis() const;
+  /** 
+   * Set the default eta axis to use in case we didn't get one from
+   * the read-in corretions.  Override this if the sub class should go
+   * on even without a valid eta axis from the corrections (e.g. QA
+   * task)
+   * 
+   * @return null
+   */
+  virtual TAxis* DefaultVertexAxis() const;
+  /* @} */
 protected: 
   /** 
-   * Initialise the sub objects and stuff.  Called on first event 
+   * Copy constructor 
+   * 
+   * @param o Object to copy from 
+   */
+  AliFMDEnergyFitterTask(const AliFMDEnergyFitterTask& o);
+  /** 
+   * Assignment operator 
+   * 
+   * @param o Object to assign from 
    * 
+   * @return Reference to this object 
    */
-  virtual void   InitializeSubs();
+  AliFMDEnergyFitterTask& operator=(const AliFMDEnergyFitterTask& o);
 
-  Bool_t               fFirstEvent;     // Whether the event is the first seen 
   AliFMDEventInspector fEventInspector; // Algorithm
   AliFMDEnergyFitter   fEnergyFitter;   // Algorithm
-  TList*               fList;           // Output list 
-  Float_t              fbLow;
-  Float_t              fbHigh;
-  
-  ClassDef(AliFMDEnergyFitterTask,1) // Forward multiplicity class
+  Bool_t               fOnlyMB;         // Only MB flag
+
+  ClassDef(AliFMDEnergyFitterTask,4) // Forward multiplicity class
 };
 
 #endif