CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
TauDQMFileLoader::cfgEntryFileSet Struct Reference

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

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

Definition at line 54 of file DQMFileLoader.cc.

References defaultScaleFactor, dqmDirectory_store_, edm::ParameterSet::exists(), MillePedeFileConverter_cfg::fileName, edm::ParameterSet::getParameter(), writeEcalDQMStatus::inputFile, diJetCalib::inputFileList, inputFileNames_, mergeVDriftHistosByStation::name, name_, print(), rangeKeyword, scaleFactor_, AlCaHLTBitMon_QueryRunRegistry::string, and HLT_FULL_cff::verbosity.

54  {
55  //std::cout << "<TauDQMFileLoader::cfgEntryFileSet>" << std::endl;
56 
57  name_ = name;
58 
59  vstring inputFileList = cfg.getParameter<vstring>("inputFileNames");
60  for (vstring::const_iterator inputFile = inputFileList.begin(); inputFile != inputFileList.end(); ++inputFile) {
61  if (inputFile->find(rangeKeyword) != std::string::npos) {
62  size_t posRangeStart = inputFile->find(rangeKeyword) + rangeKeyword.length();
63  size_t posRangeEnd = inputFile->find('#', posRangeStart);
64 
65  size_t posRangeSeparator = inputFile->find('-', posRangeStart);
66 
67  if ((posRangeEnd == std::string::npos) || (posRangeSeparator >= posRangeEnd)) {
68  edm::LogError("TauDQMFileLoader::cfgEntryFileSet")
69  << " Invalid range specification in inputFile = " << (*inputFile) << " !!";
70  continue;
71  }
72 
73  std::string firstFile = std::string(*inputFile, posRangeStart, posRangeSeparator - posRangeStart);
74  //std::cout << "firstFile = " << firstFile << std::endl;
75  std::string lastFile = std::string(*inputFile, posRangeSeparator + 1, posRangeEnd - (posRangeSeparator + 1));
76  //std::cout << "lastFile = " << lastFile << std::endl;
77 
78  if (firstFile.length() != lastFile.length()) {
79  edm::LogError("TauDQMFileLoader::cfgEntryFileSet")
80  << " Invalid range specification in inputFile = " << (*inputFile) << " !!";
81  continue;
82  }
83 
84  int numFirstFile = atoi(firstFile.data());
85  int numLastFile = atoi(lastFile.data());
86  for (int iFile = numFirstFile; iFile <= numLastFile; ++iFile) {
87  std::ostringstream fileName;
88  fileName << std::string(*inputFile, 0, inputFile->find(rangeKeyword));
89  fileName << std::setfill('0') << std::setw(firstFile.length()) << iFile;
90  fileName << std::string(*inputFile, posRangeEnd + 1);
91  //std::cout << "iFile = " << iFile << ", fileName = " << fileName.str() << std::endl;
92  inputFileNames_.push_back(fileName.str());
93  }
94  } else {
95  inputFileNames_.push_back(*inputFile);
96  }
97  }
98 
99  scaleFactor_ = (cfg.exists("scaleFactor")) ? cfg.getParameter<double>("scaleFactor") : defaultScaleFactor;
100 
101  //dqmDirectory_store_ = ( cfg.exists("dqmDirectory_store") ) ? cfg.getParameter<std::string>("dqmDirectory_store") : name_;
102  dqmDirectory_store_ = (cfg.exists("dqmDirectory_store")) ? cfg.getParameter<std::string>("dqmDirectory_store") : "";
103 
104  if (verbosity)
105  print();
106 }
const double defaultScaleFactor
vector< string > vstring
Definition: ExoticaDQM.cc:8
bool exists(std::string const &parameterName) const
checks if a parameter exists
Log< level::Error, false > LogError
const std::string rangeKeyword
tuple inputFileList
Definition: diJetCalib.py:17
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

void TauDQMFileLoader::cfgEntryFileSet::print ( void  ) const

Definition at line 108 of file DQMFileLoader.cc.

References gather_cfg::cout, and format_vstring().

Referenced by cfgEntryFileSet().

108  {
109  std::cout << "<cfgEntryFileSet::print>:" << std::endl;
110  std::cout << " name = " << name_ << std::endl;
111  std::cout << " inputFileNames = " << format_vstring(inputFileNames_) << std::endl;
112  std::cout << " scaleFactor = " << scaleFactor_ << std::endl;
113  std::cout << " dqmDirectory_store = " << dqmDirectory_store_ << std::endl;
114 }
std::string format_vstring(const std::vector< std::string > &vs)
tuple cout
Definition: gather_cfg.py:144

Member Data Documentation

std::string TauDQMFileLoader::cfgEntryFileSet::dqmDirectory_store_

Definition at line 37 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

vstring TauDQMFileLoader::cfgEntryFileSet::inputFileNames_

Definition at line 35 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

std::string TauDQMFileLoader::cfgEntryFileSet::name_

Definition at line 34 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

double TauDQMFileLoader::cfgEntryFileSet::scaleFactor_

Definition at line 36 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().