]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h
Added tasks and trains to investigate time-to-previous event.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDDensityCalculator.h
index 574eba11ad076048242dfa0b7c2033ac745850a8..478b5c6799541e8c8696590834c19c775fbfc26e 100644 (file)
@@ -16,6 +16,7 @@
 #include <TNamed.h>
 #include <TList.h>
 #include <TArrayI.h>
+#include <TVector3.h>
 #include "AliForwardUtil.h"
 #include "AliFMDMultCuts.h"
 #include "AliPoissonCalculator.h"
@@ -60,6 +61,10 @@ public:
     /** Correct the energy loss */
     kPhiCorrectELoss
   };
+  /** 
+   * Folder name 
+   */
+  static const char* fgkFolderName;
   /** 
    * Constructor 
    */
@@ -93,44 +98,44 @@ public:
    * 
    * @param etaAxis Not used 
    */
-  virtual void Init(const TAxis& etaAxis);
+  virtual void SetupForData(const TAxis& etaAxis);
   /** 
    * Do the calculations 
    * 
    * @param fmd      AliESDFMD object (possibly) corrected for sharing
    * @param hists    Histogram cache
-   * @param vtxBin   Vertex bin 
    * @param lowFlux  Low flux flag. 
    * @param cent     Centrality 
-   * @param vz       Vertex Z position
+   * @param ip       Coordinates of interaction point
    * 
    * @return true on successs 
    */
   virtual Bool_t Calculate(const AliESDFMD&        fmd, 
                           AliForwardUtil::Histos& hists, 
-                          UShort_t                vtxBin, 
                           Bool_t                  lowFlux, 
                           Double_t                cent=-1, 
-                          Double_t                vz=0);
+                          const TVector3&         ip=TVector3(1024,1024,0));
   /** 
    * Scale the histograms to the total number of events 
    * 
    * @param dir     where to put the output
+   * @param output  Output list
    * @param nEvents Number of events 
    */
-  virtual void ScaleHistograms(const TList* dir, Int_t nEvents);
+  virtual void Terminate(const TList* dir, TList* output, Int_t nEvents);
   /** 
    * Output diagnostic histograms to directory 
    * 
    * @param dir List to write in
    */  
-  virtual void DefineOutput(TList* dir);
+  virtual void CreateOutputObjects(TList* dir);
   /** 
    * Set the debug level.  The higher the value the more output 
    * 
    * @param dbg Debug level 
    */
-  void SetDebug(Int_t dbg=1) { fDebug = dbg; }
+  void SetDebug(Int_t dbg=1) { fDebug = dbg; } 
+  void SetDoTiming(Bool_t enable=true) { fDoTiming = enable; }
   /** 
    * Maximum particle weight to use 
    * 
@@ -159,6 +164,13 @@ public:
    * 
    */
   void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
+  /** 
+   * In case of a displaced vertices recalculate eta and angle correction
+   * 
+   * @param use recalculate or not
+   * 
+   */
+  void SetRecalculatePhi(Bool_t use) { fRecalculatePhi = use; }
   /** 
    * Set whether to use the phi acceptance correction. 
    * 
@@ -181,6 +193,12 @@ public:
     fEtaLumping = (eta < 1 ? 1 : eta); 
     fPhiLumping = (phi < 1 ? 1 : phi); 
   }
+  /** 
+   * Set the minimum quality of the energy loss fits 
+   * 
+   * @param cut Cut value 
+   */
+  void SetMinQuality(UShort_t cut=10) { fMinQuality = cut; }
   /** 
    * Get the multiplicity cut.  If the user has set fMultCut (via
    * SetMultCut) then that value is used.  If not, then the lower
@@ -209,6 +227,12 @@ public:
    */
   Double_t GetMultCut(UShort_t d, Char_t r, Int_t ieta, 
                      Bool_t errors=true) const;
+  /** 
+   * Set the minimum quality of the energy loss fits 
+   * 
+   * @return Cut value 
+   */
+  UShort_t GetMinQuality() const { return fMinQuality; }
   /** 
    * Print information 
    * 
@@ -277,17 +301,16 @@ protected:
    * @param mult     Signal
    * @param d        Detector
    * @param r        Ring 
-   * @param s        Sector 
-   * @param t        Strip (not used)
-   * @param v        Vertex bin 
    * @param eta      Pseudo-rapidity 
    * @param lowFlux  Low-flux flag 
    * 
    * @return The number of particles 
    */
-  virtual Float_t NParticles(Float_t mult, 
-                            UShort_t d, Char_t r, UShort_t s, UShort_t t, 
-                            UShort_t v, Float_t eta, Bool_t lowFlux) const;
+  virtual Float_t NParticles(Float_t  mult, 
+                            UShort_t d, 
+                            Char_t   r, 
+                            Float_t  eta, 
+                            Bool_t   lowFlux) const;
   /** 
    * Get the inverse correction factor.  This consist of
    * 
@@ -297,16 +320,14 @@ protected:
    * 
    * @param d        Detector
    * @param r        Ring 
-   * @param s        Sector 
-   * @param t        Strip (not used)
-   * @param v        Vertex bin 
+   * @param t        Strip 
    * @param eta      Pseudo-rapidity 
    * @param lowFlux  Low-flux flag 
    * 
-   * @return 
+   * @return the correction factor 
    */
-  virtual Float_t Correction(UShort_t d, Char_t r, UShort_t s, UShort_t t, 
-                            UShort_t v, Float_t eta, Bool_t lowFlux) const;
+  virtual Float_t Correction(UShort_t d, Char_t r, UShort_t t, 
+                            Float_t eta, Bool_t lowFlux) const;
   /** 
    * Get the acceptance correction for strip @a t in an ring of type @a r
    * 
@@ -363,33 +384,39 @@ protected:
      * 
      * @param eAxis 
      */
-    void Init(const TAxis& eAxis);
+    void SetupForData(const TAxis& eAxis);
     /** 
      * Make output 
      * 
      * @param dir Where to put it 
      */
-    void Output(TList* dir);
+    void CreateOutputObjects(TList* dir);
     /** 
      * Scale the histograms to the total number of events 
      * 
      * @param dir     Where the output is 
      * @param nEvents Number of events 
      */
-    void ScaleHistograms(TList* dir, Int_t nEvents);
-    TH2D*     fEvsN;           // Correlation of Eloss vs uncorrected Nch
-    TH2D*     fEvsM;           // Correlation of Eloss vs corrected Nch
-    TProfile* fEtaVsN;         // Average uncorrected Nch vs eta
-    TProfile* fEtaVsM;         // Average corrected Nch vs eta
+    void Terminate(TList* dir, Int_t nEvents);
+    TList*    fList;
+    // TH2D*     fEvsN;           // Correlation of Eloss vs uncorrected Nch
+    // TH2D*     fEvsM;           // Correlation of Eloss vs corrected Nch
+    // TProfile* fEtaVsN;         // Average uncorrected Nch vs eta
+    // TProfile* fEtaVsM;         // Average corrected Nch vs eta
     TProfile* fCorr;           // Average correction vs eta
     TH2D*     fDensity;        // Distribution inclusive Nch
     TH2D*     fELossVsPoisson; // Correlation of energy loss vs Poisson N_ch
+    TH1D*     fDiffELossPoisson;// Relative difference to Poisson
     AliPoissonCalculator fPoisson; // Calculate density using Poisson method
     TH1D*     fELoss;          // Energy loss as seen by this 
     TH1D*     fELossUsed;      // Energy loss in strips with signal 
     Double_t  fMultCut;        // If set, use this
-    
-    ClassDef(RingHistos,6);
+    TH1D*     fTotal;          // Total number of strips per eta
+    TH1D*     fGood;           // Number of good strips per eta
+    TH2D*     fPhiAcc;         // Phi acceptance vs IpZ
+    TH1D*     fPhiBefore;      // Phi before re-calce 
+    TH1D*     fPhiAfter;       // Phi after re-calc
+    ClassDef(RingHistos,9);
   };
   /** 
    * Get the ring histogram container 
@@ -420,9 +447,14 @@ protected:
   Int_t    fPhiLumping;    //  How to lump phi bins for Poisson 
   Int_t    fDebug;         //  Debug level 
   AliFMDMultCuts fCuts;    // Cuts
-  Bool_t fRecalculateEta;  //  //Whether to recalculate eta and angle correction (disp vtx)
+  Bool_t   fRecalculateEta;  // Whether to recalc eta and angle correction (disp vtx)
+  Bool_t   fRecalculatePhi;  // Whether to correct for (X,Y) offset
+  UShort_t fMinQuality;      // Least quality for fits
+  AliForwardUtil::Histos fCache;
+  Bool_t                 fDoTiming;
+  TProfile*              fHTiming;
 
-  ClassDef(AliFMDDensityCalculator,7); // Calculate Nch density 
+  ClassDef(AliFMDDensityCalculator,13); // Calculate Nch density 
 };
 
 #endif