Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions DQM/GEM/interface/GEMDQMEfficiencyCalculator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef DQM_GEM_GEMDQMEfficiencyCalculator_h
#define DQM_GEM_GEMDQMEfficiencyCalculator_h

/** GEMDQMEfficiencyCalculator
*
* \author Seungjin Yang <[email protected]>
*/

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

#include <vector>
#include <string>

class GEMDQMEfficiencyCalculator {
public:
typedef dqm::harvesting::DQMStore DQMStore;
typedef dqm::harvesting::MonitorElement MonitorElement;

GEMDQMEfficiencyCalculator();
~GEMDQMEfficiencyCalculator();

void drawEfficiency(DQMStore::IBooker&, DQMStore::IGetter&, const std::string&);

private:
TProfile* computeEfficiency(const TH1F*, const TH1F*, const char*, const char*);
TH2F* computeEfficiency(const TH2F*, const TH2F*, const char*, const char*);

const float kConfidenceLevel_ = 0.683;
const std::string kMatchedSuffix_ = "_matched";
const std::string kLogCategory_ = "GEMDQMEfficiencyCalculator";
};

#endif // DQM_GEM_GEMDQMEfficiencyCalculator_h
22 changes: 22 additions & 0 deletions DQM/GEM/plugins/GEMEffByGEMCSCSegmentClient.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "DQM/GEM/plugins/GEMEffByGEMCSCSegmentClient.h"

GEMEffByGEMCSCSegmentClient::GEMEffByGEMCSCSegmentClient(const edm::ParameterSet& parameter_set)
: kFolder_(parameter_set.getUntrackedParameter<std::string>("folder")),
kLogCategory_(parameter_set.getUntrackedParameter<std::string>("logCategory")) {
eff_calculator_ = std::make_unique<GEMDQMEfficiencyCalculator>();
}

void GEMEffByGEMCSCSegmentClient::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<std::string>("folder", "GEM/Efficiency/GEMCSCSegment");
desc.addUntracked<std::string>("logCategory", "GEMEffByGEMCSCSegmentClient");
descriptions.addWithDefaultLabel(desc);
}

void GEMEffByGEMCSCSegmentClient::dqmEndLuminosityBlock(DQMStore::IBooker& booker,
DQMStore::IGetter& getter,
edm::LuminosityBlock const&,
edm::EventSetup const&) {
eff_calculator_->drawEfficiency(booker, getter, kFolder_ + "/Efficiency");
eff_calculator_->drawEfficiency(booker, getter, kFolder_ + "/Misc");
}
39 changes: 39 additions & 0 deletions DQM/GEM/plugins/GEMEffByGEMCSCSegmentClient.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef DQM_GEM_GEMEffByGEMCSCSegmentClient_h
#define DQM_GEM_GEMEffByGEMCSCSegmentClient_h

/** \class GEMEffByGEMCSCSegmentClient
*
* `GEMEffByGEMCSCSegmentSource` measures the efficiency of GE11-L1(2) using GE11-L2(1) and ME11 as trigger detectors.
* See https://github.com/cms-sw/cmssw/blob/CMSSW_12_3_0_pre5/RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegAlgoRR.cc
*
* \author Seungjin Yang <[email protected]>
*/

#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "DQM/GEM/interface/GEMDQMEfficiencyCalculator.h"

class GEMEffByGEMCSCSegmentClient : public DQMEDHarvester {
public:
GEMEffByGEMCSCSegmentClient(const edm::ParameterSet &);
~GEMEffByGEMCSCSegmentClient() override{};
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);

protected:
void dqmEndLuminosityBlock(DQMStore::IBooker &,
DQMStore::IGetter &,
edm::LuminosityBlock const &,
edm::EventSetup const &) override;

void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override{};

// initialized in the constructor initializer list
const std::string kFolder_;
const std::string kLogCategory_;

std::unique_ptr<GEMDQMEfficiencyCalculator> eff_calculator_;
};

#endif // DQM_GEM_GEMEffByGEMCSCSegmentClient_h
Loading