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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Types

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

Protected Member Functions

virtual void createHistos (const edm::ParameterSet &, const edm::EventSetup &)
 
virtual void setInputFiles (std::vector< std::string > &, const std::string, const std::string, uint32_t, bool)
 
virtual void uploadToConfigDb ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Protected Attributes

bool analyzeHistos_
 
DQMStorebei_
 
bool clientHistos_
 
bool collateHistos_
 
bool createSummaryPlots_
 
CommissioningHistogramshistos_
 
std::vector< std::string > inputFiles_
 
HistosMap map_
 
std::string outputFileName_
 
edm::ParameterSet parameters_
 
std::string partitionName_
 
std::vector< SummaryPlotplots_
 
uint32_t runNumber_
 
sistrip::RunType runType_
 
bool uploadToDb_
 
std::string xmlFile_
 

Additional Inherited Members

- 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:161
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 378 of file SiStripCommissioningOfflineClient.cc.

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

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

Definition at line 75 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(), runEdmFileComparison::found, edm::ParameterSet::getUntrackedParameter(), trackerHits::histo, 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_, CalibrationHistograms::save(), 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){
343  else
345  }
346  else{
348  histo->save( outputFileName_, runNumber_ );
349  }
350  }
351  else {
353  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
354  << " Client file not saved!";
355  }
356  }
357 
358  // Virtual method to trigger the database upload
360 
361  // Print analyses
362  if ( histos_ ) {
364  histos_->printSummary();
365  }
366 
367  // Remove all ME/CME objects
368  if ( histos_ ) { histos_->remove(); }
369 
371  << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
372  << " Finished analyzing root file(s)...";
373 
374 }
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
T getUntrackedParameter(std::string const &, T const &) const
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
jfile
Definition: looper.py:282
static const char dqmClientFileName_[]
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:1165
virtual void histoAnalysis(bool debug)
void SiStripCommissioningOfflineClient::createHistos ( const edm::ParameterSet pset,
const edm::EventSetup setup 
)
protectedvirtual

Reimplemented in SiStripCommissioningOfflineDbClient.

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

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

389 {}
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 447 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().

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

Reimplemented in SiStripCommissioningOfflineDbClient.

Definition at line 43 of file SiStripCommissioningOfflineClient.h.

References setInputFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

43 {;}

Member Data Documentation

bool SiStripCommissioningOfflineClient::analyzeHistos_
protected

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