8 folderName_ ( iConfig.getParameter<
std::
string>(
"FolderName") )
10 , muonPt_variable_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"muonPtBinning") )
18 , muonSelectionGeneral_ ( iConfig.getParameter<
edm::
ParameterSet>(
"muonSelection").getParameter<
std::
string>(
"general") )
21 , nmuons_ ( iConfig.getParameter<unsigned
int>(
"nmuons" ) )
87 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, min, max);
88 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, min, max);
92 int nbins = binning.size()-1;
93 std::vector<float> fbinning(binning.begin(),binning.end());
94 float* arr = &fbinning[0];
95 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, arr);
96 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, arr);
100 me.
numerator = ibooker.
bookProfile(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
101 if(bookDen) me.
denominator = ibooker.
bookProfile(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
105 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
106 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
110 int nbinsX = binningX.size()-1;
111 std::vector<float> fbinningX(binningX.begin(),binningX.end());
112 float* arrX = &fbinningX[0];
113 int nbinsY = binningY.size()-1;
114 std::vector<float> fbinningY(binningY.begin(),binningY.end());
115 float* arrY = &fbinningY[0];
117 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, arrX, nbinsY, arrY);
118 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, arrX, nbinsY, arrY);
132 histname =
"muonPt"; histtitle =
"muonPt";
135 setTitle(
muonPtME_,
"DisplacedStandAlone Muon p_{T} [GeV]",
"Events / [GeV]", bookDen);
137 histname =
"muonPtNoDxyCut"; histtitle =
"muonPtNoDxyCut";
142 histname =
"muonPt_variable"; histtitle =
"muonPt";
147 histname =
"muonPtVsLS"; histtitle =
"muonPt vs LS";
152 histname =
"muonEta"; histtitle =
"muonEta";
157 histname =
"muonPhi"; histtitle =
"muonPhi";
162 histname =
"muonDxy"; histtitle =
"muonDxy";
173 histname =
"subMuonPt"; histtitle =
"subMuonPt";
176 setTitle(
subMuonPtME_,
"Subleading DisplacedStandAlone Muon p_{T} [GeV]",
"Events / [GeV]", bookDen);
178 histname =
"subMuonPt_variable"; histtitle =
"subMuonPt";
183 histname =
"subMuonEta"; histtitle =
"subMuonEta";
188 histname =
"subMuonPhi"; histtitle =
"subMuonPhi";
193 histname =
"subMuonDxy"; histtitle =
"subMuonDxy";
216 if ((
unsigned int)(DSAHandle->size()) <
nmuons_ )
return;
217 std::vector<edm::Ptr<reco::Track>> dsaMuonPtrs_{};
218 for (
size_t i(0);
i!=DSAHandle->size(); ++
i) {
219 dsaMuonPtrs_.emplace_back(DSAHandle,
i);
221 std::vector<edm::Ptr<reco::Track>>
muons{}, muonsCutOnPt{}, muonsCutOnDxy{}, muonsCutOnPtAndDxy{};
225 std::copy_if(dsaMuonPtrs_.begin(), dsaMuonPtrs_.end(), back_inserter(
muons), selectGeneral_);
234 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnPt), selectOnPt_);
237 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnDxy), selectOnDxy_);
240 std::copy_if(
muons.begin(),
muons.end(), back_inserter(muonsCutOnPtAndDxy), selectOnPtAndDxy_);
242 std::sort(muonsCutOnPt.begin(), muonsCutOnPt.end(), ptSorter_);
243 std::sort(muonsCutOnDxy.begin(), muonsCutOnDxy.end(), ptSorter_);
244 std::sort(muonsCutOnPtAndDxy.begin(), muonsCutOnPtAndDxy.end(), ptSorter_);
249 if(muonsCutOnDxy.size() >=
nmuons_) {
260 if(muonsCutOnPtAndDxy.size() >=
nmuons_) {
269 if(muonsCutOnPt.size() >=
nmuons_){
283 if(muonsCutOnDxy.size() >=
nmuons_) {
294 if(muonsCutOnPtAndDxy.size() >=
nmuons_) {
303 if(muonsCutOnPt.size() >=
nmuons_){
316 pset.
add<
unsigned int> (
"nbins", 200);
317 pset.
add<
double>(
"xmin", -0.5 );
318 pset.
add<
double>(
"xmax", 19999.5 );
323 pset.
add<
unsigned int> (
"nbins", 2000);
332 desc.
add<
unsigned int>(
"nmuons", 2);
335 muonSelection.add<
std::string>(
"general",
"pt > 0");
341 genericTriggerEventPSet.
add<
bool>(
"andOr");
343 genericTriggerEventPSet.add<std::vector<int> >(
"dcsPartitions",{});
344 genericTriggerEventPSet.add<
bool>(
"andOrDcs",
false);
345 genericTriggerEventPSet.add<
bool>(
"errorReplyDcs",
true);
346 genericTriggerEventPSet.add<
std::string>(
"dbLabel",
"");
347 genericTriggerEventPSet.add<
bool>(
"andOrHlt",
true);
349 genericTriggerEventPSet.add<std::vector<std::string> >(
"hltPaths",{});
350 genericTriggerEventPSet.add<
std::string>(
"hltDBKey",
"");
351 genericTriggerEventPSet.add<
bool>(
"errorReplyHlt",
false);
352 genericTriggerEventPSet.add<
unsigned int>(
"verbosityLevel",1);
373 std::vector<double>
bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,1000.};
374 histoPSet.add<std::vector<double> >(
"muonPtBinning",
bins);
378 descriptions.
add(
"DiDispStaMuonMonitoring", desc);
DiDispStaMuonME subMuonPtME_
T getParameter(std::string const &) const
~DiDispStaMuonMonitor() override
void setTitle(DiDispStaMuonME &me, const std::string &titleX, const std::string &titleY, bool bookDen)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
DiDispStaMuonME subMuonEtaME_
std::vector< double > muonPt_variable_binning_
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
MonitorElement * bookProfile(Args &&...args)
DiDispStaMuonME muonPtNoDxyCutME_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static MEbinning getHistoLSPSet(const edm::ParameterSet &pset)
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
DiDispStaMuonME muonPhiME_
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...
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * denominator
MEbinning muonPt_binning_
StringCutObjectSelector< reco::Track, true > muonSelectionGeneral_
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
DiDispStaMuonME subMuonDxyME_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
double pt() const
track transverse momentum
void bookME(DQMStore::IBooker &, DiDispStaMuonME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
MEbinning muonEta_binning_
DiDispStaMuonMonitor(const edm::ParameterSet &)
MonitorElement * book1D(Args &&...args)
MEbinning muonDxy_binning_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
StringCutObjectSelector< reco::Track, true > muonSelectionPt_
MonitorElement * numerator
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
MonitorElement * book2D(Args &&...args)
DiDispStaMuonME muonEtaME_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DiDispStaMuonME muonPtVsLS_
MEbinning muonPhi_binning_
DiDispStaMuonME subMuonPtME_variableBinning_
edm::EDGetTokenT< reco::TrackCollection > muonToken_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
DiDispStaMuonME muonDxyME_
DiDispStaMuonME subMuonPhiME_
DiDispStaMuonME muonPtME_
StringCutObjectSelector< reco::Track, true > muonSelectionDxy_
DiDispStaMuonME muonPtME_variableBinning_