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);
virtual void setCurrentFolder(std::string const &fullpath)
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
const std::string metname
math::Error< dimension >::type Error
covariance error matrix (3x3)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
Inizialize parameters for histo binning.
MuonMiniAOD(const edm::ParameterSet &)
Constructor.
bool isLooseMuon(const reco::Muon &)
math::XYZPoint Point
point in the space
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
~MuonMiniAOD() override
Destructor.
Log< level::Info, false > LogInfo
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static int position[264][3]
bool PassesCut_A(edm::View< pat::Muon >::const_iterator, reco::Vertex, TString)
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
bool PassesCut_B(edm::View< pat::Muon >::const_iterator, reco::Vertex, TString)