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