96 LogTrace(
metname)<<
"[TriggerMatchMonitor] Analyze the mu in different eta regions";
115 unsigned int theIndexOfThePrimaryVertex = 999.;
116 for (
unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
117 if ( (*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake()) ) {
118 theIndexOfThePrimaryVertex = ind;
122 if (theIndexOfThePrimaryVertex<100) {
123 posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
position();
124 errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
error();
127 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
134 errVtx(2,2) = bs.
sigmaZ();
139 for(
const auto & patMuon : *PATmuons){
140 bool Isolated=patMuon.pfIsolationR04().sumChargedHadronPt +
TMath::Max(0., patMuon.pfIsolationR04().sumNeutralHadronEt + patMuon.pfIsolationR04().sumPhotonEt - 0.5*patMuon.pfIsolationR04().sumPUPt) / patMuon.pt() < 0.25;
142 if(patMuon.isGlobalMuon() && Isolated && patMuon.isTightMuon(thePrimaryVertex)){
144 TLorentzVector offlineMuon;
145 offlineMuon.SetPtEtaPhiM(patMuon.pt(), patMuon.eta(), patMuon.phi(),0.0);
159 if(patMuon.triggered(ptrmuPath1) && patMuon.hltObject() !=
nullptr){
160 TLorentzVector hltMuon;
161 hltMuon.SetPtEtaPhiM(patMuon.hltObject()->pt(),patMuon.hltObject()->eta(),patMuon.hltObject()->phi(),0.0);
162 double DelRrecoHLT=offlineMuon.DeltaR(hltMuon);
166 matchHists[2]->Fill(patMuon.hltObject()->pt()/patMuon.pt());
172 if(patMuon.l1Object() !=
nullptr){
173 TLorentzVector L1Muon;
174 L1Muon.SetPtEtaPhiM(patMuon.l1Object()->pt(),patMuon.l1Object()->eta(),patMuon.l1Object()->phi(),0.0);
175 double DelRrecoL1=offlineMuon.DeltaR(L1Muon);
178 matchHists[5]->Fill(patMuon.l1Object()->pt()/patMuon.pt());
184 if(patMuon.triggered(ptrmuPath2)){
185 TLorentzVector hltMuon50;
186 hltMuon50.SetPtEtaPhiM(patMuon.hltObject()->pt(),patMuon.hltObject()->eta(),patMuon.hltObject()->phi(),0.0);
187 double DelRrecoHLT50=offlineMuon.DeltaR(hltMuon50);
191 matchHists[8]->Fill(patMuon.hltObject()->pt()/patMuon.pt());
199 if(patMuon.l1Object() !=
nullptr){
200 TLorentzVector L1Muon50;
201 L1Muon50.SetPtEtaPhiM(patMuon.l1Object()->pt(),patMuon.l1Object()->eta(),patMuon.l1Object()->phi(),0.0);
202 double DelRrecoL150=offlineMuon.DeltaR(L1Muon50);
205 matchHists[11]->Fill(patMuon.l1Object()->pt()/patMuon.pt());
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
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_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
MonitorElement * h_totalHLTPath2_pt_Tight
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< 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_