CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CentralityTableHandler Class Reference

#include <CentralityTableHandler.h>

Inheritance diagram for CentralityTableHandler:
popcon::PopConSourceHandler< CentralityTable >

Public Member Functions

 CentralityTableHandler (edm::ParameterSet const &pset)
 
void getNewObjects ()
 
std::string id () const
 
 ~CentralityTableHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< CentralityTable >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string centralityTag_
 
std::string inputTFileName_
 
int runnum_
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< CentralityTable >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< CentralityTable
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< CentralityTable
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef CentralityTable value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< CentralityTable >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< CentralityTable >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file CentralityTableHandler.h.

Constructor & Destructor Documentation

CentralityTableHandler::CentralityTableHandler ( edm::ParameterSet const &  pset)
inline

Definition at line 13 of file CentralityTableHandler.h.

13  :
14  // popcon::PopConSourceHandler<CentralityTable>(pset),
15  inputTFileName_(pset.getParameter<std::string>("inputFile")),
16  centralityTag_(pset.getParameter<std::string>("rootTag"))
17  {;}
CentralityTableHandler::~CentralityTableHandler ( )
inline

Definition at line 18 of file CentralityTableHandler.h.

18 {;}

Member Function Documentation

void CentralityTableHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< CentralityTable >.

Definition at line 11 of file CentralityTableHandler.cc.

References CentralityTable::CBin::b, CentralityTable::CBin::bin_edge, CentralityBins::bMeanOfBin(), CentralityBins::bSigmaOfBin(), gather_cfg::cout, CentralityBins::getNbins(), j, CentralityBins::lowEdgeOfBin(), CentralityTable::m_table, CentralityTable::BinValues::mean, CentralityTable::CBin::n_coll, CentralityTable::CBin::n_hard, CentralityTable::CBin::n_part, CentralityBins::NcollMeanOfBin(), CentralityBins::NcollSigmaOfBin(), CentralityBins::NhardMeanOfBin(), CentralityBins::NhardSigmaOfBin(), CentralityBins::NpartMeanOfBin(), CentralityBins::NpartSigmaOfBin(), and CentralityTable::BinValues::var.

11  {
12  // cond::TagInfo const & tagInfo_ = tagInfo();
13  // cond::LogDBEntry const & logDBEntry_ = logDBEntry();
14  Ref payload = lastPayload();
15  cond::Time_t snc = 1;
16  TFile* inputTFile_ = new TFile(inputTFileName_.data(),"read");
17  runnum_ = 1;
18  CentralityBins* CB = (CentralityBins*) inputTFile_->Get(Form("%s/run%d",centralityTag_.data(),runnum_));
19  cout<<centralityTag_.data()<<endl;
20  CentralityTable* CT = new CentralityTable();
21  CT->m_table.reserve(CB->getNbins());
22 
23  for(int j=0; j<CB->getNbins(); j++){
25  thisBin->bin_edge = CB->lowEdgeOfBin(j);
26  thisBin->n_part.mean = CB->NpartMeanOfBin(j);
27  thisBin->n_part.var = CB->NpartSigmaOfBin(j);
28  thisBin->n_coll.mean = CB->NcollMeanOfBin(j);
29  thisBin->n_coll.var = CB->NcollSigmaOfBin(j);
30  thisBin->n_hard.mean = CB->NhardMeanOfBin(j);
31  thisBin->n_hard.var = CB->NhardSigmaOfBin(j);
32  thisBin->b.mean = CB->bMeanOfBin(j);
33  thisBin->b.var = CB->bSigmaOfBin(j);
34 
35  CT->m_table.push_back(*thisBin);
36  }
37 
38  m_to_transfer.push_back(std::make_pair(CT,snc));
39 
40 }
std::vector< CBin > m_table
float NpartSigmaOfBin(int bin) const
float lowEdgeOfBin(int bin) const
unsigned long long Time_t
Definition: Time.h:16
float NcollMeanOfBin(int bin) const
int j
Definition: DBlmapReader.cc:9
float bSigmaOfBin(int bin) const
float NhardMeanOfBin(int bin) const
float NpartMeanOfBin(int bin) const
int getNbins() const
float bMeanOfBin(int bin) const
tuple cout
Definition: gather_cfg.py:121
float NhardSigmaOfBin(int bin) const
float NcollSigmaOfBin(int bin) const
std::string CentralityTableHandler::id ( void  ) const
inlinevirtual

Implements popcon::PopConSourceHandler< CentralityTable >.

Definition at line 20 of file CentralityTableHandler.h.

20 {return "CentralityTableHandler";}

Member Data Documentation

std::string CentralityTableHandler::centralityTag_
private

Definition at line 24 of file CentralityTableHandler.h.

std::string CentralityTableHandler::inputTFileName_
private

Definition at line 23 of file CentralityTableHandler.h.

int CentralityTableHandler::runnum_
private

Definition at line 25 of file CentralityTableHandler.h.