CMS 3D CMS Logo

Classes | Namespaces | Typedefs | Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/HeavyIonEvent/interface/Centrality.h File Reference

#include <string>
#include <vector>
#include "DataFormats/HeavyIonEvent/interface/CentralityBins.h"
#include "FWCore/Framework/interface/EventSetup.h"

Go to the source code of this file.

Classes

class  reco::Centrality

Namespaces

namespace  reco
 

fixed size matrix


Typedefs

typedef std::vector
< reco::Centrality
reco::CentralityCollection

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::CBin::n_coll, CentralityTable::CBin::n_hard, CentralityTable::CBin::n_part, and CentralityBins::table_.

                                                                          {

  string centralityLabel = "";
  string centralityMC = "";
  
  const edm::ParameterSet &thepset = edm::getProcessParameterSet();
  if(thepset.exists("HeavyIonGlobalParameters")){
    edm::ParameterSet hiPset = thepset.getParameter<edm::ParameterSet>("HeavyIonGlobalParameters");
    centralityLabel = hiPset.getParameter<string>("centralityVariable");
    if(hiPset.exists("nonDefaultGlauberModel")){
      centralityMC = hiPset.getParameter<string>("nonDefaultGlauberModel");
      centralityLabel += centralityMC;
    }
  }
  
  edm::ESHandle<CentralityTable> inputDB_;
  iSetup.get<HeavyIonRcd>().get(centralityLabel,inputDB_);
  int nbinsMax = inputDB_->m_table.size();
  //cout<<"nbinsMax "<<nbinsMax<<endl;
   CentralityBins* CB = new CentralityBins("ctemp","",nbinsMax);
   for(int j=0; j<nbinsMax; j++){

      const CentralityTable::CBin* thisBin;
      thisBin = &(inputDB_->m_table[j]);
      CB->table_[j].bin_edge = thisBin->bin_edge;
      CB->table_[j].n_part_mean = thisBin->n_part.mean;
      CB->table_[j].n_part_var  = thisBin->n_part.var;
      CB->table_[j].n_coll_mean = thisBin->n_coll.mean;
      CB->table_[j].n_coll_var  = thisBin->n_coll.var;
      CB->table_[j].n_hard_mean = thisBin->n_hard.mean;
      CB->table_[j].n_hard_var  = thisBin->n_hard.var;
      CB->table_[j].b_mean = thisBin->b.mean;
      CB->table_[j].b_var = thisBin->b.var;

   }

   return CB;
}