137 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
147 unsigned int theIndexOfThePrimaryVertex = 999.;
152 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
153 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
154 theIndexOfThePrimaryVertex = ind;
160 if (theIndexOfThePrimaryVertex<100) {
161 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
162 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
165 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
174 errVtx(2,2) = bs.
sigmaZ();
181 cout <<
"[MuonKinVsEtaAnalyzer]: Analyze the mu in different eta regions" << endl;
185 for (reco::MuonCollection::const_iterator muonIt = muons->begin(); muonIt!=muons->end(); ++muonIt){
188 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
196 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is global... Filling the histos" << endl;
198 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is global - filling the histos";
201 if(fabs(recoCombinedGlbTrack->eta())>
EtaCutMin && fabs(recoCombinedGlbTrack->eta())<
EtaCutMax){
202 etaGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->eta());
203 phiGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->phi());
204 pGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->p());
205 ptGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->pt());
206 chi2GlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->normalizedChi2());
207 chi2probGlbTrack[iEtaRegion]->Fill(TMath::Prob(recoCombinedGlbTrack->normalizedChi2(),recoCombinedGlbTrack->ndof()));
213 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tracker... Filling the histos" << endl;
215 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
219 etaTrack[iEtaRegion]->Fill(recoTrack->eta());
220 phiTrack[iEtaRegion]->Fill(recoTrack->phi());
221 pTrack[iEtaRegion]->Fill(recoTrack->p());
222 ptTrack[iEtaRegion]->Fill(recoTrack->pt());
223 chi2Track[iEtaRegion]->Fill(recoTrack->normalizedChi2());
224 chi2probTrack[iEtaRegion]->Fill(TMath::Prob(recoTrack->normalizedChi2(),recoTrack->ndof()));
230 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is standlone... Filling the histos" << endl;
232 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is standalone - filling the histos";
236 etaStaTrack[iEtaRegion]->Fill(recoStaTrack->eta());
237 phiStaTrack[iEtaRegion]->Fill(recoStaTrack->phi());
238 pStaTrack[iEtaRegion]->Fill(recoStaTrack->p());
239 ptStaTrack[iEtaRegion]->Fill(recoStaTrack->pt());
240 chi2StaTrack[iEtaRegion]->Fill(recoStaTrack->normalizedChi2());
241 chi2probStaTrack[iEtaRegion]->Fill(TMath::Prob(recoStaTrack->normalizedChi2(),recoStaTrack->ndof()));
247 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is tight... Filling the histos" << endl;
249 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
254 pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
256 chi2TightTrack[iEtaRegion]->Fill(recoTightTrack->normalizedChi2());
257 chi2probTightTrack[iEtaRegion]->Fill(TMath::Prob(recoTightTrack->normalizedChi2(),recoTightTrack->ndof()));
264 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Loose... Filling the histos" << endl;
266 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
270 else recoLooseTrack = recoMu.
track();
275 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
277 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
278 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->normalizedChi2(),recoLooseTrack->ndof()));
284 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is Soft... Filling the histos" << endl;
286 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Soft - filling the histos";
291 pSoftTrack[iEtaRegion]->Fill(recoSoftTrack->p());
292 ptSoftTrack[iEtaRegion]->Fill(recoSoftTrack->pt());
293 chi2SoftTrack[iEtaRegion]->Fill(recoSoftTrack->normalizedChi2());
294 chi2probSoftTrack[iEtaRegion]->Fill(TMath::Prob(recoSoftTrack->normalizedChi2(),recoSoftTrack->ndof()));
300 cout <<
"[MuonKinVsEtaAnalyzer]: The mu is HighPt... Filling the histos" << endl;
302 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is HightPt - filling the histos";
310 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
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
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 * > 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 * > chi2Track
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
static int position[264][3]
std::vector< MonitorElement * > chi2SoftTrack
const Point & position() const
position
std::vector< MonitorElement * > pLooseTrack
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