CMS 3D CMS Logo

Public Member Functions | Private Attributes

CentralityTableHandler Class Reference

#include <CentralityTableHandler.h>

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

List of all members.

Public Member Functions

 CentralityTableHandler (edm::ParameterSet const &pset)
void getNewObjects ()
std::string id () const
 ~CentralityTableHandler ()

Private Attributes

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

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.

                                                      :
    //    popcon::PopConSourceHandler<CentralityTable>(pset),
    inputTFileName_(pset.getParameter<std::string>("inputFile")),
    centralityTag_(pset.getParameter<std::string>("rootTag"))
      {;}
CentralityTableHandler::~CentralityTableHandler ( ) [inline]

Definition at line 18 of file CentralityTableHandler.h.

{;}

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::CBin::n_coll, CentralityTable::CBin::n_hard, CentralityTable::CBin::n_part, CentralityBins::NcollMeanOfBin(), CentralityBins::NcollSigmaOfBin(), CentralityBins::NhardMeanOfBin(), CentralityBins::NhardSigmaOfBin(), CentralityBins::NpartMeanOfBin(), and CentralityBins::NpartSigmaOfBin().

                                          {
  //  cond::TagInfo const & tagInfo_ = tagInfo();
  //  cond::LogDBEntry const & logDBEntry_ = logDBEntry();     
  Ref payload = lastPayload();
  cond::Time_t snc = 1;
  TFile* inputTFile_ = new TFile(inputTFileName_.data(),"read");
  runnum_ = 1;
  CentralityBins* CB = (CentralityBins*) inputTFile_->Get(Form("%s/run%d",centralityTag_.data(),runnum_));
  cout<<centralityTag_.data()<<endl;
  CentralityTable* CT = new CentralityTable();
  CT->m_table.reserve(CB->getNbins());

  for(int j=0; j<CB->getNbins(); j++){
    CentralityTable::CBin* thisBin = new CentralityTable::CBin();
    thisBin->bin_edge = CB->lowEdgeOfBin(j);
    thisBin->n_part.mean = CB->NpartMeanOfBin(j);
    thisBin->n_part.var  = CB->NpartSigmaOfBin(j);
    thisBin->n_coll.mean = CB->NcollMeanOfBin(j);
    thisBin->n_coll.var  = CB->NcollSigmaOfBin(j);
    thisBin->n_hard.mean = CB->NhardMeanOfBin(j);
    thisBin->n_hard.var  = CB->NhardSigmaOfBin(j);
    thisBin->b.mean = CB->bMeanOfBin(j);
    thisBin->b.var = CB->bSigmaOfBin(j);

    CT->m_table.push_back(*thisBin);
  }

  m_to_transfer.push_back(std::make_pair(CT,snc));

}
std::string CentralityTableHandler::id ( void  ) const [inline, virtual]

Implements popcon::PopConSourceHandler< CentralityTable >.

Definition at line 20 of file CentralityTableHandler.h.

{return "CentralityTableHandler";}

Member Data Documentation

Definition at line 24 of file CentralityTableHandler.h.

Definition at line 23 of file CentralityTableHandler.h.

Definition at line 25 of file CentralityTableHandler.h.