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_
 
int thetaBin
 
double thetaMax
 
double thetaMin
 
MonitorElementthetaStaTrack
 

Detailed Description

Definition at line 23 of file CosmicMuonRecoAnalyzer.cc.

Constructor & Destructor Documentation

◆ CosmicMuonRecoAnalyzer()

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

Constructor.

Definition at line 101 of file CosmicMuonRecoAnalyzer.cc.

References muonRecoAnalyzer_cfi::chi2Bin, muonRecoAnalyzer_cfi::chi2Max, muonRecoAnalyzer_cfi::chi2Min, 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, AlignmentTrackSelector_cfi::ptMax, ptMin, muonRecoAnalyzer_cfi::thetaBin, muonRecoAnalyzer_cfi::thetaMax, and muonRecoAnalyzer_cfi::thetaMin.

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

◆ ~CosmicMuonRecoAnalyzer()

CosmicMuonRecoAnalyzer::~CosmicMuonRecoAnalyzer ( )
override

Destructor.

Definition at line 139 of file CosmicMuonRecoAnalyzer.cc.

139 {}

Member Function Documentation

◆ analyze()

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

Inizialize parameters for histo binning.

Definition at line 214 of file CosmicMuonRecoAnalyzer.cc.

References iEvent, LogTrace, HLT_2022v11_cff::muon, and PDWG_BPHSkim_cff::muons.

214  {
215  LogTrace("CosmicMuon") << "[MuonRecoAnalyzer] Analyze the mu";
216 
217  // Take the muon container
219  iEvent.getByToken(theMuonCollectionLabel_, muons);
220 
221  int nTracks_ = 0;
222 
223  if (!muons.isValid())
224  return;
225 
226  for (edm::View<reco::Track>::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
227  nTracks_++;
228 
229  // get the track using only the mu spectrometer data
230 
231  etaStaTrack->Fill(muon->eta());
232  thetaStaTrack->Fill(muon->theta());
233  phiStaTrack->Fill(muon->phi());
234  chi2OvDFStaTrack->Fill(muon->normalizedChi2());
235  probchi2StaTrack->Fill(TMath::Prob(muon->chi2(), muon->ndof()));
236  pStaTrack->Fill(muon->p());
237  ptStaTrack->Fill(muon->pt());
238  qStaTrack->Fill(muon->charge());
239  qOverPStaTrack->Fill(muon->qoverp());
240  qOverPStaTrack_p->Fill(muon->p(), muon->qoverp());
241  phiVsetaStaTrack->Fill(muon->eta(), muon->phi());
242 
243  nValidHitsStaTrack->Fill(muon->numberOfValidHits());
244  nValidHitsStaTrack_eta->Fill(muon->eta(), muon->numberOfValidHits());
245  nValidHitsStaTrack_phi->Fill(muon->phi(), muon->numberOfValidHits());
246  }
247 
248  nTracksSta->Fill(nTracks_);
249 }
MonitorElement * nValidHitsStaTrack
#define LogTrace(id)
void Fill(long long x)
MonitorElement * nValidHitsStaTrack_phi
int iEvent
Definition: GenABIO.cc:224
MonitorElement * nValidHitsStaTrack_eta
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::View< reco::Track > > theMuonCollectionLabel_

◆ bookHistograms()

void CosmicMuonRecoAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 141 of file CosmicMuonRecoAnalyzer.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), muonRecoAnalyzer_cfi::chi2Bin, muonRecoAnalyzer_cfi::chi2Max, muonRecoAnalyzer_cfi::chi2Min, 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, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, muonRecoAnalyzer_cfi::thetaBin, muonRecoAnalyzer_cfi::thetaMax, and muonRecoAnalyzer_cfi::thetaMin.

143  {
144  ibooker.cd();
145  ibooker.setCurrentFolder(theFolder);
146 
148  // monitoring of eta parameter
150  std::string histname = "cosmicMuon";
151 
152  nTracksSta = ibooker.book1D(histname + "_traks", "#tracks", nTrkBin, nTrkMin, nTrkMax);
153 
154  etaStaTrack = ibooker.book1D(histname + "_eta", "#eta_{STA}", etaBin, etaMin, etaMax);
155 
157  // monitoring of theta parameter
159 
160  thetaStaTrack = ibooker.book1D(histname + "_theta", "#theta_{STA}", thetaBin, thetaMin, thetaMax);
161  thetaStaTrack->setAxisTitle("rad");
162 
163  // monitoring of phi paramater
164 
165  phiStaTrack = ibooker.book1D(histname + "_phi", "#phi_{STA}", phiBin, phiMin, phiMax);
166  phiStaTrack->setAxisTitle("rad");
167 
168  // monitoring of the chi2 parameter
169 
170  chi2OvDFStaTrack = ibooker.book1D(histname + "_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max);
171 
172  //--------------------------
173 
174  probchi2StaTrack = ibooker.book1D(histname + "_probchi", "Prob #chi_{STA}", 120, chi2Min, 1.20);
175 
176  // monitoring of the momentum
177 
178  pStaTrack = ibooker.book1D(histname + "_p", "p_{STA}", pBin, pMin, pMax);
179  pStaTrack->setAxisTitle("GeV");
180 
181  qOverPStaTrack = ibooker.book1D(histname + "_qoverp", "qoverp_{STA}", pResBin, pResMin, pResMax);
182  qOverPStaTrack->setAxisTitle("1/GeV");
183 
185  ibooker.book2D(histname + "_qoverp_p", "qoverp_p_{STA}", pBin, pMin, pMax, pResBin, pResMin, pResMax);
186 
187  // monitoring of the transverse momentum
188 
189  ptStaTrack = ibooker.book1D(histname + "_pt", "pt_{STA}", ptBin, ptMin, pMax);
190  ptStaTrack->setAxisTitle("GeV");
191 
192  // monitoring of the muon charge
193 
194  qStaTrack = ibooker.book1D(histname + "_q", "q_{STA}", 5, -2.5, 2.5);
195 
197  // monitoring of the phi-eta
198 
199  phiVsetaStaTrack = ibooker.book2D(
200  histname + "_phiVseta", "#phi vs #eta (STA)", etaBin / 2, etaMin, etaMax, phiBin / 2, phiMin, phiMax);
201  phiVsetaStaTrack->setAxisTitle("eta", 1);
202  phiVsetaStaTrack->setAxisTitle("phi", 2);
203 
204  // monitoring the hits
205  nValidHitsStaTrack = ibooker.book1D(histname + "_nValidHits", "#valid hits (STA)", hitsBin, hitsMin, hitsMax);
206 
207  nValidHitsStaTrack_eta = ibooker.book2D(
208  histname + "_nValidHits_eta", "#valid hits vs eta (STA)", etaBin, etaMin, etaMax, hitsBin, hitsMin, hitsMax);
209 
210  nValidHitsStaTrack_phi = ibooker.book2D(
211  histname + "_nValidHits_phi", "#valid hits vs phi (STA)", phiBin, phiMin, phiMax, hitsBin, hitsMin, hitsMax);
212 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * nValidHitsStaTrack
MonitorElement * nValidHitsStaTrack_phi
MonitorElement * nValidHitsStaTrack_eta
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
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

◆ chi2Bin

int CosmicMuonRecoAnalyzer::chi2Bin
private

Definition at line 63 of file CosmicMuonRecoAnalyzer.cc.

◆ chi2Max

double CosmicMuonRecoAnalyzer::chi2Max
private

Definition at line 65 of file CosmicMuonRecoAnalyzer.cc.

◆ chi2Min

double CosmicMuonRecoAnalyzer::chi2Min
private

Definition at line 64 of file CosmicMuonRecoAnalyzer.cc.

◆ chi2OvDFStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::chi2OvDFStaTrack
private

Definition at line 85 of file CosmicMuonRecoAnalyzer.cc.

◆ etaBin

int CosmicMuonRecoAnalyzer::etaBin
private

Definition at line 51 of file CosmicMuonRecoAnalyzer.cc.

◆ etaMax

double CosmicMuonRecoAnalyzer::etaMax
private

Definition at line 53 of file CosmicMuonRecoAnalyzer.cc.

◆ etaMin

double CosmicMuonRecoAnalyzer::etaMin
private

Definition at line 52 of file CosmicMuonRecoAnalyzer.cc.

◆ etaStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::etaStaTrack
private

Definition at line 82 of file CosmicMuonRecoAnalyzer.cc.

◆ hitsBin

int CosmicMuonRecoAnalyzer::hitsBin
private

Definition at line 43 of file CosmicMuonRecoAnalyzer.cc.

◆ hitsMax

int CosmicMuonRecoAnalyzer::hitsMax
private

Definition at line 45 of file CosmicMuonRecoAnalyzer.cc.

◆ hitsMin

int CosmicMuonRecoAnalyzer::hitsMin
private

Definition at line 44 of file CosmicMuonRecoAnalyzer.cc.

◆ nTracksSta

MonitorElement* CosmicMuonRecoAnalyzer::nTracksSta
private

Definition at line 80 of file CosmicMuonRecoAnalyzer.cc.

◆ nTrkBin

int CosmicMuonRecoAnalyzer::nTrkBin
private

Definition at line 47 of file CosmicMuonRecoAnalyzer.cc.

◆ nTrkMax

int CosmicMuonRecoAnalyzer::nTrkMax
private

Definition at line 48 of file CosmicMuonRecoAnalyzer.cc.

◆ nTrkMin

int CosmicMuonRecoAnalyzer::nTrkMin
private

Definition at line 49 of file CosmicMuonRecoAnalyzer.cc.

◆ nValidHitsStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack
private

Definition at line 91 of file CosmicMuonRecoAnalyzer.cc.

◆ nValidHitsStaTrack_eta

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_eta
private

Definition at line 95 of file CosmicMuonRecoAnalyzer.cc.

◆ nValidHitsStaTrack_phi

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_phi
private

Definition at line 96 of file CosmicMuonRecoAnalyzer.cc.

◆ parameters

edm::ParameterSet CosmicMuonRecoAnalyzer::parameters
private

Definition at line 37 of file CosmicMuonRecoAnalyzer.cc.

◆ pBin

int CosmicMuonRecoAnalyzer::pBin
private

Definition at line 67 of file CosmicMuonRecoAnalyzer.cc.

◆ phiBin

int CosmicMuonRecoAnalyzer::phiBin
private

Definition at line 59 of file CosmicMuonRecoAnalyzer.cc.

◆ phiMax

double CosmicMuonRecoAnalyzer::phiMax
private

Definition at line 61 of file CosmicMuonRecoAnalyzer.cc.

◆ phiMin

double CosmicMuonRecoAnalyzer::phiMin
private

Definition at line 60 of file CosmicMuonRecoAnalyzer.cc.

◆ phiStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::phiStaTrack
private

Definition at line 84 of file CosmicMuonRecoAnalyzer.cc.

◆ phiVsetaStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::phiVsetaStaTrack
private

Definition at line 94 of file CosmicMuonRecoAnalyzer.cc.

◆ pMax

double CosmicMuonRecoAnalyzer::pMax
private

Definition at line 69 of file CosmicMuonRecoAnalyzer.cc.

◆ pMin

double CosmicMuonRecoAnalyzer::pMin
private

Definition at line 68 of file CosmicMuonRecoAnalyzer.cc.

◆ pResBin

int CosmicMuonRecoAnalyzer::pResBin
private

Definition at line 75 of file CosmicMuonRecoAnalyzer.cc.

◆ pResMax

double CosmicMuonRecoAnalyzer::pResMax
private

Definition at line 77 of file CosmicMuonRecoAnalyzer.cc.

◆ pResMin

double CosmicMuonRecoAnalyzer::pResMin
private

Definition at line 76 of file CosmicMuonRecoAnalyzer.cc.

◆ probchi2StaTrack

MonitorElement* CosmicMuonRecoAnalyzer::probchi2StaTrack
private

Definition at line 86 of file CosmicMuonRecoAnalyzer.cc.

◆ pStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::pStaTrack
private

Definition at line 87 of file CosmicMuonRecoAnalyzer.cc.

◆ ptBin

int CosmicMuonRecoAnalyzer::ptBin
private

Definition at line 71 of file CosmicMuonRecoAnalyzer.cc.

◆ ptMax

double CosmicMuonRecoAnalyzer::ptMax
private

Definition at line 73 of file CosmicMuonRecoAnalyzer.cc.

◆ ptMin

double CosmicMuonRecoAnalyzer::ptMin
private

Definition at line 72 of file CosmicMuonRecoAnalyzer.cc.

◆ ptStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::ptStaTrack
private

Definition at line 89 of file CosmicMuonRecoAnalyzer.cc.

◆ qOverPStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack
private

Definition at line 88 of file CosmicMuonRecoAnalyzer.cc.

◆ qOverPStaTrack_p

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack_p
private

Definition at line 93 of file CosmicMuonRecoAnalyzer.cc.

◆ qStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::qStaTrack
private

Definition at line 90 of file CosmicMuonRecoAnalyzer.cc.

◆ theFolder

std::string CosmicMuonRecoAnalyzer::theFolder
private

Definition at line 98 of file CosmicMuonRecoAnalyzer.cc.

◆ theMuonCollectionLabel_

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

Definition at line 39 of file CosmicMuonRecoAnalyzer.cc.

◆ thetaBin

int CosmicMuonRecoAnalyzer::thetaBin
private

Definition at line 55 of file CosmicMuonRecoAnalyzer.cc.

◆ thetaMax

double CosmicMuonRecoAnalyzer::thetaMax
private

Definition at line 57 of file CosmicMuonRecoAnalyzer.cc.

◆ thetaMin

double CosmicMuonRecoAnalyzer::thetaMin
private

Definition at line 56 of file CosmicMuonRecoAnalyzer.cc.

◆ thetaStaTrack

MonitorElement* CosmicMuonRecoAnalyzer::thetaStaTrack
private

Definition at line 83 of file CosmicMuonRecoAnalyzer.cc.