CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
SiStripCommissioningOfflineClient Class Reference

Class which reads a root file containing "commissioning histograms", analyzes the histograms to extract "monitorables", and creates summary histograms. More...

#include <SiStripCommissioningOfflineClient.h>

Inheritance diagram for SiStripCommissioningOfflineClient:
edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase SiStripCommissioningOfflineDbClient

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 SiStripCommissioningOfflineClient (const edm::ParameterSet &)
 
 ~SiStripCommissioningOfflineClient () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Types

typedef std::vector< TH1 * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 

Protected Member Functions

virtual void createHistos (const edm::ParameterSet &, const edm::EventSetup &)
 
virtual void setInputFiles (std::vector< std::string > &, const std::string, const std::string, uint32_t, bool)
 
virtual void uploadToConfigDb ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Protected Attributes

bool analyzeHistos_
 
DQMStorebei_
 
bool clientHistos_
 
bool collateHistos_
 
bool createSummaryPlots_
 
CommissioningHistogramshistos_
 
std::vector< std::string > inputFiles_
 
HistosMap map_
 
std::string outputFileName_
 
edm::ParameterSet parameters_
 
std::string partitionName_
 
std::vector< SummaryPlotplots_
 
uint32_t runNumber_
 
sistrip::RunType runType_
 
bool uploadToDb_
 
std::string xmlFile_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Class which reads a root file containing "commissioning histograms", analyzes the histograms to extract "monitorables", and creates summary histograms.

Author
M.Wingham, R.Bainbridge

Definition at line 29 of file SiStripCommissioningOfflineClient.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 32 of file SiStripCommissioningOfflineClient.h.

◆ Histos

typedef std::vector<TH1*> SiStripCommissioningOfflineClient::Histos
protected

Definition at line 88 of file SiStripCommissioningOfflineClient.h.

◆ HistosMap

typedef std::map<uint32_t, Histos> SiStripCommissioningOfflineClient::HistosMap
protected

Definition at line 91 of file SiStripCommissioningOfflineClient.h.

◆ MonitorElement

Definition at line 31 of file SiStripCommissioningOfflineClient.h.

Constructor & Destructor Documentation

◆ SiStripCommissioningOfflineClient()

SiStripCommissioningOfflineClient::SiStripCommissioningOfflineClient ( const edm::ParameterSet pset)

Definition at line 36 of file SiStripCommissioningOfflineClient.cc.

References collateHistos_, inputFiles_, LogTrace, sistrip::mlDqmClient_, muonDTDigis_cfi::pset, setInputFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

38  histos_(nullptr),
39  //inputFiles_( pset.getUntrackedParameter< std::vector<std::string> >( "InputRootFiles", std::vector<std::string>() ) ),
40  outputFileName_(pset.getUntrackedParameter<std::string>("OutputRootFile", "")),
41  collateHistos_(!pset.getUntrackedParameter<bool>("UseClientFile", false)),
42  analyzeHistos_(pset.getUntrackedParameter<bool>("AnalyzeHistos", true)),
43  xmlFile_((pset.getUntrackedParameter<edm::FileInPath>("SummaryXmlFile", edm::FileInPath())).fullPath()),
44  createSummaryPlots_(false),
45  clientHistos_(false),
46  uploadToDb_(false),
48  runNumber_(0),
49  partitionName_(pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName")
50  : ""),
51  map_(),
52  plots_(),
53  parameters_(pset) {
54  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
55  << " Constructing object...";
56  usesResource("DQMStore");
58  pset.getUntrackedParameter<std::string>("FilePath"),
59  pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : "",
60  pset.getUntrackedParameter<uint32_t>("RunNumber"),
62 }
static const char mlDqmClient_[]
#define LogTrace(id)
virtual void setInputFiles(std::vector< std::string > &, const std::string, const std::string, uint32_t, bool)

◆ ~SiStripCommissioningOfflineClient()

SiStripCommissioningOfflineClient::~SiStripCommissioningOfflineClient ( )
override

Definition at line 66 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

66  {
67  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
68  << " Destructing object...";
69 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

◆ analyze()

void SiStripCommissioningOfflineClient::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 345 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

345  {
346  if (!(event.id().event() % 10)) {
347  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
348  << " Empty event loop! User can kill job...";
349  }
350 }
static const char mlDqmClient_[]
#define LogTrace(id)
Definition: event.py:1

◆ beginRun()

void SiStripCommissioningOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
override

Definition at line 73 of file SiStripCommissioningOfflineClient.cc.

References analyzeHistos_, bei_, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, clientHistos_, sistrip::collate_, relmon_rootfiles_spy::contents, CommissioningHistograms::copyCustomInformation(), createHistos(), CommissioningHistograms::createSummaryHisto(), createSummaryPlots_, sistrip::DAQ_SCOPE_MODE, sistrip::dqmClientFileName_, CommissioningHistograms::extractHistograms(), newFWLiteAna::found, dqm::implementation::IGetter::getAllContents(), edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, CommissioningHistograms::histoAnalysis(), histos_, compare_using_db::ifile, inputFiles_, looper::jfile, LogTrace, hlt_dqm_clientPB-live_cfg::me, sistrip::mlDqmClient_, Skims_PA_cff::name, dqm::implementation::DQMStore::open(), outputFileName_, parameters_, SummaryPlotXmlParser::parseXML(), partitionName_, plots_, CommissioningHistograms::printAnalyses(), CommissioningHistograms::printSummary(), CommissioningHistograms::remove(), CommissioningHistograms::runNumber(), runNumber_, SiStripEnumsAndStrings::runType(), CommissioningHistograms::runType(), runType_, alignCSCRings::s, CommissioningHistograms::save(), cuy::save, singleTopDQM_cfi::setup, contentValuesCheck::ss, SummaryPlotXmlParser::summaryPlots(), groupFilesInBlocks::temp, sistrip::UNKNOWN_RUN_TYPE, uploadToConfigDb(), and xmlFile_.

73  {
74  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
75  << " Analyzing root file(s)...";
76 
77  // Check for null pointer
78  if (!bei_) {
79  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
80  << " NULL pointer to DQMStore!"
81  << " Aborting...";
82  return;
83  }
84 
85  // Check if .root file can be opened
86  std::vector<std::string>::const_iterator ifile = inputFiles_.begin();
87  for (; ifile != inputFiles_.end(); ifile++) {
88  std::ifstream root_file;
89  root_file.open(ifile->c_str());
90  if (!root_file.is_open()) {
91  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
92  << " The input root file \"" << *ifile << "\" could not be opened!"
93  << " Please check the path and filename!";
94  } else {
95  root_file.close();
97  if (found != std::string::npos && clientHistos_) {
98  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
99  << " The input root files appear to be a mixture"
100  << " of \"Source\" and \"Client\" files!"
101  << " Aborting...";
102  return;
103  }
104  if (found != std::string::npos && inputFiles_.size() != 1) {
105  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
106  << " There appear to be multiple input \"Client\" root files!"
107  << " Aborting...";
108  return;
109  }
110  if (found != std::string::npos) {
111  clientHistos_ = true;
112  }
113  }
114  }
115  if (clientHistos_ && inputFiles_.size() == 1) {
116  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
117  << " Collated histograms found in input root file \"" << inputFiles_[0] << "\"";
118  }
119 
120  // Check if .xml file can be opened
121  if (!xmlFile_.empty()) {
122  std::ifstream xml_file;
123  xml_file.open(xmlFile_.c_str());
124  if (!xml_file.is_open()) {
125  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
126  << " The SummaryPlot XML file \"" << xmlFile_ << "\" could not be opened!"
127  << " Please check the path and filename!"
128  << " Aborting...";
129  return;
130  } else {
131  createSummaryPlots_ = true;
132  xml_file.close();
133  }
134  }
135 
136  // Open root file(s) and create ME's
137  if (inputFiles_.empty()) {
138  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
139  << " No input root files specified!";
140  return;
141  }
142 
143  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
144  << " Opening root files. This may take some time!...";
145  std::vector<std::string>::const_iterator jfile = inputFiles_.begin();
146  for (; jfile != inputFiles_.end(); jfile++) {
147  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
148  << " Opening root file \"" << *jfile << "\"... (This may take some time.)";
149  if (clientHistos_) {
150  bei_->open(*jfile, false, sistrip::collate_, "");
151  } else {
152  bei_->open(*jfile, false, "SiStrip", sistrip::collate_);
153  }
154  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
155  << " Opened root file \"" << *jfile << "\"!";
156  }
157  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
158  << " Opened " << inputFiles_.size() << " root files!";
159 
160  // Retrieve list of histograms
161  auto allmes = bei_->getAllContents("");
162  std::vector<std::string> contents;
163 
164  // If using client file, remove "source" histograms from list
165  if (clientHistos_) {
166  std::set<std::string> temp;
167  for (auto me : allmes) {
168  const auto& name = me->getPathname();
169  if (name.find(sistrip::collate_) != std::string::npos) {
170  temp.insert(name);
171  }
172  }
173  contents.clear();
174  for (const auto& s : temp) {
175  // the old code expects a ":", but does not really need the ME names
176  contents.push_back(s + ":");
177  }
178  }
179 
180  // Some debug
181  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
182  << " Found " << contents.size() << " directories containing MonitorElements";
183 
184  // Some more debug
185  if (false) {
186  std::stringstream ss;
187  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
188  << " Directories found: " << std::endl;
189  std::vector<std::string>::iterator istr = contents.begin();
190  for (; istr != contents.end(); istr++) {
191  ss << " " << *istr << std::endl;
192  }
193  LogTrace(mlDqmClient_) << ss.str();
194  }
195 
196  // Extract run type from contents
198 
199  // Extract run number from contents
201 
202  // Copy custom information to the collated structure
204 
205  // Check runType
207  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
208  << " Unknown commissioning runType: " << SiStripEnumsAndStrings::runType(runType_)
209  << " and run number is " << runNumber_;
210  return;
211  } else {
212  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
213  << " Run type is " << SiStripEnumsAndStrings::runType(runType_)
214  << " and run number is " << runNumber_;
215  }
216 
217  // Open and parse "summary plot" xml file
218  if (createSummaryPlots_) {
219  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
220  << " Parsing summary plot XML file...";
221  SummaryPlotXmlParser xml_file;
222  xml_file.parseXML(xmlFile_);
223  plots_ = xml_file.summaryPlots(runType_);
224  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
225  << " Parsed summary plot XML file and found " << plots_.size() << " plots defined!";
226  } else {
227  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
228  << " Null string for SummaryPlotXmlFile!"
229  << " No summary plots will be created!";
230  }
231 
232  // Some debug
233  std::stringstream ss;
234  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]" << std::endl << " Input root files : ";
235  if (inputFiles_.empty()) {
236  ss << "(none)";
237  } else {
238  std::vector<std::string>::const_iterator ifile = inputFiles_.begin();
239  for (; ifile != inputFiles_.end(); ifile++) {
240  if (ifile != inputFiles_.begin()) {
241  ss << std::setw(25) << std::setfill(' ') << ": ";
242  }
243  ss << "\"" << *ifile << "\"" << std::endl;
244  }
245  }
246  ss << " Run type : \"" << SiStripEnumsAndStrings::runType(runType_) << "\"" << std::endl
247  << " Run number : " << runNumber_ << std::endl
248  << " Summary plot XML file : ";
249  if (xmlFile_.empty()) {
250  ss << "(none)";
251  } else {
252  ss << "\"" << xmlFile_ << "\"";
253  }
254  edm::LogVerbatim(mlDqmClient_) << ss.str();
255 
256  // Virtual method that creates CommissioningHistogram object
257  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
258  << " Creating CommissioningHistogram object...";
260  if (histos_) {
261  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
262  << " Created CommissioningHistogram object!";
263  } else {
264  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
265  << " NULL pointer to CommissioningHistogram object!"
266  << " Aborting...";
267  return;
268  }
269 
270  // Perform collation
271  if (histos_) {
273  }
274 
275  // Perform analysis
276  if (analyzeHistos_) {
277  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
278  << " Analyzing histograms...";
279  if (histos_) {
280  histos_->histoAnalysis(true);
281  }
282  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
283  << " Analyzed histograms!";
284  } else {
285  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
286  << " No histogram analysis performed!";
287  }
288 
289  // Create summary plots
290  if (createSummaryPlots_) {
291  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
292  << " Generating summary plots...";
293  std::vector<SummaryPlot>::const_iterator iplot = plots_.begin();
294  for (; iplot != plots_.end(); iplot++) {
295  if (histos_) {
296  histos_->createSummaryHisto(iplot->monitorable(), iplot->presentation(), iplot->level(), iplot->granularity());
297  }
298  }
299  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
300  << " Generated summary plots!";
301  } else {
302  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
303  << " No summary plots generated!";
304  }
305 
306  // Save client root file
307  if (histos_) {
308  bool save = parameters_.getUntrackedParameter<bool>("SaveClientFile", true);
309  if (save) {
313  else
315  } else {
318  }
319  } else {
320  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
321  << " Client file not saved!";
322  }
323  }
324 
325  // Virtual method to trigger the database upload
327 
328  // Print analyses
329  if (histos_) {
332  }
333 
334  // Remove all ME/CME objects
335  if (histos_) {
336  histos_->remove();
337  }
338 
339  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
340  << " Finished analyzing root file(s)...";
341 }
Log< level::Info, true > LogVerbatim
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
jfile
Definition: looper.py:281
static const char dqmClientFileName_[]
void parseXML(const std::string &xml_file)
static const char mlDqmClient_[]
Log< level::Error, false > LogError
uint16_t size_type
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
static std::string runType(const sistrip::RunType &)
Parses the "summary plot" xml configuration file.
void extractHistograms(const std::vector< std::string > &)
static sistrip::RunType runType(DQMStore *const, const std::vector< std::string > &)
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:641
virtual void createHistos(const edm::ParameterSet &, const edm::EventSetup &)
static uint32_t runNumber(DQMStore *const, const std::vector< std::string > &)
std::vector< SummaryPlot > summaryPlots(const sistrip::RunType &)
virtual void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
static void copyCustomInformation(DQMStore *const, const std::vector< std::string > &)
Log< level::Warning, false > LogWarning
static const char collate_[]
void remove(std::string pattern="")
save
Definition: cuy.py:1164
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:830
virtual void histoAnalysis(bool debug)

◆ createHistos()

void SiStripCommissioningOfflineClient::createHistos ( const edm::ParameterSet pset,
const edm::EventSetup setup 
)
protectedvirtual

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 358 of file SiStripCommissioningOfflineClient.cc.

References sistrip::APV_LATENCY, sistrip::APV_TIMING, bei_, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistograms::configure(), sistrip::DAQ_SCOPE_MODE, sistrip::FAST_CABLING, sistrip::FED_CABLING, sistrip::FINE_DELAY, histos_, sistrip::mlDqmClient_, sistrip::NOISE, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_FULL_NOISE, sistrip::PEDS_ONLY, muonDTDigis_cfi::pset, runType_, singleTopDQM_cfi::setup, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, and sistrip::VPSP_SCAN.

Referenced by beginRun().

358  {
359  // Check pointer
360  if (histos_) {
361  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
362  << " CommissioningHistogram object already exists!"
363  << " Aborting...";
364  return;
365  }
366 
367  // Check pointer to BEI
368  if (!bei_) {
369  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
370  << " NULL pointer to DQMStore!";
371  return;
372  }
373 
374  // Create "commissioning histograms" object
377  } else if (runType_ == sistrip::FED_CABLING) {
379  } else if (runType_ == sistrip::APV_TIMING) {
381  } else if (runType_ == sistrip::OPTO_SCAN) {
383  } else if (runType_ == sistrip::VPSP_SCAN) {
385  } else if (runType_ == sistrip::PEDESTALS) {
387  } else if (runType_ == sistrip::PEDS_FULL_NOISE) {
389  } else if (runType_ == sistrip::PEDS_ONLY) {
391  } else if (runType_ == sistrip::NOISE) {
398  } else if (runType_ == sistrip::DAQ_SCOPE_MODE) {
400  } else if (runType_ == sistrip::UNDEFINED_RUN_TYPE) {
401  histos_ = nullptr;
402  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
403  << " Undefined run type!";
404  return;
405  } else if (runType_ == sistrip::UNKNOWN_RUN_TYPE) {
406  histos_ = nullptr;
407  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
408  << " Unknown run type!";
409  return;
410  }
412 }
static const char mlDqmClient_[]
Log< level::Error, false > LogError
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)

◆ endJob()

void SiStripCommissioningOfflineClient::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 354 of file SiStripCommissioningOfflineClient.cc.

354 {}

◆ endRun()

void SiStripCommissioningOfflineClient::endRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverride

Definition at line 38 of file SiStripCommissioningOfflineClient.h.

38 {}

◆ setInputFiles()

void SiStripCommissioningOfflineClient::setInputFiles ( std::vector< std::string > &  files,
const std::string  path,
const std::string  partitionName,
uint32_t  run_number,
bool  collate_histos 
)
protectedvirtual

Definition at line 416 of file SiStripCommissioningOfflineClient.cc.

References dqmPostProcessing_online::DIR, Calorimetry_cff::dp, mps_splice::entry, MillePedeFileConverter_cfg::fileName, submitPVResolutionJobs::files, compare_using_db::ifile, looper::jfile, LogTrace, sistrip::mlDqmClient_, FrameHeaderEvents_cfi::partitionName, castor_dqm_sourceclient_file_cfg::path, contentValuesCheck::run_number, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripCommissioningOfflineClient().

420  {
421  std::string runStr;
422  std::stringstream ss;
423  ss << std::setfill('0') << std::setw(8) << run_number;
424  runStr = ss.str();
425 
426  std::string nameStr = "";
427  if (!collate_histos) {
428  nameStr = "SiStripCommissioningClient_";
429  } else {
430  nameStr = "SiStripCommissioningSource_";
431  }
432 
433  LogTrace("TEST") << " runStr " << runStr;
434 
435  // Open directory
436  DIR* dp;
437  struct dirent* dirp;
438  if ((dp = opendir(path.c_str())) == nullptr) {
439  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
440  << " Error locating directory \"" << path << "\". No such directory!";
441  return;
442  }
443 
444  // Find compatible files
445  while ((dirp = readdir(dp)) != nullptr) {
446  std::string fileName(dirp->d_name);
447  bool goodName = (fileName.find(nameStr) != std::string::npos);
448  bool goodRun = (fileName.find(runStr) != std::string::npos);
449  bool rootFile = (fileName.find(".root") != std::string::npos);
450  bool goodPartition = true;
451  if (not partitionName.empty()) {
452  goodPartition = (fileName.find(partitionName) != std::string::npos);
453  }
454 
455  //bool rootFile = ( fileName.rfind(".root",5) == fileName.size()-5 );
456  if (goodName && goodRun && rootFile && goodPartition) {
458  entry += "/";
459  entry += fileName;
460  files.push_back(entry);
461  }
462  }
463  closedir(dp);
464 
465  // Some debug
466  if (!collate_histos && files.size() > 1) {
467  std::stringstream ss;
468  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
469  << " Found more than one client file!";
470  std::vector<std::string>::const_iterator ifile = files.begin();
471  std::vector<std::string>::const_iterator jfile = files.end();
472  for (; ifile != jfile; ++ifile) {
473  ss << std::endl << *ifile;
474  }
475  edm::LogError(mlDqmClient_) << ss.str();
476  } else if (files.empty()) {
477  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
478  << " No input files found!";
479  }
480 }
jfile
Definition: looper.py:281
static const char mlDqmClient_[]
Log< level::Error, false > LogError
#define LogTrace(id)

◆ uploadToConfigDb()

virtual void SiStripCommissioningOfflineClient::uploadToConfigDb ( )
inlineprotectedvirtual

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 44 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

44 { ; }

Member Data Documentation

◆ analyzeHistos_

bool SiStripCommissioningOfflineClient::analyzeHistos_
protected

Definition at line 64 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ bei_

DQMStore* SiStripCommissioningOfflineClient::bei_
protected

◆ clientHistos_

bool SiStripCommissioningOfflineClient::clientHistos_
protected

Definition at line 73 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ collateHistos_

bool SiStripCommissioningOfflineClient::collateHistos_
protected

◆ createSummaryPlots_

bool SiStripCommissioningOfflineClient::createSummaryPlots_
protected

Flag.

Definition at line 70 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ histos_

CommissioningHistograms* SiStripCommissioningOfflineClient::histos_
protected

◆ inputFiles_

std::vector<std::string> SiStripCommissioningOfflineClient::inputFiles_
protected

Input .root file.

Definition at line 55 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), and SiStripCommissioningOfflineClient().

◆ map_

HistosMap SiStripCommissioningOfflineClient::map_
protected

Map containing commissioning histograms.

Definition at line 94 of file SiStripCommissioningOfflineClient.h.

◆ outputFileName_

std::string SiStripCommissioningOfflineClient::outputFileName_
protected

Output .root file.

Definition at line 58 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ parameters_

edm::ParameterSet SiStripCommissioningOfflineClient::parameters_
protected

◆ partitionName_

std::string SiStripCommissioningOfflineClient::partitionName_
protected

Partition Name

Definition at line 85 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ plots_

std::vector<SummaryPlot> SiStripCommissioningOfflineClient::plots_
protected

SummaryPlot objects.

Definition at line 97 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ runNumber_

uint32_t SiStripCommissioningOfflineClient::runNumber_
protected

Run number.

Definition at line 82 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ runType_

sistrip::RunType SiStripCommissioningOfflineClient::runType_
protected

Commissioning runType.

Definition at line 79 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), SiStripCommissioningOfflineDbClient::createHistos(), and createHistos().

◆ uploadToDb_

bool SiStripCommissioningOfflineClient::uploadToDb_
protected

Definition at line 76 of file SiStripCommissioningOfflineClient.h.

◆ xmlFile_

std::string SiStripCommissioningOfflineClient::xmlFile_
protected

Input .xml file.

Definition at line 67 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().