StRoot  1
StNegativeBinomial.h
1 /******************************************************************************
2  * \$Id: StNegativeBinomial.h,v 1.2 2012/04/25 05:13:24 hmasui Exp \$
3  * \$Log: StNegativeBinomial.h,v \$
4  * Revision 1.2 2012/04/25 05:13:24 hmasui
5  * Use STAR logger. Take into account additional constant inefficiency by using the trigger bias parameter
6  *
7 ******************************************************************************/
8
9 #ifndef __StNegativeBinomial_h__
10 #define __StNegativeBinomial_h__
11
12 class TH1 ;
13 #include "Rtypes.h"
14
15 //____________________________________________________________________________________________________
16 // StNegativeBinomial class: Generate negative binomial distribution
18  public:
20  // npp: mean multiplicity in p+p
21  // k: 1/k deviation from poisson (1/k -> 0 poisson)
22  // x: fraction of hard component
23  // efficiency: detector efficiency
24  // triggerbias: trigger bias
25  // IsConstEfficiency: true-> constant efficiencty, false-> multiplicity dependent efficiency
26  StNegativeBinomial(const Double_t npp = 2.38, const Double_t k = 2.00, const Double_t x = 0.13,
27  const Double_t efficiency = 1.0, const Double_t triggerbias = 1.0, const Bool_t isConstEfficiency=kTRUE);
28
30  virtual ~StNegativeBinomial();
31
33  Double_t GetTwoComponentMultiplicity(const Double_t npart, const Double_t ncoll) const ;
34
36  Int_t GetMultiplicity(const Double_t npart, const Double_t ncoll) const ;
37
39  TH1* GetMultiplicity(const Double_t npart, const Double_t ncoll,
40  const Double_t weight) const ;
41
42  Double_t GetNegativeBinomial(const Int_t n) const ;
43  Double_t GetNegativeBinomial(const Int_t n, const Double_t m) const ;
44
46  void SetParameters(const Double_t npp, const Double_t k, const Double_t x = -1.0) ;
47
48  // Getter
49  Double_t GetNpp() const ;
50  Double_t GetK() const ;
51  Double_t GetX() const ;
52  Double_t GetEfficiency() const ;
53  Bool_t IsConstEfficiency() const ;
54  void DrawNbd() const ;
55
56  private:
57  // Functions
58  Double_t GetEfficiency(const Int_t mult) const ;
59  void InitHistogram() ;
60
61  // Data members
62  const Double_t mEfficiency ;
63  const Double_t mTriggerBias ;
64  Double_t mNpp ;
65  Double_t mK ;
66  Double_t mX ;
67  const Bool_t mIsConstEfficiency ;
68  static UInt_t mCounter ;
69
70  TH1* mhNbd ;
71
72  ClassDef(StNegativeBinomial, 0)
73 };
74
75 inline Double_t StNegativeBinomial::GetNpp() const { return mNpp ; }
76 inline Double_t StNegativeBinomial::GetK() const { return mK ; }
77 inline Double_t StNegativeBinomial::GetX() const { return mX ; }
78 inline Double_t StNegativeBinomial::GetEfficiency() const { return mEfficiency ; }
79 inline Bool_t StNegativeBinomial::IsConstEfficiency() const { return mIsConstEfficiency ; }
80
81 #endif
82
void SetParameters(const Double_t npp, const Double_t k, const Double_t x=-1.0)
Get NBD(npp*m, k*m; n)
void DrawNbd() const
Get flag for efficiency.
Double_t GetK() const
Get npp parameter.
StNegativeBinomial(const Double_t npp=2.38, const Double_t k=2.00, const Double_t x=0.13, const Double_t efficiency=1.0, const Double_t triggerbias=1.0, const Bool_t isConstEfficiency=kTRUE)
Default constructor.
Bool_t IsConstEfficiency() const
Get mEfficiency (CAUTION: value has different meaning between constant and multiplicity dep...
Double_t GetEfficiency() const
Get x parameter.
virtual ~StNegativeBinomial()
Default destructor.
Int_t GetMultiplicity(const Double_t npart, const Double_t ncoll) const
Get multiplcity by convoluting NBD.
Double_t GetX() const
Get k parameter.
Double_t GetTwoComponentMultiplicity(const Double_t npart, const Double_t ncoll) const
(1-x)*npart/2 + x*ncoll