145 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
155 unsigned int theIndexOfThePrimaryVertex = 999.;
160 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
161 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
162 theIndexOfThePrimaryVertex = ind;
168 if (theIndexOfThePrimaryVertex<100) {
169 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
170 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
173 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
182 errVtx(2,2) = bs.
sigmaZ();
189 cout <<
"[MuonKinVsEtaAnalyzer]: Analyze the mu in different eta regions" << endl;
195 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
201 if(
muon->isGlobalMuon()) {
203 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is global... Filling the histos" << endl;
205 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is global - filling the histos";
208 if(fabs(recoCombinedGlbTrack->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack->eta())<
EtaCutMax){
209 etaGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->eta());
210 phiGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->phi());
211 pGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->p());
212 ptGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->pt());
213 chi2GlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->normalizedChi2());
214 chi2probGlbTrack[iEtaRegion]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
218 if(
muon->isTrackerMuon()) {
220 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tracker... Filling the histos" << endl;
222 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
226 etaTrack[iEtaRegion]->Fill(recoTrack->eta());
227 phiTrack[iEtaRegion]->Fill(recoTrack->phi());
228 pTrack[iEtaRegion]->Fill(recoTrack->p());
229 ptTrack[iEtaRegion]->Fill(recoTrack->pt());
230 chi2Track[iEtaRegion]->Fill(recoTrack->normalizedChi2());
231 chi2probTrack[iEtaRegion]->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
235 if(
muon->isStandAloneMuon()) {
237 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is standlone... Filling the histos" << endl;
239 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is standalone - filling the histos";
243 etaStaTrack[iEtaRegion]->Fill(recoStaTrack->eta());
244 phiStaTrack[iEtaRegion]->Fill(recoStaTrack->phi());
245 pStaTrack[iEtaRegion]->Fill(recoStaTrack->p());
246 ptStaTrack[iEtaRegion]->Fill(recoStaTrack->pt());
247 chi2StaTrack[iEtaRegion]->Fill(recoStaTrack->normalizedChi2());
248 chi2probStaTrack[iEtaRegion]->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
254 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tight... Filling the histos" << endl;
256 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
261 pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
263 chi2TightTrack[iEtaRegion]->Fill(recoTightTrack->normalizedChi2());
264 chi2probTightTrack[iEtaRegion]->Fill(TMath::Prob(recoTightTrack->chi2(),recoTightTrack->ndof()));
271 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Loose... Filling the histos" << endl;
273 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
276 if (
muon->isGlobalMuon()) recoLooseTrack =
muon->combinedMuon();
277 else recoLooseTrack =
muon->track();
282 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
284 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
285 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->chi2(),recoLooseTrack->ndof()));
291 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Medium... Filling the histos" << endl;
293 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Medium - filling the histos";
296 if (
muon->isGlobalMuon()) recoMediumTrack =
muon->combinedMuon();
297 else recoMediumTrack =
muon->track();
305 chi2probMediumTrack[iEtaRegion]->Fill(TMath::Prob(recoMediumTrack->chi2(),recoMediumTrack->ndof()));
311 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Soft... Filling the histos" << endl;
313 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Soft - filling the histos";
318 pSoftTrack[iEtaRegion]->Fill(recoSoftTrack->p());
319 ptSoftTrack[iEtaRegion]->Fill(recoSoftTrack->pt());
320 chi2SoftTrack[iEtaRegion]->Fill(recoSoftTrack->normalizedChi2());
321 chi2probSoftTrack[iEtaRegion]->Fill(TMath::Prob(recoSoftTrack->chi2(),recoSoftTrack->ndof()));
327 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is HighPt... Filling the histos" << endl;
329 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is HightPt - filling the histos";
337 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