Skip to content

Commit

Permalink
basic improvements in V0Monitor
Browse files Browse the repository at this point in the history
- added fillDescriptions
- const correctness member in initializer list
- correct inclusion guards as per coding rule 4.1
  • Loading branch information
mmusich committed Jun 5, 2024
1 parent a4dce6d commit 2566f9d
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 31 deletions.
46 changes: 22 additions & 24 deletions DQM/TrackingMonitor/interface/V0Monitor.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
#ifndef LUMIMONITOR_H
#define LUMIMONITOR_H
#ifndef DQM_TRACKINGMONITOR_V0MONITOR_H
#define DQM_TRACKINGMONITOR_V0MONITOR_H

#include <string>
#include <vector>
#include <map>

#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include <DQMServices/Core/interface/DQMEDAnalyzer.h>

#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
#include "DataFormats/V0Candidate/interface/V0Candidate.h"
#include "DataFormats/OnlineMetaData/interface/OnlineLuminosityRecord.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"

#include "DataFormats/Scalers/interface/LumiScalers.h"
#include "DataFormats/V0Candidate/interface/V0Candidate.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"

#include "DataFormats/Scalers/interface/LumiScalers.h"
#include "DataFormats/OnlineMetaData/interface/OnlineLuminosityRecord.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/EDGetToken.h"

class GenericTriggerEventFlag;

Expand All @@ -45,6 +42,8 @@ class V0Monitor : public DQMEDAnalyzer {
V0Monitor(const edm::ParameterSet&);
~V0Monitor() override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

protected:
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
MonitorElement* bookHisto1D(DQMStore::IBooker& ibooker,
Expand Down Expand Up @@ -72,17 +71,16 @@ class V0Monitor : public DQMEDAnalyzer {
private:
void getHistoPSet(edm::ParameterSet pset, MEbinning& mebinning);

std::string folderName_;
const std::string folderName_;

edm::EDGetTokenT<reco::VertexCompositeCandidateCollection> v0Token_;
edm::EDGetTokenT<reco::BeamSpot> bsToken_;
edm::EDGetTokenT<reco::VertexCollection> pvToken_;
edm::EDGetTokenT<LumiScalersCollection> lumiscalersToken_;
edm::EDGetTokenT<OnlineLuminosityRecord> metaDataToken_;
const edm::EDGetTokenT<reco::VertexCompositeCandidateCollection> v0Token_;
const edm::EDGetTokenT<reco::BeamSpot> bsToken_;
const edm::EDGetTokenT<reco::VertexCollection> pvToken_;
const edm::EDGetTokenT<LumiScalersCollection> lumiscalersToken_;
const edm::EDGetTokenT<OnlineLuminosityRecord> metaDataToken_;

const bool forceSCAL_;

int pvNDOF_;
const int pvNDOF_;

GenericTriggerEventFlag* genTriggerEventFlag_;

Expand Down Expand Up @@ -136,4 +134,4 @@ class V0Monitor : public DQMEDAnalyzer {
MEbinning ls_binning_;
};

#endif // LUMIMONITOR_H
#endif // DQM_TRACKINGMONITOR_V0MONITOR_H
91 changes: 84 additions & 7 deletions DQM/TrackingMonitor/src/V0Monitor.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,94 @@
#include "DQM/TrackingMonitor/interface/V0Monitor.h"
#include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "RecoVertex/VertexTools/interface/VertexDistance3D.h"
#include "DQM/TrackingMonitor/interface/V0Monitor.h"
#include "DataFormats/VertexReco/interface/Vertex.h"

#include "DQM/TrackingMonitor/interface/GetLumi.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

// -----------------------------
// constructors and destructor
// -----------------------------

// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
void V0Monitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("FolderName", "Tracking/V0Monitoring");
desc.add<edm::InputTag>("v0", edm::InputTag("generalV0Candidates:Kshort"));
desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
desc.add<edm::InputTag>("lumiScalers", edm::InputTag("scalersRawToDigi"));
desc.add<bool>("forceSCAL", true);
desc.add<edm::InputTag>("metadata", edm::InputTag("onlineMetaDataDigis"));
desc.add<int>("pvNDOF", 4);

{
edm::ParameterSetDescription psd0;
{
edm::ParameterSetDescription psd1;
psd1.add<int>("nbins", 3700);
psd1.add<double>("xmin", 0.);
psd1.add<double>("xmax", 14000.);
psd0.add<edm::ParameterSetDescription>("lumiPSet", psd1);
}
{
edm::ParameterSetDescription psd2;
psd2.add<int>("nbins", 100);
psd2.add<double>("xmin", 0.400);
psd2.add<double>("xmax", 0.600);
psd0.add<edm::ParameterSetDescription>("massPSet", psd2);
}
{
edm::ParameterSetDescription psd3;
psd3.add<int>("nbins", 100);
psd3.add<double>("xmin", 0.);
psd3.add<double>("xmax", 50.);
psd0.add<edm::ParameterSetDescription>("ptPSet", psd3);
}
{
edm::ParameterSetDescription psd4;
psd4.add<int>("nbins", 60);
psd4.add<double>("xmin", -3.);
psd4.add<double>("xmax", 3.);
psd0.add<edm::ParameterSetDescription>("etaPSet", psd4);
}
{
edm::ParameterSetDescription psd5;
psd5.add<int>("nbins", 350);
psd5.add<double>("xmin", 0.);
psd5.add<double>("xmax", 70.);
psd0.add<edm::ParameterSetDescription>("LxyPSet", psd5);
}
{
edm::ParameterSetDescription psd6;
psd6.add<int>("nbins", 100);
psd6.add<double>("xmin", 0.);
psd6.add<double>("xmax", 30.);
psd0.add<edm::ParameterSetDescription>("chi2oNDFPSet", psd6);
}
{
edm::ParameterSetDescription psd7;
psd7.add<int>("nbins", 100);
psd7.add<double>("xmin", -0.5);
psd7.add<double>("xmax", 99.5);
psd0.add<edm::ParameterSetDescription>("puPSet", psd7);
}
{
edm::ParameterSetDescription psd8;
psd8.add<int>("nbins", 2000);
psd8.add<double>("xmin", 0.);
psd8.add<double>("xmax", 2000.);
psd0.add<edm::ParameterSetDescription>("lsPSet", psd8);
}
desc.add<edm::ParameterSetDescription>("histoPSet", psd0);
}

{
edm::ParameterSetDescription genericTriggerEventPSet;
GenericTriggerEventFlag::fillPSetDescription(genericTriggerEventPSet);
desc.add<edm::ParameterSetDescription>("genericTriggerEventPSet", genericTriggerEventPSet);
}

descriptions.addWithDefaultLabel(desc);
}

V0Monitor::V0Monitor(const edm::ParameterSet& iConfig)
: folderName_(iConfig.getParameter<std::string>("FolderName")),
v0Token_(consumes<reco::VertexCompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("v0"))),
Expand Down

0 comments on commit 2566f9d

Please sign in to comment.