CMS 3D CMS Logo

List of all members | 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 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
 
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)
 
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 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

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

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

Definition at line 88 of file SiStripCommissioningOfflineClient.h.

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

Definition at line 91 of file SiStripCommissioningOfflineClient.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file SiStripCommissioningOfflineClient.cc.

References collateHistos_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputFiles_, LogTrace, sistrip::mlDqmClient_, setInputFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

39  histos_(nullptr),
40  //inputFiles_( pset.getUntrackedParameter< std::vector<std::string> >( "InputRootFiles", std::vector<std::string>() ) ),
41  outputFileName_( pset.getUntrackedParameter<std::string>( "OutputRootFile", "" ) ),
42  collateHistos_( !pset.getUntrackedParameter<bool>( "UseClientFile", false ) ),
43  analyzeHistos_( pset.getUntrackedParameter<bool>( "AnalyzeHistos", true ) ),
44  xmlFile_( (pset.getUntrackedParameter<edm::FileInPath>( "SummaryXmlFile", edm::FileInPath() )).fullPath() ),
45  createSummaryPlots_( false ),
46  clientHistos_( false ),
47  uploadToDb_( false ),
49  runNumber_(0),
50  partitionName_(pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : ""),
51  map_(),
52  plots_(),
53  parameters_(pset)
54 {
56  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
57  << " Constructing object...";
59  pset.getUntrackedParameter<std::string>( "FilePath" ),
60  pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : "",
61  pset.getUntrackedParameter<uint32_t>("RunNumber"),
63 }
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:186
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 67 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

67  {
69  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
70  << " Destructing object...";
71 }
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 372 of file SiStripCommissioningOfflineClient.cc.

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

373  {
374  if ( !(event.id().event()%10) ) {
376  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
377  << " Empty event loop! User can kill job...";
378  }
379 }
EventNumber_t event() const
Definition: EventID.h:41
static const char mlDqmClient_[]
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:60
void SiStripCommissioningOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
override

Definition at line 75 of file SiStripCommissioningOfflineClient.cc.

References analyzeHistos_, bei_, clientHistos_, sistrip::collate_, relmon_rootfiles_spy::contents, CommissioningHistograms::copyCustomInformation(), createHistos(), CommissioningHistograms::createSummaryHisto(), createSummaryPlots_, sistrip::DAQ_SCOPE_MODE, sistrip::dqmClientFileName_, CommissioningHistograms::extractHistograms(), runEdmFileComparison::found, edm::ParameterSet::getUntrackedParameter(), CommissioningHistograms::histoAnalysis(), histos_, compare_using_db::ifile, inputFiles_, looper::jfile, LogTrace, sistrip::mlDqmClient_, outputFileName_, parameters_, SummaryPlotXmlParser::parseXML(), partitionName_, plots_, CommissioningHistograms::printAnalyses(), CommissioningHistograms::printSummary(), CommissioningHistograms::remove(), CommissioningHistograms::runNumber(), runNumber_, SiStripEnumsAndStrings::runType(), CommissioningHistograms::runType(), runType_, CommissioningHistograms::save(), cuy::save, SummaryPlotXmlParser::summaryPlots(), groupFilesInBlocks::temp, funct::true, sistrip::UNKNOWN_RUN_TYPE, uploadToConfigDb(), and xmlFile_.

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

Reimplemented in SiStripCommissioningOfflineDbClient.

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

387  {
388 
389  // Check pointer
390  if ( histos_ ) {
392  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
393  << " CommissioningHistogram object already exists!"
394  << " Aborting...";
395  return;
396  }
397 
398  // Check pointer to BEI
399  if ( !bei_ ) {
401  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
402  << " NULL pointer to DQMStore!";
403  return;
404  }
405 
406  // Create "commissioning histograms" object
408  else if ( runType_ == sistrip::FED_CABLING ) { histos_ = new FedCablingHistograms( pset, bei_ ); }
409  else if ( runType_ == sistrip::APV_TIMING ) { histos_ = new ApvTimingHistograms( pset, bei_ ); }
410  else if ( runType_ == sistrip::OPTO_SCAN ) { histos_ = new OptoScanHistograms( pset, bei_ ); }
411  else if ( runType_ == sistrip::VPSP_SCAN ) { histos_ = new VpspScanHistograms( pset, bei_ ); }
412  else if ( runType_ == sistrip::PEDESTALS ) { histos_ = new PedestalsHistograms( pset, bei_ ); }
413  else if ( runType_ == sistrip::PEDS_FULL_NOISE ) { histos_ = new PedsFullNoiseHistograms( pset, bei_ ); }
414  else if ( runType_ == sistrip::PEDS_ONLY ) { histos_ = new PedsOnlyHistograms( pset, bei_ ); }
415  else if ( runType_ == sistrip::NOISE ) { histos_ = new NoiseHistograms( pset, bei_ ); }
416  else if ( runType_ == sistrip::APV_LATENCY ||
418  else if ( runType_ == sistrip::CALIBRATION ||
422  else if ( runType_ == sistrip::DAQ_SCOPE_MODE) { histos_ = new DaqScopeModeHistograms( pset, bei_);}
423  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
424  histos_ = nullptr;
426  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
427  << " Undefined run type!";
428  return;
429  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
430  histos_ = nullptr;
432  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
433  << " Unknown run type!";
434  return;
435  }
436  histos_->configure(pset,setup);
437 }
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 383 of file SiStripCommissioningOfflineClient.cc.

383 {}
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 441 of file SiStripCommissioningOfflineClient.cc.

References mps_splice::entry, MillePedeFileConverter_cfg::fileName, compare_using_db::ifile, looper::jfile, LogTrace, sistrip::mlDqmClient_, nullptr, callgraph::path, indexGen::rootFile, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripCommissioningOfflineClient(), and uploadToConfigDb().

445  {
446 
447  std::string runStr;
448  std::stringstream ss;
449  ss << std::setfill('0') << std::setw(8) << run_number;
450  runStr = ss.str();
451 
452  std::string nameStr = "";
453  if ( !collate_histos ) { nameStr = "SiStripCommissioningClient_"; }
454  else { nameStr = "SiStripCommissioningSource_"; }
455 
456  LogTrace("TEST") << " runStr " << runStr;
457 
458  // Open directory
459  DIR* dp;
460  struct dirent* dirp;
461  if ( (dp = opendir(path.c_str())) == nullptr ) {
463  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
464  << " Error locating directory \"" << path
465  << "\". No such directory!";
466  return;
467  }
468 
469  // Find compatible files
470  while ( (dirp = readdir(dp)) != nullptr ) {
471  std::string fileName(dirp->d_name);
472  bool goodName = ( fileName.find(nameStr) != std::string::npos );
473  bool goodRun = ( fileName.find(runStr) != std::string::npos );
474  bool rootFile = ( fileName.find(".root") != std::string::npos );
475  bool goodPartition = true;
476  if(not partitionName.empty()){
477  goodPartition = ( fileName.find(partitionName) != std::string::npos );
478  }
479 
480  //bool rootFile = ( fileName.rfind(".root",5) == fileName.size()-5 );
481  if ( goodName && goodRun && rootFile && goodPartition ){
483  entry += "/";
484  entry += fileName;
485  files.push_back(entry);
486  }
487  }
488  closedir(dp);
489 
490  // Some debug
491  if ( !collate_histos && files.size() > 1 ) {
492  std::stringstream ss;
493  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
494  << " Found more than one client file!";
495  std::vector<std::string>::const_iterator ifile = files.begin();
496  std::vector<std::string>::const_iterator jfile = files.end();
497  for ( ; ifile != jfile; ++ifile ) { ss << std::endl << *ifile; }
498  edm::LogError(mlDqmClient_) << ss.str();
499  } else if ( files.empty() ) {
501  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
502  << " No input files found!" ;
503  }
504 
505 }
jfile
Definition: looper.py:279
static const char mlDqmClient_[]
#define nullptr
#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 64 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Definition at line 73 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Flag.

Definition at line 70 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Input .root file.

Definition at line 55 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), and SiStripCommissioningOfflineClient().

HistosMap SiStripCommissioningOfflineClient::map_
protected

Map containing commissioning histograms.

Definition at line 94 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::outputFileName_
protected

Output .root file.

Definition at line 58 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Partition Name

Definition at line 85 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

SummaryPlot objects.

Definition at line 97 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

uint32_t SiStripCommissioningOfflineClient::runNumber_
protected

Run number.

Definition at line 82 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

sistrip::RunType SiStripCommissioningOfflineClient::runType_
protected

Commissioning runType.

Definition at line 79 of file SiStripCommissioningOfflineClient.h.

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

bool SiStripCommissioningOfflineClient::uploadToDb_
protected

Definition at line 76 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::xmlFile_
protected

Input .xml file.

Definition at line 67 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().