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

Replaced DQM histogram booking macro to regular methods inside IBooker #26161

Merged
merged 4 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions DQM/Physics/src/FSQDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ FSQDQM::~FSQDQM()
h_ntracks_transverse = bei.book1D("h_ntracks_transverse",";h_ntracks_transverse",50,-0.5,49.5);
h_ntracks_away = bei.book1D("h_ntracks_away",";h_ntracks_away",50,-0.5,49.5);

h_leadingtrkpt_ntrk_away =bei.bookProfile("h_leadingtrkpt_ntrk_away","h_leadingtrkpt_ntrk_away",50,0,50,0,30," ");
h_leadingtrkpt_ntrk_towards =bei.bookProfile("h_leadingtrkpt_ntrk_towards","h_leadingtrkpt_ntrk_towards",50,0,50,0,30," ");
h_leadingtrkpt_ntrk_transverse =bei.bookProfile("h_leadingtrkpt_ntrk_transverse","h_leadingtrkpt_ntrk_transverse",50,0,50,0,30," ");
h_leadingtrkpt_ptsum_away =bei.bookProfile("h_leadingtrkpt_ptsum_away","h_leadingtrkpt_ptsum_away",50,0,50,0,30," ");
h_leadingtrkpt_ptsum_towards =bei.bookProfile("h_leadingtrkpt_ptsum_towards","h_leadingtrkpt_ptsum_towards",50,0,50,0,30," ");
h_leadingtrkpt_ptsum_transverse =bei.bookProfile("h_leadingtrkpt_ptsum_transverse","h_leadingtrkpt_ptsum_transverse",50,0,50,0,30," ");
h_leadingtrkpt_ntrk_away =bei.bookProfile("h_leadingtrkpt_ntrk_away","h_leadingtrkpt_ntrk_away",50,0.0,50,0,30," ");
h_leadingtrkpt_ntrk_towards =bei.bookProfile("h_leadingtrkpt_ntrk_towards","h_leadingtrkpt_ntrk_towards",50,0.0,50,0,30," ");
h_leadingtrkpt_ntrk_transverse =bei.bookProfile("h_leadingtrkpt_ntrk_transverse","h_leadingtrkpt_ntrk_transverse",50,0.0,50,0,30," ");
h_leadingtrkpt_ptsum_away =bei.bookProfile("h_leadingtrkpt_ptsum_away","h_leadingtrkpt_ptsum_away",50,0.0,50,0,30," ");
h_leadingtrkpt_ptsum_towards =bei.bookProfile("h_leadingtrkpt_ptsum_towards","h_leadingtrkpt_ptsum_towards",50,0.0,50,0,30," ");
h_leadingtrkpt_ptsum_transverse =bei.bookProfile("h_leadingtrkpt_ptsum_transverse","h_leadingtrkpt_ptsum_transverse",50,0.0,50,0,30," ");

}

Expand Down
4 changes: 2 additions & 2 deletions DQM/SiPixelPhase1Summary/src/SiPixelPhase1Summary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void SiPixelPhase1Summary::bookTrendPlots(DQMStore::IBooker & iBooker){
}
}
else {
deadROCTrends_[offline] = iBooker.bookProfile("deadRocTotal","N dead ROCs",6,0,6,0.,8192,"");
ineffROCTrends_[offline] = iBooker.bookProfile("ineffRocTotal","N inefficient ROCs",6,0,6,0.,8192,"");
deadROCTrends_[offline] = iBooker.bookProfile("deadRocTotal","N dead ROCs",6,0.,6,0.,8192,"");
ineffROCTrends_[offline] = iBooker.bookProfile("ineffRocTotal","N inefficient ROCs",6,0.,6,0.,8192,"");
deadROCTrends_[offline]->setAxisTitle("Subdetector",1);
ineffROCTrends_[offline]->setAxisTitle("Subdetector",1);
for (unsigned int i = 1; i <= binAxisLabels.size(); i++){
Expand Down
2 changes: 1 addition & 1 deletion DQM/TrackingMonitor/src/TrackAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ void TrackAnalyzer::bookHistosForState(std::string sname, DQMStore::IBooker & ib
tkmes.Chi2oNDFVsPt->setAxisTitle("Track #chi^{2}/ndf",2);

histname = "Chi2oNDFVsNHits_" + histTag;
tkmes.Chi2oNDFVsNHits = ibooker.bookProfile(histname, histname, 50, 0, 50, Chi2NDFMin, Chi2NDFMax,"");
tkmes.Chi2oNDFVsNHits = ibooker.bookProfile(histname, histname, 50, 0., 50, Chi2NDFMin, Chi2NDFMax,"");
tkmes.Chi2oNDFVsNHits->setAxisTitle("Track NHits", 1);
tkmes.Chi2oNDFVsNHits->setAxisTitle("Track #chi^{2}/ndf",2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void StandaloneTrackMonitor::bookHistograms(DQMStore::IBooker &iBook, edm::Run c
TrackPtHistoPar.getParameter<double>("Xmin"),
TrackPtHistoPar.getParameter<double>("Xmax"),0.0,0.0,"g");
if (!nHitsVsnVtxH_)
nHitsVsnVtxH_ = iBook.bookProfile("nHitsVsnVtx", "Number of Hits Vs Number of Vertex", 100,0,50,0.0,0.0,"g");
nHitsVsnVtxH_ = iBook.bookProfile("nHitsVsnVtx", "Number of Hits Vs Number of Vertex", 100,0.0,50,0.0,0.0,"g");
if (!nHitsVsEtaH_)
nHitsVsEtaH_ = iBook.bookProfile("nHitsVsEta", "Number of Hits Vs Eta",
TrackEtaHistoPar.getParameter<int32_t>("Xbins"),
Expand Down
117 changes: 56 additions & 61 deletions DQMServices/Core/interface/DQMStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,34 @@ class DQMStore {
public:
friend class DQMStore;

#define IBOOKER_FUNCTION_WITH_SUFFIX(suffix) \
template <typename... Args> \
MonitorElement* book##suffix(Args&&... args) \
{ \
return owner_->book##suffix(std::forward<Args>(args)...); \
}

// For the supported interface, see the DQMStore function that
// starts with "book" and ends with the supplied suffix. For
// example, giving an argument of "String" generates a function
// that interfaces with DQMStore::bookString.
IBOOKER_FUNCTION_WITH_SUFFIX(String);
IBOOKER_FUNCTION_WITH_SUFFIX(Int);
IBOOKER_FUNCTION_WITH_SUFFIX(Float);
IBOOKER_FUNCTION_WITH_SUFFIX(1D);
IBOOKER_FUNCTION_WITH_SUFFIX(1S);
IBOOKER_FUNCTION_WITH_SUFFIX(1DD);
IBOOKER_FUNCTION_WITH_SUFFIX(2D);
IBOOKER_FUNCTION_WITH_SUFFIX(2S);
IBOOKER_FUNCTION_WITH_SUFFIX(2DD);
IBOOKER_FUNCTION_WITH_SUFFIX(3D);
IBOOKER_FUNCTION_WITH_SUFFIX(Profile);
IBOOKER_FUNCTION_WITH_SUFFIX(Profile2D);

#undef IBOOKER_FUNCTION_WITH_SUFFIX
MonitorElement* bookInt(TString const& name);
MonitorElement* bookFloat(TString const& name);
MonitorElement* bookString(TString const& name, TString const& value);
MonitorElement* book1D(TString const& name, TString const& title, int const nchX, double const lowX, double const highX);
MonitorElement* book1D(TString const& name, TString const& title, int nchX, float const* xbinsize);
MonitorElement* book1D(TString const& name, TH1F* object);
MonitorElement* book1S(TString const& name, TString const& title, int nchX, double lowX, double highX);
MonitorElement* book1S(TString const& name, TH1S* object);
MonitorElement* book1DD(TString const& name, TString const& title, int nchX, double lowX, double highX);
MonitorElement* book1DD(TString const& name, TH1D* object);
MonitorElement* book2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
MonitorElement* book2D(TString const& name, TString const& title, int nchX, float const* xbinsize, int nchY, float const* ybinsize);
MonitorElement* book2D(TString const& name, TH2F* object);
MonitorElement* book2S(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
MonitorElement* book2S(TString const& name, TString const& title, int nchX, float const* xbinsize, int nchY, float const* ybinsize);
MonitorElement* book2S(TString const& name, TH2S* object);
MonitorElement* book2DD(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
MonitorElement* book2DD(TString const& name, TH2D* object);
MonitorElement* book3D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ);
MonitorElement* book3D(TString const& name, TH3F* object);
MonitorElement* bookProfile(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const* option = "s");
MonitorElement* bookProfile(TString const& name, TString const& title, int nchX, double lowX, double highX, double lowY, double highY, char const* option = "s");
MonitorElement* bookProfile(TString const& name, TString const& title, int nchX, double const* xbinsize, int nchY, double lowY, double highY, char const* option = "s");
MonitorElement* bookProfile(TString const& name, TString const& title, int nchX, double const* xbinsize, double lowY, double highY, char const* option = "s");
MonitorElement* bookProfile(TString const& name, TProfile* object);
MonitorElement* bookProfile2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const* option = "s");
MonitorElement* bookProfile2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, char const* option = "s");
MonitorElement* bookProfile2D(TString const& name, TProfile2D* object);

void cd();
void cd(std::string const& dir);
Expand Down Expand Up @@ -142,32 +145,34 @@ class DQMStore {
public:
friend class DQMStore;

#define CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(suffix) \
template <typename... Args> \
ConcurrentMonitorElement book##suffix(Args&&... args) \
{ \
MonitorElement* me = IBooker::book##suffix(std::forward<Args>(args)...); \
return ConcurrentMonitorElement(me); \
}

// For the supported interface, see the DQMStore function that
// starts with "book" and ends with the supplied suffix. For
// example, giving an argument of "String" generates a function
// that interfaces with DQMStore::bookString.
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(String);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(Int);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(Float);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(1D);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(1S);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(1DD);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(2D);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(2S);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(2DD);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(3D);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(Profile);
CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX(Profile2D);

#undef CONCURRENTBOOKER_FUNCTION_WITH_SUFFIX
ConcurrentMonitorElement bookInt(TString const& name);
ConcurrentMonitorElement bookFloat(TString const& name);
ConcurrentMonitorElement bookString(TString const& name, TString const& value);
ConcurrentMonitorElement book1D(TString const& name, TString const& title, int const nchX, double const lowX, double const highX);
ConcurrentMonitorElement book1D(TString const& name, TString const& title, int nchX, float const* xbinsize);
ConcurrentMonitorElement book1D(TString const& name, TH1F* object);
ConcurrentMonitorElement book1S(TString const& name, TString const& title, int nchX, double lowX, double highX);
ConcurrentMonitorElement book1S(TString const& name, TH1S* object);
ConcurrentMonitorElement book1DD(TString const& name, TString const& title, int nchX, double lowX, double highX);
ConcurrentMonitorElement book1DD(TString const& name, TH1D* object);
ConcurrentMonitorElement book2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
ConcurrentMonitorElement book2D(TString const& name, TString const& title, int nchX, float const* xbinsize, int nchY, float const* ybinsize);
ConcurrentMonitorElement book2D(TString const& name, TH2F* object);
ConcurrentMonitorElement book2S(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
ConcurrentMonitorElement book2S(TString const& name, TString const& title, int nchX, float const* xbinsize, int nchY, float const* ybinsize);
ConcurrentMonitorElement book2S(TString const& name, TH2S* object);
ConcurrentMonitorElement book2DD(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
ConcurrentMonitorElement book2DD(TString const& name, TH2D* object);
ConcurrentMonitorElement book3D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ);
ConcurrentMonitorElement book3D(TString const& name, TH3F* object);
ConcurrentMonitorElement bookProfile(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const* option = "s");
ConcurrentMonitorElement bookProfile(TString const& name, TString const& title, int nchX, double lowX, double highX, double lowY, double highY, char const* option = "s");
ConcurrentMonitorElement bookProfile(TString const& name, TString const& title, int nchX, double const* xbinsize, int nchY, double lowY, double highY, char const* option = "s");
ConcurrentMonitorElement bookProfile(TString const& name, TString const& title, int nchX, double const* xbinsize, double lowY, double highY, char const* option = "s");
ConcurrentMonitorElement bookProfile(TString const& name, TProfile* object);
ConcurrentMonitorElement bookProfile2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const* option = "s");
ConcurrentMonitorElement bookProfile2D(TString const& name, TString const& title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, char const* option = "s");
ConcurrentMonitorElement bookProfile2D(TString const& name, TProfile2D* object);

ConcurrentBooker() = delete;
ConcurrentBooker(ConcurrentBooker const&) = delete;
Expand Down Expand Up @@ -339,16 +344,10 @@ class DQMStore {
MonitorElement* book1S(char_string const& name,
char_string const& title,
int nchX, double lowX, double highX);
MonitorElement* book1S(char_string const& name,
char_string const& title,
int nchX, float const* xbinsize);
MonitorElement* book1S(char_string const& name, TH1S* h);
MonitorElement* book1DD(char_string const& name,
char_string const& title,
int nchX, double lowX, double highX);
MonitorElement* book1DD(char_string const& name,
char_string const& title,
int nchX, float const* xbinsize);
MonitorElement* book1DD(char_string const& name, TH1D* h);
MonitorElement* book2D(char_string const& name,
char_string const& title,
Expand All @@ -372,10 +371,6 @@ class DQMStore {
char_string const& title,
int nchX, double lowX, double highX,
int nchY, double lowY, double highY);
MonitorElement* book2DD(char_string const& name,
char_string const& title,
int nchX, float const* xbinsize,
int nchY, float const* ybinsize);
MonitorElement* book2DD(char_string const& name, TH2D* h);
MonitorElement* book3D(char_string const& name,
char_string const& title,
Expand Down