143 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
153 unsigned int theIndexOfThePrimaryVertex = 999.;
158 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
159 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
160 theIndexOfThePrimaryVertex = ind;
166 if (theIndexOfThePrimaryVertex<100) {
167 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
168 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
171 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
180 errVtx(2,2) = bs.
sigmaZ();
187 cout <<
"[MuonKinVsEtaAnalyzer]: Analyze the mu in different eta regions" << endl;
191 for (reco::MuonCollection::const_iterator muonIt = muons->begin(); muonIt!=muons->end(); ++muonIt){
194 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
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->normalizedChi2(),recoCombinedGlbTrack->ndof()));
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->normalizedChi2(),recoTrack->ndof()));
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->normalizedChi2(),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->normalizedChi2(),recoTightTrack->ndof()));
270 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Loose... Filling the histos" << endl;
272 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
276 else recoLooseTrack = recoMu.
track();
281 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
283 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
284 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->normalizedChi2(),recoLooseTrack->ndof()));
290 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Medium... Filling the histos" << endl;
292 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Medium - filling the histos";
296 else recoMediumTrack = recoMu.
track();
304 chi2probMediumTrack[iEtaRegion]->Fill(TMath::Prob(recoMediumTrack->normalizedChi2(),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->normalizedChi2(),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->normalizedChi2(),recoHighPtTrack->ndof()));
MuonServiceProxy * theService
std::vector< MonitorElement * > chi2HighPtTrack
std::vector< MonitorElement * > etaTrack
std::vector< MonitorElement * > pSoftTrack
std::vector< MonitorElement * > chi2probSoftTrack
std::vector< MonitorElement * > etaLooseTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > chi2LooseTrack
std::vector< MonitorElement * > phiStaTrack
bool isTrackerMuon() const
std::vector< MonitorElement * > etaMediumTrack
std::vector< MonitorElement * > ptMediumTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
virtual TrackRef track() const
reference to a Track
bool isGlobalMuon() const
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< MonitorElement * > chi2probLooseTrack
bool isStandAloneMuon() const
std::vector< MonitorElement * > ptTrack
bool isMediumMuon(const reco::Muon &)
std::vector< MonitorElement * > chi2TightTrack
std::vector< MonitorElement * > chi2probGlbTrack
std::vector< MonitorElement * > chi2GlbTrack
bool isLooseMuon(const reco::Muon &)
std::vector< MonitorElement * > ptLooseTrack
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
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
std::vector< MonitorElement * > etaSoftTrack
std::vector< MonitorElement * > phiTightTrack
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
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
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
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
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track