95 LogTrace(
metname)<<
"[TriggerMatchMonitor] Analyze the mu in different eta regions";
114 unsigned int theIndexOfThePrimaryVertex = 999.;
115 for (
unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
116 if ( (*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake()) ) {
117 theIndexOfThePrimaryVertex = ind;
121 if (theIndexOfThePrimaryVertex<100) {
122 posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
position();
123 errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).
error();
126 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
133 errVtx(2,2) = bs.
sigmaZ();
138 for(
const auto & patMuon : *PATmuons){
139 bool Isolated=patMuon.pfIsolationR04().sumChargedHadronPt +
TMath::Max(0., patMuon.pfIsolationR04().sumNeutralHadronEt + patMuon.pfIsolationR04().sumPhotonEt - 0.5*patMuon.pfIsolationR04().sumPUPt) / patMuon.pt() < 0.25;
141 if(patMuon.isGlobalMuon() && Isolated && patMuon.isTightMuon(thePrimaryVertex)){
143 TLorentzVector offlineMuon;
144 offlineMuon.SetPtEtaPhiM(patMuon.pt(), patMuon.eta(), patMuon.phi(),0.0);
158 if(patMuon.triggered(ptrmuPath1) && patMuon.hltObject() !=
nullptr){
159 TLorentzVector hltMuon;
160 hltMuon.SetPtEtaPhiM(patMuon.hltObject()->pt(),patMuon.hltObject()->eta(),patMuon.hltObject()->phi(),0.0);
161 double DelRrecoHLT=offlineMuon.DeltaR(hltMuon);
165 matchHists[2]->Fill(patMuon.hltObject()->pt()/patMuon.pt());
171 if(patMuon.l1Object() !=
nullptr){
172 TLorentzVector L1Muon;
173 L1Muon.SetPtEtaPhiM(patMuon.l1Object()->pt(),patMuon.l1Object()->eta(),patMuon.l1Object()->phi(),0.0);
174 double DelRrecoL1=offlineMuon.DeltaR(L1Muon);
177 matchHists[5]->Fill(patMuon.l1Object()->pt()/patMuon.pt());
183 if(patMuon.triggered(ptrmuPath2)){
184 TLorentzVector hltMuon50;
185 hltMuon50.SetPtEtaPhiM(patMuon.hltObject()->pt(),patMuon.hltObject()->eta(),patMuon.hltObject()->phi(),0.0);
186 double DelRrecoHLT50=offlineMuon.DeltaR(hltMuon50);
190 matchHists[8]->Fill(patMuon.hltObject()->pt()/patMuon.pt());
198 if(patMuon.l1Object() !=
nullptr){
199 TLorentzVector L1Muon50;
200 L1Muon50.SetPtEtaPhiM(patMuon.l1Object()->pt(),patMuon.l1Object()->eta(),patMuon.l1Object()->phi(),0.0);
201 double DelRrecoL150=offlineMuon.DeltaR(L1Muon50);
204 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_