133 LogTrace(
metname)<<
"[EfficiencyAnalyzer] Analyze the mu in different eta regions";
153 bool bPrimaryVertex =
true;
155 bPrimaryVertex =
false;
158 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
159 bPrimaryVertex =
false;
164 int vertex_number = vertexCollection.size();
166 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
167 for ( ; v != vertexCollection.end(); ++
v) {
168 double vertex_chi2 = v->normalizedChi2();
169 double vertex_ndof = v->ndof();
170 bool fakeVtx = v->isFake();
171 double vertex_Z = v->z();
174 && vertex_number >= 1
177 && fabs(vertex_Z)< 24. ) {
178 bPrimaryVertex =
true;
190 unsigned int theIndexOfThePrimaryVertex = 999.;
192 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
193 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
194 theIndexOfThePrimaryVertex = ind;
200 if (theIndexOfThePrimaryVertex<100) {
201 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
202 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
205 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
214 errVtx(2,2) = bs.
sigmaZ();
223 TLorentzVector Mu1, Mu2;
229 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over first muons" << endl;
233 float combIso = (Iso_muon.
emEt + Iso_muon.
hadEt + Iso_muon.
sumPt);
236 if (!muon1->isGlobalMuon())
continue;
240 float muPt1 = recoCombinedGlbTrack1->pt();
241 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
251 if (muPt1 <= 15)
continue;
252 if (combIso/muPt1 > 0.1 )
continue;
255 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over second muon" <<endl;
256 if (muon2 == muon1)
continue;
258 if (muon2->eta() < 1.479 ) isMB =
true;
259 if (muon2->eta() >= 1.479 ) isME =
true;
262 Mu2.SetPxPyPzE(muon2->px(), muon2->py(), muon2->pz(), muon2->p());
264 float Minv = (Mu1+Mu2).M();
265 if (!muon2->isTrackerMuon())
continue;
266 if ( muon2->pt() < 5 )
continue;
267 if ( (muon1->charge())*(muon2->charge()) > 0 )
continue;
268 if ( Minv < 70 || Minv > 110 )
continue;
273 if(muon2->innerTrack()->extra().isAvailable()) {
292 if(muon2->innerTrack()->extra().isAvailable()) {
312 float tkIso = muon2->isolationR03().sumPt;
313 float emIso = muon2->isolationR03().emEt;
314 float hadIso = muon2->isolationR03().hadEt + muon2->isolationR03().hoEt;
315 float relDetIso = (tkIso + emIso + hadIso) / (muon2->pt());
317 if (relDetIso < 0.05 ) {
328 float chargedIso = muon2->pfIsolationR04().sumChargedHadronPt;
329 float neutralIso = muon2->pfIsolationR04().sumNeutralHadronEt;
330 float photonIso = muon2->pfIsolationR04().sumPhotonEt;
331 float relPFIso = (chargedIso + neutralIso + photonIso) / (muon2->pt());
333 float pu = muon2->pfIsolationR04().sumPUPt;
334 float neutralphotonPUCorrected =
std::max(0.0 , (neutralIso + photonIso - 0.5*pu ) );
335 float relPFIsoPUCorrected = (chargedIso + neutralphotonPUCorrected) / (muon2->pt());
339 if (relPFIso < 0.12 ) {
350 if ( relPFIsoPUCorrected < 0.12 ) {
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
MuonServiceProxy * theService
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_
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