CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
RPCRecHitProbability Class Reference

Data Format. More...

#include <RPCRecHitProbability.h>

Inheritance diagram for RPCRecHitProbability:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 RPCRecHitProbability (const edm::ParameterSet &)
 
 ~RPCRecHitProbability () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Member Functions

void makeDcsInfo (const edm::Event &)
 

Private Attributes

int counter
 
bool dcs_
 
std::string globalFolder_
 
float muEtaCut_
 
std::string muonFolder_
 
edm::EDGetTokenT< reco::CandidateViewmuonLabel_
 
float muPtCut_
 
MonitorElementNumberOfMuonEta_
 
MonitorElementNumberOfMuonPhi_B_
 
MonitorElementNumberOfMuonPhi_EM_
 
MonitorElementNumberOfMuonPhi_EP_
 
MonitorElementNumberOfMuonPt_B_
 
MonitorElementNumberOfMuonPt_EM_
 
MonitorElementNumberOfMuonPt_EP_
 
MonitorElementrecHitEta_ [6]
 
MonitorElementrecHitPhi_B_ [6]
 
MonitorElementrecHitPhi_EM_ [6]
 
MonitorElementrecHitPhi_EP_ [6]
 
MonitorElementrecHitPt_B_ [6]
 
MonitorElementrecHitPt_EM_ [6]
 
MonitorElementrecHitPt_EP_ [6]
 
std::string RootFileName
 
MonitorElementRPCRecHitMuonEta_
 
bool saveRootFile
 
edm::EDGetTokenT< DcsStatusCollectionscalersRawToDigiLabel_
 
std::string subsystemFolder_
 

Detailed Description

Data Format.

Definition at line 21 of file RPCRecHitProbability.h.

Constructor & Destructor Documentation

RPCRecHitProbability::RPCRecHitProbability ( const edm::ParameterSet pset)
explicit

Definition at line 14 of file RPCRecHitProbability.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalFolder_, muEtaCut_, muonFolder_, muonLabel_, muPtCut_, RootFileName, saveRootFile, scalersRawToDigiLabel_, AlCaHLTBitMon_QueryRunRegistry::string, and subsystemFolder_.

14  :counter(0){
15 
16  saveRootFile = pset.getUntrackedParameter<bool>("SaveRootFile", false);
17  RootFileName = pset.getUntrackedParameter<std::string>("RootFileName", "RPCRecHitProbabilityDQM.root");
18 
19  muonLabel_ =consumes<reco::CandidateView>(pset.getParameter<edm::InputTag>("MuonLabel"));
20  muPtCut_ = pset.getUntrackedParameter<double>("MuonPtCut", 3.0);
21  muEtaCut_ = pset.getUntrackedParameter<double>("MuonEtaCut", 1.9);
22  scalersRawToDigiLabel_ = consumes<DcsStatusCollection>(pset.getParameter<edm::InputTag>("ScalersRawToDigiLabel"));
23 
24  subsystemFolder_ = pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
25  globalFolder_ = pset.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
26  muonFolder_ = pset.getUntrackedParameter<std::string>("MuonFolder", "Muon");
27 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
edm::EDGetTokenT< reco::CandidateView > muonLabel_
RPCRecHitProbability::~RPCRecHitProbability ( )
override

Definition at line 29 of file RPCRecHitProbability.cc.

29 {}

Member Function Documentation

void RPCRecHitProbability::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprotected

Definition at line 103 of file RPCRecHitProbability.cc.

References counter, dcs_, PVValHelper::eta, reco::LeafCandidate::eta(), MonitorElement::Fill(), HcalObjRepresent::Fill(), mps_fire::i, reco::Muon::isGlobalMuon(), edm::HandleBase::isValid(), makeDcsInfo(), muEtaCut_, muonLabel_, muPtCut_, NumberOfMuonEta_, NumberOfMuonPhi_B_, NumberOfMuonPhi_EM_, NumberOfMuonPhi_EP_, NumberOfMuonPt_B_, NumberOfMuonPt_EM_, NumberOfMuonPt_EP_, reco::Muon::outerTrack(), phi, reco::LeafCandidate::phi(), EnergyCorrector::pt, reco::LeafCandidate::pt(), recHitEta_, recHitPhi_B_, recHitPhi_EM_, recHitPhi_EP_, recHitPt_B_, recHitPt_EM_, recHitPt_EP_, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, RPCRecHitMuonEta_, and edm::View< T >::size().

103  {
104  dcs_ = true;
105  //Check HV status
106  this->makeDcsInfo(event);
107  if( !dcs_){
108  edm::LogWarning ("rpcrechitprobability") <<"[RPCRecHitProbability]: DCS bit OFF" ;
109  return;//if RPC not ON there's no need to continue
110  }
111 
112  counter++;
113  edm::LogInfo ("rpcrechitprobability") <<"[RPCRecHitProbability]: Beginning analyzing event " << counter;
114 
115  //Muons
117  event.getByToken(muonLabel_, muonCands);
118  std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
119 
120  if(muonCands.isValid()){
121 
122  int nStaMuons = muonCands->size();
123 
124  for( int i = 0; i < nStaMuons; i++ ) {
125 
126  const reco::Candidate & goodMuon = (*muonCands)[i];
127  const reco::Muon * muCand = dynamic_cast<const reco::Muon*>(&goodMuon);
128 
129  if(!muCand->isGlobalMuon())continue;
130  float eta = muCand->eta();
131  float pt = muCand->pt();
132  if( pt < muPtCut_ || fabs(eta)>muEtaCut_) continue;
133 
134  float phi = muCand->phi();
135 
136  NumberOfMuonEta_ -> Fill(eta);
137 
138  if(eta > 0.8){
139  NumberOfMuonPt_EP_ -> Fill(pt);
140  NumberOfMuonPhi_EP_ -> Fill(phi);
141  }else if (eta < -0.8){
142  NumberOfMuonPt_EM_ -> Fill(pt);
143  NumberOfMuonPhi_EM_ -> Fill(phi);
144  }else{
145  NumberOfMuonPt_B_ -> Fill(pt);
146  NumberOfMuonPhi_B_ -> Fill(phi);
147  }
148 
149  reco::Track muTrack = (*(muCand->outerTrack()));
150  std::vector<TrackingRecHitRef > rpcTrackRecHits;
151 
152  //loop on mu rechits
153 
154  int recHitCounter = 0;
155  for ( trackingRecHit_iterator it= muTrack.recHitsBegin(); it != muTrack.recHitsEnd() ; it++) {
156  if (!(*it)->isValid ()) continue;
157  int muSubDetId = (*it)->geographicalId().subdetId();
158  if(muSubDetId == MuonSubdetId::RPC) {
159  recHitCounter ++;
160  }
161  }// end loop on mu rechits
162 
163  RPCRecHitMuonEta_ -> Fill(eta, recHitCounter);
164 
165  int j = 0;
166  while (recHitCounter >= j+1 && j<6){
167 
168  if(recHitEta_[j]) recHitEta_[j]->Fill(eta);
169  if(eta > 0.8) {
170  recHitPt_EP_[j] -> Fill(pt);
171  recHitPhi_EP_[j] -> Fill(phi);
172  }else if (eta < -0.8){
173  recHitPt_EM_[j]-> Fill(pt);
174  recHitPhi_EM_[j]-> Fill(phi);
175  }else{
176  recHitPt_B_[j]-> Fill(pt);
177  recHitPhi_B_[j]-> Fill(phi);
178  }
179 
180  j++;
181  }
182 
183 
184  }
185  }else{
186  edm::LogError ("rpcrechitprobability") <<"[RPCRecHitProbability]: Muons - Product not valid for event" << counter;
187  }
188 
189 }
MonitorElement * RPCRecHitMuonEta_
MonitorElement * NumberOfMuonPhi_EM_
double eta() const final
momentum pseudorapidity
MonitorElement * NumberOfMuonPt_EP_
MonitorElement * NumberOfMuonEta_
MonitorElement * recHitEta_[6]
MonitorElement * NumberOfMuonPt_B_
MonitorElement * NumberOfMuonPt_EM_
size_type size() const
double pt() const final
transverse momentum
MonitorElement * recHitPt_B_[6]
edm::EDGetTokenT< reco::CandidateView > muonLabel_
MonitorElement * recHitPhi_B_[6]
MonitorElement * recHitPhi_EP_[6]
void Fill(long long x)
MonitorElement * recHitPt_EM_[6]
MonitorElement * NumberOfMuonPhi_EP_
bool isGlobalMuon() const override
Definition: Muon.h:291
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void makeDcsInfo(const edm::Event &)
MonitorElement * NumberOfMuonPhi_B_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:109
bool isValid() const
Definition: HandleBase.h:74
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
MonitorElement * recHitPt_EP_[6]
static constexpr int RPC
Definition: MuonSubdetId.h:14
MonitorElement * recHitPhi_EM_[6]
double phi() const final
momentum azimuthal angle
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:114
void RPCRecHitProbability::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  r,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 31 of file RPCRecHitProbability.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), dcs_, globalFolder_, mps_fire::i, createfilelist::int, muEtaCut_, muonFolder_, muPtCut_, dataset::name, NumberOfMuonEta_, NumberOfMuonPhi_B_, NumberOfMuonPhi_EM_, NumberOfMuonPhi_EP_, NumberOfMuonPt_B_, NumberOfMuonPt_EM_, NumberOfMuonPt_EP_, Pi, recHitEta_, recHitPhi_B_, recHitPhi_EM_, recHitPhi_EP_, recHitPt_B_, recHitPt_EM_, recHitPt_EP_, RPCRecHitMuonEta_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and runGCPTkAlMap::title.

31  {
32 
33 
34  edm::LogInfo ("rpcrechitprobability") <<"[RPCRecHitProbability]: Begin Run " ;
35 
36  std::string currentFolder = subsystemFolder_ +"/"+muonFolder_+"/"+ globalFolder_;
37  ibooker.setCurrentFolder(currentFolder);
38 
39  int ptBins = 100 - (int)muPtCut_;
40 
41  //General part
42  NumberOfMuonEta_ = ibooker.book1D("NumberOfMuonEta", "Muons vs Eta", 20*muEtaCut_, -muEtaCut_, muEtaCut_ );
43  NumberOfMuonPt_B_ = ibooker.book1D("NumberOfMuonPt_Barrel", "Muons vs Pt - Barrel", ptBins, muPtCut_, 100);
44  NumberOfMuonPt_EP_ = ibooker.book1D("NumberOfMuonPt_EndcapP", "Muons vs Pt - Endcap+", ptBins , muPtCut_ , 100);
45  NumberOfMuonPt_EM_ = ibooker.book1D("NumberOfMuonPt_EndcapM", "Muons vs Pt - Endcap-", ptBins , muPtCut_ , 100);
46  NumberOfMuonPhi_B_ = ibooker.book1D("NumberOfMuonPhi_Barrel", "Muons vs Phi - Barrel", 144, -TMath::Pi(), TMath::Pi());
47  NumberOfMuonPhi_EP_ = ibooker.book1D("NumberOfMuonPhi_EndcapP", "Muons vs Phi - Endcap+", 144, -TMath::Pi(), TMath::Pi() );
48  NumberOfMuonPhi_EM_ = ibooker.book1D("NumberOfMuonPhi_EndcapM", "Muons vs Phi - Endcap-", 144, -TMath::Pi(), TMath::Pi());
49 
50  //RPC part
51  RPCRecHitMuonEta_ = ibooker.book2D("RPCRecHitMuonEta", "Number Of RecHits per Muons vs Eta", 20*muEtaCut_, -muEtaCut_, muEtaCut_, 7, 0.5, 7.5);
52 
53  std::stringstream name, title;
54  for(int i = 0 ; i< 6 ; i++) {
55  name.str("");
56  title.str("");
57  name<<(i+1)<<"RecHitMuonEta";
58  title<<"At least " <<(i+1)<<" Cluster vs Eta";
59  recHitEta_[i] = ibooker.book1D(name.str(), title.str(), 20*muEtaCut_, -muEtaCut_, muEtaCut_);
60 
61  name.str("");
62  title.str("");
63  name<<(i+1)<<"RecHitMuonPhiB";
64  title<<"At least " <<(i+1)<<" Cluster vs Phi-Barrel";
65  recHitPhi_B_[i] = ibooker.book1D(name.str(), title.str(), 144, -TMath::Pi(), TMath::Pi());
66 
67  name.str("");
68  title.str("");
69  name<<(i+1)<<"RecHitMuonPtB";
70  title<<"At least " <<(i+1)<<" Cluster vs Pt-Barrel";
71  recHitPt_B_[i] = ibooker.book1D(name.str(), title.str(), ptBins , muPtCut_ , 100);
72 
73  name.str("");
74  title.str("");
75  name<<(i+1)<<"RecHitMuonPhiEP";
76  title<<"At least " <<(i+1)<<" Cluster vs Phi-Endcap+";
77  recHitPhi_EP_[i] = ibooker.book1D(name.str(), title.str(), 144, -TMath::Pi(), TMath::Pi() );
78 
79  name.str("");
80  title.str("");
81  name<<(i+1)<<"RecHitMuonPtEP";
82  title<<"At least " <<(i+1)<<" Cluster vs Pt-Endcap+";
83  recHitPt_EP_[i] = ibooker.book1D(name.str(), title.str(), ptBins , muPtCut_ , 100);
84 
85  name.str("");
86  title.str("");
87  name<<(i+1)<<"RecHitMuonPhiEM";
88  title<<"At least " <<(i+1)<<" Cluster vs Phi-Endcap-";
89  recHitPhi_EM_[i] = ibooker.book1D(name.str(), title.str(), 144, -TMath::Pi(), TMath::Pi());
90 
91  name.str("");
92  title.str("");
93  name<<(i+1)<<"RecHitMuonPtEM";
94  title<<"At least " <<(i+1)<<" Cluster vs Pt-Endcap-";
95  recHitPt_EM_[i] = ibooker.book1D(name.str(), title.str(), ptBins , muPtCut_ , 100);
96 
97  }
98 
99  dcs_ = true;
100 }
MonitorElement * RPCRecHitMuonEta_
const double Pi
MonitorElement * NumberOfMuonPhi_EM_
MonitorElement * NumberOfMuonPt_EP_
MonitorElement * NumberOfMuonEta_
MonitorElement * recHitEta_[6]
MonitorElement * NumberOfMuonPt_B_
MonitorElement * NumberOfMuonPt_EM_
MonitorElement * recHitPt_B_[6]
MonitorElement * recHitPhi_B_[6]
MonitorElement * recHitPhi_EP_[6]
MonitorElement * recHitPt_EM_[6]
MonitorElement * NumberOfMuonPhi_EP_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * NumberOfMuonPhi_B_
MonitorElement * recHitPt_EP_[6]
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * recHitPhi_EM_[6]
void RPCRecHitProbability::makeDcsInfo ( const edm::Event e)
private

Definition at line 191 of file RPCRecHitProbability.cc.

References dcs_, edm::Event::getByToken(), edm::HandleBase::isValid(), mathSSE::return(), DcsStatus::RPC, and scalersRawToDigiLabel_.

Referenced by analyze().

191  {
192 
194 
195 
196  if ( ! e.getByToken(scalersRawToDigiLabel_, dcsStatus) ){
197  dcs_ = true;
198  return;
199  }
200 
201  if ( ! dcsStatus.isValid() )
202  {
203  edm::LogWarning("RPCDcsInfo") << "scalersRawToDigi not found" ;
204  dcs_ = true; // info not available: set to true
205  return;
206  }
207 
208  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
209  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr){
210 
211  if (!dcsStatusItr->ready(DcsStatus::RPC)) dcs_=false;
212  }
213 
214  return ;
215 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
return((rh^lh)&mask)
bool isValid() const
Definition: HandleBase.h:74

Member Data Documentation

int RPCRecHitProbability::counter
private

Definition at line 36 of file RPCRecHitProbability.h.

Referenced by counter.Counters::__getitem__(), and analyze().

bool RPCRecHitProbability::dcs_
private

Definition at line 38 of file RPCRecHitProbability.h.

Referenced by analyze(), bookHistograms(), and makeDcsInfo().

std::string RPCRecHitProbability::globalFolder_
private

Definition at line 41 of file RPCRecHitProbability.h.

Referenced by bookHistograms(), and RPCRecHitProbability().

float RPCRecHitProbability::muEtaCut_
private

Definition at line 39 of file RPCRecHitProbability.h.

Referenced by analyze(), bookHistograms(), and RPCRecHitProbability().

std::string RPCRecHitProbability::muonFolder_
private

Definition at line 35 of file RPCRecHitProbability.h.

Referenced by bookHistograms(), and RPCRecHitProbability().

edm::EDGetTokenT<reco::CandidateView> RPCRecHitProbability::muonLabel_
private

Definition at line 64 of file RPCRecHitProbability.h.

Referenced by analyze(), and RPCRecHitProbability().

float RPCRecHitProbability::muPtCut_
private

Definition at line 39 of file RPCRecHitProbability.h.

Referenced by analyze(), bookHistograms(), and RPCRecHitProbability().

MonitorElement* RPCRecHitProbability::NumberOfMuonEta_
private

Definition at line 53 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPhi_B_
private

Definition at line 48 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPhi_EM_
private

Definition at line 52 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPhi_EP_
private

Definition at line 50 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPt_B_
private

Definition at line 47 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPt_EM_
private

Definition at line 51 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::NumberOfMuonPt_EP_
private

Definition at line 49 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitEta_[6]
private

Definition at line 56 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPhi_B_[6]
private

Definition at line 58 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPhi_EM_[6]
private

Definition at line 62 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPhi_EP_[6]
private

Definition at line 60 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPt_B_[6]
private

Definition at line 57 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPt_EM_[6]
private

Definition at line 61 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCRecHitProbability::recHitPt_EP_[6]
private

Definition at line 59 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

std::string RPCRecHitProbability::RootFileName
private

Definition at line 45 of file RPCRecHitProbability.h.

Referenced by RPCRecHitProbability().

MonitorElement* RPCRecHitProbability::RPCRecHitMuonEta_
private

Definition at line 54 of file RPCRecHitProbability.h.

Referenced by analyze(), and bookHistograms().

bool RPCRecHitProbability::saveRootFile
private

Definition at line 44 of file RPCRecHitProbability.h.

Referenced by RPCRecHitProbability().

edm::EDGetTokenT<DcsStatusCollection> RPCRecHitProbability::scalersRawToDigiLabel_
private

Definition at line 65 of file RPCRecHitProbability.h.

Referenced by makeDcsInfo(), and RPCRecHitProbability().

std::string RPCRecHitProbability::subsystemFolder_
private

Definition at line 42 of file RPCRecHitProbability.h.

Referenced by bookHistograms(), and RPCRecHitProbability().