69 requireValidHLTPaths_(
iConfig.getParameter<
bool>("requireValidHLTPaths")),
70 hltPathsAreValid_(
false),
72 muonPt_variable_binning_(
85 iConfig.getParameter<edm::
ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
87 iConfig.getParameter<edm::
ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
88 muonSelectionGeneral_(
92 nmuons_(
iConfig.getParameter<
unsigned int>("nmuons")) {}
131 histtitle =
"muonPt";
136 histname =
"muonPtNoDxyCut";
137 histtitle =
"muonPtNoDxyCut";
147 histname =
"muonPt_variable";
148 histtitle =
"muonPt";
152 histname =
"muonPtVsLS";
153 histtitle =
"muonPt vs LS";
165 histname =
"muonEta";
166 histtitle =
"muonEta";
171 histname =
"muonPhi";
172 histtitle =
"muonPhi";
177 histname =
"muonDxy";
178 histtitle =
"muonDxy";
184 histname =
"subMuonPt";
185 histtitle =
"subMuonPt";
190 histname =
"subMuonPt_variable";
191 histtitle =
"subMuonPt";
195 histname =
"subMuonEta";
196 histtitle =
"subMuonEta";
206 histname =
"subMuonPhi";
207 histtitle =
"subMuonPhi";
217 histname =
"subMuonDxy";
218 histtitle =
"subMuonDxy";
245 if ((
unsigned int)(DSAHandle->size()) <
nmuons_)
247 std::vector<edm::Ptr<reco::Track>> dsaMuonPtrs_{};
248 for (
size_t i(0);
i != DSAHandle->size(); ++
i) {
249 dsaMuonPtrs_.emplace_back(DSAHandle,
i);
251 std::vector<edm::Ptr<reco::Track>>
muons{}, muonsCutOnPt{}, muonsCutOnDxy{}, muonsCutOnPtAndDxy{};
255 std::copy_if(dsaMuonPtrs_.begin(), dsaMuonPtrs_.end(), back_inserter(
muons), selectGeneral_);
261 return lhs->pt() > rhs->pt();
263 std::sort(
muons.begin(),
muons.end(), ptSorter_);
267 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnPt), selectOnPt_);
270 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnDxy), selectOnDxy_);
272 auto selectOnPtAndDxy_(
274 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnPtAndDxy), selectOnPtAndDxy_);
276 std::sort(muonsCutOnPt.begin(), muonsCutOnPt.end(), ptSorter_);
277 std::sort(muonsCutOnDxy.begin(), muonsCutOnDxy.end(), ptSorter_);
278 std::sort(muonsCutOnPtAndDxy.begin(), muonsCutOnPtAndDxy.end(), ptSorter_);
283 if (muonsCutOnDxy.size() >=
nmuons_) {
294 if (muonsCutOnPtAndDxy.size() >=
nmuons_) {
303 if (muonsCutOnPt.size() >=
nmuons_) {
317 if (muonsCutOnDxy.size() >=
nmuons_) {
328 if (muonsCutOnPtAndDxy.size() >=
nmuons_) {
337 if (muonsCutOnPt.size() >=
nmuons_) {
349 desc.
add<
bool>(
"requireValidHLTPaths",
true);
352 desc.
add<
unsigned int>(
"nmuons", 2);
355 muonSelection.add<
std::string>(
"general",
"pt > 0");
361 genericTriggerEventPSet.
add<
bool>(
"andOr");
363 genericTriggerEventPSet.add<std::vector<int>>(
"dcsPartitions", {});
364 genericTriggerEventPSet.add<
bool>(
"andOrDcs",
false);
365 genericTriggerEventPSet.add<
bool>(
"errorReplyDcs",
true);
366 genericTriggerEventPSet.add<
std::string>(
"dbLabel",
"");
367 genericTriggerEventPSet.add<
bool>(
"andOrHlt",
true);
369 genericTriggerEventPSet.add<std::vector<std::string>>(
"hltPaths", {});
370 genericTriggerEventPSet.add<
std::string>(
"hltDBKey",
"");
371 genericTriggerEventPSet.add<
bool>(
"errorReplyHlt",
false);
372 genericTriggerEventPSet.add<
unsigned int>(
"verbosityLevel", 1);
393 std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
394 170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
395 histoPSet.
add<std::vector<double>>(
"muonPtBinning", bins);
399 descriptions.
add(
"DiDispStaMuonMonitoring", desc);
~DiDispStaMuonMonitor() override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< double > muonPt_variable_binning_
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const bool requireValidHLTPaths_
std::vector< Track > TrackCollection
collection of Tracks
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
const std::string folderName_
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
LuminosityBlockNumber_t luminosityBlock() const
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
MEbinning muonPt_binning_
dqm::reco::MonitorElement MonitorElement
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
StringCutObjectSelector< reco::Track, true > muonSelectionDxy_
StringCutObjectSelector< reco::Track, true > muonSelectionGeneral_
MEbinning muonEta_binning_
MonitorElement * denominator
DiDispStaMuonMonitor(const edm::ParameterSet &)
MonitorElement * numerator
MEbinning muonDxy_binning_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ObjME muonPtME_variableBinning_
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
dqm::reco::DQMStore DQMStore
ObjME subMuonPtME_variableBinning_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StringCutObjectSelector< reco::Track, true > muonSelectionPt_
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MEbinning muonPhi_binning_
edm::EDGetTokenT< reco::TrackCollection > muonToken_