AliPhysics  32b88a8 (32b88a8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFMDDensityCalculator.h
Go to the documentation of this file.
1 // This class calculates the inclusive charged particle density
2 // in each for the 5 FMD rings.
3 //
4 #ifndef ALIFMDDENSITYCALCULATOR_H
5 #define ALIFMDDENSITYCALCULATOR_H
6 
16 #include <TNamed.h>
17 #include <TList.h>
18 #include <TArrayI.h>
19 #include <TVector3.h>
20 #include "AliForwardUtil.h"
21 #include "AliFMDMultCuts.h"
22 #include "AliPoissonCalculator.h"
23 class AliESDFMD;
24 class TH2D;
25 class TH1D;
26 class TProfile;
27 class AliFMDCorrELossFit;
28 
48 {
49 public:
55  enum {
62  };
66  static const char* fgkFolderName;
76  AliFMDDensityCalculator(const char* name);
86  virtual ~AliFMDDensityCalculator();
100  virtual void SetupForData(const TAxis& etaAxis);
112  virtual Bool_t Calculate(const AliESDFMD& fmd,
113  AliForwardUtil::Histos& hists,
114  Bool_t lowFlux,
115  Double_t cent=-1,
116  const TVector3& ip=TVector3(1024,1024,0));
124  virtual void Terminate(const TList* dir, TList* output, Int_t nEvents);
130  virtual void CreateOutputObjects(TList* dir);
136  void SetDebug(Int_t dbg=1) { fDebug = dbg; }
137  void SetDoTiming(Bool_t enable=true) { fDoTiming = enable; }
184  void SetLumping(Int_t eta, Int_t phi) {
185  fEtaLumping = (eta < 1 ? 1 : eta);
186  fPhiLumping = (phi < 1 ? 1 : phi);
187  }
193  void SetMinQuality(UShort_t cut=10) { fMinQuality = cut; }
200  void SetMaxOutliers(Double_t ratio=0.10) { fMaxOutliers = ratio; }
207  void SetOutlierCut(Double_t cut=0.50) { fOutlierCut = cut; }
221  Bool_t errors=true) const;
235  Bool_t errors=true) const;
241  UShort_t GetMinQuality() const { return fMinQuality; }
248  void Print(Option_t* option="") const;
254  AliFMDMultCuts& GetCuts() { return fCuts; }
260  void SetCuts(const AliFMDMultCuts& c) { fCuts = c; }
261 protected:
273  UShort_t d, Char_t r, Int_t iEta) const;
274 
286  UShort_t d, Char_t r, Double_t iEta) const;
287 
293  void CacheMaxWeights(const TAxis& axis);
304  Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const;
315  Int_t GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const;
316 
328  virtual Float_t NParticles(Float_t mult,
329  UShort_t d,
330  Char_t r,
331  Float_t eta,
332  Bool_t lowFlux) const;
348  virtual Float_t Correction(UShort_t d, Char_t r, UShort_t t,
349  Float_t eta, Bool_t lowFlux) const;
358  virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
366  virtual TH1D* GenerateAcceptanceCorrection(Char_t r) const;
381  virtual Bool_t CheckOutlier(Double_t eloss,
382  Double_t poisson,
383  Double_t cut=0.5) const;
389  {
393  RingHistos();
400  RingHistos(UShort_t d, Char_t r);
406  RingHistos(const RingHistos& o);
414  RingHistos& operator=(const RingHistos& o);
418  ~RingHistos();
424  void SetupForData(const TAxis& eAxis);
430  void CreateOutputObjects(TList* dir);
437  void Terminate(TList* dir, Int_t nEvents);
439  // TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
440  // TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
441  // TProfile* fEtaVsN; // Average uncorrected Nch vs eta
442  // TProfile* fEtaVsM; // Average corrected Nch vs eta
443  TProfile* fCorr; // Average correction vs eta
444  TH2D* fDensity; // Distribution inclusive Nch
445  TH2D* fELossVsPoisson; // Correlation of energy loss vs Poisson N_ch
446  TH1D* fDiffELossPoisson;// Relative difference to Poisson
447  TH2D* fELossVsPoissonOut; // Correlation of energy loss vs Poisson N_ch
448  TH1D* fDiffELossPoissonOut;// Relative difference to Poisson
449  TH1D* fOutliers; // Fraction of outliers per event
450  AliPoissonCalculator fPoisson; // Calculate density using Poisson method
451  TH1D* fELoss; // Energy loss as seen by this
452  TH1D* fELossUsed; // Energy loss in strips with signal
453  Double_t fMultCut; // If set, use this
454  TH1D* fTotal; // Total number of strips per eta
455  TH1D* fGood; // Number of good strips per eta
456  TH2D* fPhiAcc; // Phi acceptance vs IpZ
457  TH1D* fPhiBefore; // Phi before re-calce
458  TH1D* fPhiAfter; // Phi after re-calc
459  TH1D* fEtaBefore; // Phi before re-calce
460  TH1D* fEtaAfter; // Phi after re-calc
461  // ClassDef(RingHistos,10);
462  };
472  TList fRingHistos; // List of histogram containers
473  TH1D* fSumOfWeights; // Histogram
474  TH1D* fWeightedSum; // Histogram
475  TH1D* fCorrections; // Histogram
476  UShort_t fMaxParticles; // Maximum particle weight to use
477  Bool_t fUsePoisson; // If true, then use poisson statistics
478  UShort_t fUsePhiAcceptance; // Whether to correct for corners
479  TH1D* fAccI; // Acceptance correction for inner rings
480  TH1D* fAccO; // Acceptance correction for outer rings
481  TArrayI fFMD1iMax; // Array of max weights
482  TArrayI fFMD2iMax; // Array of max weights
483  TArrayI fFMD2oMax; // Array of max weights
484  TArrayI fFMD3iMax; // Array of max weights
485  TArrayI fFMD3oMax; // Array of max weights
486  TH2D* fMaxWeights; // Histogram of max weights
487  TH2D* fLowCuts; // Histogram of low cuts
488  Int_t fEtaLumping; // How to lump eta bins for Poisson
489  Int_t fPhiLumping; // How to lump phi bins for Poisson
490  Int_t fDebug; // Debug level
492  Bool_t fRecalculatePhi; // Whether to correct for (X,Y) offset
493  UShort_t fMinQuality; // Least quality for fits
496  TProfile* fHTiming;
497  Double_t fMaxOutliers; // Maximum ratio of outlier bins
498  Double_t fOutlierCut; // Maximum relative diviation
499 
500  ClassDef(AliFMDDensityCalculator,14); // Calculate Nch density
501 };
502 
503 #endif
504 // Local Variables:
505 // mode: C++
506 // End:
507 
Double_t GetMultCut(UShort_t d, Char_t r, Double_t eta, Bool_t errors=true) const
virtual void SetupForData(const TAxis &etaAxis)
void SetUsePhiAcceptance(UShort_t u=kPhiCorrectNch)
void CacheMaxWeights(const TAxis &axis)
double Double_t
Definition: External.C:58
Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const
virtual void Terminate(const TList *dir, TList *output, Int_t nEvents)
RingHistos & operator=(const RingHistos &o)
char Char_t
Definition: External.C:18
TCanvas * c
Definition: TestFitELoss.C:172
RingHistos * GetRingHistos(UShort_t d, Char_t r) const
AliForwardUtil::Histos fCache
AliFMDDensityCalculator & operator=(const AliFMDDensityCalculator &o)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Various utilities used in PWGLF/FORWARD.
void SetMaxOutliers(Double_t ratio=0.10)
ClassDef(AliFMDDensityCalculator, 14)
Definition: External.C:228
Definition: External.C:212
virtual void CreateOutputObjects(TList *dir)
void SetDoTiming(Bool_t enable=true)
virtual Float_t NParticles(Float_t mult, UShort_t d, Char_t r, Float_t eta, Bool_t lowFlux) const
virtual Bool_t Calculate(const AliESDFMD &fmd, AliForwardUtil::Histos &hists, Bool_t lowFlux, Double_t cent=-1, const TVector3 &ip=TVector3(1024, 1024, 0))
void SetOutlierCut(Double_t cut=0.50)
virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const
void Terminate(TList *dir, Int_t nEvents)
Float_t nEvents[nProd]
Int_t FindMaxWeight(const AliFMDCorrELossFit *cor, UShort_t d, Char_t r, Int_t iEta) const
virtual TH1D * GenerateAcceptanceCorrection(Char_t r) const
void SetCuts(const AliFMDMultCuts &c)
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
virtual Bool_t CheckOutlier(Double_t eloss, Double_t poisson, Double_t cut=0.5) const
static const char * fgkFolderName
void SetMinQuality(UShort_t cut=10)
virtual Float_t Correction(UShort_t d, Char_t r, UShort_t t, Float_t eta, Bool_t lowFlux) const
void Print(Option_t *option="") const
void SetLumping(Int_t eta, Int_t phi)