CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
dqm::DQMFileSaverBase Class Reference

#include <DQMFileSaverBase.h>

Inheritance diagram for dqm::DQMFileSaverBase:
edm::global::EDAnalyzer< edm::RunCache< NoCache >, edm::LuminosityBlockCache< NoCache > > edm::global::EDAnalyzerBase edm::EDConsumerBase dqm::DQMFileSaverOnline dqm::DQMFileSaverPB

Classes

struct  FileParameters
 

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 DQMFileSaverBase (const edm::ParameterSet &ps)
 
 ~DQMFileSaverBase () override
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< NoCache >, edm::LuminosityBlockCache< NoCache > >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &d)
 
- 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

void analyze (edm::StreamID, const edm::Event &e, const edm::EventSetup &) const final
 
std::shared_ptr< NoCacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const final
 
std::shared_ptr< NoCacheglobalBeginRun (const edm::Run &, const edm::EventSetup &) const final
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const final
 
void globalEndRun (const edm::Run &, const edm::EventSetup &) const final
 
virtual void initRun () const
 
void logFileAction (const std::string &msg, const std::string &fileName) const
 
void saveJobReport (const std::string &filename) const
 
virtual void saveLumi (const FileParameters &fp) const
 
virtual void saveRun (const FileParameters &fp) const
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Static Protected Member Functions

static const std::string filename (const FileParameters &fp, bool useLumi=false)
 

Protected Attributes

FileParameters initial_fp_
 
std::mutex initial_fp_lock_
 

Detailed Description

Definition at line 23 of file DQMFileSaverBase.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 26 of file DQMFileSaverBase.h.

◆ MonitorElement

Definition at line 25 of file DQMFileSaverBase.h.

Constructor & Destructor Documentation

◆ DQMFileSaverBase()

DQMFileSaverBase::DQMFileSaverBase ( const edm::ParameterSet ps)

Definition at line 27 of file DQMFileSaverBase.cc.

27  {
28  FileParameters fp;
29 
30  fp.path_ = ps.getUntrackedParameter<std::string>("path");
31  fp.producer_ = ps.getUntrackedParameter<std::string>("producer");
32  fp.run_ = 0;
33  fp.tag_ = ps.getUntrackedParameter<std::string>("tag");
34  fp.lumi_ = 0;
35  fp.version_ = 1;
36  fp.child_ = "";
37 
38  std::unique_lock<std::mutex> lck(initial_fp_lock_);
39  initial_fp_ = fp;
40 }

References personalPlayback::fp, edm::ParameterSet::getUntrackedParameter(), initial_fp_, initial_fp_lock_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~DQMFileSaverBase()

DQMFileSaverBase::~DQMFileSaverBase ( )
overridedefault

Member Function Documentation

◆ analyze()

void DQMFileSaverBase::analyze ( edm::StreamID  ,
const edm::Event e,
const edm::EventSetup  
) const
finalprotectedvirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 55 of file DQMFileSaverBase.cc.

55  {
56  // not supported
57 }

◆ filename()

const std::string DQMFileSaverBase::filename ( const FileParameters fp,
bool  useLumi = false 
)
staticprotected

Definition at line 84 of file DQMFileSaverBase.cc.

84  {
85  char buf[256];
86  if (useLumi) {
87  snprintf(buf,
88  256,
89  "%s_V%04d_%s_R%09ld_L%09ld%s",
90  fp.producer_.c_str(),
91  fp.version_,
92  fp.tag_.c_str(),
93  fp.run_,
94  fp.lumi_,
95  fp.child_.c_str());
96  } else {
97  snprintf(buf,
98  256,
99  "%s_V%04d_%s_R%09ld%s",
100  fp.producer_.c_str(),
101  fp.version_,
102  fp.tag_.c_str(),
103  fp.run_,
104  fp.child_.c_str());
105  }
106  buf[255] = 0;
107 
108  namespace fs = boost::filesystem;
109  fs::path path(fp.path_);
110  fs::path file(buf);
111 
112  return (path / file).string();
113 }

References visDQMUpload::buf, FrontierConditions_GlobalTag_cff::file, personalPlayback::fp, and castor_dqm_sourceclient_file_cfg::path.

Referenced by dqm::DQMFileSaverOnline::fillOrigin(), dqm::DQMFileSaverOnline::makeSnapshot(), saveJobReport(), and dqm::DQMFileSaverPB::savePB().

◆ fillDescription()

void DQMFileSaverBase::fillDescription ( edm::ParameterSetDescription d)
static

Definition at line 131 of file DQMFileSaverBase.cc.

131  {
132  desc.addUntracked<std::string>("tag", "UNKNOWN")->setComment("File tag, DQM_V000_<TAG>*, usually a subsytem name.");
133 
134  desc.addUntracked<std::string>("producer", "DQM")
135  ->setComment("Base prefix for files, <BASE>_V000_**, either 'DQM' or 'Playback'.");
136 
137  desc.addUntracked<std::string>("referenceHandling", "all")->setComment("saveReference_, passed to the DQMStore");
138 
139  desc.addUntracked<int>("referenceRequireStatus", dqm::qstatus::STATUS_OK)
140  ->setComment("saveReference_, passed to the DQMStore");
141 
142  desc.addUntracked<std::string>("path", "./")->setComment("Output path prefix.");
143 }

References edm::ParameterSetDescription::addUntracked(), dqm::qstatus::STATUS_OK, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqm::DQMFileSaverPB::fillDescriptions(), and dqm::DQMFileSaverOnline::fillDescriptions().

◆ globalBeginLuminosityBlock()

std::shared_ptr< NoCache > DQMFileSaverBase::globalBeginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup  
) const
finalprotected

Definition at line 50 of file DQMFileSaverBase.cc.

51  {
52  return nullptr;
53 }

◆ globalBeginRun()

std::shared_ptr< NoCache > DQMFileSaverBase::globalBeginRun ( const edm::Run r,
const edm::EventSetup  
) const
finalprotected

Definition at line 44 of file DQMFileSaverBase.cc.

44  {
45  this->initRun();
46 
47  return nullptr;
48 }

References initRun().

◆ globalEndLuminosityBlock()

void DQMFileSaverBase::globalEndLuminosityBlock ( const edm::LuminosityBlock iLS,
const edm::EventSetup  
) const
finalprotected

Definition at line 59 of file DQMFileSaverBase.cc.

59  {
60  int ilumi = iLS.id().luminosityBlock();
61  int irun = iLS.id().run();
62 
63  std::unique_lock<std::mutex> lck(initial_fp_lock_);
64  FileParameters fp = initial_fp_;
65  lck.unlock();
66 
67  fp.lumi_ = ilumi;
68  fp.run_ = irun;
69 
70  this->saveLumi(fp);
71 }

References personalPlayback::fp, edm::LuminosityBlockBase::id(), initial_fp_, initial_fp_lock_, edm::LuminosityBlockID::luminosityBlock(), edm::LuminosityBlockID::run(), and saveLumi().

◆ globalEndRun()

void DQMFileSaverBase::globalEndRun ( const edm::Run iRun,
const edm::EventSetup  
) const
finalprotected

Definition at line 73 of file DQMFileSaverBase.cc.

73  {
74  std::unique_lock<std::mutex> lck(initial_fp_lock_);
75  FileParameters fp = initial_fp_;
76  lck.unlock();
77 
78  fp.run_ = iRun.id().run();
79 
80  // empty
81  this->saveRun(fp);
82 }

References personalPlayback::fp, edm::RunBase::id(), initial_fp_, initial_fp_lock_, edm::RunID::run(), and saveRun().

◆ initRun()

virtual void dqm::DQMFileSaverBase::initRun ( ) const
inlineprotectedvirtual

Reimplemented in dqm::DQMFileSaverPB.

Definition at line 59 of file DQMFileSaverBase.h.

59 {};

Referenced by globalBeginRun().

◆ logFileAction()

void DQMFileSaverBase::logFileAction ( const std::string &  msg,
const std::string &  fileName 
) const
protected

◆ saveJobReport()

void DQMFileSaverBase::saveJobReport ( const std::string &  filename) const
protected

Definition at line 115 of file DQMFileSaverBase.cc.

115  {
116  // Report the file to job report service.
118  if (jr.isAvailable()) {
119  std::map<std::string, std::string> info;
120  info["Source"] = "DQMStore";
121  info["FileClass"] = "DQM";
123  }
124 }

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

Referenced by dqm::DQMFileSaverOnline::makeSnapshot().

◆ saveLumi()

virtual void dqm::DQMFileSaverBase::saveLumi ( const FileParameters fp) const
inlineprotectedvirtual

Reimplemented in dqm::DQMFileSaverPB, and dqm::DQMFileSaverOnline.

Definition at line 60 of file DQMFileSaverBase.h.

60 {};

Referenced by globalEndLuminosityBlock().

◆ saveRun()

virtual void dqm::DQMFileSaverBase::saveRun ( const FileParameters fp) const
inlineprotectedvirtual

Reimplemented in dqm::DQMFileSaverPB, and dqm::DQMFileSaverOnline.

Definition at line 61 of file DQMFileSaverBase.h.

61 {};

Referenced by globalEndRun().

Member Data Documentation

◆ initial_fp_

FileParameters dqm::DQMFileSaverBase::initial_fp_
protected

Definition at line 71 of file DQMFileSaverBase.h.

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

◆ initial_fp_lock_

std::mutex dqm::DQMFileSaverBase::initial_fp_lock_
mutableprotected

Definition at line 70 of file DQMFileSaverBase.h.

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

edm::LogAbsolute
Definition: MessageLogger.h:469
edm::TimeOfDay
Definition: TimeOfDay.h:9
dqm::DQMFileSaverBase::saveLumi
virtual void saveLumi(const FileParameters &fp) const
Definition: DQMFileSaverBase.h:60
edm::RunID::run
RunNumber_t run() const
Definition: RunID.h:36
dqm::DQMFileSaverBase::filename
static const std::string filename(const FileParameters &fp, bool useLumi=false)
Definition: DQMFileSaverBase.cc:84
edm::JobReport::reportAnalysisFile
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
Definition: JobReport.cc:473
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
personalPlayback.fp
fp
Definition: personalPlayback.py:523
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
dqm::DQMFileSaverBase::initRun
virtual void initRun() const
Definition: DQMFileSaverBase.h:59
dqm::DQMFileSaverBase::initial_fp_lock_
std::mutex initial_fp_lock_
Definition: DQMFileSaverBase.h:70
dqm::DQMFileSaverBase::saveRun
virtual void saveRun(const FileParameters &fp) const
Definition: DQMFileSaverBase.h:61
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::FlushMessageLog
void FlushMessageLog()
Definition: MessageLogger.cc:94
dqm::DQMFileSaverBase::initial_fp_
FileParameters initial_fp_
Definition: DQMFileSaverBase.h:71
edm::Service
Definition: Service.h:30
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::LuminosityBlockID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockID.h:42
edm::LuminosityBlockBase::id
LuminosityBlockID id() const
Definition: LuminosityBlockBase.h:44
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
dqm::qstatus::STATUS_OK
static const int STATUS_OK
Definition: MonitorElement.h:52
edm::LuminosityBlockID::run
RunNumber_t run() const
Definition: LuminosityBlockID.h:41
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
edm::RunBase::id
RunID const & id() const
Definition: RunBase.h:39