81 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
82 if (iEtaRegion==0) EtaName =
"Barrel";
83 if (iEtaRegion==1) EtaName =
"EndCap";
84 if (iEtaRegion==2) EtaName =
"Overlap";
85 if (iEtaRegion==3) EtaName =
"";
88 etaGlbTrack.push_back(dbe->
book1D(
"GlbMuon_eta_"+EtaName,
"#eta_{GLB} "+EtaName, etaBin, etaMin, etaMax));
89 etaTrack.push_back(dbe->
book1D(
"TkMuon_eta_"+EtaName,
"#eta_{TK} "+EtaName, etaBin, etaMin, etaMax));
90 etaStaTrack.push_back(dbe->
book1D(
"StaMuon_eta_"+EtaName,
"#eta_{STA} "+EtaName, etaBin, etaMin, etaMax));
91 etaTightTrack.push_back(dbe->
book1D(
"TightMuon_eta_"+EtaName,
"#eta_{Tight} "+EtaName, etaBin, etaMin, etaMax));
92 etaLooseTrack.push_back(dbe->
book1D(
"LooseMuon_eta_"+EtaName,
"#eta_{Loose} "+EtaName, etaBin, etaMin, etaMax));
93 etaSoftTrack.push_back(dbe->
book1D(
"SoftMuon_eta_"+EtaName,
"#eta_{Soft} "+EtaName, etaBin, etaMin, etaMax));
94 etaHighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_eta_"+EtaName,
"#eta_{HighPt} "+EtaName, etaBin, etaMin, etaMax));
97 phiGlbTrack.push_back(dbe->
book1D(
"GlbMuon_phi_"+EtaName,
"#phi_{GLB} "+EtaName+
"(rad)", phiBin, phiMin, phiMax));
98 phiTrack.push_back(dbe->
book1D(
"TkMuon_phi_"+EtaName,
"#phi_{TK}" +EtaName +
"(rad)", phiBin, phiMin, phiMax));
99 phiStaTrack.push_back(dbe->
book1D(
"StaMuon_phi_"+EtaName,
"#phi_{STA}"+EtaName+
" (rad)", phiBin, phiMin, phiMax));
100 phiTightTrack.push_back(dbe->
book1D(
"TightMuon_phi_"+EtaName,
"#phi_{Tight}_"+EtaName, phiBin, phiMin, phiMax));
101 phiLooseTrack.push_back(dbe->
book1D(
"LooseMuon_phi_"+EtaName,
"#phi_{Loose}_"+EtaName, phiBin, phiMin, phiMax));
102 phiSoftTrack.push_back(dbe->
book1D(
"SoftMuon_phi_"+EtaName,
"#phi_{Soft}_"+EtaName, phiBin, phiMin, phiMax));
103 phiHighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_phi_"+EtaName,
"#phi_{HighPt}_"+EtaName, phiBin, phiMin, phiMax));
106 pGlbTrack.push_back(dbe->
book1D(
"GlbMuon_p_"+EtaName,
"p_{GLB} "+EtaName, pBin, pMin, pMax));
107 pTrack.push_back(dbe->
book1D(
"TkMuon_p"+EtaName,
"p_{TK} "+EtaName, pBin, pMin, pMax));
108 pStaTrack.push_back(dbe->
book1D(
"StaMuon_p"+EtaName,
"p_{STA} "+EtaName, pBin, pMin, pMax));
109 pTightTrack.push_back(dbe->
book1D(
"TightMuon_p_"+EtaName,
"p_{Tight} "+EtaName, pBin, pMin, pMax));
110 pLooseTrack.push_back(dbe->
book1D(
"LooseMuon_p_"+EtaName,
"p_{Loose} "+EtaName, pBin, pMin, pMax));
111 pSoftTrack.push_back(dbe->
book1D(
"SoftMuon_p_"+EtaName,
"p_{Soft} "+EtaName, pBin, pMin, pMax));
112 pHighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_p_"+EtaName,
"p_{HighPt} "+EtaName, pBin, pMin, pMax));
115 ptGlbTrack.push_back(dbe->
book1D(
"GlbMuon_pt_" +EtaName,
"pt_{GLB} "+EtaName, ptBin, ptMin, ptMax));
116 ptTrack.push_back(dbe->
book1D(
"TkMuon_pt_"+EtaName,
"pt_{TK} "+EtaName, ptBin, ptMin, ptMax));
117 ptStaTrack.push_back(dbe->
book1D(
"StaMuon_pt_"+EtaName,
"pt_{STA} "+EtaName, ptBin, ptMin, pMax));
118 ptTightTrack.push_back(dbe->
book1D(
"TightMuon_pt_"+EtaName,
"pt_{Tight} "+EtaName, ptBin, ptMin, ptMax));
119 ptLooseTrack.push_back(dbe->
book1D(
"LooseMuon_pt_"+EtaName,
"pt_{Loose} "+EtaName, ptBin, ptMin, ptMax));
120 ptSoftTrack.push_back(dbe->
book1D(
"SoftMuon_pt_"+EtaName,
"pt_{Soft} "+EtaName, ptBin, ptMin, ptMax));
121 ptHighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_pt_"+EtaName,
"pt_{HighPt} "+EtaName, ptBin, ptMin, ptMax));
124 chi2GlbTrack.push_back(dbe->
book1D(
"GlbMuon_chi2_"+EtaName,
"#chi^{2}_{GLB} " + EtaName, chiBin, chiMin, chiMax));
125 chi2probGlbTrack.push_back(dbe->
book1D(
"GlbMuon_chi2prob_"+EtaName,
"#chi^{2}_{GLB} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
126 chi2Track.push_back(dbe->
book1D(
"TkMuon_chi2_"+EtaName,
"#chi^{2}_{TK} " + EtaName, chiBin, chiMin, chiMax));
127 chi2probTrack.push_back(dbe->
book1D(
"TkMuon_chi2prob_"+EtaName,
"#chi^{2}_{TK} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
128 chi2StaTrack.push_back(dbe->
book1D(
"StaMuon_chi2_"+EtaName,
"#chi^{2}_{STA} " + EtaName, chiBin, chiMin, chiMax));
129 chi2probStaTrack.push_back(dbe->
book1D(
"StaMuon_chi2prob_"+EtaName,
"#chi^{2}_{STA} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
130 chi2TightTrack.push_back(dbe->
book1D(
"TightMuon_chi2_"+EtaName,
"#chi^{2}_{Tight} " + EtaName, chiBin, chiMin, chiMax));
131 chi2probTightTrack.push_back(dbe->
book1D(
"TightMuon_chi2prob_"+EtaName,
"#chi^{2}_{Tight} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
132 chi2LooseTrack.push_back(dbe->
book1D(
"LooseMuon_chi2_"+EtaName,
"#chi^{2}_{Loose} " + EtaName, chiBin, chiMin, chiMax));
133 chi2probLooseTrack.push_back(dbe->
book1D(
"LooseMuon_chi2prob_"+EtaName,
"#chi^{2}_{Loose} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
134 chi2SoftTrack.push_back(dbe->
book1D(
"SoftMuon_chi2_"+EtaName,
"#chi^{2}_{Soft} " + EtaName, chiBin, chiMin, chiMax));
135 chi2probSoftTrack.push_back(dbe->
book1D(
"SoftMuon_chi2prob_"+EtaName,
"#chi^{2}_{Soft} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
136 chi2HighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_chi2_"+EtaName,
"#chi^{2}_{HighPt} " + EtaName, chiBin, chiMin, chiMax));
137 chi2probHighPtTrack.push_back(dbe->
book1D(
"HighPtMuon_chi2prob_"+EtaName,
"#chi^{2}_{HighPt} prob." + EtaName, chiBin, chiprobMin, chiprobMax));
154 unsigned int theIndexOfThePrimaryVertex = 999.;
161 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
162 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
163 theIndexOfThePrimaryVertex = ind;
169 if (theIndexOfThePrimaryVertex<100) {
170 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
171 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
173 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
183 errVtx(2,2) = bs.
sigmaZ();
192 iEvent.
getByLabel(
"offlineBeamSpot", beamSpotHandle);
193 beamSpot = *beamSpotHandle;
195 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";
197 for(
unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
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()));
218 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
222 etaTrack[iEtaRegion]->Fill(recoTrack->eta());
223 phiTrack[iEtaRegion]->Fill(recoTrack->phi());
224 pTrack[iEtaRegion]->Fill(recoTrack->p());
225 ptTrack[iEtaRegion]->Fill(recoTrack->pt());
226 chi2Track[iEtaRegion]->Fill(recoTrack->normalizedChi2());
227 chi2probTrack[iEtaRegion]->Fill(TMath::Prob(recoTrack->normalizedChi2(),recoTrack->ndof()));
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()));
246 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
251 pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
253 chi2TightTrack[iEtaRegion]->Fill(recoTightTrack->normalizedChi2());
254 chi2probTightTrack[iEtaRegion]->Fill(TMath::Prob(recoTightTrack->normalizedChi2(),recoTightTrack->ndof()));
260 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Loose - filling the histos";
264 else recoLooseTrack = recoMu.
track();
269 pLooseTrack[iEtaRegion]->Fill(recoLooseTrack->p());
271 chi2LooseTrack[iEtaRegion]->Fill(recoLooseTrack->normalizedChi2());
272 chi2probLooseTrack[iEtaRegion]->Fill(TMath::Prob(recoLooseTrack->normalizedChi2(),recoLooseTrack->ndof()));
277 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is Soft - filling the histos";
282 pSoftTrack[iEtaRegion]->Fill(recoSoftTrack->p());
283 ptSoftTrack[iEtaRegion]->Fill(recoSoftTrack->pt());
284 chi2SoftTrack[iEtaRegion]->Fill(recoSoftTrack->normalizedChi2());
285 chi2probSoftTrack[iEtaRegion]->Fill(TMath::Prob(recoSoftTrack->normalizedChi2(),recoSoftTrack->ndof()));
290 LogTrace(
metname)<<
"[MuonKinVsEtaAnalyzer] The mu is HightPt - filling the histos";
298 chi2probHighPtTrack[iEtaRegion]->Fill(TMath::Prob(recoHighPtTrack->normalizedChi2(),recoHighPtTrack->ndof()));
T getParameter(std::string const &) const
std::vector< MonitorElement * > chi2HighPtTrack
std::vector< MonitorElement * > etaTrack
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< MonitorElement * > pSoftTrack
std::vector< MonitorElement * > chi2probSoftTrack
std::vector< MonitorElement * > etaLooseTrack
std::vector< MonitorElement * > chi2LooseTrack
std::vector< MonitorElement * > phiStaTrack
bool isTrackerMuon() const
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
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
Get the analysis.
std::vector< MonitorElement * > ptTrack
static int position[TOTALCHAMBERS][3]
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
void beginJob(DQMStore *dbe)
Iniyeszialize parameters for histo binning.
MuonKinVsEtaAnalyzer(const edm::ParameterSet &, MuonServiceProxy *theService)
Constructor.
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
edm::ParameterSet parameters
std::vector< MonitorElement * > chi2probStaTrack
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< MonitorElement * > etaSoftTrack
std::vector< MonitorElement * > phiTightTrack
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
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
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
void setCurrentFolder(const std::string &fullpath)
std::vector< MonitorElement * > ptGlbTrack
std::vector< MonitorElement * > chi2probHighPtTrack
std::vector< MonitorElement * > phiGlbTrack
std::vector< MonitorElement * > phiHighPtTrack
virtual ~MuonKinVsEtaAnalyzer()
Destructor.
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track