Skip to content

Commit

Permalink
Fix several usages of un-initialized variables in DQM.
Browse files Browse the repository at this point in the history
In CastorMonitor and DTSegmentsTask the initialization from
ParameterSet was commented out, I don't know why.
I haven't un-un-commented them, just added initial values.

In QcdPhotonsDQM the variable was used to count the number of events,
and scale the histogram at the endJob.
This should be done via dqm harvesting now what we are multithreaded,
and does not make sense in the DQMEDAnalyzer.
If someone cares or needs the rates (instead of actual
values), we will create a DQMEDHarvester.

In L1TdeCSCTF.cc the array was not properly initialized,
because of the single-character error left by the developer.
  • Loading branch information
Dmitrijus Bugelskis committed Jun 24, 2015
1 parent 103028a commit 9859982
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions DQM/CastorMonitor/src/CastorBaseMonitor.cc
Expand Up @@ -14,6 +14,7 @@ CastorBaseMonitor::CastorBaseMonitor() {
fVerbosity = 0;
rootFolder_ = "Castor";
baseFolder_ = "BaseMonitor";
showTiming = false;
}

//======================= Destructor ===============================//
Expand Down
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/src/L1TdeCSCTF.cc
Expand Up @@ -478,7 +478,7 @@ void L1TdeCSCTF::analyze(Event const& e, EventSetup const& es){
for(int dK=0; dK<15; dK++)
{
eDtStub[dJ][dK] = -55;
eDtStub[dJ][dK] = -55;
dDtStub[dJ][dK] = -55;
dDtStub[7][dK] = -55;
}
}
Expand Down
5 changes: 0 additions & 5 deletions DQM/Physics/src/QcdPhotonsDQM.cc
Expand Up @@ -254,8 +254,6 @@ void QcdPhotonsDQM::bookHistograms(DQMStore::IBooker & ibooker,
}

void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
num_events_in_run++;

LogTrace(logTraceName) << "Analysis of event # ";

////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -530,9 +528,6 @@ void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
}

void QcdPhotonsDQM::endRun(const edm::Run& run, const edm::EventSetup& es) {
if (num_events_in_run > 0) {
h_triggers_passed->getTH1F()->Scale(1.0 / num_events_in_run);
}
h_photon_et_ratio_co_cs->getTH1F()->Divide(h_photon_et_jetco->getTH1F(),
h_photon_et_jetcs->getTH1F());
h_photon_et_ratio_fo_fs->getTH1F()->Divide(h_photon_et_jetfo->getTH1F(),
Expand Down
2 changes: 0 additions & 2 deletions DQM/Physics/src/QcdPhotonsDQM.h
Expand Up @@ -69,8 +69,6 @@ class QcdPhotonsDQM : public DQMEDAnalyzer {
edm::EDGetTokenT<EcalRecHitCollection> theBarrelRecHitToken_;
edm::EDGetTokenT<EcalRecHitCollection> theEndcapRecHitToken_;

int num_events_in_run;

// Histograms
MonitorElement* h_triggers_passed;
MonitorElement* h_photon_et_beforeCuts;
Expand Down
6 changes: 5 additions & 1 deletion DQMOffline/Muon/src/DTSegmentsTask.cc
Expand Up @@ -30,8 +30,12 @@ DTSegmentsTask::DTSegmentsTask(const edm::ParameterSet& pset) {
debug = pset.getUntrackedParameter<bool>("debug",false);
parameters = pset;

// should be init from pset, but it was commented out...
// better false than undefined
checkNoisyChannels = false;

// the name of the 4D rec hits collection
theRecHits4DLabel_ = consumes<DTRecSegment4DCollection>(parameters.getParameter<std::string>("recHits4DLabel"));
theRecHits4DLabel_ = consumes<DTRecSegment4DCollection>(parameters.getParameter<std::string>("recHits4DLabel"));
}


Expand Down

0 comments on commit 9859982

Please sign in to comment.