126 LogTrace(
metname)<<
"[EfficiencyAnalyzer] Analyze the mu in different eta regions";
146 bool bPrimaryVertex =
true;
148 bPrimaryVertex =
false;
151 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
152 bPrimaryVertex =
false;
157 int vertex_number = vertexCollection.size();
159 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
160 for ( ; v != vertexCollection.end(); ++
v) {
161 double vertex_chi2 = v->normalizedChi2();
162 double vertex_ndof = v->ndof();
163 bool fakeVtx = v->isFake();
164 double vertex_Z = v->z();
167 && vertex_number >= 1
170 && fabs(vertex_Z)< 24. ) {
171 bPrimaryVertex =
true;
183 unsigned int theIndexOfThePrimaryVertex = 999.;
185 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
186 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
187 theIndexOfThePrimaryVertex = ind;
193 if (theIndexOfThePrimaryVertex<100) {
194 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
195 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
198 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
207 errVtx(2,2) = bs.
sigmaZ();
216 TLorentzVector Mu1, Mu2;
221 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
222 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over first muons" << endl;
226 float combIso = (Iso_muon.
emEt + Iso_muon.
hadEt + Iso_muon.
sumPt);
229 if (!recoMu1->isGlobalMuon())
continue;
233 float muPt1 = recoCombinedGlbTrack1->pt();
234 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
244 if (muPt1 <= 15)
continue;
245 if (combIso/muPt1 > 0.1 )
continue;
247 for (reco::MuonCollection::const_iterator recoMu2 = muons->begin(); recoMu2!=muons->end(); ++recoMu2){
248 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over second muon" <<endl;
249 if (recoMu2 == recoMu1)
continue;
251 if (recoMu2->eta() < 1.479 ) isMB =
true;
252 if (recoMu2->eta() >= 1.479 ) isME =
true;
255 Mu2.SetPxPyPzE(recoMu2->px(), recoMu2->py(), recoMu2->pz(), recoMu2->p());
257 float Minv = (Mu1+Mu2).M();
258 if (!recoMu2->isTrackerMuon())
continue;
259 if ( recoMu2->pt() < 5 )
continue;
260 if ( (recoMu1->charge())*(recoMu2->charge()) > 0 )
continue;
261 if ( Minv < 70 || Minv > 110 )
continue;
296 float tkIso = recoMu2->isolationR03().sumPt;
297 float emIso = recoMu2->isolationR03().emEt;
298 float hadIso = recoMu2->isolationR03().hadEt + recoMu2->isolationR03().hoEt;
299 float relDetIso = (tkIso + emIso + hadIso) / (recoMu2->pt());
301 if (relDetIso < 0.05 ) {
312 float chargedIso = recoMu2->pfIsolationR04().sumChargedHadronPt;
313 float neutralIso = recoMu2->pfIsolationR04().sumNeutralHadronEt;
314 float photonIso = recoMu2->pfIsolationR04().sumPhotonEt;
315 float relPFIso = (chargedIso + neutralIso + photonIso) / (recoMu2->pt());
317 float pu = recoMu2->pfIsolationR04().sumPUPt;
318 float neutralphotonPUCorrected =
std::max(0.0 , (neutralIso + photonIso - 0.5*pu ) );
319 float relPFIsoPUCorrected = (chargedIso + neutralphotonPUCorrected) / (recoMu2->pt());
323 if (relPFIso < 0.12 ) {
334 if ( relPFIsoPUCorrected < 0.12 ) {
MonitorElement * h_allProbes_ID_nVtx
MonitorElement * h_passProbes_EB_pfIsodBID_nVtx
MonitorElement * h_passProbes_EE_pfIsoID_pt
MonitorElement * h_allProbes_EB_ID_nVtx
MonitorElement * h_passProbes_ID_pt
float sumPt
sum-pt of tracks
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
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * h_passProbes_EB_pfIsoID_nVtx
bool isMediumMuon(const reco::Muon &)
MonitorElement * h_passProbes_pfIsoID_pt
bool isLooseMuon(const reco::Muon &)
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_hp_eta
MonitorElement * h_passProbes_pfIsoID_nVtx
MonitorElement * h_passProbes_EE_pfIsodBID_nVtx
MonitorElement * h_passProbes_EE_pfIsoID_nVtx
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
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_allProbes_hp_eta
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
MonitorElement * h_passProbes_EE_detIsoID_nVtx
MonitorElement * h_allProbes_phi
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * h_passProbes_EB_pfIsoID_pt