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::EDAnalyzer edm::EDConsumerBase SiStripCommissioningOfflineDbClient

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer 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
 
 SiStripCommissioningOfflineClient (const edm::ParameterSet &)
 
 ~SiStripCommissioningOfflineClient () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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)
 
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<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)
 

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::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

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

Definition at line 32 of file SiStripCommissioningOfflineClient.h.

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

Definition at line 87 of file SiStripCommissioningOfflineClient.h.

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

Definition at line 90 of file SiStripCommissioningOfflineClient.h.

Definition at line 31 of file SiStripCommissioningOfflineClient.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file SiStripCommissioningOfflineClient.cc.

References collateHistos_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputFiles_, LogTrace, sistrip::mlDqmClient_, 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...";
57  pset.getUntrackedParameter<std::string>("FilePath"),
58  pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : "",
59  pset.getUntrackedParameter<uint32_t>("RunNumber"),
61 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
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 ( )
override

Definition at line 65 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

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

Definition at line 341 of file SiStripCommissioningOfflineClient.cc.

References edm::EventID::event(), edm::EventBase::id(), LogTrace, and sistrip::mlDqmClient_.

341  {
342  if (!(event.id().event() % 10)) {
343  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
344  << " Empty event loop! User can kill job...";
345  }
346 }
EventNumber_t event() const
Definition: EventID.h:40
static const char mlDqmClient_[]
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:59
void SiStripCommissioningOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
override

Definition at line 72 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::dqmstoreimpl::DQMStore::getContents(), edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, CommissioningHistograms::histoAnalysis(), histos_, compare_using_db::ifile, inputFiles_, looper::jfile, LogTrace, sistrip::mlDqmClient_, dqm::dqmstoreimpl::DQMStore::open(), outputFileName_, parameters_, SummaryPlotXmlParser::parseXML(), partitionName_, plots_, CommissioningHistograms::printAnalyses(), CommissioningHistograms::printSummary(), CommissioningHistograms::remove(), CommissioningHistograms::runNumber(), runNumber_, SiStripEnumsAndStrings::runType(), CommissioningHistograms::runType(), runType_, CalibrationHistograms::save(), CommissioningHistograms::save(), cuy::save, contentValuesCheck::ss, SummaryPlotXmlParser::summaryPlots(), groupFilesInBlocks::temp, sistrip::UNKNOWN_RUN_TYPE, uploadToConfigDb(), and xmlFile_.

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 354 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, runType_, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, and sistrip::VPSP_SCAN.

Referenced by beginRun().

354  {
355  // Check pointer
356  if (histos_) {
357  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
358  << " CommissioningHistogram object already exists!"
359  << " Aborting...";
360  return;
361  }
362 
363  // Check pointer to BEI
364  if (!bei_) {
365  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
366  << " NULL pointer to DQMStore!";
367  return;
368  }
369 
370  // Create "commissioning histograms" object
373  } else if (runType_ == sistrip::FED_CABLING) {
374  histos_ = new FedCablingHistograms(pset, bei_);
375  } else if (runType_ == sistrip::APV_TIMING) {
376  histos_ = new ApvTimingHistograms(pset, bei_);
377  } else if (runType_ == sistrip::OPTO_SCAN) {
378  histos_ = new OptoScanHistograms(pset, bei_);
379  } else if (runType_ == sistrip::VPSP_SCAN) {
380  histos_ = new VpspScanHistograms(pset, bei_);
381  } else if (runType_ == sistrip::PEDESTALS) {
382  histos_ = new PedestalsHistograms(pset, bei_);
383  } else if (runType_ == sistrip::PEDS_FULL_NOISE) {
384  histos_ = new PedsFullNoiseHistograms(pset, bei_);
385  } else if (runType_ == sistrip::PEDS_ONLY) {
386  histos_ = new PedsOnlyHistograms(pset, bei_);
387  } else if (runType_ == sistrip::NOISE) {
388  histos_ = new NoiseHistograms(pset, bei_);
390  histos_ = new SamplingHistograms(pset, bei_, runType_);
394  } else if (runType_ == sistrip::DAQ_SCOPE_MODE) {
395  histos_ = new DaqScopeModeHistograms(pset, bei_);
396  } else if (runType_ == sistrip::UNDEFINED_RUN_TYPE) {
397  histos_ = nullptr;
398  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
399  << " Undefined run type!";
400  return;
401  } else if (runType_ == sistrip::UNKNOWN_RUN_TYPE) {
402  histos_ = nullptr;
403  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
404  << " Unknown run type!";
405  return;
406  }
407  histos_->configure(pset, setup);
408 }
static const char mlDqmClient_[]
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
void SiStripCommissioningOfflineClient::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 350 of file SiStripCommissioningOfflineClient.cc.

350 {}
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 412 of file SiStripCommissioningOfflineClient.cc.

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

Referenced by SiStripCommissioningOfflineClient(), and uploadToConfigDb().

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 43 of file SiStripCommissioningOfflineClient.h.

References setInputFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

43 { ; }

Member Data Documentation

bool SiStripCommissioningOfflineClient::analyzeHistos_
protected

Definition at line 63 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

DQMStore* SiStripCommissioningOfflineClient::bei_
protected
bool SiStripCommissioningOfflineClient::clientHistos_
protected

Definition at line 72 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

bool SiStripCommissioningOfflineClient::collateHistos_
protected
bool SiStripCommissioningOfflineClient::createSummaryPlots_
protected

Flag.

Definition at line 69 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

CommissioningHistograms* SiStripCommissioningOfflineClient::histos_
protected
std::vector<std::string> SiStripCommissioningOfflineClient::inputFiles_
protected

Input .root file.

Definition at line 54 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), and SiStripCommissioningOfflineClient().

HistosMap SiStripCommissioningOfflineClient::map_
protected

Map containing commissioning histograms.

Definition at line 93 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::outputFileName_
protected

Output .root file.

Definition at line 57 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

edm::ParameterSet SiStripCommissioningOfflineClient::parameters_
protected
std::string SiStripCommissioningOfflineClient::partitionName_
protected

Partition Name

Definition at line 84 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

SummaryPlot objects.

Definition at line 96 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

uint32_t SiStripCommissioningOfflineClient::runNumber_
protected

Run number.

Definition at line 81 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

sistrip::RunType SiStripCommissioningOfflineClient::runType_
protected

Commissioning runType.

Definition at line 78 of file SiStripCommissioningOfflineClient.h.

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

bool SiStripCommissioningOfflineClient::uploadToDb_
protected

Definition at line 75 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::xmlFile_
protected

Input .xml file.

Definition at line 66 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().