CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Centrality.cc
Go to the documentation of this file.
1 //
2 //
3 
6 
7 #include <iostream>
8 using namespace std;
9 using namespace reco;
10 
11 Centrality::Centrality(double d, std::string label)
12  :
13 value_(d),
14 label_(label),
15 etHFhitSumPlus_(0),
16 etHFtowerSumPlus_(0),
17 etHFtruncatedPlus_(0),
18 etHFhitSumMinus_(0),
19 etHFtowerSumMinus_(0),
20 etHFtruncatedMinus_(0),
21 etEESumPlus_(0),
22 etEEtruncatedPlus_(0),
23 etEESumMinus_(0),
24 etEEtruncatedMinus_(0),
25 etEBSum_(0),
26 etEBtruncated_(0),
27 pixelMultiplicity_(0),
28 trackMultiplicity_(0),
29 zdcSumPlus_(0),
30 zdcSumMinus_(0),
31 etMidRapiditySum_(0),
32 ntracksPtCut_(0),
33 ntracksEtaCut_(0),
34 ntracksEtaPtCut_(0),
35 nPixelTracks_(0)
36 {
37 }
38 
39 
41 {
42 }
43 
47 
49 
50  string centralityLabel = "";
51  string centralityMC = "";
52 
54  if(thepset.exists("HeavyIonGlobalParameters")){
55  edm::ParameterSet hiPset = thepset.getParameter<edm::ParameterSet>("HeavyIonGlobalParameters");
56  centralityLabel = hiPset.getParameter<string>("centralityVariable");
57  if(hiPset.exists("nonDefaultGlauberModel")){
58  centralityMC = hiPset.getParameter<string>("nonDefaultGlauberModel");
59  centralityLabel += centralityMC;
60  }
61  }
62 
64  iSetup.get<HeavyIonRcd>().get(centralityLabel,inputDB_);
65  int nbinsMax = inputDB_->m_table.size();
66  //cout<<"nbinsMax "<<nbinsMax<<endl;
67  CentralityBins* CB = new CentralityBins("ctemp","",nbinsMax);
68  for(int j=0; j<nbinsMax; j++){
69 
70  const CentralityTable::CBin* thisBin;
71  thisBin = &(inputDB_->m_table[j]);
72  CB->table_[j].bin_edge = thisBin->bin_edge;
73  CB->table_[j].n_part_mean = thisBin->n_part.mean;
74  CB->table_[j].n_part_var = thisBin->n_part.var;
75  CB->table_[j].n_coll_mean = thisBin->n_coll.mean;
76  CB->table_[j].n_coll_var = thisBin->n_coll.var;
77  CB->table_[j].n_hard_mean = thisBin->n_hard.mean;
78  CB->table_[j].n_hard_var = thisBin->n_hard.var;
79  CB->table_[j].b_mean = thisBin->b.mean;
80  CB->table_[j].b_var = thisBin->b.var;
81 
82  }
83 
84  return CB;
85 }
86 
87 
88 
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
virtual ~Centrality()
Definition: Centrality.cc:40
int j
Definition: DBlmapReader.cc:9
ParameterSet const & getProcessParameterSet()
Definition: Registry.cc:85
const T & get() const
Definition: EventSetup.h:55
const CentralityBins * getCentralityBinsFromDB(const edm::EventSetup &iSetup)
Definition: Centrality.cc:48
std::vector< CBin > table_