AliPhysics  ebc57ae (ebc57ae)
 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; }
213  void SetHitThreshold(Double_t cut=0.9) { fHitThreshold = cut; }
227  Bool_t errors=true) const;
241  Bool_t errors=true) const;
247  UShort_t GetMinQuality() const { return fMinQuality; }
254  void Print(Option_t* option="") const;
260  AliFMDMultCuts& GetCuts() { return fCuts; }
266  void SetCuts(const AliFMDMultCuts& c) { fCuts = c; }
267 protected:
279  UShort_t d, Char_t r, Int_t iEta) const;
280 
292  UShort_t d, Char_t r, Double_t iEta) const;
293 
299  void CacheMaxWeights(const TAxis& axis);
310  Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const;
321  Int_t GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const;
322 
334  virtual Float_t NParticles(Float_t mult,
335  UShort_t d,
336  Char_t r,
337  Float_t eta,
338  Bool_t lowFlux) const;
354  virtual Float_t Correction(UShort_t d, Char_t r, UShort_t t,
355  Float_t eta, Bool_t lowFlux) const;
364  virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
372  virtual TH1D* GenerateAcceptanceCorrection(Char_t r) const;
387  virtual Bool_t CheckOutlier(Double_t eloss,
388  Double_t poisson,
389  Double_t cut=0.5) const;
395  {
399  RingHistos();
406  RingHistos(UShort_t d, Char_t r);
412  RingHistos(const RingHistos& o);
420  RingHistos& operator=(const RingHistos& o);
424  ~RingHistos();
430  void SetupForData(const TAxis& eAxis);
443  void Terminate(TList* dir, Int_t nEvents);
445  // TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
446  // TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
447  // TProfile* fEtaVsN; // Average uncorrected Nch vs eta
448  // TProfile* fEtaVsM; // Average corrected Nch vs eta
449  TProfile* fCorr; // Average correction vs eta
450  TH2D* fSignal; // Signal distribution vs eta
451  TH2D* fDensity; // Distribution inclusive Nch
452  TH2D* fELossVsPoisson; // Correlation of energy loss vs Poisson N_ch
453  TH1D* fDiffELossPoisson;// Relative difference to Poisson
454  TH2D* fELossVsPoissonOut; // Correlation of energy loss vs Poisson N_ch
455  TH1D* fDiffELossPoissonOut;// Relative difference to Poisson
456  TH1D* fOutliers; // Fraction of outliers per event
457  AliPoissonCalculator fPoisson; // Calculate density using Poisson method
458  TH1D* fELoss; // Energy loss as seen by this
459  TH1D* fELossUsed; // Energy loss in strips with signal
460  Double_t fMultCut; // If set, use this
461  TH1D* fTotal; // Total number of strips per eta
462  TH1D* fGood; // Number of good strips per eta
463  TH2D* fPhiAcc; // Phi acceptance vs IpZ
464  TH1D* fPhiBefore; // Phi before re-calce
465  TH1D* fPhiAfter; // Phi after re-calc
466  TH1D* fEtaBefore; // Phi before re-calce
467  TH1D* fEtaAfter; // Phi after re-calc
468  // ClassDef(RingHistos,10);
469  };
479  TList fRingHistos; // List of histogram containers
480  TH1D* fSumOfWeights; // Histogram
481  TH1D* fWeightedSum; // Histogram
482  TH1D* fCorrections; // Histogram
483  UShort_t fMaxParticles; // Maximum particle weight to use
484  Bool_t fUsePoisson; // If true, then use poisson statistics
485  UShort_t fUsePhiAcceptance; // Whether to correct for corners
486  TH1D* fAccI; // Acceptance correction for inner rings
487  TH1D* fAccO; // Acceptance correction for outer rings
488  TArrayI fFMD1iMax; // Array of max weights
489  TArrayI fFMD2iMax; // Array of max weights
490  TArrayI fFMD2oMax; // Array of max weights
491  TArrayI fFMD3iMax; // Array of max weights
492  TArrayI fFMD3oMax; // Array of max weights
493  TH2D* fMaxWeights; // Histogram of max weights
494  TH2D* fLowCuts; // Histogram of low cuts
495  Int_t fEtaLumping; // How to lump eta bins for Poisson
496  Int_t fPhiLumping; // How to lump phi bins for Poisson
497  Int_t fDebug; // Debug level
499  Bool_t fRecalculatePhi; // Whether to correct for (X,Y) offset
500  UShort_t fMinQuality; // Least quality for fits
501  Double_t fHitThreshold; // Threshold for hits
504  TProfile* fHTiming;
505  Double_t fMaxOutliers; // Maximum ratio of outlier bins
506  Double_t fOutlierCut; // Maximum relative diviation
507 
508  ClassDef(AliFMDDensityCalculator,16); // Calculate Nch density
509 };
510 
511 #endif
512 // Local Variables:
513 // mode: C++
514 // End:
515 
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, 16)
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)
void SetHitThreshold(Double_t cut=0.9)
virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const
void Terminate(TList *dir, Int_t nEvents)
Float_t nEvents[nProd]
Input train file.
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)
TDirectoryFile * dir