CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

HiTrivialConditionRetriever Class Reference

#include <yetkin/HiTrivialConditionRetriever/src/HiTrivialConditionRetriever.cc>

Inheritance diagram for HiTrivialConditionRetriever:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 HiTrivialConditionRetriever (const edm::ParameterSet &)

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Member Functions

void printBin (const CentralityTable::CBin *)
virtual std::auto_ptr
< CentralityTable
produceTable (const HeavyIonRcd &)

Private Attributes

string inputFileName_
int verbose_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 44 of file HiTrivialConditionRetriever.cc.


Constructor & Destructor Documentation

HiTrivialConditionRetriever::HiTrivialConditionRetriever ( const edm::ParameterSet iConfig)

Definition at line 77 of file HiTrivialConditionRetriever.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and produceTable().

                                                                                      {
  
  setWhatProduced(this, &HiTrivialConditionRetriever::produceTable);
  findingRecord<HeavyIonRcd>();
  
  //now do what ever initialization is needed
  verbose_ = iConfig.getUntrackedParameter<int>("verbosity",1);
  inputFileName_ = iConfig.getParameter<string>("inputFile");
}

Member Function Documentation

void HiTrivialConditionRetriever::printBin ( const CentralityTable::CBin thisBin) [private]

Definition at line 117 of file HiTrivialConditionRetriever.cc.

References CentralityTable::CBin::b, CentralityTable::CBin::bin_edge, gather_cfg::cout, CentralityTable::CBin::n_coll, and CentralityTable::CBin::n_part.

                                                                            {
   cout<<"HF Cut = "<<thisBin->bin_edge<<endl;
   cout<<"Npart = "<<thisBin->n_part.mean<<endl;
   cout<<"sigma = "<<thisBin->n_part.var<<endl;
   cout<<"Ncoll = "<<thisBin->n_coll.mean<<endl;
   cout<<"sigma = "<<thisBin->n_coll.var<<endl;
   cout<<"B     = "<<thisBin->b.mean<<endl;
   cout<<"sigma = "<<thisBin->b.var<<endl;
   cout<<"__________________________________________________"<<endl;
}
std::auto_ptr< CentralityTable > HiTrivialConditionRetriever::produceTable ( const HeavyIonRcd ) [private, virtual]

Definition at line 88 of file HiTrivialConditionRetriever.cc.

References i, recoMuon::in, and geometryCSVtoXML::line.

Referenced by HiTrivialConditionRetriever().

                                                             {

  std::auto_ptr<CentralityTable> CT(new CentralityTable()) ;

  // Get values from text file
  ifstream in( edm::FileInPath(inputFileName_).fullPath().c_str() );
  string line;

  int i = 0;
  while ( getline( in, line ) ) {
    if ( !line.size() || line[0]=='#' ) { continue; }
    CentralityTable::CBin thisBin;
    CT->m_table.push_back(thisBin);
    istringstream ss(line);
    ss>>CT->m_table[i].bin_edge
      >>CT->m_table[i].n_part.mean
      >>CT->m_table[i].n_part.var
      >>CT->m_table[i].n_coll.mean
      >>CT->m_table[i].n_coll.var
      >>CT->m_table[i].n_hard.mean
      >>CT->m_table[i].n_hard.var
      >>CT->m_table[i].b.mean
      >>CT->m_table[i].b.var;
    i++;
  }

  return CT; 
}
void HiTrivialConditionRetriever::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey rk,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
) [protected, virtual]

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 129 of file HiTrivialConditionRetriever.cc.

References edm::IOVSyncValue::beginOfTime(), gather_cfg::cout, edm::IOVSyncValue::endOfTime(), edm::eventsetup::EventSetupRecordKey::name(), and edm::IOVSyncValue::time().

{
  if(verbose_>=1) std::cout << "HiTrivialConditionRetriever::setIntervalFor(): record key = " << rk.name() << "\ttime: " << iTime.time().value() << std::endl;
  //For right now, we will just use an infinite interval of validity
  oValidity = edm::ValidityInterval( edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime() );
}

Member Data Documentation

Definition at line 63 of file HiTrivialConditionRetriever.cc.

Definition at line 62 of file HiTrivialConditionRetriever.cc.