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

◆ DQMStore

Definition at line 32 of file SiStripCommissioningOfflineClient.h.

◆ Histos

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

Definition at line 87 of file SiStripCommissioningOfflineClient.h.

◆ HistosMap

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

Definition at line 90 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...";
57  pset.getUntrackedParameter<std::string>("FilePath"),
58  pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : "",
59  pset.getUntrackedParameter<uint32_t>("RunNumber"),
61 }
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 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

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 344 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

◆ beginRun()

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

Reimplemented from edm::EDAnalyzer.

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::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_.

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  auto allmes = bei_->getAllContents("");
161  std::vector<std::string> contents;
162 
163  // If using client file, remove "source" histograms from list
164  if (clientHistos_) {
165  std::set<std::string> temp;
166  for (auto me : allmes) {
167  const auto& name = me->getPathname();
168  if (name.find(sistrip::collate_) != std::string::npos) {
169  temp.insert(name);
170  }
171  }
172  contents.clear();
173  for (const auto& s : temp) {
174  // the old code expects a ":", but does not really need the ME names
175  contents.push_back(s + ":");
176  }
177  }
178 
179  // Some debug
180  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
181  << " Found " << contents.size() << " directories containing MonitorElements";
182 
183  // Some more debug
184  if (false) {
185  std::stringstream ss;
186  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
187  << " Directories found: " << std::endl;
188  std::vector<std::string>::iterator istr = contents.begin();
189  for (; istr != contents.end(); istr++) {
190  ss << " " << *istr << std::endl;
191  }
192  LogTrace(mlDqmClient_) << ss.str();
193  }
194 
195  // Extract run type from contents
197 
198  // Extract run number from contents
200 
201  // Copy custom information to the collated structure
203 
204  // Check runType
206  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
207  << " Unknown commissioning runType: " << SiStripEnumsAndStrings::runType(runType_)
208  << " and run number is " << runNumber_;
209  return;
210  } else {
211  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
212  << " Run type is " << SiStripEnumsAndStrings::runType(runType_)
213  << " and run number is " << runNumber_;
214  }
215 
216  // Open and parse "summary plot" xml file
217  if (createSummaryPlots_) {
218  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
219  << " Parsing summary plot XML file...";
220  SummaryPlotXmlParser xml_file;
221  xml_file.parseXML(xmlFile_);
222  plots_ = xml_file.summaryPlots(runType_);
223  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
224  << " Parsed summary plot XML file and found " << plots_.size() << " plots defined!";
225  } else {
226  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
227  << " Null string for SummaryPlotXmlFile!"
228  << " No summary plots will be created!";
229  }
230 
231  // Some debug
232  std::stringstream ss;
233  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]" << std::endl << " Input root files : ";
234  if (inputFiles_.empty()) {
235  ss << "(none)";
236  } else {
237  std::vector<std::string>::const_iterator ifile = inputFiles_.begin();
238  for (; ifile != inputFiles_.end(); ifile++) {
239  if (ifile != inputFiles_.begin()) {
240  ss << std::setw(25) << std::setfill(' ') << ": ";
241  }
242  ss << "\"" << *ifile << "\"" << std::endl;
243  }
244  }
245  ss << " Run type : \"" << SiStripEnumsAndStrings::runType(runType_) << "\"" << std::endl
246  << " Run number : " << runNumber_ << std::endl
247  << " Summary plot XML file : ";
248  if (xmlFile_.empty()) {
249  ss << "(none)";
250  } else {
251  ss << "\"" << xmlFile_ << "\"";
252  }
253  edm::LogVerbatim(mlDqmClient_) << ss.str();
254 
255  // Virtual method that creates CommissioningHistogram object
256  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
257  << " Creating CommissioningHistogram object...";
259  if (histos_) {
260  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
261  << " Created CommissioningHistogram object!";
262  } else {
263  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
264  << " NULL pointer to CommissioningHistogram object!"
265  << " Aborting...";
266  return;
267  }
268 
269  // Perform collation
270  if (histos_) {
272  }
273 
274  // Perform analysis
275  if (analyzeHistos_) {
276  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
277  << " Analyzing histograms...";
278  if (histos_) {
279  histos_->histoAnalysis(true);
280  }
281  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
282  << " Analyzed histograms!";
283  } else {
284  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
285  << " No histogram analysis performed!";
286  }
287 
288  // Create summary plots
289  if (createSummaryPlots_) {
290  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
291  << " Generating summary plots...";
292  std::vector<SummaryPlot>::const_iterator iplot = plots_.begin();
293  for (; iplot != plots_.end(); iplot++) {
294  if (histos_) {
295  histos_->createSummaryHisto(iplot->monitorable(), iplot->presentation(), iplot->level(), iplot->granularity());
296  }
297  }
298  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
299  << " Generated summary plots!";
300  } else {
301  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
302  << " No summary plots generated!";
303  }
304 
305  // Save client root file
306  if (histos_) {
307  bool save = parameters_.getUntrackedParameter<bool>("SaveClientFile", true);
308  if (save) {
312  else
314  } else {
317  }
318  } else {
319  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
320  << " Client file not saved!";
321  }
322  }
323 
324  // Virtual method to trigger the database upload
326 
327  // Print analyses
328  if (histos_) {
331  }
332 
333  // Remove all ME/CME objects
334  if (histos_) {
335  histos_->remove();
336  }
337 
338  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
339  << " Finished analyzing root file(s)...";
340 }
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:609
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:790
virtual void histoAnalysis(bool debug)

◆ createHistos()

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 357 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().

357  {
358  // Check pointer
359  if (histos_) {
360  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
361  << " CommissioningHistogram object already exists!"
362  << " Aborting...";
363  return;
364  }
365 
366  // Check pointer to BEI
367  if (!bei_) {
368  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
369  << " NULL pointer to DQMStore!";
370  return;
371  }
372 
373  // Create "commissioning histograms" object
376  } else if (runType_ == sistrip::FED_CABLING) {
378  } else if (runType_ == sistrip::APV_TIMING) {
380  } else if (runType_ == sistrip::OPTO_SCAN) {
382  } else if (runType_ == sistrip::VPSP_SCAN) {
384  } else if (runType_ == sistrip::PEDESTALS) {
386  } else if (runType_ == sistrip::PEDS_FULL_NOISE) {
388  } else if (runType_ == sistrip::PEDS_ONLY) {
390  } else if (runType_ == sistrip::NOISE) {
397  } else if (runType_ == sistrip::DAQ_SCOPE_MODE) {
399  } else if (runType_ == sistrip::UNDEFINED_RUN_TYPE) {
400  histos_ = nullptr;
401  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
402  << " Undefined run type!";
403  return;
404  } else if (runType_ == sistrip::UNKNOWN_RUN_TYPE) {
405  histos_ = nullptr;
406  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
407  << " Unknown run type!";
408  return;
409  }
411 }
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::EDAnalyzer.

Definition at line 353 of file SiStripCommissioningOfflineClient.cc.

353 {}

◆ 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 415 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().

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

Referenced by beginRun().

43 { ; }

Member Data Documentation

◆ analyzeHistos_

bool SiStripCommissioningOfflineClient::analyzeHistos_
protected

Definition at line 63 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ bei_

DQMStore* SiStripCommissioningOfflineClient::bei_
protected

◆ clientHistos_

bool SiStripCommissioningOfflineClient::clientHistos_
protected

Definition at line 72 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ collateHistos_

bool SiStripCommissioningOfflineClient::collateHistos_
protected

◆ createSummaryPlots_

bool SiStripCommissioningOfflineClient::createSummaryPlots_
protected

Flag.

Definition at line 69 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 54 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), and SiStripCommissioningOfflineClient().

◆ map_

HistosMap SiStripCommissioningOfflineClient::map_
protected

Map containing commissioning histograms.

Definition at line 93 of file SiStripCommissioningOfflineClient.h.

◆ outputFileName_

std::string SiStripCommissioningOfflineClient::outputFileName_
protected

Output .root file.

Definition at line 57 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ parameters_

edm::ParameterSet SiStripCommissioningOfflineClient::parameters_
protected

◆ partitionName_

std::string SiStripCommissioningOfflineClient::partitionName_
protected

Partition Name

Definition at line 84 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ plots_

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

SummaryPlot objects.

Definition at line 96 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ runNumber_

uint32_t SiStripCommissioningOfflineClient::runNumber_
protected

Run number.

Definition at line 81 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

◆ runType_

sistrip::RunType SiStripCommissioningOfflineClient::runType_
protected

Commissioning runType.

Definition at line 78 of file SiStripCommissioningOfflineClient.h.

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

◆ uploadToDb_

bool SiStripCommissioningOfflineClient::uploadToDb_
protected

Definition at line 75 of file SiStripCommissioningOfflineClient.h.

◆ xmlFile_

std::string SiStripCommissioningOfflineClient::xmlFile_
protected

Input .xml file.

Definition at line 66 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().