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;
188 int vertex_number = vertexCollection.size();
190 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
191 for (; v != vertexCollection.end(); ++
v) {
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";
232 errVtx(2, 2) = bs.
sigmaZ();
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;
382 float relPFIso = (chargedIso + neutralIso + photonIso) / (muon2->pt());
384 float pu = muon2->pfIsolationR04().sumPUPt;
385 float neutralphotonPUCorrected =
std::max(0.0, (neutralIso + photonIso - 0.5 * pu));
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
auto const & tracks
cannot be loose
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
double BeamWidthX() const
beam width X
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
T const * product() const
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
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
const Point & position() const
position
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