]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h
Mega commit of many changes to PWGLFforward
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardMultiplicityBase.h
index 2e0eef26684d258b505b0157b1ba5117c58d3a1b..6a856433ad80fc589083747c3fe1fcd5e133feac 100644 (file)
  * @ingroup pwglf_forward_aod
  */
 #include <AliAnalysisTaskSE.h>
+#include "AliForwardUtil.h"
+#include "AliAODForwardMult.h"
+#include "AliAODForwardEP.h"
 class AliFMDEventInspector;
 class AliFMDEnergyFitter;
 class AliFMDSharingFilter;
 class AliFMDDensityCalculator;
 class AliFMDCorrector;
 class AliFMDHistCollector;
+class AliAODHandler;
 class AliForwardCorrectionManager;
 class AliFMDEventPlaneFinder;
 class AliESDEvent;
@@ -90,7 +94,7 @@ public:
    * Create output objects 
    * 
    */
-  virtual void UserCreateOutputObjects() = 0;
+  virtual void UserCreateOutputObjects();
   /** 
    * Process each event 
    *
@@ -102,7 +106,7 @@ public:
    * 
    * @param option Not used 
    */
-  virtual void Terminate(Option_t* option) = 0;
+  virtual void Terminate(Option_t* option);
   /** 
    * @} 
    */
@@ -209,7 +213,7 @@ public:
    * 
    * @param dbg 
    */
-  virtual void SetDebug(Int_t dbg) = 0;
+  virtual void SetDebug(Int_t dbg);
   /** 
    * Overload super class method for setting debug level to call our
    * SetDebug member function.
@@ -221,6 +225,15 @@ public:
     AliAnalysisTaskSE::SetDebugLevel(dbg); 
     SetDebug(dbg);
   }
+  /** 
+   * Set whether to make separate branches for each ring.  If enabled
+   * there will be 5 additional branches on the AOD tree - each
+   * holding a TH2D object of the charged particle multiplicity in
+   * @f$(\eta,\varphi)@f$ bins for that event.
+   * 
+   * @param use If true, make separate branches for each ring. 
+   */
+  void SetStorePerRing(Bool_t use) { fStorePerRing = use; }
 protected: 
   /** 
    * Constructor 
@@ -235,6 +248,13 @@ protected:
   : AliAnalysisTaskSE(), 
     fEnableLowFlux(true), 
     fFirstEvent(true),
+    fStorePerRing(false),
+    fList(0),
+    fHData(0),
+    fHistos(),
+    fAODFMD(),
+    fAODEP(),
+    fRingSums(),
     fCorrManager(0)
   {}
   /** 
@@ -246,8 +266,18 @@ protected:
     : AliAnalysisTaskSE(o),
       fEnableLowFlux(o.fEnableLowFlux), 
       fFirstEvent(o.fFirstEvent),
+      fStorePerRing(o.fStorePerRing),
+      fList(o.fList),
+      fHData(o.fHData),
+      fHistos(o.fHistos),
+      fAODFMD(o.fAODFMD),
+      fAODEP(o.fAODEP),
+      fRingSums(o.fRingSums),
       fCorrManager(o.fCorrManager)
-  {}
+  {
+    DefineOutput(1, TList::Class());
+    DefineOutput(2, TList::Class());
+  }
   /** 
    * Assignment operator 
    * 
@@ -277,7 +307,8 @@ protected:
    */
   virtual Bool_t ReadCorrections(const TAxis*& pe, 
                                 const TAxis*& pv,
-                                Bool_t mc=false);
+                                Bool_t mc=false,
+                                Bool_t sat=false);
   /**
    * Get the ESD event. IF this is the first event, initialise
    *
@@ -289,12 +320,31 @@ protected:
    *
    * @return false on errors 
    */
-  virtual Bool_t SetupForData() = 0;
+  virtual Bool_t SetupForData();
+  /** 
+   * Initialize members based on eta and vertex axis - only available
+   * after first event - called from SetupForData.
+   * 
+   * @param pe @f$\eta@f$ axis
+   * @param pv Interaction point Z-coordinate axis 
+   */
+  virtual void InitMembers(const TAxis* pe, const TAxis* pv);
+  /**
+   * Create output branches - called from UserCreateOutputObjects
+   */
+  virtual void CreateBranches(AliAODHandler* ah);
   /**
    * Mark this event as one to store in the AOD 
    * 
    */
   virtual void MarkEventForStore() const;
+  /** 
+   * Do estimates of @f$dN/d\eta@f$  - called at Terminate
+   * 
+   * @param input  Input list
+   * @param output Output list
+   */
+  virtual void EstimatedNdeta(const TList* input, TList* output) const;
   /** 
    * Calculate a simple dN/deta from all accepted events 
    * 
@@ -325,8 +375,15 @@ protected:
                              TList*       output,
                              const char*  outName,
                              Int_t        style=20) const;
-  Bool_t fEnableLowFlux;// Whether to use low-flux specific code
-  Bool_t fFirstEvent;   // Whether the event is the first seen 
+  Bool_t                 fEnableLowFlux;// Whether to use low-flux specific code
+  Bool_t                 fFirstEvent;   // Whether the event is the first seen 
+  Bool_t                 fStorePerRing; // Store each ring on separate branch
+  TList*                 fList;         // Output list
+  TH2D*                  fHData;        // Summed 1/Nd^2N_{ch}/dphideta
+  AliForwardUtil::Histos fHistos;       // Cache histograms 
+  AliAODForwardMult      fAODFMD;       // Output object
+  AliAODForwardEP        fAODEP;        // Output object
+  AliForwardUtil::Histos fRingSums;     // Cache histograms 
 private:
   /**
    * A pointer to the corrections manager.  This is here to make the