AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFMDEnergyFitter.h
Go to the documentation of this file.
1 //
2 // Class to fit the energy distribution.
3 //
4 #ifndef ALIFMDENERGYFITTER_H
5 #define ALIFMDENERGYFITTER_H
6 
16 #include <TNamed.h>
17 // #include <TH1D.h>
18 #include <TAxis.h>
19 #include <TList.h>
20 #include <TObjArray.h>
21 #include <TClonesArray.h>
22 #include "AliFMDCorrELossFit.h"
23 #include "AliForwardUtil.h"
24 #include "AliLandauGaus.h"
25 class TH1;
26 class TH2;
27 class AliESDFMD;
28 class TFitResult;
29 class TF1;
30 class TArrayD;
31 
49 class AliFMDEnergyFitter : public TNamed
50 {
51 public:
55  enum {
71  };
87  };
88 
92  enum FMDRingBits {
94  kFMD1I=0x01,
98  kFMD2I=0x02,
100  kFMD2O=0x04,
104  kFMD3I=0x08,
106  kFMD3O=0x10,
109  };
113  virtual ~AliFMDEnergyFitter();
123  AliFMDEnergyFitter(const char* title);
124 
125  // -----------------------------------------------------------------
141  void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax);
151  void SetEtaAxis(const TAxis& etaAxis);
164  void SetCentralityAxis(UShort_t nBins, Double_t* bins);
170  void SetLowCut(Double_t lowCut=0.3) { fLowCut = lowCut; }
171  Double_t GetLowCut() const { return fLowCut; }
185  void SetDoFits(Bool_t doFit=kTRUE) { fDoFits = doFit; }
192  void SetDoMakeObject(Bool_t doMake=kTRUE) { fDoMakeObject = doMake; }
198  void SetNParticles(UShort_t n) { fNParticles = (n<1 ? 1 : (n>7 ? 7 : n)); }
205  void SetMinEntries(UShort_t n) { fMinEntries = (n < 1 ? 1 : n); }
211  void SetMaxE(Double_t x) { fMaxE = x; }
217  void SetNEbins(Int_t x) { fNEbins = x; }
235  void SetMinWeight(Double_t c=1e-7) { fMinWeight = c; }
256  {
257  fResidualMethod = x;
258  }
286  {
287  fRegularizationCut = cut;
288  }
289  void SetSkips(UShort_t skip) { fSkips = skip; }
295  void SetDebug(Int_t dbg=1);
301  void SetEnableDeltaShift(Bool_t use=true);
302 
303  /* @} */
304  // -----------------------------------------------------------------
309  void Init();
317  virtual void CreateOutputObjects(TList* dir);
329  virtual void SetupForData(const TAxis& etaAxis, UShort_t sys=0);
339  virtual Bool_t Accumulate(const AliESDFMD& input,
340  Double_t cent,
341  Bool_t empty);
347  virtual void Fit(const TList* dir);
360  void Print(Option_t* option="") const;
368  Bool_t ReadParameters(const TCollection* list);
369  //==================================================================
378  {
383  RingHistos();
390  RingHistos(UShort_t d, Char_t r);
396  RingHistos(const RingHistos& o){;}
404  RingHistos& operator=(const RingHistos& o){return *this;}
408  ~RingHistos();
418  virtual TArrayD MakeIncreasingAxis(Int_t n,
419  Double_t min,
420  Double_t max) const;
431  TH2* Make(const char* name,
432  const char* title,
433  const TAxis& eAxis,
434  Double_t deMax=12,
435  Int_t nDeBins=300,
436  Bool_t incr=true);
442  virtual void CreateOutputObjects(TList* dir);
452  virtual void SetupForData(const TAxis& eAxis,
453  const TAxis& cAxis,
454  Double_t maxDE=10,
455  Int_t nDEbins=300,
456  Bool_t useIncrBin=true);
465  virtual void Fill(Bool_t empty, Double_t eta, Int_t icent, Double_t mult);
488  virtual TObjArray* Fit(TList* dir,
489  Double_t lowCut,
490  UShort_t nParticles,
491  UShort_t minEntries,
492  UShort_t minusBins,
493  Double_t relErrorCut,
494  Double_t chi2nuCut,
495  Double_t minWeight,
496  Double_t regCut,
497  EResidualMethod residuals) const;
536  virtual TObjArray* FitSlices(TList* dir,
537  const char* name,
538  Double_t lowCut,
539  UShort_t nParticles,
540  UShort_t minEntries,
541  UShort_t minusBins,
542  Double_t relErrorCut,
543  Double_t chi2nuCut,
544  Double_t minWeight,
545  Double_t regCut,
546  EResidualMethod residuals,
547  Bool_t scaleToPeak=true,
548  TObjArray* best=0) const;
556  virtual void Scale(TH1* dist) const;
586  virtual ELossFit_t* FitHist(TH1* dist,
587  Double_t lowCut,
588  UShort_t nParticles,
589  UShort_t minEntries,
590  UShort_t minusBins,
591  Double_t relErrorCut,
592  Double_t chi2nuCut,
593  Double_t minWeight,
594  Double_t regCut,
595  Bool_t scaleToPeak,
596  UShort_t& status) const;
610  virtual ELossFit_t* FindBestFit(const TH1* dist,
611  Double_t relErrorCut,
612  Double_t chi2nuCut,
613  Double_t minWeightCut) const;
624  Double_t lowCut,
625  TH1* dist,
626  ELossFit_t* fit,
627  TCollection* out) const;
640  virtual void FindBestFits(const TList* d,
641  AliFMDCorrELossFit& obj,
642  const TAxis& eta);
652  TH1* MakePar(const char* name, const char* title, const TAxis& eta) const;
667  TH1* MakeTotal(const char* name,
668  const char* title,
669  const TAxis& eta,
670  Int_t low,
671  Int_t high,
672  Double_t val,
673  Double_t err) const;
674  TH1* fEDist; // Ring energy distribution
675  TH1* fEmpty; // Ring energy dist for empty events
676  TH2* fHist; // Two dimension Delta distribution
677  // TList* fEtaEDists; // Energy distributions per eta bin.
679  mutable TObjArray fBest;
680  mutable TClonesArray fFits;
682  ClassDef(RingHistos,4);
683  };
684 protected:
699 
700  virtual RingHistos* CreateRingHistos(UShort_t d, Char_t r) const;
732  static Bool_t CheckSkip(UShort_t d, Char_t r, UShort_t skips);
733 
734  TList fRingHistos; // List of histogram containers
735  Double_t fLowCut; // Low cut on energy
736  UShort_t fNParticles; // Number of landaus to try to fit
737  UShort_t fMinEntries; // Minimum number of entries
738  UShort_t fFitRangeBinWidth; // N-bins to subtract from found max
739  Bool_t fDoFits; // Whether to actually do the fits
740  Bool_t fDoMakeObject; // Whether to make corrections object
741  TAxis fEtaAxis; // Eta axis
742  TAxis fCentralityAxis; // Centrality axis
743  Double_t fMaxE; // Maximum energy loss to consider
744  Int_t fNEbins; // Number of energy loss bins
745  Bool_t fUseIncreasingBins; // Wheter to use increasing bin sizes
746  Double_t fMaxRelParError; // Relative error cut
747  Double_t fMaxChi2PerNDF; // chi^2/nu cit
748  Double_t fMinWeight; // Minimum weight value
749  Int_t fDebug; // Debug level
750  EResidualMethod fResidualMethod; // Whether to store residuals (debugging)
751  UShort_t fSkips; // Rings to skip when fitting
752  Double_t fRegularizationCut; // When to regularize the chi^2
753 
754  ClassDef(AliFMDEnergyFitter,8); //
755 };
756 
757 #endif
758 // Local Variables:
759 // mode: C++
760 // End:
void SetEnableDeltaShift(Bool_t use=true)
virtual TArrayD MakeIncreasingAxis(Int_t n, Double_t min, Double_t max) const
EResidualMethod fResidualMethod
double Double_t
Definition: External.C:58
virtual void CreateOutputObjects(TList *dir)
void SetMaxRelativeParameterError(Double_t e=0.2)
void SetMinWeight(Double_t c=1e-7)
RingHistos & operator=(const RingHistos &o)
void SetMaxChi2PerNDF(Double_t c=10)
const char * title
Definition: MakeQAPdf.C:27
AliFMDEnergyFitter & operator=(const AliFMDEnergyFitter &o)
virtual void Fill(Bool_t empty, Double_t eta, Int_t icent, Double_t mult)
virtual void SetupForData(const TAxis &eAxis, const TAxis &cAxis, Double_t maxDE=10, Int_t nDEbins=300, Bool_t useIncrBin=true)
void SetDoFits(Bool_t doFit=kTRUE)
virtual Bool_t Accumulate(const AliESDFMD &input, Double_t cent, Bool_t empty)
void SetLowCut(Double_t lowCut=0.3)
char Char_t
Definition: External.C:18
virtual void Scale(TH1 *dist) const
Double_t GetLowCut() const
TCanvas * c
Definition: TestFitELoss.C:172
virtual void Fit(const TList *dir)
Declaration and implementation of Landau-Gauss distributions.
virtual void FindBestFits(const TList *d, AliFMDCorrELossFit &obj, const TAxis &eta)
void SetCentralityAxis(UShort_t nBins, Double_t *bins)
void SetSkips(UShort_t skip)
void SetFitRangeBinWidth(UShort_t n=4)
virtual ELossFit_t * FitHist(TH1 *dist, Double_t lowCut, UShort_t nParticles, UShort_t minEntries, UShort_t minusBins, Double_t relErrorCut, Double_t chi2nuCut, Double_t minWeight, Double_t regCut, Bool_t scaleToPeak, UShort_t &status) const
Bool_t ReadParameters(const TCollection *list)
void SetStoreResiduals(EResidualMethod x=kResidualDifference)
void SetMaxE(Double_t x)
TH2 * Make(const char *name, const char *title, const TAxis &eAxis, Double_t deMax=12, Int_t nDeBins=300, Bool_t incr=true)
virtual ELossFit_t * FindBestFit(const TH1 *dist, Double_t relErrorCut, Double_t chi2nuCut, Double_t minWeightCut) const
virtual void CreateOutputObjects(TList *dir)
TH1 * MakePar(const char *name, const char *title, const TAxis &eta) const
void SetNParticles(UShort_t n)
int Int_t
Definition: External.C:63
void SetDoMakeObject(Bool_t doMake=kTRUE)
Various utilities used in PWGLF/FORWARD.
TH1 * MakeTotal(const char *name, const char *title, const TAxis &eta, Int_t low, Int_t high, Double_t val, Double_t err) const
void SetRegularizationCut(Double_t cut=3e6)
virtual TObjArray * Fit(TList *dir, Double_t lowCut, UShort_t nParticles, UShort_t minEntries, UShort_t minusBins, Double_t relErrorCut, Double_t chi2nuCut, Double_t minWeight, Double_t regCut, EResidualMethod residuals) const
void SetUseIncreasingBins(Bool_t x)
virtual void CalculateResiduals(EResidualMethod mode, Double_t lowCut, TH1 *dist, ELossFit_t *fit, TCollection *out) const
Int_t mode
Definition: anaM.C:41
void SetMinEntries(UShort_t n)
void MakeCorrectionsObject(TList *dir)
Definition: External.C:220
void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax)
static Bool_t CheckSkip(UShort_t d, Char_t r, UShort_t skips)
unsigned short UShort_t
Definition: External.C:28
RingHistos * GetRingHistos(UShort_t d, Char_t r) const
void SetDebug(Int_t dbg=1)
const char Option_t
Definition: External.C:48
virtual TObjArray * FitSlices(TList *dir, const char *name, Double_t lowCut, UShort_t nParticles, UShort_t minEntries, UShort_t minusBins, Double_t relErrorCut, Double_t chi2nuCut, Double_t minWeight, Double_t regCut, EResidualMethod residuals, Bool_t scaleToPeak=true, TObjArray *best=0) const
bool Bool_t
Definition: External.C:53
virtual RingHistos * CreateRingHistos(UShort_t d, Char_t r) const
void Print(Option_t *option="") const
AliFMDCorrELossFit::ELossFit ELossFit_t
Definition: External.C:196
virtual void SetupForData(const TAxis &etaAxis, UShort_t sys=0)
TDirectoryFile * dir