AliPhysics  d565ceb (d565ceb)
AliIntSpotEstimator.h
Go to the documentation of this file.
1 #ifndef ALIINTSPOTESTIMATOR_H
2 #define ALIINTSPOTESTIMATOR_H
3 
4 #include <TNamed.h>
5 #include <TObjArray.h>
6 #include <TMath.h>
7 #include <TH2F.h>
8 #include <TAxis.h>
9 
10 class TH1;
11 class TNtuple;
12 class TCanvas;
13 class AliESDEvent;
14 class AliESDtrack;
15 class AliESDVertex;
16 class AliVertexerTracks;
17 
18 class AliIntSpotEstimator : public TNamed {
19  //
20  public:
21  //
22  AliIntSpotEstimator(Bool_t initDef=kFALSE);
23  AliIntSpotEstimator(const char* name, Double_t outcut=1e-4,Int_t ntrIP=2,
24  Int_t nPhiBins=12,Int_t nestb=500,
25  Double_t estmin=-2e-2,Double_t estmax=6e-2,
26  Int_t ntrBins=10,Int_t ntMn=2,Int_t ntMx=32,
27  Int_t nPBins=14,Double_t pmn=0.2,Double_t pmx=3., Bool_t ntuple=kFALSE);
30  //
31  void InitEstimators(Int_t nPhiBins=12,Int_t nestb=500,
32  Double_t estmin=-2e-2,Double_t estmax=6e-2,
33  Int_t ntrBins=10,Int_t ntMn=2,Int_t ntMx=32,
34  Int_t nPBins=14,Double_t pmn=0.2,Double_t pmx=3.,Bool_t ntuple=kFALSE);
35  //
36  Bool_t ProcessEvent(const AliESDEvent* esd, const AliESDVertex* vtx=0);
37  Bool_t ProcessEvent(const TObjArray* tracks);
38  //
39  Double_t GetIPCenter(Int_t id,Double_t *err=0) const;
40  Double_t GetIPCenIni(Int_t id) const {return fIPCenIni[id];}
41  Double_t GetIPSigma(Int_t phibin=0,Double_t *err=0) const;
42  Double_t GetVtxSigma(int ntr, Double_t *err=0) const;
43  Double_t GetDCASigma(double p, Double_t *err=0) const;
44  //
46  Int_t GetEventsProcessed() const {return fEvProc;}
48  //
49  void SetOutlierCut(Double_t v=1e-4) {fOutlierCut = v;}
50  void SetIPCenIni(Double_t *xyz) {for (int i=3;i--;) fIPCenIni[i] = xyz[i];}
51  void SetMinTracksForIP(Int_t ntr=2) {fMinTracksForIP = ntr>2 ? ntr : 2;}
52  //
53  TH2F* GetHistoIP() const {return fEstimIP;}
54  TH2F* GetHistoVtx() const {return fEstimVtx;}
55  TH2F* GetHistoTrc() const {return fEstimTrc;}
56  TH2F* GetHistoVtxXY() const {return fHVtxXY;}
57  TNtuple* GetNtuple() const {return (TNtuple*)fNtuple;}
58  AliVertexerTracks* GetVertexer() const {return fVertexer;}
59  //
60  Int_t GetNPhiBins() const {return !IsValid() ? 0:fEstimIP->GetXaxis()->GetNbins();}
61  Int_t GetNTrackBins() const {return !IsValid() ? 0:fEstimVtx->GetXaxis()->GetNbins();}
62  Int_t GetMinTracks() const {return !IsValid() ? 0:TMath::Nint(fEstimVtx->GetXaxis()->GetXmin());}
63  Int_t GetMaxTracks() const {return !IsValid() ? 0:TMath::Nint(fEstimVtx->GetXaxis()->GetXmax());}
64  Int_t GetNPBins() const {return !IsValid() ? 0:fEstimTrc->GetXaxis()->GetNbins();}
65  Double_t GetTrackMinP() const {return !IsValid() ? 0:1./fEstimTrc->GetXaxis()->GetXmax();}
66  Double_t GetTrackMaxP() const {return !IsValid() ? 0:1./fEstimTrc->GetXaxis()->GetXmin();}
67  //
68  TCanvas* CreateReport(const char* outname = 0);
69  virtual void Print(Option_t *opt="") const;
70  virtual void Clear(Option_t *opt="");
71  virtual Long64_t Merge(TCollection *coll);
72  static Double_t CalcMean(TH1* histo, Double_t ctfact,Double_t *err=0);
73  //
74  protected:
75  Bool_t IsValid() const {return fEstimIP!=0;}
76  Bool_t IsZero(Double_t v,Double_t thresh=1e-15) const {return TMath::Abs(v)<thresh;}
78  Bool_t ProcessIPCenter(const AliESDVertex* vtx);
80  void UpdateEstimators(double rvD, double rtD, double nTracks, double pTrack, double phiTrack);
81  //
82  private :
85  //
86  protected:
87  //
88  Int_t fEvProc; // number of events processed
89  Int_t fIPCenterStat; // number of events used for fIPCenter
90  Int_t fMinTracksForIP; // account IP estimator only for vertices with >= tracks
91  Double_t fOutlierCut; // cut on outliers
92  Double_t fIPCenIni[3]; // mean IP position XYZ (initial)
93  Double_t fIPCenter[3]; // IP position XYZ
94  Double_t fIPCen2[3]; // IP position XYZ^2
95  //
96  TH2F *fEstimIP; // distribution of IP estimator
97  TH2F *fEstimVtx; // distribution of VTRes estimator
98  TH2F *fEstimTrc; // distribution of DCA res estimator
99  TH2F *fHVtxXY; // XY histo
100  TNtuple *fNtuple;
101  //
102  AliVertexerTracks* fVertexer;
104  //
105  ClassDef(AliIntSpotEstimator,1)
106 };
107 
108 
109 #endif
virtual Long64_t Merge(TCollection *coll)
static Double_t CalcMean(TH1 *histo, Double_t ctfact, Double_t *err=0)
Bool_t IsZero(Double_t v, Double_t thresh=1e-15) const
double Double_t
Definition: External.C:58
Int_t GetNPBins() const
Definition: External.C:236
long long Long64_t
Definition: External.C:43
Double_t GetTrackMinP() const
AliVertexerTracks * GetVertexer() const
TH2F * GetHistoTrc() const
void UpdateEstimators(double rvD, double rtD, double nTracks, double pTrack, double phiTrack)
void InitEstimators(Int_t nPhiBins=12, Int_t nestb=500, Double_t estmin=-2e-2, Double_t estmax=6e-2, Int_t ntrBins=10, Int_t ntMn=2, Int_t ntMx=32, Int_t nPBins=14, Double_t pmn=0.2, Double_t pmx=3., Bool_t ntuple=kFALSE)
AliIntSpotEstimator & operator=(const AliIntSpotEstimator &src)
Double_t GetIPCenIni(Int_t id) const
Int_t GetMinTracksForIP() const
Int_t GetMaxTracks() const
Int_t GetMinTracks() const
void SetOutlierCut(Double_t v=1e-4)
Int_t GetEventsProcessed() const
int Int_t
Definition: External.C:63
Bool_t ProcessEvent(const AliESDEvent *esd, const AliESDVertex *vtx=0)
Bool_t ProcessEstimators(const AliESDEvent *esd)
TH2F * GetHistoVtx() const
Bool_t IsValid() const
void SetMinTracksForIP(Int_t ntr=2)
void SetIPCenIni(Double_t *xyz)
TH2F * GetHistoIP() const
virtual void Print(Option_t *opt="") const
virtual void Clear(Option_t *opt="")
Int_t GetEventsAccepted() const
Double_t GetDCASigma(double p, Double_t *err=0) const
Int_t GetNPhiBins() const
Double_t GetIPCenter(Int_t id, Double_t *err=0) const
TH2F * GetHistoVtxXY() const
AliVertexerTracks * fVertexer
optional ntuple with dca&#39;s
TNtuple * GetNtuple() const
TObjArray * fTracks
vertex fitter
AliIntSpotEstimator(Bool_t initDef=kFALSE)
Double_t GetVtxSigma(int ntr, Double_t *err=0) const
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
TCanvas * CreateReport(const char *outname=0)
Double_t GetIPSigma(Int_t phibin=0, Double_t *err=0) const
Double_t GetTrackMaxP() const
Int_t GetNTrackBins() const
Definition: External.C:196
Bool_t ProcessIPCenter(const AliESDVertex *vtx)
AliIntSpotEstimator & operator+=(const AliIntSpotEstimator &src)