30 vertex_ = consumes<reco::VertexCollection>(
parameters.getParameter<
InputTag>(
"vertex"));
31 theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
parameters.getParameter<
InputTag>(
"MuonCollection"));
32 lumiSummaryToken_ = consumes<LumiSummary, edm::InLumi>(
parameters.getParameter<
InputTag>(
"lumiSummary"));
34 global_background =
nullptr;
35 diMuonMass_global =
nullptr;
36 tracker_background =
nullptr;
37 diMuonMass_tracker =
nullptr;
38 standalone_background =
nullptr;
39 diMuonMass_standalone =
nullptr;
42 glbSigNoCut =
nullptr;
43 glbBkgNoCut =
nullptr;
45 staSigNoCut =
nullptr;
46 staBkgNoCut =
nullptr;
48 trkSigNoCut =
nullptr;
49 trkBkgNoCut =
nullptr;
59 global_background = iBooker.
book1D(
"global_background",
"Same-sign global-global dimuon mass", 750, 0, 15);
60 diMuonMass_global = iBooker.
book1D(
"diMuonMass_global",
"Opposite-sign global-global dimuon mass", 750, 0, 15);
62 iBooker.
book1D(
"tracker_background",
"Same-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
64 iBooker.
book1D(
"diMuonMass_tracker",
"Opposite-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
65 standalone_background =
66 iBooker.
book1D(
"standalone_background",
"Same-sign standalone-standalone dimuon mass", 500, 0, 15);
67 diMuonMass_standalone =
68 iBooker.
book1D(
"diMuonMass_standalone",
"Opposite-sign standalone-standalone dimuon mass", 500, 0, 15);
70 glbSigCut = iBooker.
book1D(
"glbSigCut",
"Opposite-sign glb-glb dimuon mass", 650, 0, 130);
71 glbSigNoCut = iBooker.
book1D(
"glbSigNoCut",
"Opposite-sign glb-glb dimuon mass (no cut)", 650, 0, 130);
72 glbBkgNoCut = iBooker.
book1D(
"glbBkgNoCut",
"Same-sign glb-glb dimuon mass (no cut)", 650, 0, 130);
73 staSigCut = iBooker.
book1D(
"staSigCut",
"Opposite-sign sta-sta dimuon mass", 430, 0, 129);
74 staSigNoCut = iBooker.
book1D(
"staSigNoCut",
"Opposite-sign sta-sta dimuon mass (no cut)", 430, 0, 129);
75 staBkgNoCut = iBooker.
book1D(
"staBkgNoCut",
"Same-sign sta-sta dimuon mass (no cut)", 430, 0, 129);
76 trkSigCut = iBooker.
book1D(
"trkSigCut",
"Opposite-sign trk-trk dimuon mass", 650, 0, 130);
77 trkSigNoCut = iBooker.
book1D(
"trkSigNoCut",
"Opposite-sign trk-trk dimuon mass (no cut)", 650, 0, 130);
78 trkBkgNoCut = iBooker.
book1D(
"trkBkgNoCutt",
"Same-sign trk-trk dimuon mass (no cut)", 650, 0, 130);
89 iEvent.getByToken(vertex_, privtxs);
90 VertexCollection::const_iterator privtx;
92 if (privtxs->begin() != privtxs->end()) {
93 privtx = privtxs->begin();
94 RefVtx = privtx->position();
96 RefVtx.SetXYZ(0., 0., 0.);
99 if (
muons.isValid()) {
100 for (MuonCollection::const_iterator recoMu1 =
muons->begin(); recoMu1 !=
muons->end(); ++recoMu1) {
102 if (recoMu1->isGlobalMuon() || recoMu1->isTrackerMuon() || recoMu1->isStandAloneMuon()) {
103 for (MuonCollection::const_iterator recoMu2 = recoMu1 + 1; recoMu2 !=
muons->end(); ++recoMu2) {
106 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()) {
109 float massJPsi = computeMass(
vec1,
vec2);
112 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
113 if (diMuonMass_global !=
nullptr) {
114 diMuonMass_global->Fill(massJPsi);
117 if (glbSigNoCut !=
nullptr) {
118 glbSigNoCut->Fill(massJPsi);
119 if (selGlobalMuon(*recoMu1) && selGlobalMuon(*recoMu2)) {
120 if (glbSigCut !=
nullptr)
121 glbSigCut->Fill(massJPsi);
125 if (global_background !=
nullptr) {
126 global_background->Fill(massJPsi);
129 if (glbBkgNoCut !=
nullptr) {
130 glbBkgNoCut->Fill(massJPsi);
135 if (recoMu1->isStandAloneMuon() && recoMu2->isStandAloneMuon() && fabs(recoMu1->outerTrack()->d0()) < 5 &&
136 fabs(recoMu1->outerTrack()->dz()) < 30 && fabs(recoMu2->outerTrack()->d0()) < 5 &&
137 fabs(recoMu2->outerTrack()->dz()) < 30) {
140 float massJPsi = computeMass(
vec1,
vec2);
143 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
144 if (diMuonMass_standalone !=
nullptr) {
145 diMuonMass_standalone->Fill(massJPsi);
148 if (staSigNoCut !=
nullptr) {
149 staSigNoCut->Fill(massJPsi);
152 if (standalone_background !=
nullptr) {
153 standalone_background->Fill(massJPsi);
156 if (staBkgNoCut !=
nullptr) {
157 staBkgNoCut->Fill(massJPsi);
162 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon() &&
167 float massJPsi = computeMass(
vec1,
vec2);
170 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
171 if (diMuonMass_tracker !=
nullptr) {
172 diMuonMass_tracker->Fill(massJPsi);
175 if (trkSigNoCut !=
nullptr) {
176 trkSigNoCut->Fill(massJPsi);
177 if (selTrackerMuon(*recoMu1) && selTrackerMuon(*recoMu2)) {
178 if (trkSigCut !=
nullptr)
179 trkSigCut->Fill(massJPsi);
183 if (tracker_background !=
nullptr) {
184 tracker_background->Fill(massJPsi);
187 if (trkBkgNoCut !=
nullptr) {
188 trkBkgNoCut->Fill(massJPsi);
200 float massMu = 0.10566;
202 if (massMu * massMu +
vec1.Mag2() > 0)
203 eMu1 =
sqrt(massMu * massMu +
vec1.Mag2());
205 if (massMu * massMu +
vec2.Mag2() > 0)
206 eMu2 =
sqrt(massMu * massMu +
vec2.Mag2());
211 float eJPsi = eMu1 + eMu2;
213 float massJPsi = -999;
214 if ((eJPsi * eJPsi - pJPsi * pJPsi) > 0)
215 massJPsi =
sqrt(eJPsi * eJPsi - pJPsi * pJPsi);
221 return (fabs(recoMu.
eta()) < 2.4 && ((fabs(recoMu.
eta()) < 1.3 && recoMu.
pt() > 3.3) ||
222 (fabs(recoMu.
eta()) > 1.3 && fabs(recoMu.
eta()) < 2.2 && recoMu.
p() > 2.9) ||
223 (fabs(recoMu.
eta()) > 2.2 && recoMu.
pt() > 0.8)));
233 return (isMuonInAccept(recoMu) && iTrack->found() > 11 && gTrack->chi2() / gTrack->ndof() < 20.0 &&
234 q.numberOfValidMuonHits() > 0 && iTrack->chi2() / iTrack->ndof() < 4.0 &&
237 p.pixelLayersWithMeasurement() > 1 && fabs(iTrack->dxy(RefVtx)) < 3.0 && fabs(iTrack->dz(RefVtx)) < 15.0);
244 return (isMuonInAccept(recoMu) && iTrack->found() > 11 && iTrack->chi2() / iTrack->ndof() < 4.0 &&
247 p.pixelLayersWithMeasurement() > 1 && fabs(iTrack->dxy(RefVtx)) < 3.0 && fabs(iTrack->dz(RefVtx)) < 15.0);
bool selGlobalMuon(const reco::Muon &recoMu)
double pt() const final
transverse momentum
virtual void setCurrentFolder(std::string const &fullpath)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
const std::string metname
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
double p() const final
magnitude of momentum vector
bool isMuonInAccept(const reco::Muon &recoMu)
std::vector< double > vec1
BPhysicsOniaDQM(const edm::ParameterSet &)
Constructor.
~BPhysicsOniaDQM() override
Destructor.
virtual TrackRef innerTrack() const
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
XYZVectorD XYZVector
spatial vector with cartesian internal representation
bool selTrackerMuon(const reco::Muon &recoMu)
float computeMass(const math::XYZVector &vec1, const math::XYZVector &vec2)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double eta() const final
momentum pseudorapidity