CMS 3D CMS Logo

DQMHarvestingMetadata.cc
Go to the documentation of this file.
2 
4 
6 public:
9 
11  ~DQMHarvestingMetadata() override;
12 
13 protected:
15  void dqmEndRun(DQMStore::IBooker& ibooker,
16  DQMStore::IGetter& igetter,
17  edm::Run const& iRun,
18  edm::EventSetup const& /* iSetup */) override;
20  DQMStore::IGetter& igetter,
21  edm::LuminosityBlock const& iLumi,
22  edm::EventSetup const& /* iSetup */) override;
23 
25 
26 private:
29 
36 
41 
42  double currentTime_;
43 };
44 
45 static inline double stampToReal(edm::Timestamp time) {
46  return (time.value() >> 32) + 1e-6 * (time.value() & 0xffffffff);
47 }
48 
49 static inline double stampToReal(const timeval& time) { return time.tv_sec + 1e-6 * time.tv_usec; }
50 
52  struct timeval now;
53  gettimeofday(&now, nullptr);
55 
56  // read config parms
57  std::string folder = ps.getUntrackedParameter<std::string>("eventInfoFolder", "EventInfo");
58  subsystemname_ = ps.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem");
59 
61 }
62 
64 
66  DQMStore::IGetter& igetter,
67  edm::Run const& iRun,
68  edm::EventSetup const& /* iSetup */) {
70 
71  runList_ = ibooker.bookString("Run", "");
72  runId_ = ibooker.bookInt("iRun");
73  runStartTimeStamp_ = ibooker.bookFloat("runStartTimeStamp");
74 
75  if (runList_->getStringValue().empty()) {
76  std::string run = std::to_string(iRun.id().run());
77  runList_->Fill(run);
78  runId_->Fill(iRun.id().run());
79  // in case of multiple runs, record start time of the first.
81  } else {
82  std::string run = runList_->getStringValue() + "," + std::to_string(iRun.id().run());
83  runList_->Fill(run);
84  // this is the agreed-upon pseudo-runnumber for multi-run harvesting.
85  runId_->Fill(999999);
86  }
87 
88  processTimeStamp_ = ibooker.bookFloat("processTimeStamp");
90 
91  char hostname[65];
92  gethostname(hostname, 64);
93  hostname[64] = 0;
94  hostName_ = ibooker.bookString("hostName", hostname);
95  char* pwd = getcwd(nullptr, 0);
96  workingDir_ = ibooker.bookString("workingDir", pwd);
97  free(pwd);
98  cmsswVer_ = ibooker.bookString("CMSSW_Version", edm::getReleaseVersion());
99 }
100 
102  DQMStore::IGetter& igetter,
103  edm::LuminosityBlock const& iLumi,
104  edm::EventSetup const& /* iSetup */) {
105  int lumi = iLumi.luminosityBlock();
106 
108  firstLumisecId_ = ibooker.bookInt("firstLumiSection");
109  lastLumisecId_ = ibooker.bookInt("lastLumiSection");
110  lumisecId_ = ibooker.bookInt("iLumiSection");
111  lumisecId_->Fill(lumi);
112 
115  }
118  }
119 }
120 
DQMEDHarvester.h
alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
DQMHarvestingMetadata::workingDir_
MonitorElement * workingDir_
Hostname of the local machine.
Definition: DQMHarvestingMetadata.cc:39
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::RunID::run
RunNumber_t run() const
Definition: RunID.h:36
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
edm::Run
Definition: Run.h:45
printsummarytable.folder
folder
Definition: printsummarytable.py:7
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
stampToReal
static double stampToReal(edm::Timestamp time)
Definition: DQMHarvestingMetadata.cc:45
protons_cff.time
time
Definition: protons_cff.py:35
DQMHarvestingMetadata::runId_
MonitorElement * runId_
Definition: DQMHarvestingMetadata.cc:30
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DQMHarvestingMetadata
Definition: DQMHarvestingMetadata.cc:5
DQMHarvestingMetadata::dqmEndRun
void dqmEndRun(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::Run const &iRun, edm::EventSetup const &) override
Analyze.
Definition: DQMHarvestingMetadata.cc:65
MakerMacros.h
BXlumiParameters_cfi.lumi
lumi
Definition: BXlumiParameters_cfi.py:6
DQMHarvestingMetadata::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::LuminosityBlock const &iLumi, edm::EventSetup const &) override
Definition: DQMHarvestingMetadata.cc:101
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DQMHarvestingMetadata::runStartTimeStamp_
MonitorElement * runStartTimeStamp_
Definition: DQMHarvestingMetadata.cc:32
DQMHarvestingMetadata::runList_
MonitorElement * runList_
Definition: DQMHarvestingMetadata.cc:31
edm::ParameterSet
Definition: ParameterSet.h:47
GetReleaseVersion.h
dqm::implementation::IBooker::bookString
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
DQMHarvestingMetadata::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DQMHarvestingMetadata.cc:24
DQMHarvestingMetadata::lastLumisecId_
MonitorElement * lastLumisecId_
Definition: DQMHarvestingMetadata.cc:35
DQMHarvestingMetadata::cmsswVer_
MonitorElement * cmsswVer_
Current working directory of the job.
Definition: DQMHarvestingMetadata.cc:40
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMEDHarvester
Definition: DQMEDHarvester.py:1
DQMHarvestingMetadata::currentTime_
double currentTime_
CMSSW version run for this job.
Definition: DQMHarvestingMetadata.cc:42
writedatasetfile.run
run
Definition: writedatasetfile.py:27
dqm::implementation::IGetter
Definition: DQMStore.h:484
edm::getReleaseVersion
std::string getReleaseVersion()
Definition: GetReleaseVersion.cc:7
DQMHarvestingMetadata::~DQMHarvestingMetadata
~DQMHarvestingMetadata() override
Destructor.
dqm::impl::MonitorElement::getStringValue
virtual const std::string & getStringValue() const
Definition: MonitorElement.cc:934
DQMHarvestingMetadata::eventInfoFolder_
std::string eventInfoFolder_
Definition: DQMHarvestingMetadata.cc:24
dqm::implementation::IBooker
Definition: DQMStore.h:43
DQMHarvestingMetadata::lumisecId_
MonitorElement * lumisecId_
UTC time of the run start.
Definition: DQMHarvestingMetadata.cc:33
DQMHarvestingMetadata::subsystemname_
std::string subsystemname_
Definition: DQMHarvestingMetadata.cc:28
DQMHarvestingMetadata::DQMHarvestingMetadata
DQMHarvestingMetadata(const edm::ParameterSet &ps)
Constructor.
Definition: DQMHarvestingMetadata.cc:51
DQMHarvestingMetadata::firstLumisecId_
MonitorElement * firstLumisecId_
Definition: DQMHarvestingMetadata.cc:34
lumi
Definition: LumiSectionData.h:20
DQMHarvestingMetadata::hostName_
MonitorElement * hostName_
The UTC time of the job initialization.
Definition: DQMHarvestingMetadata.cc:38
edm::RunBase::id
RunID const & id() const
Definition: RunBase.h:39
edm::RunBase::beginTime
Timestamp const & beginTime() const
Definition: RunBase.h:41
DQMHarvestingMetadata::processTimeStamp_
MonitorElement * processTimeStamp_
Definition: DQMHarvestingMetadata.cc:37
dqm::impl::MonitorElement::getIntValue
virtual int64_t getIntValue() const
Definition: MonitorElement.cc:924
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::Timestamp
Definition: Timestamp.h:30