StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StCentralityMaker.cxx
1 /******************************************************************************
2  * $Id: StCentralityMaker.cxx,v 1.4 2012/04/25 05:17:24 hmasui Exp $
3  * $Log: StCentralityMaker.cxx,v $
4  * Revision 1.4 2012/04/25 05:17:24 hmasui
5  * Remove SetModeNBD() and corresponding data member, merged into GetNegativeBinomial() function
6  *
7 ******************************************************************************/
8 
9 #include <assert.h>
10 
11 #include "TError.h"
12 
13 #include "StMessMgr.h"
14 #include "StNegativeBinomial.h"
15 #include "StCentrality.h"
16 #include "StCentralityMaker.h"
17 
18 ClassImp(StCentralityMaker)
19 
20 //____________________________________________________________________________________________________
21 // Default constructor
23  : mNBinomial(0), mCentrality(0)
24 {
25  LOG_INFO << "StCentralityMaker User needs to call Init(const Char_t* system) function to Initialize NBD (see below)" << endm;
27 }
28 
29 //____________________________________________________________________________________________________
30 // Initialization inside the constructor
31 StCentralityMaker::StCentralityMaker(const Char_t* system)
32  : mNBinomial(0), mCentrality(0)
33 {
34  Init(system);
35 }
36 
37 //____________________________________________________________________________________________________
38 // Default destructor
40 {
41 }
42 
43 //____________________________________________________________________________________________________
45 {
46  if( id >= mNBinomial.size() ){
47  Error("StCentralityMaker::GetNegativeBinomial", "Invalid index for negative binomial, id=%3d", id);
48  assert(0);
49  }
50 
51  return mNBinomial[id] ;
52 }
53 
54 //____________________________________________________________________________________________________
55 StCentrality* StCentralityMaker::GetCentrality(const UInt_t id) const
56 {
57  if( id >= mCentrality.size() ){
58  Error("StCentralityMaker::GetCentrality", "Invalid index for centrality, id=%3d", id);
59  assert(0);
60  }
61 
62  return mCentrality[id] ;
63 }
64 
65 //____________________________________________________________________________________________________
66 // Use this function to initialize centrality bin and NBD
67 void StCentralityMaker::Init(const Char_t* system)
68 {
70  const TString systemName(system);
71 
72  LOG_INFO << "StCentralityMaker::Init Initialization for " << systemName.Data() << endm;
73 
75  const TString type[] = {"default", "low", "high"};
76  for(UInt_t id=0; id<3; id++){
77  mCentrality.push_back( new StCentrality(systemName, type[id]) );
78  }
79 
81  // Use multiplicity depdent efficiency for all systems
82  for(UInt_t id=0; id<3; id++){
83  Bool_t isConstEfficiency = kFALSE ;
84 
85  mNBinomial.push_back(
86  new StNegativeBinomial( mCentrality[id]->GetNpp(), mCentrality[id]->GetK(), mCentrality[id]->GetX(),
87  mCentrality[id]->GetEfficiency(), mCentrality[id]->GetTriggerBias(), isConstEfficiency)
88  );
89  }
90 }
91 
void Init(const Char_t *system="AuAu_200GeV")
Definition: FJcore.h:367
static void help()
Default destructor.
virtual ~StCentralityMaker()
Call init(const Char_t* system)
const StNegativeBinomial * GetNegativeBinomial(const UInt_t id=0) const
Default destructor.