CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
 SiStripCommissioningOfflineClient (const edm::ParameterSet &)
 
virtual ~SiStripCommissioningOfflineClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Types

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

Protected Member Functions

virtual void createHistos (const edm::ParameterSet &, const edm::EventSetup &)
 
virtual void setInputFiles (std::vector< std::string > &, const std::string, uint32_t, bool)
 
virtual void uploadToConfigDb ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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::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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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 30 of file SiStripCommissioningOfflineClient.h.

Member Typedef Documentation

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

Definition at line 86 of file SiStripCommissioningOfflineClient.h.

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

Definition at line 89 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::getUntrackedParameter(), inputFiles_, LogTrace, sistrip::mlDqmClient_, setInputFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

38  histos_(0),
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  map_(),
50  plots_(),
51  parameters_(pset)
52 {
54  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
55  << " Constructing object...";
57  pset.getUntrackedParameter<std::string>( "FilePath" ),
58  pset.getUntrackedParameter<uint32_t>("RunNumber"),
60 }
T getUntrackedParameter(std::string const &, T const &) const
static const char mlDqmClient_[]
virtual void setInputFiles(std::vector< std::string > &, const std::string, uint32_t, bool)
#define LogTrace(id)
SiStripCommissioningOfflineClient::~SiStripCommissioningOfflineClient ( )
virtual

Definition at line 64 of file SiStripCommissioningOfflineClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

64  {
66  << "[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 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 364 of file SiStripCommissioningOfflineClient.cc.

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

365  {
366  if ( !(event.id().event()%10) ) {
368  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
369  << " Empty event loop! User can kill job...";
370  }
371 }
EventNumber_t event() const
Definition: EventID.h:44
static const char mlDqmClient_[]
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:56
void SiStripCommissioningOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file SiStripCommissioningOfflineClient.cc.

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

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 379 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::FAST_CABLING, sistrip::FED_CABLING, sistrip::FINE_DELAY, histos_, sistrip::mlDqmClient_, sistrip::NOISE, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_ONLY, runType_, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, and sistrip::VPSP_SCAN.

Referenced by beginRun().

379  {
380 
381  // Check pointer
382  if ( histos_ ) {
384  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
385  << " CommissioningHistogram object already exists!"
386  << " Aborting...";
387  return;
388  }
389 
390  // Check pointer to BEI
391  if ( !bei_ ) {
393  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
394  << " NULL pointer to DQMStore!";
395  return;
396  }
397 
398  // Create "commissioning histograms" object
400  else if ( runType_ == sistrip::FED_CABLING ) { histos_ = new FedCablingHistograms( pset, bei_ ); }
401  else if ( runType_ == sistrip::APV_TIMING ) { histos_ = new ApvTimingHistograms( pset, bei_ ); }
402  else if ( runType_ == sistrip::OPTO_SCAN ) { histos_ = new OptoScanHistograms( pset, bei_ ); }
403  else if ( runType_ == sistrip::VPSP_SCAN ) { histos_ = new VpspScanHistograms( pset, bei_ ); }
404  else if ( runType_ == sistrip::PEDESTALS ) { histos_ = new PedestalsHistograms( pset, bei_ ); }
405  else if ( runType_ == sistrip::PEDS_ONLY ) { histos_ = new PedsOnlyHistograms( pset, bei_ ); }
406  else if ( runType_ == sistrip::NOISE ) { histos_ = new NoiseHistograms( pset, bei_ ); }
407  else if ( runType_ == sistrip::APV_LATENCY ||
409  else if ( runType_ == sistrip::CALIBRATION ||
413  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
414  histos_ = 0;
416  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
417  << " Undefined run type!";
418  return;
419  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
420  histos_ = 0;
422  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
423  << " Unknown run type!";
424  return;
425  }
426  histos_->configure(pset,setup);
427 }
static const char mlDqmClient_[]
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
void SiStripCommissioningOfflineClient::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 375 of file SiStripCommissioningOfflineClient.cc.

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

Definition at line 431 of file SiStripCommissioningOfflineClient.cc.

References linker::DIR, reco::dp, convertXMLtoSQLite_cfg::fileName, compare_using_db::ifile, LogTrace, sistrip::mlDqmClient_, NULL, getHLTPrescaleColumns::path, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripCommissioningOfflineClient().

434  {
435 
436  std::string runStr;
437  std::stringstream ss;
438  ss << std::setfill('0') << std::setw(8) << run_number;
439  runStr = ss.str();
440 
441  std::string nameStr = "";
442  if ( !collate_histos ) { nameStr = "SiStripCommissioningClient_"; }
443  else { nameStr = "SiStripCommissioningSource_"; }
444 
445  LogTrace("TEST") << " runStr " << runStr;
446 
447  // Open directory
448  DIR* dp;
449  struct dirent* dirp;
450  if ( (dp = opendir(path.c_str())) == NULL ) {
452  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
453  << " Error locating directory \"" << path
454  << "\". No such directory!";
455  return;
456  }
457 
458  // Find compatible files
459  while ( (dirp = readdir(dp)) != NULL ) {
460  std::string fileName(dirp->d_name);
461  bool goodName = ( fileName.find(nameStr) != std::string::npos );
462  bool goodRun = ( fileName.find(runStr) != std::string::npos );
463  bool rootFile = ( fileName.find(".root") != std::string::npos );
464  //bool rootFile = ( fileName.rfind(".root",5) == fileName.size()-5 );
465  if ( goodName && goodRun && rootFile ) {
467  entry += "/";
468  entry += fileName;
469  files.push_back(entry);
470  }
471  }
472  closedir(dp);
473 
474  // Some debug
475  if ( !collate_histos && files.size() > 1 ) {
476  std::stringstream ss;
477  ss << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
478  << " Found more than one client file!";
479  std::vector<std::string>::const_iterator ifile = files.begin();
480  std::vector<std::string>::const_iterator jfile = files.end();
481  for ( ; ifile != jfile; ++ifile ) { ss << std::endl << *ifile; }
482  edm::LogError(mlDqmClient_) << ss.str();
483  } else if ( files.empty() ) {
485  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
486  << " No input files found!" ;
487  }
488 
489 }
static const char mlDqmClient_[]
#define NULL
Definition: scimark2.h:8
tuple files
Definition: linker.py:146
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
#define LogTrace(id)
list DIR
Definition: linker.py:124
auto dp
Definition: deltaR.h:24
virtual void SiStripCommissioningOfflineClient::uploadToConfigDb ( )
inlineprotectedvirtual

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 44 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

44 {;}

Member Data Documentation

bool SiStripCommissioningOfflineClient::analyzeHistos_
protected

Definition at line 65 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Definition at line 74 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Flag.

Definition at line 71 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

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

Input .root file.

Definition at line 56 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun(), and SiStripCommissioningOfflineClient().

HistosMap SiStripCommissioningOfflineClient::map_
protected

Map containing commissioning histograms.

Definition at line 92 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::outputFileName_
protected

Output .root file.

Definition at line 59 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

edm::ParameterSet SiStripCommissioningOfflineClient::parameters_
protected
std::vector<SummaryPlot> SiStripCommissioningOfflineClient::plots_
protected

SummaryPlot objects.

Definition at line 95 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

uint32_t SiStripCommissioningOfflineClient::runNumber_
protected

Run number.

Definition at line 83 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().

sistrip::RunType SiStripCommissioningOfflineClient::runType_
protected

Commissioning runType.

Definition at line 80 of file SiStripCommissioningOfflineClient.h.

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

bool SiStripCommissioningOfflineClient::uploadToDb_
protected

Definition at line 77 of file SiStripCommissioningOfflineClient.h.

std::string SiStripCommissioningOfflineClient::xmlFile_
protected

Input .xml file.

Definition at line 68 of file SiStripCommissioningOfflineClient.h.

Referenced by beginRun().