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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::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
 
- 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 &)
 

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

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

Definition at line 88 of file SiStripCommissioningOfflineClient.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file SiStripCommissioningOfflineClient.cc.

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

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

References LogTrace, and sistrip::mlDqmClient_.

63  {
65  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
66  << " Destructing object...";
67 }
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 363 of file SiStripCommissioningOfflineClient.cc.

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

364  {
365  if ( !(event.id().event()%10) ) {
367  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
368  << " Empty event loop! User can kill job...";
369  }
370 }
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 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 71 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, edm::ParameterSet::getUntrackedParameter(), CommissioningHistograms::histoAnalysis(), histos_, compare_using_db::ifile, inputFiles_, LogTrace, sistrip::mlDqmClient_, outputFileName_, parameters_, SummaryPlotXmlParser::parseXML(), plots_, CommissioningHistograms::printAnalyses(), CommissioningHistograms::printSummary(), CommissioningHistograms::remove(), CommissioningHistograms::runNumber(), runNumber_, SiStripEnumsAndStrings::runType(), CommissioningHistograms::runType(), runType_, CommissioningHistograms::save(), cuy::save, contentValuesCheck::ss, SummaryPlotXmlParser::summaryPlots(), groupFilesInBlocks::temp, funct::true, sistrip::UNKNOWN_RUN_TYPE, uploadToConfigDb(), and xmlFile_.

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

378  {
379 
380  // Check pointer
381  if ( histos_ ) {
383  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
384  << " CommissioningHistogram object already exists!"
385  << " Aborting...";
386  return;
387  }
388 
389  // Check pointer to BEI
390  if ( !bei_ ) {
392  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
393  << " NULL pointer to DQMStore!";
394  return;
395  }
396 
397  // Create "commissioning histograms" object
399  else if ( runType_ == sistrip::FED_CABLING ) { histos_ = new FedCablingHistograms( pset, bei_ ); }
400  else if ( runType_ == sistrip::APV_TIMING ) { histos_ = new ApvTimingHistograms( pset, bei_ ); }
401  else if ( runType_ == sistrip::OPTO_SCAN ) { histos_ = new OptoScanHistograms( pset, bei_ ); }
402  else if ( runType_ == sistrip::VPSP_SCAN ) { histos_ = new VpspScanHistograms( pset, bei_ ); }
403  else if ( runType_ == sistrip::PEDESTALS ) { histos_ = new PedestalsHistograms( pset, bei_ ); }
404  else if ( runType_ == sistrip::PEDS_ONLY ) { histos_ = new PedsOnlyHistograms( pset, bei_ ); }
405  else if ( runType_ == sistrip::NOISE ) { histos_ = new NoiseHistograms( pset, bei_ ); }
406  else if ( runType_ == sistrip::APV_LATENCY ||
408  else if ( runType_ == sistrip::CALIBRATION ||
412  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
413  histos_ = 0;
415  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
416  << " Undefined run type!";
417  return;
418  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
419  histos_ = 0;
421  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
422  << " Unknown run type!";
423  return;
424  }
425  histos_->configure(pset,setup);
426 }
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 374 of file SiStripCommissioningOfflineClient.cc.

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

Definition at line 430 of file SiStripCommissioningOfflineClient.cc.

References dqmPostProcessing_online::DIR, convertXMLtoSQLite_cfg::fileName, compare_using_db::ifile, LogTrace, sistrip::mlDqmClient_, NULL, cmsHarvester::path, cmsHarvester::run_number, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripCommissioningOfflineClient().

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 43 of file SiStripCommissioningOfflineClient.h.

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 91 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::vector<SummaryPlot> SiStripCommissioningOfflineClient::plots_
protected

SummaryPlot objects.

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