16 theMuonCollectionLabel_ = consumes<edm::View<pat::Muon> > (
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
32 workingPoints.push_back(ibooker.
book2D(
"tightMuons" ,
"Tight Muons" ,2,1,3,2,1,3));
33 workingPoints.push_back(ibooker.
book2D(
"mediumMuons",
"Medium Muons" ,2,1,3,2,1,3));
34 workingPoints.push_back(ibooker.
book2D(
"looseMuons" ,
"Loose Muons" ,2,1,3,2,1,3));
35 workingPoints.push_back(ibooker.
book2D(
"highPtMuons",
"High Pt Muons",2,1,3,2,1,3));
36 workingPoints.push_back(ibooker.
book2D(
"softMuons" ,
"Soft Muons" ,2,1,3,2,1,3));
38 for (std::vector<MonitorElement*>::iterator monitor = workingPoints.begin();
39 monitor != workingPoints.end(); ++monitor){
40 (*monitor)-> setBinLabel(1,
"Pass",1);
41 (*monitor) -> setBinLabel(2,
"No Pass",1);
42 (*monitor) -> setBinLabel(1,
"Pass",2);
43 (*monitor) -> setBinLabel(2,
"No Pass",2);
50 if (WorkingPoint ==
"tightMuons")
52 else if (WorkingPoint ==
"mediumMuons")
54 else if (WorkingPoint ==
"looseMuons")
56 else if (WorkingPoint ==
"highPtMuons")
58 else if (WorkingPoint ==
"softMuons")
61 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
69 if (WorkingPoint ==
"tightMuons")
71 else if (WorkingPoint ==
"mediumMuons")
73 else if (WorkingPoint ==
"looseMuons")
75 else if (WorkingPoint ==
"highPtMuons")
77 else if (WorkingPoint ==
"softMuons")
80 LogInfo(
"RecoMuonValidator") <<
"[MuonMiniAOD]: MuonMiniAOD. Unknown WP, returning false.\n";
93 iEvent.
getByToken(theMuonCollectionLabel_,muons);
104 unsigned int theIndexOfThePrimaryVertex = 999.;
106 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
107 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
108 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
109 theIndexOfThePrimaryVertex = ind;
115 if (theIndexOfThePrimaryVertex<100) {
116 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
117 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
120 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
123 iEvent.
getByToken(theBeamSpotLabel_,recoBeamSpotHandle);
129 errVtx(2,2) = bs.
sigmaZ();
138 for (std::vector<MonitorElement*>::iterator monitor = workingPoints.begin();
139 monitor != workingPoints.end(); ++monitor){
142 if (PassesCut_A(muon1, thePrimaryVertex,(*monitor)->getName()))
146 if (PassesCut_B(muon1, thePrimaryVertex,(*monitor)->getName()))
151 (*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
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 &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
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)