]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h
New script to generate overview index. Javascript code to
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDDensityCalculator.h
index db71189ab8bbc08927565fd2fe16e56e5e27b04e..454d0e0172e1b2530297e8176a4cef308a3b8d15 100644 (file)
@@ -106,7 +106,7 @@ public:
    * @param hists    Histogram cache
    * @param lowFlux  Low flux flag. 
    * @param cent     Centrality 
-   * @param vz       Vertex Z position
+   * @param ip       Coordinates of interaction point
    * 
    * @return true on successs 
    */
@@ -119,6 +119,7 @@ public:
    * 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 Terminate(const TList* dir, TList* output, Int_t nEvents);
@@ -133,7 +134,8 @@ public:
    * 
    * @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 
    * 
@@ -191,6 +193,26 @@ 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; }
+  /** 
+   * Set the maximum ratio of outlier bins to the total number of bins
+   * with data.  
+   * 
+   * @param ratio Maximum ratio (number between 0 and 1) 
+   */
+  void SetMaxOutliers(Double_t ratio=0.10) { fMaxOutliers = ratio; }
+  /** 
+   * Set the maximum relative diviation between @f$N_{ch}^{Poisson}@f$
+   * and @f$N_{ch}^{\Delta}@f$
+   * 
+   * @param cut Relative cut (number between 0 and 1) 
+   */
+  void SetOutlierCut(Double_t cut=0.50) { fOutlierCut = cut; }
   /** 
    * Get the multiplicity cut.  If the user has set fMultCut (via
    * SetMultCut) then that value is used.  If not, then the lower
@@ -219,6 +241,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 
    * 
@@ -252,6 +280,19 @@ protected:
   Int_t FindMaxWeight(const AliFMDCorrELossFit* cor,
                      UShort_t d, Char_t r, Int_t iEta) const;
 
+  /** 
+   * Find the max weight to use for FMD<i>dr</i> in eta @a eta
+   * 
+   * @param cor   Correction
+   * @param d     Detector 
+   * @param r     Ring 
+   * @param eta   Eta
+   *
+   * @return The maximum weight 
+   */
+  Int_t FindMaxWeight(const AliFMDCorrELossFit* cor,
+                     UShort_t d, Char_t r, Double_t iEta) const;
+
   /** 
    * Find the max weights and cache them 
    * 
@@ -306,13 +347,11 @@ 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 t, 
                             Float_t eta, Bool_t lowFlux) const;
@@ -333,6 +372,23 @@ protected:
    * @return Newly allocated histogram of acceptance corrections
    */
   virtual TH1D*   GenerateAcceptanceCorrection(Char_t r) const;
+  /** 
+   * Check if, for a given region, whether this is an outlier 
+   * 
+   * The condition for an outlier event are 
+   * @f[
+   * |N_{ch}^{Poisson} - N_{ch}^{\Delta}| / N_{ch}^{\Delta} > c
+   * @f]
+   *
+   * @param eloss    @f$ N_{ch}^{\Delta}@f$ - number of charged particles
+   * @param poisson  @f$ N_{ch}^{Poisson}@f$ - number of charged particles
+   * @param cut      @f$ c@f$ - the cut 
+   * 
+   * @return true if the region reflects an outlier event 
+   */
+  virtual Bool_t CheckOutlier(Double_t eloss, 
+                             Double_t poisson,
+                             Double_t cut=0.5) const;
   /** 
    * Internal data structure to keep track of the histograms
    */
@@ -387,14 +443,17 @@ protected:
      */
     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
+    // 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
+    TH2D*     fELossVsPoissonOut; // Correlation of energy loss vs Poisson N_ch
+    TH1D*     fDiffELossPoissonOut;// Relative difference to Poisson
+    TH1D*     fOutliers;       // Fraction of outliers per event 
     AliPoissonCalculator fPoisson; // Calculate density using Poisson method
     TH1D*     fELoss;          // Energy loss as seen by this 
     TH1D*     fELossUsed;      // Energy loss in strips with signal 
@@ -404,7 +463,7 @@ protected:
     TH2D*     fPhiAcc;         // Phi acceptance vs IpZ
     TH1D*     fPhiBefore;      // Phi before re-calce 
     TH1D*     fPhiAfter;       // Phi after re-calc
-    ClassDef(RingHistos,9);
+    ClassDef(RingHistos,10);
   };
   /** 
    * Get the ring histogram container 
@@ -435,10 +494,16 @@ protected:
   Int_t    fPhiLumping;    //  How to lump phi bins for Poisson 
   Int_t    fDebug;         //  Debug level 
   AliFMDMultCuts fCuts;    // Cuts
-  Bool_t fRecalculateEta;  // Whether to recalc eta and angle correction (disp vtx)
-  Bool_t fRecalculatePhi;  // Whether to correct for (X,Y) offset
+  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;
+  Double_t               fMaxOutliers; // Maximum ratio of outlier bins 
+  Double_t               fOutlierCut;  // Maximum relative diviation 
 
-  ClassDef(AliFMDDensityCalculator,9); // Calculate Nch density 
+  ClassDef(AliFMDDensityCalculator,14); // Calculate Nch density 
 };
 
 #endif