144 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
154 unsigned int theIndexOfThePrimaryVertex = 999.;
159 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
160 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
161 theIndexOfThePrimaryVertex = ind;
167 if (theIndexOfThePrimaryVertex<100) {
168 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
169 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
172 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
181 errVtx(2,2) = bs.
sigmaZ();
188 cout <<
"[MuonKinVsEtaAnalyzer]: Analyze the mu in different eta regions" << endl;
194 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
200 if(
muon->isGlobalMuon()) {
202 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is global... Filling the histos" << endl;
204 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is global - filling the histos";
207 if(fabs(recoCombinedGlbTrack->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack->eta())<
EtaCutMax){
208 etaGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->eta());
209 phiGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->phi());
210 pGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->p());
211 ptGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->pt());
212 chi2GlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->normalizedChi2());
213 chi2probGlbTrack[iEtaRegion]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
217 if(
muon->isTrackerMuon()) {
219 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tracker... Filling the histos" << endl;
221 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
225 etaTrack[iEtaRegion]->Fill(recoTrack->eta());
226 phiTrack[iEtaRegion]->Fill(recoTrack->phi());
227 pTrack[iEtaRegion]->Fill(recoTrack->p());
228 ptTrack[iEtaRegion]->Fill(recoTrack->pt());
229 chi2Track[iEtaRegion]->Fill(recoTrack->normalizedChi2());
230 chi2probTrack[iEtaRegion]->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
234 if(
muon->isStandAloneMuon()) {
236 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is standlone... Filling the histos" << endl;
238 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is standalone - filling the histos";
242 etaStaTrack[iEtaRegion]->Fill(recoStaTrack->eta());
243 phiStaTrack[iEtaRegion]->Fill(recoStaTrack->phi());
244 pStaTrack[iEtaRegion]->Fill(recoStaTrack->p());
245 ptStaTrack[iEtaRegion]->Fill(recoStaTrack->pt());
246 chi2StaTrack[iEtaRegion]->Fill(recoStaTrack->normalizedChi2());
247 chi2probStaTrack[iEtaRegion]->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
253 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tight... Filling the histos" << endl;
255 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
260 pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
262 chi2TightTrack[iEtaRegion]->Fill(recoTightTrack->normalizedChi2());
263 chi2probTightTrack[iEtaRegion]->Fill(TMath::Prob(recoTightTrack->chi2(),recoTightTrack->ndof()));
270 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Loose... Filling the histos" << endl;
272 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
275 if (
muon->isGlobalMuon()) recoLooseTrack =
muon->combinedMuon();
276 else recoLooseTrack =
muon->track();
281 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
283 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
284 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->chi2(),recoLooseTrack->ndof()));
290 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Medium... Filling the histos" << endl;
292 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Medium - filling the histos";
295 if (
muon->isGlobalMuon()) recoMediumTrack =
muon->combinedMuon();
296 else recoMediumTrack =
muon->track();
304 chi2probMediumTrack[iEtaRegion]->Fill(TMath::Prob(recoMediumTrack->chi2(),recoMediumTrack->ndof()));
310 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Soft... Filling the histos" << endl;
312 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Soft - filling the histos";
317 pSoftTrack[iEtaRegion]->Fill(recoSoftTrack->p());
318 ptSoftTrack[iEtaRegion]->Fill(recoSoftTrack->pt());
319 chi2SoftTrack[iEtaRegion]->Fill(recoSoftTrack->normalizedChi2());
320 chi2probSoftTrack[iEtaRegion]->Fill(TMath::Prob(recoSoftTrack->chi2(),recoSoftTrack->ndof()));
326 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is HighPt... Filling the histos" << endl;
328 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is HightPt - filling the histos";
336 chi2probHighPtTrack[iEtaRegion]->Fill(TMath::Prob(recoHighPtTrack->chi2(),recoHighPtTrack->ndof()));
MuonServiceProxy * theService
std::vector< MonitorElement * > chi2HighPtTrack
std::vector< MonitorElement * > etaTrack
std::vector< MonitorElement * > pSoftTrack
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
std::vector< MonitorElement * > chi2probSoftTrack
std::vector< MonitorElement * > etaLooseTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > chi2LooseTrack
std::vector< MonitorElement * > phiStaTrack
std::vector< MonitorElement * > etaMediumTrack
std::vector< MonitorElement * > ptMediumTrack
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< MonitorElement * > chi2probLooseTrack
std::vector< MonitorElement * > ptTrack
std::vector< MonitorElement * > chi2TightTrack
std::vector< MonitorElement * > chi2probGlbTrack
std::vector< MonitorElement * > chi2GlbTrack
bool isLooseMuon(const reco::Muon &)
std::vector< MonitorElement * > ptLooseTrack
std::vector< MonitorElement * > pMediumTrack
std::vector< MonitorElement * > ptHighPtTrack
std::vector< MonitorElement * > pTrack
std::vector< MonitorElement * > ptTightTrack
std::vector< MonitorElement * > chi2probTrack
math::XYZPoint Point
point in the space
std::vector< MonitorElement * > phiLooseTrack
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > etaTightTrack
std::vector< MonitorElement * > chi2probStaTrack
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
std::vector< MonitorElement * > etaSoftTrack
std::vector< MonitorElement * > phiTightTrack
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
std::vector< MonitorElement * > pTightTrack
std::vector< MonitorElement * > etaStaTrack
std::vector< MonitorElement * > pGlbTrack
double sigmaZ() const
sigma z
std::vector< MonitorElement * > chi2probTightTrack
double BeamWidthY() const
beam width Y
std::vector< MonitorElement * > pStaTrack
std::vector< MonitorElement * > etaGlbTrack
std::vector< MonitorElement * > pHighPtTrack
std::vector< MonitorElement * > phiSoftTrack
std::vector< MonitorElement * > phiMediumTrack
std::vector< MonitorElement * > chi2Track
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static int position[264][3]
std::vector< MonitorElement * > chi2probMediumTrack
std::vector< MonitorElement * > chi2SoftTrack
const Point & position() const
position
std::vector< MonitorElement * > pLooseTrack
std::vector< MonitorElement * > chi2MediumTrack
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::vector< MonitorElement * > etaHighPtTrack
std::vector< MonitorElement * > chi2StaTrack
std::vector< MonitorElement * > phiTrack
std::vector< MonitorElement * > ptSoftTrack
std::vector< MonitorElement * > ptStaTrack
std::vector< MonitorElement * > ptGlbTrack
std::vector< MonitorElement * > chi2probHighPtTrack
std::vector< MonitorElement * > phiGlbTrack
std::vector< MonitorElement * > phiHighPtTrack