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);
41 if (WorkingPoint ==
"tightMuons")
43 else if (WorkingPoint ==
"mediumMuons")
45 else if (WorkingPoint ==
"looseMuons")
47 else if (WorkingPoint ==
"highPtMuons")
49 else if (WorkingPoint ==
"softMuons")
52 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
60 if (WorkingPoint ==
"tightMuons")
61 return muon1->isTightMuon(thePrimaryVertex);
62 else if (WorkingPoint ==
"mediumMuons")
63 return muon1->isMediumMuon();
64 else if (WorkingPoint ==
"looseMuons")
65 return muon1->isLooseMuon();
66 else if (WorkingPoint ==
"highPtMuons")
67 return muon1->isHighPtMuon(thePrimaryVertex);
68 else if (WorkingPoint ==
"softMuons")
69 return muon1->isSoftMuon(thePrimaryVertex);
71 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
81 iEvent.
getByToken(theMuonCollectionLabel_, muons);
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);
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);
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
void setCurrentFolder(std::string const &fullpath)
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
double BeamWidthX() const
beam width X
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
~MuonMiniAOD() override
Destructor.
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
static int position[264][3]
const Point & position() const
position
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)