11 theMuonCollectionLabel_ = consumes<edm::View<pat::Muon> >(
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
31 (*monitor)->setBinLabel(1,
"Pass", 1);
32 (*monitor)->setBinLabel(2,
"No Pass", 1);
33 (*monitor)->setBinLabel(1,
"Pass", 2);
34 (*monitor)->setBinLabel(2,
"No Pass", 2);
52 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
61 return muon1->isTightMuon(thePrimaryVertex);
63 return muon1->isMediumMuon();
65 return muon1->isLooseMuon();
67 return muon1->isHighPtMuon(thePrimaryVertex);
69 return muon1->isSoftMuon(thePrimaryVertex);
71 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
92 unsigned int theIndexOfThePrimaryVertex = 999.;
94 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
95 for (
unsigned int ind = 0; ind <
vertex->size(); ++ind) {
96 if ((*
vertex)[ind].isValid() && !((*vertex)[ind].isFake())) {
97 theIndexOfThePrimaryVertex = ind;
103 if (theIndexOfThePrimaryVertex < 100) {
104 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
105 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
107 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
110 iEvent.getByToken(theBeamSpotLabel_, recoBeamSpotHandle);
113 posVtx =
bs.position();
114 errVtx(0, 0) =
bs.BeamWidthX();
115 errVtx(1, 1) =
bs.BeamWidthY();
116 errVtx(2, 2) =
bs.sigmaZ();
126 if (PassesCut_A(muon1, thePrimaryVertex, (*monitor)->getName()))
130 if (PassesCut_B(muon1, thePrimaryVertex, (*monitor)->getName()))
135 (*monitor)->Fill(Pass_A, Pass_B);