166 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
175 unsigned int theIndexOfThePrimaryVertex = 999.;
180 for (
unsigned int ind = 0; ind < vertex->size(); ++ind) {
181 if ((*vertex)[ind].isValid() && !((*vertex)[ind].isFake())) {
182 theIndexOfThePrimaryVertex = ind;
188 if (theIndexOfThePrimaryVertex < 100) {
189 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
190 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
192 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
201 errVtx(2, 2) = bs.
sigmaZ();
208 cout <<
"[MuonKinVsEtaAnalyzer]: Analyze the mu in different eta regions" << endl;
214 for (
unsigned int iEtaRegion = 0; iEtaRegion < 4; iEtaRegion++) {
215 if (iEtaRegion == 0) {
219 if (iEtaRegion == 1) {
223 if (iEtaRegion == 2) {
227 if (iEtaRegion == 3) {
232 if (
muon->isGlobalMuon()) {
234 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is global... Filling the histos" << endl;
236 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is global - filling the histos";
239 if (fabs(recoCombinedGlbTrack->eta()) >
EtaCutMin && fabs(recoCombinedGlbTrack->eta()) <
EtaCutMax) {
240 etaGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->eta());
241 phiGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->phi());
242 pGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->p());
243 ptGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->pt());
244 chi2GlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->normalizedChi2());
245 chi2probGlbTrack[iEtaRegion]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(), recoCombinedGlbTrack->ndof()));
249 if (
muon->isTrackerMuon()) {
251 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tracker... Filling the histos" << endl;
253 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
257 etaTrack[iEtaRegion]->Fill(recoTrack->eta());
258 phiTrack[iEtaRegion]->Fill(recoTrack->phi());
259 pTrack[iEtaRegion]->Fill(recoTrack->p());
260 ptTrack[iEtaRegion]->Fill(recoTrack->pt());
261 chi2Track[iEtaRegion]->Fill(recoTrack->normalizedChi2());
262 chi2probTrack[iEtaRegion]->Fill(TMath::Prob(recoTrack->chi2(), recoTrack->ndof()));
266 if (
muon->isStandAloneMuon()) {
268 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is standlone... Filling the histos" << endl;
270 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is standalone - filling the histos";
274 etaStaTrack[iEtaRegion]->Fill(recoStaTrack->eta());
275 phiStaTrack[iEtaRegion]->Fill(recoStaTrack->phi());
276 pStaTrack[iEtaRegion]->Fill(recoStaTrack->p());
277 ptStaTrack[iEtaRegion]->Fill(recoStaTrack->pt());
278 chi2StaTrack[iEtaRegion]->Fill(recoStaTrack->normalizedChi2());
279 chi2probStaTrack[iEtaRegion]->Fill(TMath::Prob(recoStaTrack->chi2(), recoStaTrack->ndof()));
285 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tight... Filling the histos" << endl;
287 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
289 if (fabs(recoTightTrack->eta()) >
EtaCutMin && fabs(recoTightTrack->eta()) <
EtaCutMax) {
292 pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
294 chi2TightTrack[iEtaRegion]->Fill(recoTightTrack->normalizedChi2());
295 chi2probTightTrack[iEtaRegion]->Fill(TMath::Prob(recoTightTrack->chi2(), recoTightTrack->ndof()));
301 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Loose... Filling the histos" << endl;
303 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
306 if (
muon->isGlobalMuon())
307 recoLooseTrack =
muon->combinedMuon();
309 recoLooseTrack =
muon->track();
311 if (fabs(recoLooseTrack->eta()) >
EtaCutMin && fabs(recoLooseTrack->eta()) <
EtaCutMax) {
314 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
316 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
317 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->chi2(), recoLooseTrack->ndof()));
323 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Medium... Filling the histos" << endl;
325 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is Medium - filling the histos";
328 if (
muon->isGlobalMuon())
329 recoMediumTrack =
muon->combinedMuon();
331 recoMediumTrack =
muon->track();
333 if (fabs(recoMediumTrack->eta()) >
EtaCutMin && fabs(recoMediumTrack->eta()) <
EtaCutMax) {
339 chi2probMediumTrack[iEtaRegion]->Fill(TMath::Prob(recoMediumTrack->chi2(), recoMediumTrack->ndof()));
345 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Soft... Filling the histos" << endl;
347 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is Soft - filling the histos";
349 if (fabs(recoSoftTrack->eta()) >
EtaCutMin && fabs(recoSoftTrack->eta()) <
EtaCutMax) {
352 pSoftTrack[iEtaRegion]->Fill(recoSoftTrack->p());
353 ptSoftTrack[iEtaRegion]->Fill(recoSoftTrack->pt());
354 chi2SoftTrack[iEtaRegion]->Fill(recoSoftTrack->normalizedChi2());
355 chi2probSoftTrack[iEtaRegion]->Fill(TMath::Prob(recoSoftTrack->chi2(), recoSoftTrack->ndof()));
361 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is HighPt... Filling the histos" << endl;
363 LogTrace(
metname) <<
"[MuonKinVsEtaAnalyzer] The mu is HightPt - filling the histos";
365 if (fabs(recoHighPtTrack->eta()) >
EtaCutMin && fabs(recoHighPtTrack->eta()) <
EtaCutMax) {
371 chi2probHighPtTrack[iEtaRegion]->Fill(TMath::Prob(recoHighPtTrack->chi2(), recoHighPtTrack->ndof()));
std::vector< MonitorElement * > pGlbTrack
std::vector< MonitorElement * > phiHighPtTrack
std::vector< MonitorElement * > chi2GlbTrack
std::vector< MonitorElement * > phiSoftTrack
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > ptTrack
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
std::vector< MonitorElement * > ptTightTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
std::vector< MonitorElement * > phiMediumTrack
std::vector< MonitorElement * > chi2TightTrack
std::vector< MonitorElement * > ptSoftTrack
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< MonitorElement * > etaMediumTrack
std::vector< MonitorElement * > chi2probGlbTrack
std::vector< MonitorElement * > chi2HighPtTrack
std::vector< MonitorElement * > etaLooseTrack
std::vector< MonitorElement * > etaHighPtTrack
std::vector< MonitorElement * > chi2probLooseTrack
std::vector< MonitorElement * > chi2probTrack
std::vector< MonitorElement * > pLooseTrack
std::vector< MonitorElement * > chi2probStaTrack
std::vector< MonitorElement * > phiLooseTrack
std::vector< MonitorElement * > chi2probTightTrack
bool isLooseMuon(const reco::Muon &)
std::vector< MonitorElement * > ptGlbTrack
std::vector< MonitorElement * > ptHighPtTrack
std::vector< MonitorElement * > etaTrack
std::vector< MonitorElement * > pSoftTrack
std::vector< MonitorElement * > etaTightTrack
std::vector< MonitorElement * > pHighPtTrack
std::vector< MonitorElement * > pTightTrack
std::vector< MonitorElement * > ptStaTrack
std::vector< MonitorElement * > phiTightTrack
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > etaGlbTrack
std::vector< MonitorElement * > ptLooseTrack
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
std::vector< MonitorElement * > etaStaTrack
std::vector< MonitorElement * > chi2SoftTrack
std::vector< MonitorElement * > chi2probHighPtTrack
std::vector< MonitorElement * > pMediumTrack
Log< level::Info, false > LogInfo
std::vector< MonitorElement * > chi2MediumTrack
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
std::vector< MonitorElement * > chi2probSoftTrack
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
std::vector< MonitorElement * > phiTrack
std::vector< MonitorElement * > phiStaTrack
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::vector< MonitorElement * > ptMediumTrack
std::vector< MonitorElement * > pTrack
std::vector< MonitorElement * > chi2LooseTrack
std::vector< MonitorElement * > phiGlbTrack
static int position[264][3]
const Point & position() const
position
std::vector< MonitorElement * > chi2probMediumTrack
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::vector< MonitorElement * > chi2Track
std::vector< MonitorElement * > chi2StaTrack
std::vector< MonitorElement * > pStaTrack
std::vector< MonitorElement * > etaSoftTrack