CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CosmicMuonRecoAnalyzer Class Reference
Inheritance diagram for CosmicMuonRecoAnalyzer:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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 37 of file CosmicMuonRecoAnalyzer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 117 of file CosmicMuonRecoAnalyzer.cc.

References CSCSegmentAlgorithmDF_cfi::chi2Max, muonBadTrackFilter_cfi::chi2Min, conversionPostprocessing_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, MuonServiceProxy_cff::MuonServiceProxy, conversionPostprocessing_cfi::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, AlignmentTrackSelector_cfi::pMax, ALCARECOTkAlMinBias_cff::pMin, electronConversionRejectionValidator::ptBin, AlignmentTrackSelector_cfi::ptMax, and ptMin.

117  {
118  parameters = pSet;
119 
120  // the services:
121  theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters"));
122  theMuonCollectionLabel_ = consumes<edm::View<reco::Track> >(parameters.getParameter<edm::InputTag>("MuonCollection"));
123 
124  nTrkBin = parameters.getParameter<int>("nTrkBin");
125  nTrkMax = parameters.getParameter<int>("nTrkMax");
126  nTrkMin = parameters.getParameter<int>("nTrkMin");
127  ptBin = parameters.getParameter<int>("ptBin");
128  ptMin = parameters.getParameter<double>("ptMin");
129  ptMax = parameters.getParameter<double>("ptMax");
130  pBin = parameters.getParameter<int>("pBin");
131  pMin = parameters.getParameter<double>("pMin");
132  pMax = parameters.getParameter<double>("pMax");
133  chi2Bin = parameters.getParameter<int>("chi2Bin");
134  chi2Min = parameters.getParameter<double>("chi2Min");
135  chi2Max = parameters.getParameter<double>("chi2Max");
136  phiBin = parameters.getParameter<int>("phiBin");
137  phiMin = parameters.getParameter<double>("phiMin");
138  phiMax = parameters.getParameter<double>("phiMax");
139  thetaBin = parameters.getParameter<int>("thetaBin");
140  thetaMin = parameters.getParameter<double>("thetaMin");
141  thetaMax = parameters.getParameter<double>("thetaMax");
142  etaBin = parameters.getParameter<int>("etaBin");
143  etaMin = parameters.getParameter<double>("etaMin");
144  etaMax = parameters.getParameter<double>("etaMax");
145  pResBin = parameters.getParameter<int>("pResBin");
146  pResMin = parameters.getParameter<double>("pResMin");
147  pResMax = parameters.getParameter<double>("pResMax");
148 
149  hitsBin = parameters.getParameter<int>("hitsBin");
150  hitsMin = parameters.getParameter<int>("hitsMin");
151  hitsMax = parameters.getParameter<int>("hitsMax");
152 
153  theFolder = parameters.getParameter<string>("folder");
154 }
edm::EDGetTokenT< edm::View< reco::Track > > theMuonCollectionLabel_
CosmicMuonRecoAnalyzer::~CosmicMuonRecoAnalyzer ( )
override

Destructor.

Definition at line 156 of file CosmicMuonRecoAnalyzer.cc.

156 { 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 231 of file CosmicMuonRecoAnalyzer.cc.

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

231  {
232  LogTrace(metname) << "[MuonRecoAnalyzer] Analyze the mu";
233  theService->update(iSetup);
234 
235  // Take the muon container
237  iEvent.getByToken(theMuonCollectionLabel_, muons);
238 
239  int nTracks_ = 0;
240 
241  if (!muons.isValid())
242  return;
243 
244  for (edm::View<reco::Track>::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
245  nTracks_++;
246 
247  //Needed for MVA soft muon
248 
249  // get the track using only the mu spectrometer data
250 
251  etaStaTrack->Fill(muon->eta());
252  thetaStaTrack->Fill(muon->theta());
253  phiStaTrack->Fill(muon->phi());
254  chi2OvDFStaTrack->Fill(muon->normalizedChi2());
255  probchi2StaTrack->Fill(TMath::Prob(muon->chi2(), muon->ndof()));
256  pStaTrack->Fill(muon->p());
257  ptStaTrack->Fill(muon->pt());
258  qStaTrack->Fill(muon->charge());
259  qOverPStaTrack->Fill(muon->qoverp());
260  qOverPStaTrack_p->Fill(muon->p(), muon->qoverp());
261  phiVsetaStaTrack->Fill(muon->eta(), muon->phi());
262 
263  nValidHitsStaTrack->Fill(muon->numberOfValidHits());
264  nValidHitsStaTrack_eta->Fill(muon->eta(), muon->numberOfValidHits());
265  nValidHitsStaTrack_phi->Fill(muon->phi(), muon->numberOfValidHits());
266  }
267 
268  nTracksSta->Fill(nTracks_);
269 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const std::string metname
void Fill(long long x)
MonitorElement * nValidHitsStaTrack_phi
bool isValid() const
Definition: HandleBase.h:74
#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 158 of file CosmicMuonRecoAnalyzer.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), CSCSegmentAlgorithmDF_cfi::chi2Max, muonBadTrackFilter_cfi::chi2Min, conversionPostprocessing_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, conversionPostprocessing_cfi::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, AlignmentTrackSelector_cfi::pMax, ALCARECOTkAlMinBias_cff::pMin, electronConversionRejectionValidator::ptBin, ptMin, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

160  {
161  ibooker.cd();
162  ibooker.setCurrentFolder(theFolder);
163 
165  // monitoring of eta parameter
167  std::string histname = "cosmicMuon";
168 
169  nTracksSta = ibooker.book1D(histname + "_traks", "#tracks", nTrkBin, nTrkMin, nTrkMax);
170 
171  etaStaTrack = ibooker.book1D(histname + "_eta", "#eta_{STA}", etaBin, etaMin, etaMax);
172 
174  // monitoring of theta parameter
176 
177  thetaStaTrack = ibooker.book1D(histname + "_theta", "#theta_{STA}", thetaBin, thetaMin, thetaMax);
178  thetaStaTrack->setAxisTitle("rad");
179 
180  // monitoring of phi paramater
181 
182  phiStaTrack = ibooker.book1D(histname + "_phi", "#phi_{STA}", phiBin, phiMin, phiMax);
183  phiStaTrack->setAxisTitle("rad");
184 
185  // monitoring of the chi2 parameter
186 
187  chi2OvDFStaTrack = ibooker.book1D(histname + "_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max);
188 
189  //--------------------------
190 
191  probchi2StaTrack = ibooker.book1D(histname + "_probchi", "Prob #chi_{STA}", 120, chi2Min, 1.20);
192 
193  // monitoring of the momentum
194 
195  pStaTrack = ibooker.book1D(histname + "_p", "p_{STA}", pBin, pMin, pMax);
196  pStaTrack->setAxisTitle("GeV");
197 
198  qOverPStaTrack = ibooker.book1D(histname + "_qoverp", "qoverp_{STA}", pResBin, pResMin, pResMax);
199  qOverPStaTrack->setAxisTitle("1/GeV");
200 
202  ibooker.book2D(histname + "_qoverp_p", "qoverp_p_{STA}", pBin, pMin, pMax, pResBin, pResMin, pResMax);
203 
204  // monitoring of the transverse momentum
205 
206  ptStaTrack = ibooker.book1D(histname + "_pt", "pt_{STA}", ptBin, ptMin, pMax);
207  ptStaTrack->setAxisTitle("GeV");
208 
209  // monitoring of the muon charge
210 
211  qStaTrack = ibooker.book1D(histname + "_q", "q_{STA}", 5, -2.5, 2.5);
212 
214  // monitoring of the phi-eta
215 
216  phiVsetaStaTrack = ibooker.book2D(
217  histname + "_phiVseta", "#phi vs #eta (STA)", etaBin / 2, etaMin, etaMax, phiBin / 2, phiMin, phiMax);
218  phiVsetaStaTrack->setAxisTitle("eta", 1);
219  phiVsetaStaTrack->setAxisTitle("phi", 2);
220 
221  // monitoring the hits
222  nValidHitsStaTrack = ibooker.book1D(histname + "_nValidHits", "#valid hits (STA)", hitsBin, hitsMin, hitsMax);
223 
224  nValidHitsStaTrack_eta = ibooker.book2D(
225  histname + "_nValidHits_eta", "#valid hits vs eta (STA)", etaBin, etaMin, etaMax, hitsBin, hitsMin, hitsMax);
226 
227  nValidHitsStaTrack_phi = ibooker.book2D(
228  histname + "_nValidHits_phi", "#valid hits vs phi (STA)", phiBin, phiMin, phiMax, hitsBin, hitsMin, hitsMax);
229 }
MonitorElement * nValidHitsStaTrack_phi
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * nValidHitsStaTrack_eta
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
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 78 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::chi2Max
private

Definition at line 80 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::chi2Min
private

Definition at line 79 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::chi2OvDFStaTrack
private

Definition at line 100 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::etaBin
private

Definition at line 66 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::etaMax
private

Definition at line 68 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::etaMin
private

Definition at line 67 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::etaStaTrack
private

Definition at line 97 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsBin
private

Definition at line 58 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsMax
private

Definition at line 60 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::hitsMin
private

Definition at line 59 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nTracksSta
private

Definition at line 95 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkBin
private

Definition at line 62 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkMax
private

Definition at line 63 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::nTrkMin
private

Definition at line 64 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack
private

Definition at line 106 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_eta
private

Definition at line 110 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::nValidHitsStaTrack_phi
private

Definition at line 111 of file CosmicMuonRecoAnalyzer.cc.

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

Definition at line 82 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::phiBin
private

Definition at line 74 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::phiMax
private

Definition at line 76 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::phiMin
private

Definition at line 75 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::phiStaTrack
private

Definition at line 99 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::phiVsetaStaTrack
private

Definition at line 109 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pMax
private

Definition at line 84 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pMin
private

Definition at line 83 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::pResBin
private

Definition at line 90 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pResMax
private

Definition at line 92 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::pResMin
private

Definition at line 91 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::probchi2StaTrack
private

Definition at line 101 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::pStaTrack
private

Definition at line 102 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::ptBin
private

Definition at line 86 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::ptMax
private

Definition at line 88 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::ptMin
private

Definition at line 87 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::ptStaTrack
private

Definition at line 104 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack
private

Definition at line 103 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qOverPStaTrack_p
private

Definition at line 108 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::qStaTrack
private

Definition at line 105 of file CosmicMuonRecoAnalyzer.cc.

std::string CosmicMuonRecoAnalyzer::theFolder
private

Definition at line 113 of file CosmicMuonRecoAnalyzer.cc.

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

Definition at line 54 of file CosmicMuonRecoAnalyzer.cc.

MuonServiceProxy* CosmicMuonRecoAnalyzer::theService
private

Definition at line 51 of file CosmicMuonRecoAnalyzer.cc.

int CosmicMuonRecoAnalyzer::thetaBin
private

Definition at line 70 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::thetaMax
private

Definition at line 72 of file CosmicMuonRecoAnalyzer.cc.

double CosmicMuonRecoAnalyzer::thetaMin
private

Definition at line 71 of file CosmicMuonRecoAnalyzer.cc.

MonitorElement* CosmicMuonRecoAnalyzer::thetaStaTrack
private

Definition at line 98 of file CosmicMuonRecoAnalyzer.cc.