128 LogTrace(
metname)<<
"[EfficiencyAnalyzer] Analyze the mu in different eta regions";
148 bool bPrimaryVertex =
true;
150 bPrimaryVertex =
false;
153 LogTrace(
metname) <<
"[EfficiencyAnalyzer] Could not find vertex collection" << std::endl;
154 bPrimaryVertex =
false;
159 int vertex_number = vertexCollection.size();
161 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
162 for ( ; v != vertexCollection.end(); ++
v) {
163 double vertex_chi2 = v->normalizedChi2();
164 double vertex_ndof = v->ndof();
165 bool fakeVtx = v->isFake();
166 double vertex_Z = v->z();
169 && vertex_number >= 1
172 && fabs(vertex_Z)< 24. ) {
173 bPrimaryVertex =
true;
185 unsigned int theIndexOfThePrimaryVertex = 999.;
187 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
188 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
189 theIndexOfThePrimaryVertex = ind;
195 if (theIndexOfThePrimaryVertex<100) {
196 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
197 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
200 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
209 errVtx(2,2) = bs.
sigmaZ();
218 TLorentzVector Mu1, Mu2;
223 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
224 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over first muons" << endl;
228 float combIso = (Iso_muon.
emEt + Iso_muon.
hadEt + Iso_muon.
sumPt);
231 if (!recoMu1->isGlobalMuon())
continue;
235 float muPt1 = recoCombinedGlbTrack1->pt();
236 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
245 if (muPt1 <= 15)
continue;
246 if (combIso/muPt1 > 0.1 )
continue;
248 for (reco::MuonCollection::const_iterator recoMu2 = muons->begin(); recoMu2!=muons->end(); ++recoMu2){
249 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over second muon" <<endl;
250 if (recoMu2 == recoMu1)
continue;
252 if (recoMu2->eta() < 1.479 ) isMB =
true;
253 if (recoMu2->eta() >= 1.479 ) isME =
true;
256 Mu2.SetPxPyPzE(recoMu2->px(), recoMu2->py(), recoMu2->pz(), recoMu2->p());
258 float Minv = (Mu1+Mu2).M();
259 if (!recoMu2->isTrackerMuon())
continue;
260 if ( recoMu2->pt() < 5 )
continue;
261 if ( (recoMu1->charge())*(recoMu2->charge()) > 0 )
continue;
262 if ( Minv < 70 || Minv > 110 )
continue;
298 float tkIso = recoMu2->isolationR03().sumPt;
299 float emIso = recoMu2->isolationR03().emEt;
300 float hadIso = recoMu2->isolationR03().hadEt + recoMu2->isolationR03().hoEt;
301 float relDetIso = (tkIso + emIso + hadIso) / (recoMu2->pt());
303 if (relDetIso < 0.05 ) {
314 float chargedIso = recoMu2->pfIsolationR04().sumChargedHadronPt;
315 float neutralIso = recoMu2->pfIsolationR04().sumNeutralHadronEt;
316 float photonIso = recoMu2->pfIsolationR04().sumPhotonEt;
317 float relPFIso = (chargedIso + neutralIso + photonIso) / (recoMu2->pt());
319 float pu = recoMu2->pfIsolationR04().sumPUPt;
321 float neutralphotonPUCorrected =
std::max(0.0 , (neutralIso + photonIso - 0.5*pu ) );
323 float relPFIsoPUCorrected = (chargedIso + neutralphotonPUCorrected) / (recoMu2->pt());
327 if (relPFIso < 0.12 ) {
341 if ( relPFIsoPUCorrected < 0.12 ) {
MonitorElement * h_passProbes_pfIsoTightMu_nVtx
float sumPt
sum-pt of tracks
MonitorElement * h_passProbes_EB_pfIsoTightMu_pt
MonitorElement * h_passProbes_EB_pfIsodBTightMu_nVtx
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionLabel_
MonitorElement * h_allProbes_eta
MonitorElement * h_allProbes_EE_TightMu_nVtx
MonitorElement * h_passProbes_EB_detIsoTightMu_pt
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
math::Error< dimension >::type Error
covariance error matrix (3x3)
MonitorElement * h_passProbes_pfIsodBTightMu_nVtx
std::vector< Vertex > VertexCollection
collection of Vertex objects
MonitorElement * h_allProbes_EB_TightMu_pt
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * h_passProbes_EE_pfIsoTightMu_nVtx
MonitorElement * h_passProbes_EE_detIsoTightMu_pt
MonitorElement * h_allProbes_pt
MonitorElement * h_allProbes_EB_pt
MonitorElement * h_passProbes_TightMu_EB_pt
MonitorElement * h_passProbes_EE_pfIsoTightMu_pt
MonitorElement * h_passProbes_EB_pfIsoTightMu_nVtx
MonitorElement * h_passProbes_TightMu_hp_eta
MuonServiceProxy * theService
MonitorElement * h_allProbes_EE_pt
MonitorElement * h_passProbes_TightMu_eta
MonitorElement * h_passProbes_EE_detIsoTightMu_nVtx
MonitorElement * h_passProbes_TightMu_phi
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
MonitorElement * h_passProbes_TightMu_pt
MonitorElement * h_allProbes_EB_TightMu_nVtx
MonitorElement * h_passProbes_TightMu_EE_pt
MonitorElement * h_passProbes_EB_detIsoTightMu_nVtx
MonitorElement * h_passProbes_EE_pfIsodBTightMu_nVtx
MonitorElement * h_passProbes_EE_pfIsodBTightMu_pt
MonitorElement * h_allProbes_TightMu_pt
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
T const * product() const
MonitorElement * test_TightMu_Minv
MonitorElement * h_passProbes_EB_pfIsodBTightMu_pt
MonitorElement * h_passProbes_detIsoTightMu_nVtx
static int position[264][3]
const Point & position() const
position
MonitorElement * h_allProbes_hp_eta
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
MonitorElement * h_allProbes_EE_TightMu_pt
MonitorElement * h_allProbes_phi
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * h_allProbes_TightMu_nVtx
MonitorElement * h_passProbes_pfIsodBTightMu_pt
MonitorElement * h_passProbes_detIsoTightMu_pt
MonitorElement * h_passProbes_pfIsoTightMu_pt