141 LogTrace(
metname) <<
"[TriggerMatchMonitor] Analyze the mu in different eta regions";
160 unsigned int theIndexOfThePrimaryVertex = 999.;
161 for (
unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
162 if ((*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake())) {
163 theIndexOfThePrimaryVertex = ind;
167 if (theIndexOfThePrimaryVertex < 100) {
168 posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
position();
169 errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
error();
171 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
178 errVtx(2, 2) = bs.
sigmaZ();
183 for (
const auto& patMuon : *PATmuons) {
185 patMuon.pfIsolationR04().sumChargedHadronPt +
187 patMuon.pfIsolationR04().sumNeutralHadronEt + patMuon.pfIsolationR04().sumPhotonEt -
188 0.5 * patMuon.pfIsolationR04().sumPUPt) /
192 if (patMuon.isGlobalMuon() && Isolated && patMuon.isTightMuon(thePrimaryVertex)) {
194 TLorentzVector offlineMuon;
195 offlineMuon.SetPtEtaPhiM(patMuon.pt(), patMuon.eta(), patMuon.phi(), 0.0);
209 if (patMuon.triggered(ptrmuPath1) && patMuon.hltObject() !=
nullptr) {
210 TLorentzVector hltMuon;
211 hltMuon.SetPtEtaPhiM(patMuon.hltObject()->pt(), patMuon.hltObject()->eta(), patMuon.hltObject()->phi(), 0.0);
212 double DelRrecoHLT = offlineMuon.DeltaR(hltMuon);
216 matchHists[2]->Fill(patMuon.hltObject()->pt() / patMuon.pt());
222 if (patMuon.l1Object() !=
nullptr) {
223 TLorentzVector L1Muon;
224 L1Muon.SetPtEtaPhiM(patMuon.l1Object()->pt(), patMuon.l1Object()->eta(), patMuon.l1Object()->phi(), 0.0);
225 double DelRrecoL1 = offlineMuon.DeltaR(L1Muon);
228 matchHists[5]->Fill(patMuon.l1Object()->pt() / patMuon.pt());
233 if (patMuon.triggered(ptrmuPath2)) {
234 TLorentzVector hltMuon50;
235 hltMuon50.SetPtEtaPhiM(
236 patMuon.hltObject()->pt(), patMuon.hltObject()->eta(), patMuon.hltObject()->phi(), 0.0);
237 double DelRrecoHLT50 = offlineMuon.DeltaR(hltMuon50);
241 matchHists[8]->Fill(patMuon.hltObject()->pt() / patMuon.pt());
248 if (patMuon.l1Object() !=
nullptr) {
249 TLorentzVector L1Muon50;
250 L1Muon50.SetPtEtaPhiM(patMuon.l1Object()->pt(), patMuon.l1Object()->eta(), patMuon.l1Object()->phi(), 0.0);
251 double DelRrecoL150 = offlineMuon.DeltaR(L1Muon50);
254 matchHists[11]->Fill(patMuon.l1Object()->pt() / patMuon.pt());
MonitorElement * h_passHLTPath2_eta_Tight
MonitorElement * h_passHLTPath2_phi_Tight
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
MonitorElement * h_totalHLTPath1_phi_Tight
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::string triggerPathName1_
MonitorElement * h_totalHLTPath2_pt_Tight
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
MuonServiceProxy * theService
MonitorElement * h_totalHLTPath1_eta_Tight
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
static std::string const triggerResults
std::string triggerPathName2_
MonitorElement * h_passHLTPath1_phi_Tight
MonitorElement * h_passHLTPath1_eta_Tight
MonitorElement * h_totalHLTPath1_pt_Tight
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > triggerObjects_
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
double triggerPtThresholdPath1_
MonitorElement * h_totalHLTPath2_eta_Tight
static int position[264][3]
MonitorElement * h_passHLTPath2_pt_Tight
const Point & position() const
position
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
double triggerPtThresholdPath2_
MonitorElement * h_totalHLTPath2_phi_Tight
MonitorElement * h_passHLTPath1_pt_Tight
edm::EDGetTokenT< edm::View< pat::Muon > > thePATMuonCollectionLabel_
std::vector< MonitorElement * > matchHists
edm::EDGetTokenT< std::vector< reco::Vertex > > primaryVerticesToken_