159 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Analyze the mu in different eta regions";
177 bool bPrimaryVertex =
true;
179 bPrimaryVertex =
false;
182 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
183 bPrimaryVertex =
false;
192 double vertex_chi2 =
v->normalizedChi2();
193 double vertex_ndof =
v->ndof();
194 bool fakeVtx =
v->isFake();
195 double vertex_Z =
v->z();
197 if (!fakeVtx && vertex_number >= 1 && vertex_ndof > 4 && vertex_chi2 < 999 && fabs(vertex_Z) < 24.) {
198 bPrimaryVertex =
true;
209 unsigned int theIndexOfThePrimaryVertex = 999.;
211 for (
unsigned int ind = 0; ind <
vertex->size(); ++ind) {
212 if ((*
vertex)[ind].isValid() && !((*vertex)[ind].isFake())) {
213 theIndexOfThePrimaryVertex = ind;
219 if (theIndexOfThePrimaryVertex < 100) {
220 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
221 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
223 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
229 posVtx =
bs.position();
230 errVtx(0, 0) =
bs.BeamWidthX();
231 errVtx(1, 1) =
bs.BeamWidthY();
232 errVtx(2, 2) =
bs.sigmaZ();
238 if (!
muons.isValid())
242 TLorentzVector Mu1, Mu2;
248 LogTrace(
metname) <<
"[EfficiencyAnalyzer] loop over first muons" << endl;
252 float combIso = (Iso_muon.
emEt + Iso_muon.
hadEt + Iso_muon.
sumPt);
255 if (!muon1->isGlobalMuon())
260 float muPt1 = recoCombinedGlbTrack1->pt();
261 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(),
262 recoCombinedGlbTrack1->py(),
263 recoCombinedGlbTrack1->pz(),
264 recoCombinedGlbTrack1->p());
278 if (combIso / muPt1 > 0.1)
282 LogTrace(
metname) <<
"[EfficiencyAnalyzer] loop over second muon" << endl;
286 if (muon2->eta() < 1.479)
288 if (muon2->eta() >= 1.479)
292 Mu2.SetPxPyPzE(muon2->px(), muon2->py(), muon2->pz(), muon2->p());
294 float Minv = (Mu1 + Mu2).M();
295 if (!muon2->isTrackerMuon())
299 if ((muon1->charge()) * (muon2->charge()) > 0)
301 if (Minv < 70 || Minv > 110)
307 if (muon2->innerTrack()->extra().isAvailable()) {
316 if (muon2->pt() > 20)
330 if (muon2->innerTrack()->extra().isAvailable()) {
340 if (muon2->pt() > 20)
352 if (bPrimaryVertex && isMB)
354 if (bPrimaryVertex && isME)
358 float tkIso = muon2->isolationR03().sumPt;
359 float emIso = muon2->isolationR03().emEt;
360 float hadIso = muon2->isolationR03().hadEt + muon2->isolationR03().hoEt;
361 float relDetIso = (tkIso + emIso + hadIso) / (muon2->pt());
363 if (relDetIso < 0.05) {
372 if (bPrimaryVertex && isMB)
374 if (bPrimaryVertex && isME)
379 float chargedIso = muon2->pfIsolationR04().sumChargedHadronPt;
380 float neutralIso = muon2->pfIsolationR04().sumNeutralHadronEt;
381 float photonIso = muon2->pfIsolationR04().sumPhotonEt;
384 float pu = muon2->pfIsolationR04().sumPUPt;
386 float relPFIsoPUCorrected = (
chargedIso + neutralphotonPUCorrected) / (muon2->pt());
388 if (relPFIso < 0.12) {
397 if (bPrimaryVertex && isMB)
399 if (bPrimaryVertex && isME)
404 if (relPFIsoPUCorrected < 0.12) {
413 if (bPrimaryVertex && isMB)
415 if (bPrimaryVertex && isME)
MonitorElement * h_allProbes_ID_nVtx
MonitorElement * h_passProbes_EB_pfIsodBID_nVtx
MonitorElement * h_passProbes_EE_pfIsoID_pt
MonitorElement * h_allProbes_inner_eta
MonitorElement * h_allProbes_EB_ID_nVtx
MonitorElement * h_passProbes_ID_pt
float sumPt
sum-pt of tracks
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionLabel_
MonitorElement * h_allProbes_eta
MonitorElement * h_passProbes_EE_detIsoID_pt
MonitorElement * h_passProbes_ID_eta
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
MonitorElement * h_passProbes_ID_phi
MonitorElement * h_allProbes_EE_ID_nVtx
math::Error< dimension >::type Error
covariance error matrix (3x3)
MonitorElement * h_allProbes_ID_pt
std::vector< Vertex > VertexCollection
collection of Vertex objects
MonitorElement * h_allProbes_inner_phi
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * h_passProbes_EB_pfIsoID_nVtx
MonitorElement * h_passProbes_pfIsoID_pt
bool isLooseMuon(const reco::Muon &)
MonitorElement * h_allProbes_inner_pt
MonitorElement * h_allProbes_pt
MonitorElement * h_allProbes_EE_ID_pt
MonitorElement * h_passProbes_pfIsodBID_nVtx
MonitorElement * h_allProbes_EB_pt
MonitorElement * h_passProbes_EB_pfIsodBID_pt
MonitorElement * h_allProbes_EE_pt
MonitorElement * h_passProbes_pfIsodBID_pt
MonitorElement * h_passProbes_ID_EB_pt
math::XYZPoint Point
point in the space
MonitorElement * h_passProbes_ID_inner_phi
MonitorElement * h_passProbes_ID_hp_eta
MonitorElement * h_passProbes_pfIsoID_nVtx
MonitorElement * h_passProbes_EE_pfIsodBID_nVtx
MonitorElement * h_passProbes_EE_pfIsoID_nVtx
MonitorElement * h_passProbes_ID_inner_eta
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
Log< level::Info, false > LogInfo
MonitorElement * h_passProbes_detIsoID_nVtx
MonitorElement * h_passProbes_EB_detIsoID_pt
MonitorElement * h_passProbes_EB_detIsoID_nVtx
MonitorElement * h_passProbes_EE_pfIsodBID_pt
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MonitorElement * h_allProbes_EB_ID_pt
static int position[264][3]
MonitorElement * h_passProbes_detIsoID_pt
MonitorElement * h_passProbes_ID_EE_pt
MonitorElement * h_passProbes_ID_inner_pt
MonitorElement * h_allProbes_hp_eta
MonitorElement * h_passProbes_EE_detIsoID_nVtx
MonitorElement * h_allProbes_phi
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * h_passProbes_EB_pfIsoID_pt