CMS 3D CMS Logo

Public Member Functions | Public Attributes

DQMFileLoader::cfgEntryFileSet Struct Reference

List of all members.

Public Member Functions

 cfgEntryFileSet (const std::string &, const edm::ParameterSet &)
void print () const

Public Attributes

std::string dqmDirectory_store_
vstring inputFileNames_
std::string name_
double scaleFactor_

Detailed Description

Definition at line 31 of file DQMFileLoader.h.


Constructor & Destructor Documentation

DQMFileLoader::cfgEntryFileSet::cfgEntryFileSet ( const std::string &  name,
const edm::ParameterSet cfg 
)

Definition at line 55 of file DQMFileLoader.cc.

References defaultScaleFactor, dqmDirectory_store_, edm::ParameterSet::exists(), convertXMLtoSQLite_cfg::fileName, edm::ParameterSet::getParameter(), analyzePatCleaning_cfg::inputFile, diJetCalib::inputFileList, inputFileNames_, mergeVDriftHistosByStation::name, name_, print(), rangeKeyword, scaleFactor_, and verbosity.

{
  //std::cout << "<DQMFileLoader::cfgEntryFileSet>" << std::endl;

  name_ = name;

  vstring inputFileList = cfg.getParameter<vstring>("inputFileNames");
  for ( vstring::const_iterator inputFile = inputFileList.begin();
        inputFile != inputFileList.end(); ++inputFile ) {
    if ( inputFile->find(rangeKeyword) != std::string::npos ) {
      size_t posRangeStart = inputFile->find(rangeKeyword) + rangeKeyword.length();
      size_t posRangeEnd = inputFile->find('#', posRangeStart); 
      
      size_t posRangeSeparator = inputFile->find('-', posRangeStart);

      if ( (posRangeEnd == std::string::npos) || 
           (posRangeSeparator >= posRangeEnd) ) { 
        edm::LogError ("DQMFileLoader::cfgEntryFileSet") << " Invalid range specification in inputFile = " << (*inputFile) << " !!";
        continue;
      }

      std::string firstFile = std::string(*inputFile, posRangeStart, posRangeSeparator - posRangeStart);
      //std::cout << "firstFile = " << firstFile << std::endl;
      std::string lastFile = std::string(*inputFile, posRangeSeparator + 1, posRangeEnd - (posRangeSeparator + 1));
      //std::cout << "lastFile = " << lastFile << std::endl;

      if ( firstFile.length() != lastFile.length() ) {
        edm::LogError ("DQMFileLoader::cfgEntryFileSet") << " Invalid range specification in inputFile = " << (*inputFile) << " !!";
        continue;
      }

      int numFirstFile = atoi(firstFile.data());
      int numLastFile = atoi(lastFile.data());
      for ( int iFile = numFirstFile; iFile <= numLastFile; ++iFile ) {
        std::ostringstream fileName;
        fileName << std::string(*inputFile, 0, inputFile->find(rangeKeyword));
        fileName << std::setfill('0') << std::setw(firstFile.length()) << iFile;
        fileName << std::string(*inputFile, posRangeEnd + 1);
        //std::cout << "iFile = " << iFile << ", fileName = " << fileName.str() << std::endl;
        inputFileNames_.push_back(fileName.str());
      }
    } else {
      inputFileNames_.push_back(*inputFile);
    }
  }

  scaleFactor_ = ( cfg.exists("scaleFactor") ) ? cfg.getParameter<double>("scaleFactor") : defaultScaleFactor;

  //dqmDirectory_store_ = ( cfg.exists("dqmDirectory_store") ) ? cfg.getParameter<std::string>("dqmDirectory_store") : name_;
  dqmDirectory_store_ = ( cfg.exists("dqmDirectory_store") ) ? cfg.getParameter<std::string>("dqmDirectory_store") : "";

  if ( verbosity ) print();
}

Member Function Documentation

void DQMFileLoader::cfgEntryFileSet::print ( void  ) const

Definition at line 109 of file DQMFileLoader.cc.

References gather_cfg::cout, and format_vstring().

Referenced by cfgEntryFileSet().

{
  std::cout << "<cfgEntryFileSet::print>:" << std::endl;
  std::cout << " name = " << name_ << std::endl;
  std::cout << " inputFileNames = " << format_vstring(inputFileNames_) << std::endl;
  std::cout << " scaleFactor = " << scaleFactor_ << std::endl;
  std::cout << " dqmDirectory_store = " << dqmDirectory_store_ << std::endl;
}

Member Data Documentation

Definition at line 38 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

Definition at line 36 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

Definition at line 35 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

Definition at line 37 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().