CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CosmicMuonRecoAnalyzer Class Reference
Inheritance diagram for CosmicMuonRecoAnalyzer:

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Inizialize parameters for histo binning. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 CosmicMuonRecoAnalyzer (const edm::ParameterSet &)
 Constructor. More...
 
 ~CosmicMuonRecoAnalyzer () override
 Destructor. More...
 

Private Attributes

int chi2Bin
 
double chi2Max
 
double chi2Min
 
MonitorElementchi2OvDFStaTrack
 
int etaBin
 
double etaMax
 
double etaMin
 
MonitorElementetaStaTrack
 
int hitsBin
 
int hitsMax
 
int hitsMin
 
MonitorElementnTracksSta
 
int nTrkBin
 
int nTrkMax
 
int nTrkMin
 
MonitorElementnValidHitsStaTrack
 
MonitorElementnValidHitsStaTrack_eta
 
MonitorElementnValidHitsStaTrack_phi
 
edm::ParameterSet parameters
 
int pBin
 
int phiBin
 
double phiMax
 
double phiMin
 
MonitorElementphiStaTrack
 
MonitorElementphiVsetaStaTrack
 
double pMax
 
double pMin
 
int pResBin
 
double pResMax
 
double pResMin
 
MonitorElementprobchi2StaTrack
 
MonitorElementpStaTrack
 
int ptBin
 
double ptMax
 
double ptMin
 
MonitorElementptStaTrack
 
MonitorElementqOverPStaTrack
 
MonitorElementqOverPStaTrack_p
 
MonitorElementqStaTrack
 
std::string theFolder
 
edm::EDGetTokenT< edm::View< reco::Track > > theMuonCollectionLabel_
 
MuonServiceProxytheService
 
int thetaBin
 
double thetaMax
 
double thetaMin
 
MonitorElementthetaStaTrack
 

Detailed Description

Definition at line 24 of file CosmicMuonRecoAnalyzer.cc.

Constructor & Destructor Documentation

CosmicMuonRecoAnalyzer::CosmicMuonRecoAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 103 of file CosmicMuonRecoAnalyzer.cc.

References muonRecoAnalyzer_cfi::chi2Bin, muonRecoAnalyzer_cfi::chi2Max, muonRecoAnalyzer_cfi::chi2Min, muonRecoAnalyzer_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, muonRecoAnalyzer_cfi::hitsBin, muonRecoAnalyzer_cfi::hitsMax, muonRecoAnalyzer_cfi::hitsMin, MuonServiceProxy_cff::MuonServiceProxy, muonRecoAnalyzer_cfi::nTrkBin, muonRecoAnalyzer_cfi::nTrkMax, muonRecoAnalyzer_cfi::nTrkMin, muonRecoAnalyzer_cfi::pBin, BeamMonitor_cff::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, AlignmentTrackSelector_cfi::pMax, ALCARECOTkAlMinBias_cff::pMin, muonRecoAnalyzer_cfi::pResBin, muonRecoAnalyzer_cfi::pResMax, muonRecoAnalyzer_cfi::pResMin, muonRecoAnalyzer_cfi::ptBin, AlignmentTrackSelector_cfi::ptMax, ptMin, muonRecoAnalyzer_cfi::thetaBin, muonRecoAnalyzer_cfi::thetaMax, and muonRecoAnalyzer_cfi::thetaMin.

103  {
104  parameters = pSet;
105 
106  // the services:
107  theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters"));
108  theMuonCollectionLabel_ = consumes<edm::View<reco::Track> >(parameters.getParameter<edm::InputTag>("MuonCollection"));
109 
110  nTrkBin = parameters.getParameter<int>("nTrkBin");
111  nTrkMax = parameters.getParameter<int>("nTrkMax");
112  nTrkMin = parameters.getParameter<int>("nTrkMin");
113  ptBin = parameters.getParameter<int>("ptBin");
114  ptMin = parameters.getParameter<double>("ptMin");
115  ptMax = parameters.getParameter<double>("ptMax");
116  pBin = parameters.getParameter<int>("pBin");
117  pMin = parameters.getParameter<double>("pMin");
118  pMax = parameters.getParameter<double>("pMax");
119  chi2Bin = parameters.getParameter<int>("chi2Bin");
120  chi2Min = parameters.getParameter<double>("chi2Min");
121  chi2Max = parameters.getParameter<double>("chi2Max");
122  phiBin = parameters.getParameter<int>("phiBin");
123  phiMin = parameters.getParameter<double>("phiMin");
124  phiMax = parameters.getParameter<double>("phiMax");
125  thetaBin = parameters.getParameter<int>("thetaBin");
126  thetaMin = parameters.getParameter<double>("thetaMin");
127  thetaMax = parameters.getParameter<double>("thetaMax");
128  etaBin = parameters.getParameter<int>("etaBin");
129  etaMin = parameters.getParameter<double>("etaMin");
130  etaMax = parameters.getParameter<double>("etaMax");
131  pResBin = parameters.getParameter<int>("pResBin");
132  pResMin = parameters.getParameter<double>("pResMin");
133  pResMax = parameters.getParameter<double>("pResMax");
134 
135  hitsBin = parameters.getParameter<int>("hitsBin");
136  hitsMin = parameters.getParameter<int>("hitsMin");
137  hitsMax = parameters.getParameter<int>("hitsMax");
138 
139  theFolder = parameters.getParameter<string>("folder");
140 }
edm::EDGetTokenT< edm::View< reco::Track > > theMuonCollectionLabel_
CosmicMuonRecoAnalyzer::~CosmicMuonRecoAnalyzer ( )
override

Destructor.

Definition at line 142 of file CosmicMuonRecoAnalyzer.cc.

142 { delete theService; }

Member Function Documentation

void CosmicMuonRecoAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Inizialize parameters for histo binning.

Definition at line 217 of file CosmicMuonRecoAnalyzer.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), edm::HandleBase::isValid(), LogTrace, metname, HLT_2018_cff::muon, and PDWG_BPHSkim_cff::muons.

217  {
218  LogTrace(metname) << "[MuonRecoAnalyzer] Analyze the mu";
219  theService->update(iSetup);
220 
221  // Take the muon container
223  iEvent.getByToken(theMuonCollectionLabel_, muons);
224 
225  int nTracks_ = 0;
226 
227  if (!muons.isValid())
228  return;
229 
230  for (edm::View<reco::Track>::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
231  nTracks_++;
232 
233  // get the track using only the mu spectrometer data
234 
235  etaStaTrack->Fill(muon->eta());
236  thetaStaTrack->Fill(muon->theta());
237  phiStaTrack->Fill(muon->phi());
238  chi2OvDFStaTrack->Fill(muon->normalizedChi2());
239  probchi2StaTrack->Fill(TMath::Prob(muon->chi2(), muon->ndof()));
240  pStaTrack->Fill(muon->p());
241  ptStaTrack->Fill(muon->pt());
242  qStaTrack->Fill(muon->charge());
243  qOverPStaTrack->Fill(muon->qoverp());
244  qOverPStaTrack_p->Fill(muon->p(), muon->qoverp());
245  phiVsetaStaTrack->Fill(muon->eta(), muon->phi());
246 
247  nValidHitsStaTrack->Fill(muon->numberOfValidHits());
248  nValidHitsStaTrack_eta->Fill(muon->eta(), muon->numberOfValidHits());
249  nValidHitsStaTrack_phi->Fill(muon->phi(), muon->numberOfValidHits());
250  }
251 
252  nTracksSta->Fill(nTracks_);
253 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const std::string metname
MonitorElement * nValidHitsStaTrack
void Fill(long long x)
MonitorElement * nValidHitsStaTrack_phi
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
MonitorElement * nValidHitsStaTrack_eta
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::View< reco::Track > > theMuonCollectionLabel_
void CosmicMuonRecoAnalyzer::bookHistograms ( DQMStore::IBooker &  ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 144 of file CosmicMuonRecoAnalyzer.cc.

References muonRecoAnalyzer_cfi::chi2Bin, muonRecoAnalyzer_cfi::chi2Max, muonRecoAnalyzer_cfi::chi2Min, muonRecoAnalyzer_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, muonRecoAnalyzer_cfi::hitsBin, muonRecoAnalyzer_cfi::hitsMax, muonRecoAnalyzer_cfi::hitsMin, muonRecoAnalyzer_cfi::nTrkBin, muonRecoAnalyzer_cfi::nTrkMax, muonRecoAnalyzer_cfi::nTrkMin, muonRecoAnalyzer_cfi::pBin, BeamMonitor_cff::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, AlignmentTrackSelector_cfi::pMax, ALCARECOTkAlMinBias_cff::pMin, muonRecoAnalyzer_cfi::pResBin, muonRecoAnalyzer_cfi::pResMax, muonRecoAnalyzer_cfi::pResMin, muonRecoAnalyzer_cfi::ptBin, ptMin, AlCaHLTBitMon_QueryRunRegistry::string, muonRecoAnalyzer_cfi::thetaBin, muonRecoAnalyzer_cfi::thetaMax, and muonRecoAnalyzer_cfi::thetaMin.

146  {
147  ibooker.cd();
148  ibooker.setCurrentFolder(theFolder);
149 
151  // monitoring of eta parameter
153  std::string histname = "cosmicMuon";
154 
155  nTracksSta = ibooker.book1D(histname + "_traks", "#tracks", nTrkBin, nTrkMin, nTrkMax);
156 
157  etaStaTrack = ibooker.book1D(histname + "_eta", "#eta_{STA}", etaBin, etaMin, etaMax);
158 
160  // monitoring of theta parameter
162 
163  thetaStaTrack = ibooker.book1D(histname + "_theta", "#theta_{STA}", thetaBin, thetaMin, thetaMax);
164  thetaStaTrack->setAxisTitle("rad");
165 
166  // monitoring of phi paramater
167 
168  phiStaTrack = ibooker.book1D(histname + "_phi", "#phi_{STA}", phiBin, phiMin, phiMax);
169  phiStaTrack->setAxisTitle("rad");
170 
171  // monitoring of the chi2 parameter
172 
173  chi2OvDFStaTrack = ibooker.book1D(histname + "_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max);
174 
175  //--------------------------
176 
177  probchi2StaTrack = ibooker.book1D(histname + "_probchi", "Prob #chi_{STA}", 120, chi2Min, 1.20);
178 
179  // monitoring of the momentum
180 
181  pStaTrack = ibooker.book1D(histname + "_p", "p_{STA}", pBin, pMin, pMax);
182  pStaTrack->setAxisTitle("GeV");
183 
184  qOverPStaTrack = ibooker.book1D(histname + "_qoverp", "qoverp_{STA}", pResBin, pResMin, pResMax);
185  qOverPStaTrack->setAxisTitle("1/GeV");
186 
188  ibooker.book2D(histname + "_qoverp_p", "qoverp_p_{STA}", pBin, pMin, pMax, pResBin, pResMin, pResMax);
189 
190  // monitoring of the transverse momentum
191 
192  ptStaTrack = ibooker.book1D(histname + "_pt", "pt_{STA}", ptBin, ptMin, pMax);
193  ptStaTrack->setAxisTitle("GeV");
194 
195  // monitoring of the muon charge
196 
197  qStaTrack = ibooker.book1D(histname + "_q", "q_{STA}", 5, -2.5, 2.5);
198 
200  // monitoring of the phi-eta
201 
202  phiVsetaStaTrack = ibooker.book2D(
203  histname + "_phiVseta", "#phi vs #eta (STA)", etaBin / 2, etaMin, etaMax, phiBin / 2, phiMin, phiMax);
204  phiVsetaStaTrack->setAxisTitle("eta", 1);
205  phiVsetaStaTrack->setAxisTitle("phi", 2);
206 
207  // monitoring the hits
208  nValidHitsStaTrack = ibooker.book1D(histname + "_nValidHits", "#valid hits (STA)", hitsBin, hitsMin, hitsMax);
209 
210  nValidHitsStaTrack_eta = ibooker.book2D(
211  histname + "_nValidHits_eta", "#valid hits vs eta (STA)", etaBin, etaMin, etaMax, hitsBin, hitsMin, hitsMax);
212 
213  nValidHitsStaTrack_phi = ibooker.book2D(
214  histname + "_nValidHits_phi", "#valid hits vs phi (STA)", phiBin, phiMin, phiMax, hitsBin, hitsMin, hitsMax);
215 }
MonitorElement * nValidHitsStaTrack
MonitorElement * nValidHitsStaTrack_phi
MonitorElement * nValidHitsStaTrack_eta
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

int CosmicMuonRecoAnalyzer::chi2Bin
private

Definition at line 65 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::chi2Max
private

Definition at line 67 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::chi2Min
private

Definition at line 66 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::chi2OvDFStaTrack
private

Definition at line 87 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::etaBin
private

Definition at line 53 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::etaMax
private

Definition at line 55 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::etaMin
private

Definition at line 54 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::etaStaTrack
private

Definition at line 84 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsBin
private

Definition at line 45 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsMax
private

Definition at line 47 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsMin
private

Definition at line 46 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nTracksSta
private

Definition at line 82 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkBin
private

Definition at line 49 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkMax
private

Definition at line 50 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkMin
private

Definition at line 51 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack
private

Definition at line 93 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_eta
private

Definition at line 97 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_phi
private

Definition at line 98 of file CosmicMuonRecoAnalyzer.cc.

edm::ParameterSet CosmicMuonRecoAnalyzer::parameters
private
int CosmicMuonRecoAnalyzer::pBin
private

Definition at line 69 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::phiBin
private

Definition at line 61 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::phiMax
private

Definition at line 63 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::phiMin
private

Definition at line 62 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::phiStaTrack
private

Definition at line 86 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::phiVsetaStaTrack
private

Definition at line 96 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pMax
private

Definition at line 71 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pMin
private

Definition at line 70 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::pResBin
private

Definition at line 77 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pResMax
private

Definition at line 79 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pResMin
private

Definition at line 78 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::probchi2StaTrack
private

Definition at line 88 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::pStaTrack
private

Definition at line 89 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::ptBin
private

Definition at line 73 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::ptMax
private

Definition at line 75 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::ptMin
private

Definition at line 74 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::ptStaTrack
private

Definition at line 91 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack
private

Definition at line 90 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack_p
private

Definition at line 95 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qStaTrack
private

Definition at line 92 of file CosmicMuonRecoAnalyzer.cc.

std::string CosmicMuonRecoAnalyzer::theFolder
private

Definition at line 100 of file CosmicMuonRecoAnalyzer.cc.

edm::EDGetTokenT<edm::View<reco::Track> > CosmicMuonRecoAnalyzer::theMuonCollectionLabel_
private

Definition at line 41 of file CosmicMuonRecoAnalyzer.cc.

MuonServiceProxy* CosmicMuonRecoAnalyzer::theService
private

Definition at line 38 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::thetaBin
private

Definition at line 57 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::thetaMax
private

Definition at line 59 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::thetaMin
private

Definition at line 58 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::thetaStaTrack
private

Definition at line 85 of file CosmicMuonRecoAnalyzer.cc.