CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
Centrality.cc File Reference
#include "DataFormats/HeavyIonEvent/interface/Centrality.h"
#include "FWCore/ParameterSet/interface/Registry.h"
#include <iostream>
#include "CondFormats/HIObjects/interface/CentralityTable.h"
#include "CondFormats/DataRecord/interface/HeavyIonRcd.h"
#include "FWCore/Framework/interface/ESHandle.h"

Go to the source code of this file.

Functions

const CentralityBinsgetCentralityBinsFromDB (const edm::EventSetup &iSetup)
 

Function Documentation

const CentralityBins* getCentralityBinsFromDB ( const edm::EventSetup iSetup)

Definition at line 49 of file Centrality.cc.

References CentralityTable::CBin::b, CentralityTable::CBin::bin_edge, edm::ParameterSet::exists(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), edm::getProcessParameterSet(), j, CentralityTable::BinValues::mean, CentralityTable::CBin::n_coll, CentralityTable::CBin::n_hard, CentralityTable::CBin::n_part, CentralityBins::table_, and CentralityTable::BinValues::var.

49  {
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 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
int j
Definition: DBlmapReader.cc:9
ParameterSet const & getProcessParameterSet()
Definition: Registry.cc:34
const T & get() const
Definition: EventSetup.h:55
std::vector< CBin > table_