CMS 3D CMS Logo

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

◆ cfgEntryFileSet()

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

Definition at line 54 of file DQMFileLoader.cc.

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;
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 }

References looper::cfg, defaultScaleFactor, dqmDirectory_store_, MillePedeFileConverter_cfg::fileName, dtResolutionTest_cfi::inputFile, inputFileNames_, Skims_PA_cff::name, name_, print(), rangeKeyword, scaleFactor_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Member Function Documentation

◆ print()

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

Definition at line 108 of file DQMFileLoader.cc.

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 }

References gather_cfg::cout, and format_vstring().

Referenced by cfgEntryFileSet().

Member Data Documentation

◆ dqmDirectory_store_

std::string TauDQMFileLoader::cfgEntryFileSet::dqmDirectory_store_

Definition at line 37 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

◆ inputFileNames_

vstring TauDQMFileLoader::cfgEntryFileSet::inputFileNames_

Definition at line 35 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

◆ name_

std::string TauDQMFileLoader::cfgEntryFileSet::name_

Definition at line 34 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

◆ scaleFactor_

double TauDQMFileLoader::cfgEntryFileSet::scaleFactor_

Definition at line 36 of file DQMFileLoader.h.

Referenced by cfgEntryFileSet().

gather_cfg.cout
cout
Definition: gather_cfg.py:144
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
rangeKeyword
const std::string rangeKeyword
Definition: dqmAuxFunctions.h:14
TauDQMFileLoader::cfgEntryFileSet::print
void print() const
Definition: DQMFileLoader.cc:108
defaultScaleFactor
const double defaultScaleFactor
Definition: DQMFileLoader.cc:22
TauDQMFileLoader::cfgEntryFileSet::dqmDirectory_store_
std::string dqmDirectory_store_
Definition: DQMFileLoader.h:37
TauDQMFileLoader::cfgEntryFileSet::scaleFactor_
double scaleFactor_
Definition: DQMFileLoader.h:36
dtResolutionTest_cfi.inputFile
inputFile
Definition: dtResolutionTest_cfi.py:14
TauDQMFileLoader::cfgEntryFileSet::name_
std::string name_
Definition: DQMFileLoader.h:34
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
format_vstring
std::string format_vstring(const std::vector< std::string > &vs)
Definition: dqmAuxFunctions.cc:36
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
vstring
vector< string > vstring
Definition: ExoticaDQM.cc:8
verbosity
const int verbosity
Definition: DQMFileLoader.cc:24
TauDQMFileLoader::cfgEntryFileSet::inputFileNames_
vstring inputFileNames_
Definition: DQMFileLoader.h:35