31 vertex_ = consumes<reco::VertexCollection>(
33 theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
35 lumiSummaryToken_ = consumes<LumiSummary, edm::InLumi>(
38 global_background =
NULL;
39 diMuonMass_global =
NULL;
40 tracker_background =
NULL;
41 diMuonMass_tracker =
NULL;
42 standalone_background =
NULL;
43 diMuonMass_standalone =
NULL;
70 theDbe->setCurrentFolder(
72 global_background = theDbe->book1D(
73 "global_background",
"Same-sign global-global dimuon mass", 750, 0, 15);
75 theDbe->book1D(
"diMuonMass_global",
76 "Opposite-sign global-global dimuon mass", 750, 0, 15);
77 tracker_background = theDbe->book1D(
79 "Same-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
80 diMuonMass_tracker = theDbe->book1D(
82 "Opposite-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
83 standalone_background = theDbe->book1D(
84 "standalone_background",
"Same-sign standalone-standalone dimuon mass",
86 diMuonMass_standalone = theDbe->book1D(
87 "diMuonMass_standalone",
88 "Opposite-sign standalone-standalone dimuon mass", 500, 0, 15);
90 glbSigCut = theDbe->book1D(
"glbSigCut",
"Opposite-sign glb-glb dimuon mass",
92 glbSigNoCut = theDbe->book1D(
"glbSigNoCut",
93 "Opposite-sign glb-glb dimuon mass (no cut)",
95 glbBkgNoCut = theDbe->book1D(
96 "glbBkgNoCut",
"Same-sign glb-glb dimuon mass (no cut)", 650, 0, 130);
97 staSigCut = theDbe->book1D(
"staSigCut",
"Opposite-sign sta-sta dimuon mass",
99 staSigNoCut = theDbe->book1D(
"staSigNoCut",
100 "Opposite-sign sta-sta dimuon mass (no cut)",
102 staBkgNoCut = theDbe->book1D(
103 "staBkgNoCut",
"Same-sign sta-sta dimuon mass (no cut)", 430, 0, 129);
104 trkSigCut = theDbe->book1D(
"trkSigCut",
"Opposite-sign trk-trk dimuon mass",
106 trkSigNoCut = theDbe->book1D(
"trkSigNoCut",
107 "Opposite-sign trk-trk dimuon mass (no cut)",
109 trkBkgNoCut = theDbe->book1D(
110 "trkBkgNoCutt",
"Same-sign trk-trk dimuon mass (no cut)", 650, 0, 130);
120 iEvent.
getByToken(theMuonCollectionLabel_, muons);
124 VertexCollection::const_iterator privtx;
126 if (privtxs->begin() != privtxs->end()) {
127 privtx = privtxs->begin();
128 RefVtx = privtx->position();
130 RefVtx.SetXYZ(0., 0., 0.);
134 for (MuonCollection::const_iterator recoMu1 = muons->begin();
135 recoMu1 != muons->end(); ++recoMu1) {
138 if (recoMu1->isGlobalMuon() || recoMu1->isTrackerMuon() ||
139 recoMu1->isStandAloneMuon()) {
140 for (MuonCollection::const_iterator recoMu2 = recoMu1 + 1;
141 recoMu2 != muons->end(); ++recoMu2) {
145 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()) {
148 float massJPsi = computeMass(vec1, vec2);
151 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
152 if (diMuonMass_global !=
NULL) {
153 diMuonMass_global->Fill(massJPsi);
156 if (glbSigNoCut !=
NULL) {
157 glbSigNoCut->Fill(massJPsi);
158 if (selGlobalMuon(*recoMu1) && selGlobalMuon(*recoMu2)) {
159 if (glbSigCut !=
NULL) glbSigCut->Fill(massJPsi);
160 if (massJPsi >= 3.0 && massJPsi <= 3.2) jpsiGlbSigPerLS++;
164 if (global_background !=
NULL) {
165 global_background->Fill(massJPsi);
168 if (glbBkgNoCut !=
NULL) {
169 glbBkgNoCut->Fill(massJPsi);
174 if (recoMu1->isStandAloneMuon() && recoMu2->isStandAloneMuon() &&
175 fabs(recoMu1->outerTrack()->d0()) < 5 &&
176 fabs(recoMu1->outerTrack()->dz()) < 30 &&
177 fabs(recoMu2->outerTrack()->d0()) < 5 &&
178 fabs(recoMu2->outerTrack()->dz()) < 30) {
181 float massJPsi = computeMass(vec1, vec2);
184 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
185 if (diMuonMass_standalone !=
NULL) {
186 diMuonMass_standalone->Fill(massJPsi);
189 if (staSigNoCut !=
NULL) {
190 staSigNoCut->Fill(massJPsi);
198 if (standalone_background !=
NULL) {
199 standalone_background->Fill(massJPsi);
202 if (staBkgNoCut !=
NULL) {
203 staBkgNoCut->Fill(massJPsi);
208 if (recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon() &&
213 float massJPsi = computeMass(vec1, vec2);
216 if (((*recoMu1).charge() * (*recoMu2).charge()) < 0) {
217 if (diMuonMass_tracker !=
NULL) {
218 diMuonMass_tracker->Fill(massJPsi);
221 if (trkSigNoCut !=
NULL) {
222 trkSigNoCut->Fill(massJPsi);
223 if (selTrackerMuon(*recoMu1) && selTrackerMuon(*recoMu2)) {
224 if (trkSigCut !=
NULL) trkSigCut->Fill(massJPsi);
225 if (massJPsi >= 3.0 && massJPsi <= 3.2) jpsiTrkSigPerLS++;
229 if (tracker_background !=
NULL) {
230 tracker_background->Fill(massJPsi);
233 if (trkBkgNoCut !=
NULL) {
234 trkBkgNoCut->Fill(massJPsi);
263 lumiBlock.
getByToken(lumiSummaryToken_, lumiSummary);
267 jpsiGlbSig.insert(pair<int, int>(LBlockNum, jpsiGlbSigPerLS));
268 jpsiStaSig.insert(pair<int, int>(LBlockNum, jpsiStaSigPerLS));
269 jpsiTrkSig.insert(pair<int, int>(LBlockNum, jpsiTrkSigPerLS));
273 if (jpsiGlbSig.size() % 5 != 0)
return;
275 theDbe->setCurrentFolder(
"Physics/BPhysics");
324 if (!jpsiGlbSig.empty()) {
334 float massMu = 0.10566;
336 if (massMu * massMu + vec1.Mag2() > 0)
337 eMu1 =
sqrt(massMu * massMu + vec1.Mag2());
339 if (massMu * massMu + vec2.Mag2() > 0)
340 eMu2 =
sqrt(massMu * massMu + vec2.Mag2());
343 if ((vec1 + vec2).Mag2() > 0) pJPsi =
sqrt((vec1 + vec2).Mag2());
344 float eJPsi = eMu1 + eMu2;
346 float massJPsi = -999;
347 if ((eJPsi * eJPsi - pJPsi * pJPsi) > 0)
348 massJPsi =
sqrt(eJPsi * eJPsi - pJPsi * pJPsi);
354 return (fabs(recoMu.
eta()) < 2.4 &&
355 ((fabs(recoMu.
eta()) < 1.3 && recoMu.
pt() > 3.3) ||
356 (fabs(recoMu.
eta()) > 1.3 && fabs(recoMu.
eta()) < 2.2 &&
358 (fabs(recoMu.
eta()) > 2.2 && recoMu.
pt() > 0.8)));
368 return (isMuonInAccept(recoMu) && iTrack->found() > 11 &&
369 gTrack->chi2() / gTrack->ndof() < 20.0 &&
371 iTrack->chi2() / iTrack->ndof() < 4.0 &&
375 fabs(iTrack->dxy(RefVtx)) < 3.0 && fabs(iTrack->dz(RefVtx)) < 15.0);
382 return (isMuonInAccept(recoMu) && iTrack->found() > 11 &&
383 iTrack->chi2() / iTrack->ndof() < 4.0 &&
387 fabs(iTrack->dxy(RefVtx)) < 3.0 && fabs(iTrack->dz(RefVtx)) < 15.0);
LuminosityBlockID id() const
T getParameter(std::string const &) const
virtual double p() const
magnitude of momentum vector
bool selGlobalMuon(const reco::Muon &recoMu)
virtual float pt() const
transverse momentum
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
int pixelLayersWithMeasurement() const
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
bool isMuonInAccept(const reco::Muon &recoMu)
std::vector< double > vec1
virtual float eta() const
momentum pseudorapidity
BPhysicsOniaDQM(const edm::ParameterSet &)
Constructor.
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
LuminosityBlockNumber_t luminosityBlock() const
bool selTrackerMuon(const reco::Muon &recoMu)
void endRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
void beginJob()
Inizialize parameters for histo binning.
float computeMass(const math::XYZVector &vec1, const math::XYZVector &vec2)
virtual ~BPhysicsOniaDQM()
Destructor.
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
int numberOfValidMuonHits() const
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)