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;
71 theDbe->setCurrentFolder(
"Physics/BPhysics");
72 global_background = theDbe->book1D(
"global_background",
"Same-sign global-global dimuon mass", 750, 0, 15);
73 diMuonMass_global = theDbe->book1D(
"diMuonMass_global",
"Opposite-sign global-global dimuon mass", 750, 0, 15);
74 tracker_background = theDbe->book1D(
"tracker_background",
"Same-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
75 diMuonMass_tracker = theDbe->book1D(
"diMuonMass_tracker",
"Opposite-sign tracker-tracker (arbitrated) dimuon mass", 750, 0, 15);
76 standalone_background = theDbe->book1D(
"standalone_background",
"Same-sign standalone-standalone dimuon mass", 500, 0, 15);
77 diMuonMass_standalone = theDbe->book1D(
"diMuonMass_standalone",
"Opposite-sign standalone-standalone dimuon mass", 500, 0, 15);
79 glbSigCut = theDbe->book1D(
"glbSigCut",
"Opposite-sign glb-glb dimuon mass", 650, 0, 130);
80 glbSigNoCut = theDbe->book1D(
"glbSigNoCut",
"Opposite-sign glb-glb dimuon mass (no cut)", 650, 0, 130);
81 glbBkgNoCut = theDbe->book1D(
"glbBkgNoCut",
"Same-sign glb-glb dimuon mass (no cut)", 650, 0, 130);
82 staSigCut = theDbe->book1D(
"staSigCut",
"Opposite-sign sta-sta dimuon mass", 430, 0, 129);
83 staSigNoCut = theDbe->book1D(
"staSigNoCut",
"Opposite-sign sta-sta dimuon mass (no cut)", 430, 0, 129);
84 staBkgNoCut = theDbe->book1D(
"staBkgNoCut",
"Same-sign sta-sta dimuon mass (no cut)", 430, 0, 129);
85 trkSigCut = theDbe->book1D(
"trkSigCut",
"Opposite-sign trk-trk dimuon mass", 650, 0, 130);
86 trkSigNoCut = theDbe->book1D(
"trkSigNoCut",
"Opposite-sign trk-trk dimuon mass (no cut)", 650, 0, 130);
87 trkBkgNoCut = theDbe->book1D(
"trkBkgNoCutt",
"Same-sign trk-trk dimuon mass (no cut)", 650, 0, 130);
98 iEvent.
getByToken(theMuonCollectionLabel_ ,muons);
102 VertexCollection::const_iterator privtx;
104 if(privtxs->begin() != privtxs->end()){
105 privtx = privtxs->begin();
106 RefVtx = privtx->position();
108 RefVtx.SetXYZ(0.,0.,0.);
112 for (MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1){
115 if(recoMu1->isGlobalMuon() || recoMu1->isTrackerMuon() || recoMu1->isStandAloneMuon()){
116 for (MuonCollection::const_iterator recoMu2 = recoMu1+1; recoMu2!=muons->end(); ++recoMu2){
119 if (recoMu1->isGlobalMuon() && recoMu2->isGlobalMuon()){
122 float massJPsi = computeMass(vec1,vec2);
125 if (((*recoMu1).charge()*(*recoMu2).charge())<0) {
126 if(diMuonMass_global!=
NULL){
127 diMuonMass_global->Fill(massJPsi);
130 if(glbSigNoCut!=
NULL){
131 glbSigNoCut->Fill(massJPsi);
132 if (selGlobalMuon(*recoMu1) && selGlobalMuon(*recoMu2)) {
133 if (glbSigCut!=
NULL) glbSigCut->Fill(massJPsi);
134 if (massJPsi >= 3.0 && massJPsi <= 3.2) jpsiGlbSigPerLS++;
138 if(global_background!=
NULL){
139 global_background->Fill (massJPsi);
142 if(glbBkgNoCut!=
NULL){
143 glbBkgNoCut->Fill(massJPsi);
148 if(recoMu1->isStandAloneMuon() && recoMu2->isStandAloneMuon() &&
149 fabs(recoMu1->outerTrack()->d0()) < 5 && fabs(recoMu1->outerTrack()->dz()) < 30 &&
150 fabs(recoMu2->outerTrack()->d0()) < 5 && fabs(recoMu2->outerTrack()->dz()) < 30){
153 float massJPsi = computeMass(vec1,vec2);
156 if (((*recoMu1).charge()*(*recoMu2).charge())<0) {
157 if(diMuonMass_standalone!=
NULL){
158 diMuonMass_standalone->Fill(massJPsi);
161 if(staSigNoCut!=
NULL){
162 staSigNoCut->Fill(massJPsi);
169 if(standalone_background!=
NULL){
170 standalone_background->Fill (massJPsi);
173 if(staBkgNoCut!=
NULL){
174 staBkgNoCut->Fill(massJPsi);
179 if(recoMu1->isTrackerMuon() && recoMu2->isTrackerMuon() &&
184 float massJPsi = computeMass(vec1,vec2);
187 if (((*recoMu1).charge()*(*recoMu2).charge())<0) {
188 if(diMuonMass_tracker!=
NULL){
189 diMuonMass_tracker->Fill(massJPsi);
192 if(trkSigNoCut!=
NULL){
193 trkSigNoCut->Fill(massJPsi);
194 if (selTrackerMuon(*recoMu1) && selTrackerMuon(*recoMu2)) {
195 if (trkSigCut!=
NULL) trkSigCut->Fill(massJPsi);
196 if(massJPsi >= 3.0 && massJPsi <= 3.2) jpsiTrkSigPerLS++;
200 if(tracker_background!=
NULL){
201 tracker_background->Fill (massJPsi);
204 if(trkBkgNoCut!=
NULL){
205 trkBkgNoCut->Fill(massJPsi);
235 lumiBlock.
getByToken(lumiSummaryToken_, lumiSummary);
239 jpsiGlbSig.insert( pair<int,int>(LBlockNum, jpsiGlbSigPerLS) );
240 jpsiStaSig.insert( pair<int,int>(LBlockNum, jpsiStaSigPerLS) );
241 jpsiTrkSig.insert( pair<int,int>(LBlockNum, jpsiTrkSigPerLS) );
244 if (jpsiGlbSig.size()%5 != 0)
return;
246 theDbe->setCurrentFolder(
"Physics/BPhysics");
288 if (!jpsiGlbSig.empty()) {
297 float massMu = 0.10566;
299 if(massMu*massMu + vec1.Mag2()>0)
300 eMu1 =
sqrt(massMu*massMu + vec1.Mag2());
302 if(massMu*massMu + vec2.Mag2()>0)
303 eMu2 =
sqrt(massMu*massMu + vec2.Mag2());
306 if((vec1+vec2).Mag2()>0)
307 pJPsi =
sqrt((vec1+vec2).Mag2());
308 float eJPsi = eMu1 + eMu2;
310 float massJPsi = -999;
311 if((eJPsi*eJPsi - pJPsi*pJPsi) > 0)
312 massJPsi =
sqrt(eJPsi*eJPsi - pJPsi*pJPsi);
319 return (fabs(recoMu.
eta()) < 2.4 &&
320 ((fabs(recoMu.
eta()) < 1.3 && recoMu.
pt() > 3.3) ||
321 (fabs(recoMu.
eta()) > 1.3 && fabs(recoMu.
eta()) < 2.2 && recoMu.
p() > 2.9) ||
322 (fabs(recoMu.
eta()) > 2.2 && recoMu.
pt() > 0.8)));
333 return (isMuonInAccept(recoMu) &&
334 iTrack->found() > 11 &&
335 gTrack->chi2()/gTrack->ndof() < 20.0 &&
337 iTrack->chi2()/iTrack->ndof() < 4.0 &&
341 fabs(iTrack->dxy(RefVtx)) < 3.0 &&
342 fabs(iTrack->dz(RefVtx)) < 15.0 );
350 return (isMuonInAccept(recoMu) &&
351 iTrack->found() > 11 &&
352 iTrack->chi2()/iTrack->ndof() < 4.0 &&
356 fabs(iTrack->dxy(RefVtx)) < 3.0 &&
357 fabs(iTrack->dz(RefVtx)) < 15.0 );
LuminosityBlockID id() const
T getParameter(std::string const &) const
bool selGlobalMuon(const reco::Muon &recoMu)
virtual double p() const GCC11_FINAL
magnitude of momentum vector
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
BPhysicsOniaDQM(const edm::ParameterSet &)
Constructor.
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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 float pt() const GCC11_FINAL
transverse momentum
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)