Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DQM: header and namespace cleanup #27476

Merged
merged 27 commits into from Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6919ac
Run forwarddeclare-to-include
schneiml Jul 8, 2019
69d0e8a
Run remove-monitorelement-includes
schneiml Jul 8, 2019
3021888
DQM modules in test/ did nto compile without this BuildFile change.
schneiml May 15, 2019
e3e94e6
More manual fixes
schneiml May 15, 2019
264d5a3
Add missing dependency declaration.
schneiml May 15, 2019
ef9736b
Code-checks.
schneiml Jul 8, 2019
333bb1e
Code-format.
schneiml Jul 8, 2019
c66102c
Declare new DQM namespaces.
schneiml Jul 8, 2019
a1a38a0
Fix legacy modules to pick up the dqm::legacy classes.
schneiml May 29, 2019
9579d45
Changes to make DQM/ compiile again.
schneiml May 21, 2019
f8bba30
Remove a ton more includes to MonitorElement.h
schneiml Jul 8, 2019
8edd4a6
Make MonitorElement::Kind an enum class.
schneiml Jul 8, 2019
c8f5fb2
Changed every occurrence of renamed enum classes
Jun 17, 2019
1ef05ac
Fix oneDQMEDAnalyzer includes.
schneiml Jun 6, 2019
37df42e
Remove Legacy Example code.
schneiml May 22, 2019
cc6db08
Legacy declarations for DQMServices/ packages.
schneiml Jul 9, 2019
be08300
Legacy declarations to make Validation/ compile.
schneiml Jul 9, 2019
fd99101
Legacy declarations for HLTOffline.
schneiml Jul 9, 2019
dd9a721
Legacy declarations for a few more smaller packages.
schneiml Jul 9, 2019
775e359
Namepace declarations for TimerService and ThorughputService.
schneiml Jul 9, 2019
ec99408
Legacy declarations for GeneratorInterface/
schneiml Jul 9, 2019
e4f8eb0
Legacy declarations for a few packages
Jul 9, 2019
e3b727a
Added a missing declaration to Validation/
Jul 10, 2019
29c78a4
Ran code-format for previous declaration additions
Jul 10, 2019
7233436
It seem like there was a dependency declaration missing.
schneiml Jul 11, 2019
07f47c0
Remove a debug printout
schneiml Jul 11, 2019
785d00e
Remove a few redundant incudes.
schneiml Jul 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Alignment/LaserDQM/plugins/LaserDQM.h
Expand Up @@ -15,12 +15,13 @@

// DQM
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include <iostream>

class LaserDQM : public edm::EDAnalyzer {
public:
typedef dqm::legacy::DQMStore DQMStore;
typedef dqm::legacy::MonitorElement MonitorElement;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to keep in mind for the future. We highly encourage the use of using instead of typedef in all future code development.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used using in some places, but then switched to typedef for symmetry with those cases where the declarations are put in namespaces (fewer, but still some).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schneiml could you please clarify the rationale behind this choice? Is there a specific reason I am missing, or is it mostly a matter of taste?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding typedef vs. using: using only works in class scopes, but some of these declarations also appear in namespaces, where afaik using can't be used. So I chose to use the form of declaration that works everywhere.

Another option is to not import the names but just use full names. I also did that in a few places where the declarations caused trouble (e.g. due to multi-inheritance), but in general I preferred to have the import since it leads to less changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using can also be used outside of class scope.

typedef std::vector<edm::ParameterSet> Parameters;

/// constructor
Expand Down
Expand Up @@ -26,7 +26,7 @@

/*** DQM ***/
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"

/*** Records for ESWatcher ***/
#include "Geometry/Records/interface/IdealGeometryRecord.h"
Expand Down
Expand Up @@ -62,7 +62,6 @@
#include "Geometry/CommonDetUnit/interface/GeomDet.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "Alignment/CommonAlignment/interface/Alignable.h"
#include "Alignment/CommonAlignment/interface/Utilities.h"
Expand All @@ -78,6 +77,7 @@
//
class TrackerOfflineValidation : public edm::EDAnalyzer {
public:
typedef dqm::legacy::DQMStore DQMStore;
explicit TrackerOfflineValidation(const edm::ParameterSet&);
~TrackerOfflineValidation() override;

Expand Down
Expand Up @@ -49,7 +49,6 @@
#include "TMath.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

//
Expand All @@ -58,6 +57,7 @@

class TrackerOfflineValidationSummary : public edm::EDAnalyzer {
public:
typedef dqm::legacy::DQMStore DQMStore;
explicit TrackerOfflineValidationSummary(const edm::ParameterSet&);
~TrackerOfflineValidationSummary() override;

Expand Down
Expand Up @@ -36,7 +36,7 @@ Description: <one line class summary>

//#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationService.h"

#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "TLinearFitter.h"
#include "TGraphErrors.h"
#include <fstream>
Expand Down
Expand Up @@ -26,7 +26,7 @@
#include "FWCore/Framework/interface/MakerMacros.h"

#include "CalibTracker/SiPixelTools/interface/SiPixelOfflineCalibAnalysisBase.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigi.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

Expand Down
Expand Up @@ -52,6 +52,7 @@ enum sCurveErrorFlag {
// as a potential tool for potential future debugging
};

typedef dqm::legacy::MonitorElement MonitorElement;
typedef std::map<sCurveHistogramType, MonitorElement *> sCurveHistogramHolder;
typedef std::map<uint32_t, sCurveHistogramHolder> detIDHistogramMap;

Expand Down
Expand Up @@ -49,7 +49,6 @@
#include "TF1.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQM/SiPixelCommon/interface/SiPixelHistogramId.h"
#include "DQM/SiPixelCommon/interface/SiPixelFolderOrganizer.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
Expand All @@ -65,6 +64,8 @@

class SiPixelOfflineCalibAnalysisBase : public edm::EDAnalyzer {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiPixelOfflineCalibAnalysisBase(const edm::ParameterSet&);
~SiPixelOfflineCalibAnalysisBase() override;

Expand Down
Expand Up @@ -31,7 +31,6 @@

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include <string>
Expand All @@ -44,6 +43,8 @@

class SiPixelDQMRocLevelAnalyzer : public edm::EDAnalyzer {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiPixelDQMRocLevelAnalyzer(const edm::ParameterSet &);
~SiPixelDQMRocLevelAnalyzer() override;

Expand Down
23 changes: 11 additions & 12 deletions CalibTracker/SiPixelTools/plugins/SiPixelErrorsDigisToCalibDigis.cc
Expand Up @@ -129,22 +129,21 @@ void SiPixelErrorsDigisToCalibDigis::endJob() {

// ------------ helper functions ---------------------------------------------------------

MonitorElement* SiPixelErrorsDigisToCalibDigis::bookDQMHistogram2D(uint32_t detid,
std::string name,
std::string title,
int nchX,
double lowX,
double highX,
int nchY,
double lowY,
double highY) {
SiPixelErrorsDigisToCalibDigis::MonitorElement* SiPixelErrorsDigisToCalibDigis::bookDQMHistogram2D(uint32_t detid,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m fairly certain you could have used auto as the return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes, but that requires changes in two places (header and implementation). Also the return type might not (always) be obvious, so I went the most obvious route.

std::string name,
std::string title,
int nchX,
double lowX,
double highX,
int nchY,
double lowY,
double highY) {
std::string hid = theHistogramIdWorker_->setHistoId(name, detid);
return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY);
}

MonitorElement* SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D(uint32_t detid,
std::string name,
std::string title) {
SiPixelErrorsDigisToCalibDigis::MonitorElement* SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D(
uint32_t detid, std::string name, std::string title) {
DetId detId(detid);
const TrackerGeometry& theTracker(*geom_);
const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId));
Expand Down
Expand Up @@ -31,7 +31,6 @@ Description: Create monitorElements for the Errors in created in the reduction o
#include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigiError.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "DQM/SiPixelCommon/interface/SiPixelHistogramId.h"
#include "DQM/SiPixelCommon/interface/SiPixelFolderOrganizer.h"
Expand All @@ -49,6 +48,8 @@ Description: Create monitorElements for the Errors in created in the reduction o

class SiPixelErrorsDigisToCalibDigis : public edm::EDAnalyzer {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiPixelErrorsDigisToCalibDigis(const edm::ParameterSet&);
~SiPixelErrorsDigisToCalibDigis() override;

Expand Down
27 changes: 13 additions & 14 deletions CalibTracker/SiPixelTools/src/SiPixelOfflineCalibAnalysisBase.cc
Expand Up @@ -169,34 +169,33 @@ std::string SiPixelOfflineCalibAnalysisBase::translateDetIdToString(uint32_t det
return output;
}

MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(
SiPixelOfflineCalibAnalysisBase::MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(
uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX) {
std::string hid = theHistogramIdWorker_->setHistoId(name, detid);
return daqBE_->book1D(hid, title, nchX, lowX, highX);
}

MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(
SiPixelOfflineCalibAnalysisBase::MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(
uint32_t detid, std::string name, std::string title, int nchX, float* xbinsize) {
std::string hid = theHistogramIdWorker_->setHistoId(name, detid);
return daqBE_->book1D(hid, title, nchX, xbinsize);
}

MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram2D(uint32_t detid,
std::string name,
std::string title,
int nchX,
double lowX,
double highX,
int nchY,
double lowY,
double highY) {
SiPixelOfflineCalibAnalysisBase::MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistogram2D(uint32_t detid,
std::string name,
std::string title,
int nchX,
double lowX,
double highX,
int nchY,
double lowY,
double highY) {
std::string hid = theHistogramIdWorker_->setHistoId(name, detid);
return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY);
}

MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D(uint32_t detid,
std::string name,
std::string title) {
SiPixelOfflineCalibAnalysisBase::MonitorElement* SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D(
uint32_t detid, std::string name, std::string title) {
DetId detId(detid);
const TrackerGeometry& theTracker(*geom_);
const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId));
Expand Down
4 changes: 3 additions & 1 deletion CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h
Expand Up @@ -5,7 +5,7 @@
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DQMServices/Core/interface/ConcurrentMonitorElement.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"

#include <string>
#include <vector>
Expand All @@ -15,6 +15,8 @@

namespace APVGain {

typedef dqm::legacy::MonitorElement MonitorElement;

int subdetectorId(uint32_t);
int subdetectorId(const std::string&);
int subdetectorSide(uint32_t, const TrackerTopology*);
Expand Down
Expand Up @@ -89,6 +89,8 @@ using namespace APVGain;

class SiStripGainFromCalibTree : public ConditionDBWriter<SiStripApvGain> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiStripGainFromCalibTree(const edm::ParameterSet&);
~SiStripGainFromCalibTree() override;

Expand Down
Expand Up @@ -50,7 +50,6 @@
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "CalibFormats/SiStripObjects/interface/SiStripGain.h"
#include "CalibTracker/Records/interface/SiStripGainRcd.h"
Expand Down Expand Up @@ -88,6 +87,8 @@ struct stAPVGain {

class SiStripGainFromData : public ConditionDBWriter<SiStripApvGain> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiStripGainFromData(const edm::ParameterSet&);
~SiStripGainFromData() override;

Expand Down
6 changes: 3 additions & 3 deletions CalibTracker/SiStripChannelGain/src/APVGainHelpers.cc
Expand Up @@ -105,9 +105,9 @@ int APVGain::subdetectorPlane(const std::string& tag) {

/** Brief Fetch the Monitor Element corresponding to a DetId.
* */
std::vector<MonitorElement*> APVGain::FetchMonitor(std::vector<APVGain::APVmon> histos,
uint32_t det_id,
const TrackerTopology* topo) {
std::vector<APVGain::MonitorElement*> APVGain::FetchMonitor(std::vector<APVGain::APVmon> histos,
uint32_t det_id,
const TrackerTopology* topo) {
std::vector<MonitorElement*> found = std::vector<MonitorElement*>();
int sId = APVGain::subdetectorId(det_id);
int sPlane = APVGain::subdetectorPlane(det_id, topo);
Expand Down
Expand Up @@ -37,12 +37,12 @@
#include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
#include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
#include "CalibTracker/Records/interface/SiStripDependentRecords.h"

class DQMStore;
class MonitorElement;
#include "DQMServices/Core/interface/DQMStore.h"

class SiStripBadModuleFedErrESSource : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
SiStripBadModuleFedErrESSource(const edm::ParameterSet&);
~SiStripBadModuleFedErrESSource() override;

Expand All @@ -67,8 +67,7 @@ class SiStripBadModuleFedErrESSource : public edm::ESProducer, public edm::Event
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"

SiStripBadModuleFedErrESSource::SiStripBadModuleFedErrESSource(const edm::ParameterSet& iConfig) {
setWhatProduced(this).setConsumes(cablingToken_);
Expand Down Expand Up @@ -103,7 +102,7 @@ float SiStripBadModuleFedErrESSource::getProcessedEvents(DQMStore* dqmStore) con
std::vector<std::pair<uint16_t, uint16_t>> SiStripBadModuleFedErrESSource::getFedBadChannelList(
DQMStore* dqmStore, const MonitorElement* me) const {
std::vector<std::pair<uint16_t, uint16_t>> ret;
if (me->kind() == MonitorElement::DQM_KIND_TH2F) {
if (me->kind() == MonitorElement::Kind::TH2F) {
TH2F* th2 = me->getTH2F();
float entries = getProcessedEvents(dqmStore);
if (!entries)
Expand Down
2 changes: 2 additions & 0 deletions CalibTracker/SiStripLorentzAngle/BuildFile.xml
Expand Up @@ -3,6 +3,8 @@
<use name="DataFormats/SiStripCluster"/>
<use name="DataFormats/TrackerCommon" />
<use name="CalibTracker/StandaloneTrackerTopology"/>
<use name="DQMServices/Core"/>

<export>
<lib name="1"/>
</export>
Expand Up @@ -29,14 +29,16 @@
#include <TDirectory.h>
#include "TROOT.h"
#include "Riostream.h"
#include "DQMServices/Core/interface/DQMStore.h"

#include <memory>

class TrackerTopology;
class MonitorElement;

class SiStripCalibLorentzAngle : public ConditionDBWriter<SiStripLorentzAngle> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiStripCalibLorentzAngle(const edm::ParameterSet &conf);

~SiStripCalibLorentzAngle() override;
Expand Down
Expand Up @@ -11,8 +11,7 @@
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "MagneticField/Engine/interface/MagneticField.h"

//#include "DQMServices/Core/interface/MonitorElement.h"
//#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/DQMStore.h"

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/GeometryVector/interface/LocalVector.h"
Expand All @@ -23,11 +22,11 @@
#include <TDirectory.h>

class TrackerTopology;
class MonitorElement;
class DQMStore;

class SiStripLAProfileBooker : public edm::EDAnalyzer {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
explicit SiStripLAProfileBooker(const edm::ParameterSet& conf);

~SiStripLAProfileBooker() override;
Expand Down
Expand Up @@ -12,7 +12,6 @@
#include "CLHEP/Random/RandGauss.h"
#include "CondFormats/DataRecord/interface/SiStripLorentzAngleRcd.h"
#include "DQM/SiStripCommon/interface/SiStripHistoId.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "Geometry/CommonTopologies/interface/StripTopology.h"
#include "DQM/SiStripCommon/interface/ExtractTObject.h"
Expand Down
Expand Up @@ -36,13 +36,14 @@
#include "CalibTracker/SiStripQuality/interface/SiStripQualityHistos.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

class SiStripQuality;
class TrackerTopology;

class SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy {
public:
typedef dqm::legacy::DQMStore DQMStore;
typedef dqm::legacy::MonitorElement MonitorElement;
typedef SiStrip::QualityHistosMap HistoMap;

SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy(const edm::ParameterSet&, const TrackerTopology*);
Expand Down
Expand Up @@ -19,7 +19,6 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down
Expand Up @@ -18,7 +18,6 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down