CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
DQMFileSaver Class Reference

#include <DQMFileSaver.h>

Inheritance diagram for DQMFileSaver:
edm::global::EDAnalyzer< edm::RunCache< saverDetails::NoCache >, edm::LuminosityBlockCache< saverDetails::NoCache > > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Types

enum  Convention { Online, Offline, FilterUnit }
 
enum  FileFormat { ROOT, PB }
 
- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 DQMFileSaver (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< saverDetails::NoCache >, edm::LuminosityBlockCache< saverDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 ()
 

Static Public Member Functions

static boost::property_tree::ptree fillJson (int run, int lumi, const std::string &dataFilePathName, const std::string transferDestinationStr, evf::FastMonitoringService *fms)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

virtual void analyze (edm::StreamID, const edm::Event &e, const edm::EventSetup &) const
 
virtual void beginJob (void)
 
virtual void endJob (void)
 
virtual std::shared_ptr
< saverDetails::NoCache
globalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const
 
virtual std::shared_ptr
< saverDetails::NoCache
globalBeginRun (const edm::Run &, const edm::EventSetup &) const
 
virtual void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const
 
virtual void globalEndRun (const edm::Run &, const edm::EventSetup &) const
 
virtual void postForkReacquireResources (unsigned int childIndex, unsigned int numberOfChildren)
 
- 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)
 

Private Member Functions

void saveForFilterUnit (const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const
 
void saveForOffline (const std::string &workflow, int run, int lumi) const
 
void saveForOfflinePB (const std::string &workflow, int run) const
 
void saveForOnline (int run, const std::string &suffix, const std::string &rewrite) const
 
void saveForOnlinePB (int run, const std::string &suffix) const
 
void saveJobReport (const std::string &filename) const
 

Private Attributes

std::string child_
 
Convention convention_
 
DQMStoredbe_
 
std::string dirName_
 
bool enableMultiThread_
 
bool fakeFilterUnitMode_
 
std::string fileBaseName_
 
FileFormat fileFormat_
 
std::atomic< int > fileUpdate_
 
std::string filterName_
 
evf::FastMonitoringServicefms_
 
int forceRunNumber_
 
std::atomic< int > irun_
 
std::atomic< int > nlumi_
 
std::atomic< int > nrun_
 
std::string producer_
 
bool runIsComplete_
 
bool saveAtJobEnd_
 
int saveByLumiSection_
 
int saveByRun_
 
int saveReference_
 
int saveReferenceQMin_
 
std::string stream_label_
 
std::string transferDestination_
 
int version_
 
std::string workflow_
 

Static Private Attributes

static const std::string streamPrefix_
 
static const std::string streamSuffix_
 

Detailed Description

Definition at line 15 of file DQMFileSaver.h.

Member Enumeration Documentation

Enumerator
Online 
Offline 
FilterUnit 

Definition at line 39 of file DQMFileSaver.h.

Enumerator
ROOT 
PB 

Definition at line 46 of file DQMFileSaver.h.

47  {
48  ROOT,
49  PB
50  };

Constructor & Destructor Documentation

DQMFileSaver::DQMFileSaver ( const edm::ParameterSet ps)

Definition at line 432 of file DQMFileSaver.cc.

References convention_, prof2calltree::count, dirName_, Exception, fakeFilterUnitMode_, fileBaseName_, fileFormat_, filterName_, FilterUnit, fms_, forceRunNumber_, getAnInt(), edm::ParameterSet::getUntrackedParameter(), Offline, Online, PB, producer_, ROOT, runIsComplete_, alignCSCRings::s, saveAtJobEnd_, saveByLumiSection_, saveByRun_, saveReference_, saveReferenceQMin_, DQMStore::SaveWithoutReference, DQMStore::SaveWithReference, DQMStore::SaveWithReferenceForQTest, stream_label_, streamPrefix_, streamSuffix_, AlCaHLTBitMon_QueryRunRegistry::string, relval_steps::version, version_, and workflow_.

433  : convention_ (Offline),
434  fileFormat_(ROOT),
435  workflow_ (""),
436  producer_ ("DQM"),
437  stream_label_ (""),
438  dirName_ ("."),
439  child_ (""),
440  filterName_(""),
441  version_ (1),
442  runIsComplete_ (false),
443  enableMultiThread_ (false),
444  saveByLumiSection_ (-1),
445  saveByRun_ (-1),
446  saveAtJobEnd_ (false),
449  forceRunNumber_ (-1),
450  fileBaseName_ (""),
451  fileUpdate_ (0),
453  nrun_ (0),
454  nlumi_ (0),
455  irun_ (0),
456  fms_(nullptr)
457 {
458  // Determine the file saving convention, and adjust defaults accordingly.
459  std::string convention = ps.getUntrackedParameter<std::string>("convention", "Offline");
460  fakeFilterUnitMode_ = ps.getUntrackedParameter<bool>("fakeFilterUnitMode", false);
461 
462  if (convention == "Offline")
464  else if (convention == "Online")
466  else if (convention == "FilterUnit")
468  else
469  throw cms::Exception("DQMFileSaver")
470  << "Invalid 'convention' parameter '" << convention << "'."
471  << " Expected one of 'Online' or 'Offline' or 'FilterUnit'.";
472 
473  // If this is neither online nor FU convention, check workflow.
474  // In this way, FU is treated as online, so we cannot specify a workflow. TBC
476  {
478  if (workflow_.empty()
479  || workflow_[0] != '/'
480  || *workflow_.rbegin() == '/'
481  || std::count(workflow_.begin(), workflow_.end(), '/') != 3
482  || workflow_.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
483  "abcdefghijklmnopqrstuvwxyz"
484  "0123456789"
485  "-_/") != std::string::npos)
486  throw cms::Exception("DQMFileSaver")
487  << "Invalid 'workflow' parameter '" << workflow_
488  << "'. Expected '/A/B/C'.";
489  }
490  else if (! ps.getUntrackedParameter<std::string>("workflow", "").empty())
491  throw cms::Exception("DQMFileSaver")
492  << "The 'workflow' parameter must be empty in 'Online' and 'FilterUnit' conventions.";
493  else // for online set parameters
494  {
495  workflow_="/Global/Online/P5";
496  }
497 
498  // Determine the file format, and adjust defaults accordingly.
499  std::string fileFormat = ps.getUntrackedParameter<std::string>("fileFormat", "ROOT");
500  if (fileFormat == "ROOT")
501  fileFormat_ = ROOT;
502  else if (fileFormat == "PB")
503  fileFormat_ = PB;
504  else
505  throw cms::Exception("DQMFileSaver")
506  << "Invalid 'fileFormat' parameter '" << fileFormat << "'."
507  << " Expected one of 'ROOT' or 'PB'.";
508 
509  // Allow file producer to be set to specific values in certain conditions.
511  // Setting the same constraints on file producer both for online and FilterUnit conventions
512  // TODO(diguida): limit the producer for FilterUnit to be 'DQM' or 'HLTDQM'?
513  // TODO(diguida): how to handle histograms produced in the playback for the FU case?
515  && producer_ != "DQM"
516  && producer_ != "HLTDQM"
517  && producer_ != "Playback")
518  {
519  throw cms::Exception("DQMFileSaver")
520  << "Invalid 'producer' parameter '" << producer_
521  << "'. Expected 'DQM', 'HLTDQM' or 'Playback'.";
522  }
523  else if (convention_ != Online
524  && convention != FilterUnit
525  && producer_ != "DQM")
526  {
527  throw cms::Exception("DQMFileSaver")
528  << "Invalid 'producer' parameter '" << producer_
529  << "'. Expected 'DQM'.";
530  }
531 
533 
534  // version number to be used in filename
535  version_ = ps.getUntrackedParameter<int>("version", version_);
536  // flag to signal that file contains data from complete run
537  runIsComplete_ = ps.getUntrackedParameter<bool>("runIsComplete", runIsComplete_);
538 
539  // Check how we should save the references.
540  std::string refsave = ps.getUntrackedParameter<std::string>("referenceHandling", "default");
541  if (refsave == "default")
542  ;
543  else if (refsave == "skip")
544  {
546  // std::cout << "skip saving all references" << std::endl;
547  }
548  else if (refsave == "all")
549  {
551  // std::cout << "saving all references" << std::endl;
552  }
553  else if (refsave == "qtests")
554  {
556  // std::cout << "saving qtest references" << std::endl;
557  }
558  else
559  throw cms::Exception("DQMFileSaver")
560  << "Invalid 'referenceHandling' parameter '" << refsave
561  << "'. Expected 'default', 'skip', 'all' or 'qtests'.";
562 
563  // Check minimum required quality test result for which reference is saved.
564  saveReferenceQMin_ = ps.getUntrackedParameter<int>("referenceRequireStatus", saveReferenceQMin_);
565 
566  // Get and check the output directory.
567  struct stat s;
569  if (dirName_.empty() || stat(dirName_.c_str(), &s) == -1)
570  throw cms::Exception("DQMFileSaver")
571  << "Invalid 'dirName' parameter '" << dirName_ << "'.";
572 
574  // Find out when and how to save files. The following contraints apply:
575  // - For online, filter unit, and offline, allow files to be saved per lumi
576  // - For online, allow files to be saved per run, at event and time intervals.
577  // - For offline allow files to be saved per run, at job end, and run number to be overridden (for mc data).
579  {
580  getAnInt(ps, saveByLumiSection_, "saveByLumiSection");
581  }
582 
583  if (convention_ == Online)
584  {
585  getAnInt(ps, saveByRun_, "saveByRun");
586  }
587 
588  if (convention_ == Offline)
589  {
590  getAnInt(ps, saveByRun_, "saveByRun");
591  getAnInt(ps, forceRunNumber_, "forceRunNumber");
592  saveAtJobEnd_ = ps.getUntrackedParameter<bool>("saveAtJobEnd", saveAtJobEnd_);
593  }
594 
595  // Set up base file name:
596  // - for online and offline, follow the convention <dirName>/<producer>_V<4digits>_
597  // - for FilterUnit, we need to follow the DAQ2 convention, so we need the run and lumisection:
598  // the path is provided by the DAQ director service.
599  if (convention_ != FilterUnit)
600  {
601  char version[8];
602  sprintf(version, "_V%04d_", int(version_));
603  version[7]='\0';
604  fileBaseName_ = dirName_ + "/" + producer_ + version;
605  }
606  else if (fakeFilterUnitMode_)
607  {
608  edm::LogInfo("DQMFileSaver")
609  << "Fake FU mode, files are saved under <dirname>/runXXXXXX/runXXXXXX_lsXXXX_<stream_Label>.pb.\n";
610  }
611  else
612  {
613  // For FU, dirName_ will not be considered at all
614  edm::LogInfo("DQMFileSaver")
615  << "The base dir provided in the configuration '" << dirName_ << "'\n"
616  << " will not be considered: for FU, the DAQ2 services will handle directories\n";
617  //check that DAQ2 services are available: throw if not
620 
621  if (!(fms_ && daqDirector))
622  throw cms::Exception("DQMFileSaver")
623  << "Internal error, cannot initialize DAQ services.";
624  }
625 
626  // Log some information what we will do.
627  edm::LogInfo("DQMFileSaver")
628  << "DQM file saving settings:\n"
629  << " using base file name '" << fileBaseName_ << "'\n"
630  << " forcing run number " << forceRunNumber_ << "\n"
631  << " saving every " << saveByLumiSection_ << " lumi section(s)\n"
632  << " saving every " << saveByRun_ << " run(s)\n"
633  << " saving at job end: " << (saveAtJobEnd_ ? "yes" : "no") << "\n";
634 }
T getUntrackedParameter(std::string const &, T const &) const
int forceRunNumber_
Definition: DQMFileSaver.h:80
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
Convention convention_
Definition: DQMFileSaver.h:62
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:93
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
std::string dirName_
Definition: DQMFileSaver.h:67
std::string fileBaseName_
Definition: DQMFileSaver.h:82
int saveByLumiSection_
Definition: DQMFileSaver.h:75
bool enableMultiThread_
Definition: DQMFileSaver.h:72
static void getAnInt(const edm::ParameterSet &ps, int &value, const std::string &name)
Definition: DQMFileSaver.cc:38
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
bool runIsComplete_
Definition: DQMFileSaver.h:71
std::string stream_label_
Definition: DQMFileSaver.h:66
static const std::string streamPrefix_
Definition: DQMFileSaver.h:95
std::string workflow_
Definition: DQMFileSaver.h:64
std::string producer_
Definition: DQMFileSaver.h:65
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
std::string filterName_
Definition: DQMFileSaver.h:69
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:83
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
bool saveAtJobEnd_
Definition: DQMFileSaver.h:77
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
static const int STATUS_OK
static const std::string streamSuffix_
Definition: DQMFileSaver.h:96

Member Function Documentation

void DQMFileSaver::analyze ( edm::StreamID  ,
const edm::Event e,
const edm::EventSetup  
) const
protectedvirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 678 of file DQMFileSaver.cc.

679 {
680  //save by event and save by time are not supported
681  //anymore in the threaded framework. please use
682  //savebyLumiSection instead.
683 }
void DQMFileSaver::beginJob ( void  )
protectedvirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 638 of file DQMFileSaver.cc.

References convention_, dbe_, enableMultiThread_, fakeFilterUnitMode_, FilterUnit, irun_, nlumi_, nrun_, stream_label_, and transferDestination_.

639 {
640  nrun_ = nlumi_ = irun_ = 0;
641 
642  // Determine if we are running multithreading asking to the DQMStore. Not to be moved in the ctor
643  enableMultiThread_ = dbe_->enableMultiThread_;
644 
646  {
648  }
649 }
Convention convention_
Definition: DQMFileSaver.h:62
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
bool enableMultiThread_
Definition: DQMFileSaver.h:72
std::string transferDestination_
Definition: DQMFileSaver.h:97
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
std::string stream_label_
Definition: DQMFileSaver.h:66
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
void DQMFileSaver::endJob ( void  )
protectedvirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 814 of file DQMFileSaver.cc.

References child_, convention_, Exception, fileBaseName_, fileFormat_, lut2db_cfg::filename, forceRunNumber_, irun_, Offline, onlineOfflineFileName(), saveAtJobEnd_, saveForOffline(), saveJobReport(), AlCaHLTBitMon_QueryRunRegistry::string, createPayload::suffix, and workflow_.

815 {
816  if (saveAtJobEnd_)
817  {
818  if (convention_ == Offline && forceRunNumber_ > 0)
820  else if (convention_ == Offline)
822  else
823  throw cms::Exception("DQMFileSaver")
824  << "Internal error. Can only save files at the end of the"
825  << " job in Offline mode.";
826  }
827 
828  // save JobReport once per job
829  char suffix[64];
830  sprintf(suffix, "R%09d", irun_.load());
832  saveJobReport(filename);
833 }
int forceRunNumber_
Definition: DQMFileSaver.h:80
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
Convention convention_
Definition: DQMFileSaver.h:62
std::string fileBaseName_
Definition: DQMFileSaver.h:82
void saveJobReport(const std::string &filename) const
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string workflow_
Definition: DQMFileSaver.h:64
std::string child_
Definition: DQMFileSaver.h:68
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
bool saveAtJobEnd_
Definition: DQMFileSaver.h:77
tuple filename
Definition: lut2db_cfg.py:20
boost::property_tree::ptree DQMFileSaver::fillJson ( int  run,
int  lumi,
const std::string &  dataFilePathName,
const std::string  transferDestinationStr,
evf::FastMonitoringService fms 
)
static

Definition at line 260 of file DQMFileSaver.cc.

References data, Exception, evf::FastMonitoringService::getEventsProcessedForLumi(), query::host, merge::inputFiles, cmsHarvester::path, sysUtil::pid, EnergyCorrector::pt, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmservices::JsonWritingTimeoutPoolOutputModule::doExtrasAfterCloseFile(), and saveForFilterUnit().

261 {
262  namespace bpt = boost::property_tree;
263  namespace bfs = boost::filesystem;
264 
265  bpt::ptree pt;
266 
267  int hostnameReturn;
268  char host[32];
269  hostnameReturn = gethostname(host ,sizeof(host));
270  if (hostnameReturn == -1)
271  throw cms::Exception("fillJson")
272  << "Internal error, cannot get host name";
273 
274  int pid = getpid();
275  std::ostringstream oss_pid;
276  oss_pid << pid;
277 
278  int nProcessed = fms ? (fms->getEventsProcessedForLumi(lumi)) : -1;
279 
280  // Stat the data file: if not there, throw
281  std::string dataFileName;
282  struct stat dataFileStat;
283  dataFileStat.st_size=0;
284  if (nProcessed) {
285  if (stat(dataFilePathName.c_str(), &dataFileStat) != 0)
286  throw cms::Exception("fillJson")
287  << "Internal error, cannot get data file: "
288  << dataFilePathName;
289  // Extract only the data file name from the full path
290  dataFileName = bfs::path(dataFilePathName).filename().string();
291  }
292  // The availability test of the FastMonitoringService was done in the ctor.
293  bpt::ptree data;
294  bpt::ptree processedEvents, acceptedEvents, errorEvents, bitmask, fileList, fileSize, inputFiles, fileAdler32, transferDestination, hltErrorEvents;
295 
296  processedEvents.put("", nProcessed); // Processed events
297  acceptedEvents.put("", nProcessed); // Accepted events, same as processed for our purposes
298 
299  errorEvents.put("", 0); // Error events
300  bitmask.put("", 0); // Bitmask of abs of CMSSW return code
301  fileList.put("", dataFileName); // Data file the information refers to
302  fileSize.put("", dataFileStat.st_size); // Size in bytes of the data file
303  inputFiles.put("", ""); // We do not care about input files!
304  fileAdler32.put("", -1); // placeholder to match output json definition
305  transferDestination.put("", transferDestinationStr); // SM Transfer destination field
306  hltErrorEvents.put("", 0); // Error events
307 
308  data.push_back(std::make_pair("", processedEvents));
309  data.push_back(std::make_pair("", acceptedEvents));
310  data.push_back(std::make_pair("", errorEvents));
311  data.push_back(std::make_pair("", bitmask));
312  data.push_back(std::make_pair("", fileList));
313  data.push_back(std::make_pair("", fileSize));
314  data.push_back(std::make_pair("", inputFiles));
315  data.push_back(std::make_pair("", fileAdler32));
316  data.push_back(std::make_pair("", transferDestination));
317  data.push_back(std::make_pair("", hltErrorEvents));
318 
319  pt.add_child("data", data);
320 
321  if (fms == nullptr) {
322  pt.put("definition", "/fakeDefinition.jsn");
323  } else {
324  // The availability test of the EvFDaqDirector Service was done in the ctor.
325  bfs::path outJsonDefName(edm::Service<evf::EvFDaqDirector>()->baseRunDir()); //we assume this file is written bu the EvF Output module
326  outJsonDefName /= (std::string("output_") + oss_pid.str() + std::string(".jsd"));
327  pt.put("definition", outJsonDefName.string());
328  }
329 
330  char sourceInfo[64]; //host and pid information
331  sprintf(sourceInfo, "%s_%d", host, pid);
332  pt.put("source", sourceInfo);
333 
334  return pt;
335 }
unsigned int getEventsProcessedForLumi(unsigned int lumi, bool *abortFlag=0)
tuple lumi
Definition: fjr2json.py:35
tuple path
else: Piece not in the list, fine.
string host
Definition: query.py:114
tuple pid
Definition: sysUtil.py:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple inputFiles
Definition: merge.py:5
std::shared_ptr< saverDetails::NoCache > DQMFileSaver::globalBeginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 672 of file DQMFileSaver.cc.

References nlumi_.

673 {
674  ++nlumi_;
675  return nullptr;
676 }
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
std::shared_ptr< saverDetails::NoCache > DQMFileSaver::globalBeginRun ( const edm::Run r,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 652 of file DQMFileSaver.cc.

References convention_, fakeFilterUnitMode_, mergeVDriftHistosByStation::file, FilterUnit, evf::EvFDaqDirector::getInitFilePath(), nrun_, stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

653 {
654  ++nrun_;
655 
656  // For Filter Unit, create an empty ini file:
657  // it is needed by the HLT deamon in order to start merging
658  // The run number is established in the service
659  // TODO(diguida): check that they are the same?
661  {
663  const std::string initFileName = daqDirector->getInitFilePath(stream_label_);
664  std::ofstream file(initFileName);
665  file.close();
666  }
667 
668  return nullptr;
669 }
Convention convention_
Definition: DQMFileSaver.h:62
std::string getInitFilePath(std::string const &stream) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
std::string stream_label_
Definition: DQMFileSaver.h:66
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
void DQMFileSaver::globalEndLuminosityBlock ( const edm::LuminosityBlock iLS,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 686 of file DQMFileSaver.cc.

References convention_, dbe_, enableMultiThread_, Exception, fileFormat_, FilterUnit, fms_, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), nlumi_, Offline, Online, PB, ROOT, edm::LuminosityBlockID::run(), saveByLumiSection_, saveForFilterUnit(), saveForOffline(), saveForOnline(), saveForOnlinePB(), evf::FastMonitoringService::shouldWriteFiles(), createPayload::suffix, and workflow_.

687 {
688  int ilumi = iLS.id().luminosityBlock();
689  int irun = iLS.id().run();
690  if (ilumi > 0 && saveByLumiSection_ > 0 )
691  {
693  throw cms::Exception("DQMFileSaver")
694  << "Internal error, can save files at end of lumi block"
695  << " only in Online, FilterUnit or Offline mode.";
696 
697  if (convention_ == Online && (nlumi_ % saveByLumiSection_) == 0) // insist on lumi section ordering
698  {
699  char suffix[64];
700  char rewrite[128];
701  sprintf(suffix, "_R%09d_L%06d", irun, ilumi);
702  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", irun, ilumi-nlumi_, ilumi);
703  if (fileFormat_ == ROOT)
704  saveForOnline(irun, suffix, rewrite);
705  else if (fileFormat_ == PB)
706  saveForOnlinePB(irun, suffix);
707  else
708  throw cms::Exception("DQMFileSaver")
709  << "Internal error, can save files"
710  << " only in ROOT or ProtocolBuffer format.";
711  }
712 
713  // Store at every lumi section end only if some events have been processed.
714  // Caveat: if faking FilterUnit, i.e. not accessing DAQ2 services,
715  // we cannot ask FastMonitoringService the processed events, so we are forced
716  // to save the file at every lumisection, even with no statistics.
717  // Here, we protect the call to get the processed events in a lumi section
718  // by testing the pointer to FastMonitoringService: if not null, i.e. in real FU mode,
719  // we check that the events are not 0; otherwise, we skip the test, so we store at every lumi transition.
720  // TODO(diguida): allow fake FU mode to skip file creation at empty lumi sections.
721  if (convention_ == FilterUnit && (fms_ ? fms_->shouldWriteFiles(ilumi) : !fms_))
722  {
723  char rewrite[128];
724  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", irun, ilumi, ilumi);
725  saveForFilterUnit(rewrite, irun, ilumi, fileFormat_);
726  }
727  if (convention_ == Offline)
728  {
729  if (fileFormat_ == ROOT)
730  saveForOffline(workflow_, irun, ilumi);
731  else
732  // TODO(diguida): do we need to support lumisection saving in Offline for PB?
733  // In this case, for ROOT, we only save EventInfo folders: we can filter them...
734  throw cms::Exception("DQMFileSaver")
735  << "Internal error, can save files"
736  << " only in ROOT format.";
737  }
738 
739  // after saving per LS, delete the old LS global histograms.
740  dbe_->deleteUnusedLumiHistograms(enableMultiThread_ ? irun : 0, ilumi);
741  }
742 }
LuminosityBlockID id() const
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
Convention convention_
Definition: DQMFileSaver.h:62
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:93
bool shouldWriteFiles(unsigned int lumi, unsigned int *proc=0)
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
int saveByLumiSection_
Definition: DQMFileSaver.h:75
bool enableMultiThread_
Definition: DQMFileSaver.h:72
RunNumber_t run() const
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
std::string workflow_
Definition: DQMFileSaver.h:64
void saveForOnlinePB(int run, const std::string &suffix) const
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
LuminosityBlockNumber_t luminosityBlock() const
void saveForFilterUnit(const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const
void DQMFileSaver::globalEndRun ( const edm::Run iRun,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 745 of file DQMFileSaver.cc.

References convention_, data, dirName_, Exception, fakeFilterUnitMode_, mergeVDriftHistosByStation::file, fileFormat_, cmsPerfStripChart::format, edm::RunBase::id(), irun_, nlumi_, nrun_, Offline, Online, PB, EnergyCorrector::pt, ROOT, edm::RunID::run(), saveByRun_, saveForOffline(), saveForOfflinePB(), saveForOnline(), saveForOnlinePB(), AlCaHLTBitMon_QueryRunRegistry::string, createPayload::suffix, and workflow_.

746 {
747  int irun = iRun.id().run();
748  irun_ = irun;
749  if (irun > 0 && saveByRun_ > 0 && (nrun_ % saveByRun_) == 0)
750  {
751  if (convention_ == Online)
752  {
753  char suffix[64];
754  sprintf(suffix, "_R%09d", irun);
755  char rewrite[64];
756  sprintf(rewrite, "\\1Run %d/\\2/Run summary", irun);
757  if (fileFormat_ == ROOT)
758  saveForOnline(irun, suffix, rewrite);
759  else if (fileFormat_ == PB)
760  saveForOnlinePB(irun, suffix);
761  else
762  throw cms::Exception("DQMFileSaver")
763  << "Internal error, can save files"
764  << " only in ROOT or ProtocolBuffer format.";
765  }
766  else if (convention_ == Offline && fileFormat_ == ROOT)
767  saveForOffline(workflow_, irun, 0);
768  else if (convention_ == Offline && fileFormat_ == PB)
770  else
771  throw cms::Exception("DQMFileSaver")
772  << "Internal error. Can only save files in endRun()"
773  << " in Online and Offline modes.";
774  }
775 
776  // create a fake EoR file for testing purposes.
777  if (fakeFilterUnitMode_) {
778  edm::LogInfo("DQMFileSaver")
779  << "Producing fake EoR file.\n";
780 
781  std::string runDir = str(boost::format("%s/run%06d") % dirName_ % irun);
782  std::string jsonFilePathName = str(boost::format("%s/run%06d_ls0000_EoR.jsn") % runDir % irun);
783  std::string openJsonFilePathName = jsonFilePathName + ".open";
784 
785  boost::filesystem::create_directories(runDir);
786 
787  using namespace boost::property_tree;
788  ptree pt;
789  ptree data;
790 
791  ptree child1, child2, child3;
792 
793  child1.put("", -1); // Processed
794  child2.put("", -1); // Accepted
795  child3.put("", nlumi_); // number of lumi
796 
797  data.push_back(std::make_pair("", child1));
798  data.push_back(std::make_pair("", child2));
799  data.push_back(std::make_pair("", child3));
800 
801  pt.add_child("data", data);
802  pt.put("definition", "/non-existant/");
803  pt.put("source", "--hostname--");
804 
805  std::ofstream file(jsonFilePathName);
806  write_json(file, pt, true);
807  file.close();
808 
809  rename(openJsonFilePathName.c_str(), jsonFilePathName.c_str());
810  }
811 }
RunID const & id() const
Definition: RunBase.h:41
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
RunNumber_t run() const
Definition: RunID.h:39
Convention convention_
Definition: DQMFileSaver.h:62
string format
Some error handling for the usage.
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
std::string dirName_
Definition: DQMFileSaver.h:67
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
std::string workflow_
Definition: DQMFileSaver.h:64
void saveForOnlinePB(int run, const std::string &suffix) const
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
void saveForOfflinePB(const std::string &workflow, int run) const
Definition: DQMFileSaver.cc:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
void DQMFileSaver::postForkReacquireResources ( unsigned int  childIndex,
unsigned int  numberOfChildren 
)
protectedvirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 836 of file DQMFileSaver.cc.

References child_, and AlCaHLTBitMon_QueryRunRegistry::string.

837 {
838  // this is copied from IOPool/Output/src/PoolOutputModule.cc, for consistency
839  unsigned int digits = 0;
840  while (numberOfChildren != 0) {
841  ++digits;
842  numberOfChildren /= 10;
843  }
844  // protect against zero numberOfChildren
845  if (digits == 0) {
846  digits = 3;
847  }
848 
849  char buffer[digits + 2];
850  snprintf(buffer, digits + 2, "_%0*d", digits, childIndex);
851  child_ = std::string(buffer);
852 }
std::string child_
Definition: DQMFileSaver.h:68
void DQMFileSaver::saveForFilterUnit ( const std::string &  rewrite,
int  run,
int  lumi,
const FileFormat  fileFormat 
) const
private

Definition at line 338 of file DQMFileSaver.cc.

References dataFileExtension(), dbe_, dirName_, enableMultiThread_, Exception, fakeFilterUnitMode_, fileUpdate_, fillJson(), filterName_, fms_, cmsPerfStripChart::format, evf::FastMonitoringService::getEventsProcessedForLumi(), PB, EnergyCorrector::pt, ROOT, saveReference_, saveReferenceQMin_, stream_label_, AlCaHLTBitMon_QueryRunRegistry::string, and transferDestination_.

Referenced by globalEndLuminosityBlock().

339 {
340  // get from DAQ2 services where to store the files according to their format
341  namespace bpt = boost::property_tree;
342 
343  std::string openJsonFilePathName;
344  std::string jsonFilePathName;
345  std::string openHistoFilePathName;
346  std::string histoFilePathName;
347 
348  // create the files names
349  if (fakeFilterUnitMode_) {
350  std::string runDir = str(boost::format("%s/run%06d") % dirName_ % run);
351  std::string baseName = str(boost::format("%s/run%06d_ls%04d_%s") % runDir % run % lumi % stream_label_ );
352 
353  boost::filesystem::create_directories(runDir);
354 
355  jsonFilePathName = baseName + ".jsn";
356  openJsonFilePathName = jsonFilePathName + ".open";
357 
358  histoFilePathName = baseName + dataFileExtension(fileFormat);
359  openHistoFilePathName = histoFilePathName + ".open";
360  } else {
361  openJsonFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenOutputJsonFilePath(lumi, stream_label_);
362  jsonFilePathName = edm::Service<evf::EvFDaqDirector>()->getOutputJsonFilePath(lumi, stream_label_);
363 
364  if (fileFormat == ROOT) {
365  openHistoFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenRootHistogramFilePath(lumi, stream_label_);
366  histoFilePathName = edm::Service<evf::EvFDaqDirector>()->getRootHistogramFilePath(lumi, stream_label_);
367  } else if (fileFormat == PB) {
368  openHistoFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenProtocolBufferHistogramFilePath(lumi, stream_label_);
369  histoFilePathName = edm::Service<evf::EvFDaqDirector>()->getProtocolBufferHistogramFilePath(lumi, stream_label_);
370  }
371  }
372 
373  if (fms_ ? fms_->getEventsProcessedForLumi(lumi) : true) {
374  if (fileFormat == ROOT)
375  {
376  // Save the file with the full directory tree,
377  // modifying it according to @a rewrite,
378  // but not looking for MEs inside the DQMStore, as in the online case,
379  // nor filling new MEs, as in the offline case.
380  dbe_->save(openHistoFilePathName,
381  "",
382  "^(Reference/)?([^/]+)",
383  rewrite,
384  enableMultiThread_ ? run : 0,
385  lumi,
388  fileUpdate_ ? "UPDATE" : "RECREATE",
389  true);
390  }
391  else if (fileFormat == PB)
392  {
393  // Save the file in the open directory.
394  dbe_->savePB(openHistoFilePathName,
395  filterName_,
396  enableMultiThread_ ? run : 0,
397  lumi,
398  true);
399  }
400  else
401  throw cms::Exception("DQMFileSaver")
402  << "Internal error, can save files"
403  << " only in ROOT or ProtocolBuffer format.";
404 
405  // Now move the the data and json files into the output directory.
406  rename(openHistoFilePathName.c_str(), histoFilePathName.c_str());
407  }
408 
409  // Write the json file in the open directory.
410  bpt::ptree pt = fillJson(run, lumi, histoFilePathName, transferDestination_, fms_);
411  write_json(openJsonFilePathName, pt);
412  rename(openJsonFilePathName.c_str(), jsonFilePathName.c_str());
413 }
unsigned int getEventsProcessedForLumi(unsigned int lumi, bool *abortFlag=0)
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
static std::string dataFileExtension(DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:48
tuple lumi
Definition: fjr2json.py:35
static boost::property_tree::ptree fillJson(int run, int lumi, const std::string &dataFilePathName, const std::string transferDestinationStr, evf::FastMonitoringService *fms)
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:93
DQMStore * dbe_
Definition: DQMFileSaver.h:85
string format
Some error handling for the usage.
std::string dirName_
Definition: DQMFileSaver.h:67
SaveReferenceTag
Definition: DQMStore.h:78
bool enableMultiThread_
Definition: DQMFileSaver.h:72
std::string transferDestination_
Definition: DQMFileSaver.h:97
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
std::string stream_label_
Definition: DQMFileSaver.h:66
int saveReference_
Definition: DQMFileSaver.h:78
std::string filterName_
Definition: DQMFileSaver.h:69
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:83
void DQMFileSaver::saveForOffline ( const std::string &  workflow,
int  run,
int  lumi 
) const
private

Definition at line 86 of file DQMFileSaver.cc.

References child_, dbe_, alignCSCRings::e, enableMultiThread_, fileBaseName_, lut2db_cfg::filename, fileUpdate_, MonitorElement::Fill(), edm::getReleaseVersion(), i, visualization-live-secondInstance_cfg::msg, onlineOfflineFileName(), ROOT, runIsComplete_, saveReference_, saveReferenceQMin_, DQMStore::SaveWithoutReference, dqm::qstatus::STATUS_OK, AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by endJob(), globalEndLuminosityBlock(), and globalEndRun().

87 {
88  char suffix[64];
89  sprintf(suffix, "R%09d", run);
90 
91  char rewrite[128];
92  if (lumi == 0) // save for run
93  sprintf(rewrite, "\\1Run %d/\\2/Run summary", run);
94  else
95  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", run, lumi, lumi);
96 
98 
99  if (lumi == 0) // save for run
100  {
101  // set run end flag
102  dbe_->cd();
103  dbe_->setCurrentFolder("Info/ProvInfo");
104 
105  // do this, because ProvInfo is not yet run in offline DQM
106  MonitorElement* me = dbe_->get("Info/ProvInfo/CMSSW");
107  if (!me) me = dbe_->bookString("CMSSW", edm::getReleaseVersion().c_str() );
108 
109  me = dbe_->get("Info/ProvInfo/runIsComplete");
110  if (!me) me = dbe_->bookFloat("runIsComplete");
111 
112  if (me)
113  {
114  if (runIsComplete_)
115  me->Fill(1.);
116  else
117  me->Fill(0.);
118  }
119 
120  dbe_->save(filename,
121  "",
122  "^(Reference/)?([^/]+)",
123  rewrite,
124  enableMultiThread_ ? run : 0,
125  lumi,
128  fileUpdate_ ? "UPDATE" : "RECREATE");
129  }
130  else // save EventInfo folders for luminosity sections
131  {
132  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
133 
134  edm::LogAbsolute msg("fileAction");
135  msg << "DQMFileSaver: storing EventInfo folders for Run: "
136  << run << ", Lumi Section: " << lumi << ", Subsystems: " ;
137 
138  for (size_t i = 0, e = systems.size(); i != e; ++i) {
139  if (systems[i] != "Reference") {
140  dbe_->cd();
141  msg << systems[i] << " " ;
142 
143  dbe_->save(filename,
144  systems[i]+"/EventInfo", "^(Reference/)?([^/]+)",
145  rewrite,
146  enableMultiThread_ ? run : 0,
147  lumi,
150  fileUpdate_ ? "UPDATE" : "RECREATE");
151 
152  // from now on update newly created file
153  if (fileUpdate_.load() == 0) fileUpdate_ = 1;
154  }
155  }
156  }
157 }
int i
Definition: DBlmapReader.cc:9
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
tuple lumi
Definition: fjr2json.py:35
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::string fileBaseName_
Definition: DQMFileSaver.h:82
SaveReferenceTag
Definition: DQMStore.h:78
void Fill(long long x)
bool enableMultiThread_
Definition: DQMFileSaver.h:72
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
bool runIsComplete_
Definition: DQMFileSaver.h:71
std::string getReleaseVersion()
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:83
tuple filename
Definition: lut2db_cfg.py:20
static const int STATUS_OK
void DQMFileSaver::saveForOfflinePB ( const std::string &  workflow,
int  run 
) const
private

Definition at line 77 of file DQMFileSaver.cc.

References child_, dbe_, fileBaseName_, lut2db_cfg::filename, filterName_, onlineOfflineFileName(), PB, AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by globalEndRun().

78 {
79  char suffix[64];
80  sprintf(suffix, "R%09d", run);
82  dbe_->savePB(filename, filterName_);
83 }
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::string fileBaseName_
Definition: DQMFileSaver.h:82
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string child_
Definition: DQMFileSaver.h:68
std::string filterName_
Definition: DQMFileSaver.h:69
tuple filename
Definition: lut2db_cfg.py:20
void DQMFileSaver::saveForOnline ( int  run,
const std::string &  suffix,
const std::string &  rewrite 
) const
private

Definition at line 207 of file DQMFileSaver.cc.

References child_, dbe_, doSaveForOnline(), alignCSCRings::e, enableMultiThread_, fileBaseName_, i, ROOT, saveReference_, and saveReferenceQMin_.

Referenced by globalEndLuminosityBlock(), and globalEndRun().

208 {
209  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
210 
211  for (size_t i = 0, e = systems.size(); i != e; ++i)
212  {
213  if (systems[i] != "Reference")
214  {
215  dbe_->cd();
216  if (MonitorElement* me = dbe_->get(systems[i] + "/EventInfo/processName"))
217  {
219  fileBaseName_ + me->getStringValue() + suffix + child_ + ".root",
220  "", "^(Reference/)?([^/]+)", rewrite,
223  "", ROOT);
224  return;
225  }
226  }
227  }
228 
229  // look for EventInfo folder in an unorthodox location
230  for (size_t i = 0, e = systems.size(); i != e; ++i)
231  if (systems[i] != "Reference")
232  {
233  dbe_->cd();
234  std::vector<MonitorElement*> pNamesVector = dbe_->getMatchingContents("^" + systems[i] + "/.*/EventInfo/processName",lat::Regexp::Perl);
235  if (pNamesVector.size() > 0){
237  fileBaseName_ + systems[i] + suffix + child_ + ".root",
238  "", "^(Reference/)?([^/]+)", rewrite,
241  "", ROOT);
242  pNamesVector.clear();
243  return;
244  }
245  }
246 
247  // if no EventInfo Folder is found, then store subsystem wise
248  for (size_t i = 0, e = systems.size(); i != e; ++i)
249  if (systems[i] != "Reference")
251  fileBaseName_ + systems[i] + suffix + child_ + ".root",
252  systems[i], "^(Reference/)?([^/]+)", rewrite,
255  "", ROOT);
256 }
int i
Definition: DBlmapReader.cc:9
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::string fileBaseName_
Definition: DQMFileSaver.h:82
SaveReferenceTag
Definition: DQMStore.h:78
bool enableMultiThread_
Definition: DQMFileSaver.h:72
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
static void doSaveForOnline(DQMStore *store, int run, bool enableMultiThread, const std::string &filename, const std::string &directory, const std::string &rxpat, const std::string &rewrite, DQMStore::SaveReferenceTag saveref, int saveRefQMin, const std::string &filterName, DQMFileSaver::FileFormat fileFormat)
void DQMFileSaver::saveForOnlinePB ( int  run,
const std::string &  suffix 
) const
private

Definition at line 190 of file DQMFileSaver.cc.

References child_, dbe_, doSaveForOnline(), enableMultiThread_, fileBaseName_, lut2db_cfg::filename, filterName_, onlineOfflineFileName(), PB, saveReference_, saveReferenceQMin_, AlCaHLTBitMon_QueryRunRegistry::string, and workflow_.

Referenced by globalEndLuminosityBlock(), and globalEndRun().

191 {
192  // The file name contains the Online workflow name,
193  // as we do not want to look inside the DQMStore,
194  // and the @a suffix, defined in the run/lumi transitions.
195  // TODO(diguida): add the possibility to change the dir structure with rewrite.
198  filename,
199  "", "^(Reference/)?([^/]+)", "\\1\\2",
202  filterName_,
203  PB);
204 }
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::string fileBaseName_
Definition: DQMFileSaver.h:82
SaveReferenceTag
Definition: DQMStore.h:78
bool enableMultiThread_
Definition: DQMFileSaver.h:72
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string workflow_
Definition: DQMFileSaver.h:64
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
std::string filterName_
Definition: DQMFileSaver.h:69
static void doSaveForOnline(DQMStore *store, int run, bool enableMultiThread, const std::string &filename, const std::string &directory, const std::string &rxpat, const std::string &rewrite, DQMStore::SaveReferenceTag saveref, int saveRefQMin, const std::string &filterName, DQMFileSaver::FileFormat fileFormat)
tuple filename
Definition: lut2db_cfg.py:20
void DQMFileSaver::saveJobReport ( const std::string &  filename) const
private

Definition at line 416 of file DQMFileSaver.cc.

References info(), edm::Service< T >::isAvailable(), and edm::JobReport::reportAnalysisFile().

Referenced by endJob().

417 {
418 
419  // Report the file to job report service.
421  if (jr.isAvailable())
422  {
423  std::map<std::string, std::string> info;
424  info["Source"] = "DQMStore";
425  info["FileClass"] = "DQM";
426  jr->reportAnalysisFile(filename, info);
427  }
428 
429 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool isAvailable() const
Definition: Service.h:46
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
Definition: JobReport.cc:559
tuple filename
Definition: lut2db_cfg.py:20

Member Data Documentation

std::string DQMFileSaver::child_
private
Convention DQMFileSaver::convention_
private
DQMStore* DQMFileSaver::dbe_
private
std::string DQMFileSaver::dirName_
private

Definition at line 67 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), globalEndRun(), and saveForFilterUnit().

bool DQMFileSaver::enableMultiThread_
private
bool DQMFileSaver::fakeFilterUnitMode_
private
std::string DQMFileSaver::fileBaseName_
private
FileFormat DQMFileSaver::fileFormat_
private

Definition at line 63 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), endJob(), globalEndLuminosityBlock(), and globalEndRun().

std::atomic<int> DQMFileSaver::fileUpdate_
mutableprivate

Definition at line 83 of file DQMFileSaver.h.

Referenced by saveForFilterUnit(), and saveForOffline().

std::string DQMFileSaver::filterName_
private

Definition at line 69 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), saveForFilterUnit(), saveForOfflinePB(), and saveForOnlinePB().

evf::FastMonitoringService* DQMFileSaver::fms_
private

Definition at line 93 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), globalEndLuminosityBlock(), and saveForFilterUnit().

int DQMFileSaver::forceRunNumber_
private

Definition at line 80 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and endJob().

std::atomic<int> DQMFileSaver::irun_
mutableprivate

Definition at line 90 of file DQMFileSaver.h.

Referenced by beginJob(), endJob(), and globalEndRun().

std::atomic<int> DQMFileSaver::nlumi_
mutableprivate
std::atomic<int> DQMFileSaver::nrun_
mutableprivate

Definition at line 86 of file DQMFileSaver.h.

Referenced by beginJob(), globalBeginRun(), and globalEndRun().

std::string DQMFileSaver::producer_
private

Definition at line 65 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

bool DQMFileSaver::runIsComplete_
private

Definition at line 71 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and saveForOffline().

bool DQMFileSaver::saveAtJobEnd_
private

Definition at line 77 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and endJob().

int DQMFileSaver::saveByLumiSection_
private

Definition at line 75 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and globalEndLuminosityBlock().

int DQMFileSaver::saveByRun_
private

Definition at line 76 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and globalEndRun().

int DQMFileSaver::saveReference_
private
int DQMFileSaver::saveReferenceQMin_
private
std::string DQMFileSaver::stream_label_
private

Definition at line 66 of file DQMFileSaver.h.

Referenced by beginJob(), DQMFileSaver(), globalBeginRun(), and saveForFilterUnit().

const std::string DQMFileSaver::streamPrefix_
staticprivate

Definition at line 95 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

const std::string DQMFileSaver::streamSuffix_
staticprivate

Definition at line 96 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

std::string DQMFileSaver::transferDestination_
private

Definition at line 97 of file DQMFileSaver.h.

Referenced by beginJob(), and saveForFilterUnit().

int DQMFileSaver::version_
private

Definition at line 70 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

std::string DQMFileSaver::workflow_
private