138 LogTrace(
"TriggerMatching") <<
"[TriggerMatchMonitor] Analyze the mu in different eta regions";
156 unsigned int theIndexOfThePrimaryVertex = 999.;
157 for (
unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
158 if ((*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake())) {
159 theIndexOfThePrimaryVertex = ind;
163 if (theIndexOfThePrimaryVertex < 100) {
164 posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
position();
165 errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
error();
167 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
171 posVtx =
bs.position();
172 errVtx(0, 0) =
bs.BeamWidthX();
173 errVtx(1, 1) =
bs.BeamWidthY();
174 errVtx(2, 2) =
bs.sigmaZ();
179 for (
const auto& patMuon : *
PATmuons) {
181 patMuon.pfIsolationR04().sumChargedHadronPt +
183 patMuon.pfIsolationR04().sumNeutralHadronEt + patMuon.pfIsolationR04().sumPhotonEt -
184 0.5 * patMuon.pfIsolationR04().sumPUPt) /
188 if (patMuon.isGlobalMuon() && Isolated && patMuon.isTightMuon(thePrimaryVertex)) {
190 TLorentzVector offlineMuon;
191 offlineMuon.SetPtEtaPhiM(patMuon.pt(), patMuon.eta(), patMuon.phi(), 0.0);
205 if (patMuon.triggered(ptrmuPath1) && patMuon.hltObject() !=
nullptr) {
206 TLorentzVector hltMuon;
207 hltMuon.SetPtEtaPhiM(patMuon.hltObject()->pt(), patMuon.hltObject()->eta(), patMuon.hltObject()->phi(), 0.0);
208 double DelRrecoHLT = offlineMuon.DeltaR(hltMuon);
212 matchHists[2]->Fill(patMuon.hltObject()->pt() / patMuon.pt());
218 if (patMuon.l1Object() !=
nullptr) {
219 TLorentzVector L1Muon;
220 L1Muon.SetPtEtaPhiM(patMuon.l1Object()->pt(), patMuon.l1Object()->eta(), patMuon.l1Object()->phi(), 0.0);
221 double DelRrecoL1 = offlineMuon.DeltaR(L1Muon);
224 matchHists[5]->Fill(patMuon.l1Object()->pt() / patMuon.pt());
229 if (patMuon.triggered(ptrmuPath2)) {
230 TLorentzVector hltMuon50;
231 hltMuon50.SetPtEtaPhiM(
232 patMuon.hltObject()->pt(), patMuon.hltObject()->eta(), patMuon.hltObject()->phi(), 0.0);
233 double DelRrecoHLT50 = offlineMuon.DeltaR(hltMuon50);
237 matchHists[8]->Fill(patMuon.hltObject()->pt() / patMuon.pt());
244 if (patMuon.l1Object() !=
nullptr) {
245 TLorentzVector L1Muon50;
246 L1Muon50.SetPtEtaPhiM(patMuon.l1Object()->pt(), patMuon.l1Object()->eta(), patMuon.l1Object()->phi(), 0.0);
247 double DelRrecoL150 = offlineMuon.DeltaR(L1Muon50);
250 matchHists[11]->Fill(patMuon.l1Object()->pt() / patMuon.pt());