CMS 3D CMS Logo

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

#include <RPCMonitorDigi.h>

Inheritance diagram for RPCMonitorDigi:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 RPCMonitorDigi (const edm::ParameterSet &)
 
 ~RPCMonitorDigi () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookRegionME (DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
 Booking of MonitoringElemnt at region (Barrel/Endcap) level. More...
 
void bookRollME (DQMStore::IBooker &, const RPCDetId &, const RPCGeometry *rpcGeo, const std::string &, std::map< std::string, MonitorElement *> &)
 Booking of MonitoringElement for one RPCDetId (= roll) More...
 
void bookSectorRingME (DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
 Booking of MonitoringElement at Sector/Ring level. More...
 
void bookWheelDiskME (DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
 Booking of MonitoringElemnt at Wheel/Disk level. More...
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

void performSourceOperation (std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
 
int stripsInRoll (const RPCDetId &id, const RPCGeometry *rpcGeo) const
 

Private Attributes

int counter
 
std::string globalFolder_
 
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
 
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
 
float muEtaCut_
 
std::string muonFolder_
 
edm::EDGetTokenT< reco::CandidateViewmuonLabel_
 
MonitorElementmuonRPCEvents_
 
float muPtCut_
 
std::string noiseFolder_
 
MonitorElementnoiseRPCEvents_
 
int numberOfDisks_
 
int numberOfInnerRings_
 
MonitorElementNumberOfMuon_
 
MonitorElementNumberOfRecHitMuon_
 
std::map< std::string, MonitorElement * > regionMuonCollection
 
std::map< std::string, MonitorElement * > regionNoiseCollection
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcGeomToken_
 
edm::EDGetTokenT< RPCRecHitCollectionrpcRecHitLabel_
 
edm::EDGetTokenT< DcsStatusCollectionscalersRawToDigiLabel_
 
std::map< std::string, MonitorElement * > sectorRingMuonCollection
 
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
 
std::string subsystemFolder_
 
bool useMuonDigis_
 
bool useRollInfo_
 
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
 
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
 

Static Private Attributes

static const std::array< std::string, 3 > regionNames_ = {{"Endcap-", "Barrel", "Endcap+"}}
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 20 of file RPCMonitorDigi.h.

Constructor & Destructor Documentation

◆ RPCMonitorDigi()

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

Definition at line 17 of file RPCMonitorDigi.cc.

References globalFolder_, muEtaCut_, muonFolder_, muonLabel_, muPtCut_, noiseFolder_, muonDTDigis_cfi::pset, rpcGeomToken_, rpcRecHitLabel_, scalersRawToDigiLabel_, AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, useMuonDigis_, and useRollInfo_.

18  : counter(0),
19  muonRPCEvents_(nullptr),
20  NumberOfRecHitMuon_(nullptr),
21  NumberOfMuon_(nullptr),
22  numberOfDisks_(0),
24  useMuonDigis_ = pset.getUntrackedParameter<bool>("UseMuon", true);
25  useRollInfo_ = pset.getUntrackedParameter<bool>("UseRollInfo", false);
26 
27  muPtCut_ = pset.getUntrackedParameter<double>("MuonPtCut", 3.0);
28  muEtaCut_ = pset.getUntrackedParameter<double>("MuonEtaCut", 1.9);
29 
30  subsystemFolder_ = pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
31  globalFolder_ = pset.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
32 
33  //Parametersets for tokens
34  muonLabel_ = consumes<reco::CandidateView>(pset.getParameter<edm::InputTag>("MuonLabel"));
35  rpcRecHitLabel_ = consumes<RPCRecHitCollection>(pset.getParameter<edm::InputTag>("RecHitLabel"));
36  scalersRawToDigiLabel_ = consumes<DcsStatusCollection>(pset.getParameter<edm::InputTag>("ScalersRawToDigiLabel"));
37 
38  noiseFolder_ = pset.getUntrackedParameter<std::string>("NoiseFolder", "AllHits");
39  muonFolder_ = pset.getUntrackedParameter<std::string>("MuonFolder", "Muon");
40 
41  rpcGeomToken_ = esConsumes<edm::Transition::BeginRun>();
42 }
std::string globalFolder_
std::string muonFolder_
MonitorElement * muonRPCEvents_
std::string noiseFolder_
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
MonitorElement * NumberOfRecHitMuon_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
MonitorElement * NumberOfMuon_
std::string subsystemFolder_
edm::EDGetTokenT< reco::CandidateView > muonLabel_

◆ ~RPCMonitorDigi()

RPCMonitorDigi::~RPCMonitorDigi ( )
overridedefault

Member Function Documentation

◆ analyze()

void RPCMonitorDigi::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 113 of file RPCMonitorDigi.cc.

References TrackingRecHit::clone(), counter, reco::LeafCandidate::eta(), dqm::impl::MonitorElement::Fill(), mps_fire::i, createfilelist::int, reco::Muon::isGlobalMuon(), edm::HandleBase::isValid(), muEtaCut_, muonFolder_, muonLabel_, muonRPCEvents_, muPtCut_, noiseFolder_, noiseRPCEvents_, NumberOfMuon_, NumberOfRecHitMuon_, patZpeak::numMuons, reco::Muon::outerTrack(), performSourceOperation(), reco::LeafCandidate::pt(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, RPCRecHit::rpcId(), rpcRecHitLabel_, and edm::View< T >::size().

113  {
114  counter++;
115  edm::LogInfo("rpcmonitordigi") << "[RPCMonitorDigi]: Beginning analyzing event " << counter;
116 
117  //Muons
119  event.getByToken(muonLabel_, muonCands);
120 
121  std::map<RPCDetId, std::vector<RPCRecHit> > rechitMuon;
122 
123  int numMuons = 0;
124  int numRPCRecHit = 0;
125 
126  if (muonCands.isValid()) {
127  int nStaMuons = muonCands->size();
128 
129  for (int i = 0; i < nStaMuons; i++) {
130  const reco::Candidate& goodMuon = (*muonCands)[i];
131  const reco::Muon* muCand = dynamic_cast<const reco::Muon*>(&goodMuon);
132 
133  if (!muCand->isGlobalMuon())
134  continue;
135  if (muCand->pt() < muPtCut_ || fabs(muCand->eta()) > muEtaCut_)
136  continue;
137  numMuons++;
138  reco::Track muTrack = (*(muCand->outerTrack()));
139  std::vector<TrackingRecHitRef> rpcTrackRecHits;
140  //loop on mu rechits
141  for (trackingRecHit_iterator it = muTrack.recHitsBegin(); it != muTrack.recHitsEnd(); it++) {
142  if (!(*it)->isValid())
143  continue;
144  int muSubDetId = (*it)->geographicalId().subdetId();
145  if (muSubDetId == MuonSubdetId::RPC) {
146  numRPCRecHit++;
147  TrackingRecHit* tkRecHit = (*it)->clone();
148  RPCRecHit* rpcRecHit = dynamic_cast<RPCRecHit*>(tkRecHit);
149  int detId = (int)rpcRecHit->rpcId();
150  if (rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].empty()) {
151  std::vector<RPCRecHit> myVect(1, *rpcRecHit);
152  rechitMuon[detId] = myVect;
153  } else {
154  rechitMuon[detId].push_back(*rpcRecHit);
155  }
156  }
157  } // end loop on mu rechits
158  }
159 
160  //Fill muon counter
161  if (NumberOfMuon_) {
163  }
164 
165  //Fill rechit counter for muons
166  if (NumberOfRecHitMuon_ && numMuons > 0) {
167  NumberOfRecHitMuon_->Fill(numRPCRecHit);
168  }
169 
170  //Fill counter of RPC events with rechits associated in with a muon
171  if (muonRPCEvents_ != nullptr && numRPCRecHit > 0) {
172  muonRPCEvents_->Fill(1);
173  }
174 
175  //Perform client operation
176  this->performSourceOperation(rechitMuon, muonFolder_);
177 
178  } else {
179  edm::LogError("rpcmonitordigi") << "[RPCMonitorDigi]: Muons - Product not valid for event" << counter;
180  }
181 
182  //RecHits
184  event.getByToken(rpcRecHitLabel_, rpcHits);
185  std::map<RPCDetId, std::vector<RPCRecHit> > rechitNoise;
186 
187  if (rpcHits.isValid()) {
188  // RPC rec hits NOT associated to a muon
189  for (auto rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end(); rpcRecHitIter++) {
190  RPCRecHit rpcRecHit = (*rpcRecHitIter);
191  int detId = (int)rpcRecHit.rpcId();
192  if (rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].empty()) {
193  std::vector<RPCRecHit> myVect(1, rpcRecHit);
194  rechitNoise[detId] = myVect;
195  } else {
196  rechitNoise[detId].push_back(rpcRecHit);
197  }
198  }
199  } else {
200  edm::LogError("rpcmonitordigi") << "[RPCMonitorDigi]: RPCRecHits - Product not valid for event" << counter;
201  }
202 
203  //Fill counter for all RPC events
204  if (noiseRPCEvents_ != nullptr && !rechitNoise.empty()) {
205  noiseRPCEvents_->Fill(1);
206  }
207  //Perform client operation
208  this->performSourceOperation(rechitNoise, noiseFolder_);
209 }
double pt() const final
transverse momentum
std::string muonFolder_
MonitorElement * muonRPCEvents_
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:48
Log< level::Error, false > LogError
std::string noiseFolder_
size_type size() const
void Fill(long long x)
RPCDetId rpcId() const
Return the rpcId.
Definition: RPCRecHit.h:71
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
MonitorElement * NumberOfRecHitMuon_
virtual TrackingRecHit * clone() const =0
Log< level::Info, false > LogInfo
static constexpr int RPC
Definition: MuonSubdetId.h:13
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
bool isValid() const
Definition: HandleBase.h:70
void performSourceOperation(std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
MonitorElement * noiseRPCEvents_
MonitorElement * NumberOfMuon_
bool isGlobalMuon() const override
Definition: Muon.h:303
edm::EDGetTokenT< reco::CandidateView > muonLabel_
double eta() const final
momentum pseudorapidity

◆ bookHistograms()

void RPCMonitorDigi::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  r,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 44 of file RPCMonitorDigi.cc.

References dqm::implementation::IBooker::book1D(), bookRegionME(), bookRollME(), bookSectorRingME(), bookWheelDiskME(), RPCNameHelper::chamberName(), edm::EventSetup::getData(), meMuonCollection, meNoiseCollection, SiStripPI::min, muonFolder_, muonRPCEvents_, noiseFolder_, noiseRPCEvents_, numberOfDisks_, numberOfInnerRings_, NumberOfMuon_, NumberOfRecHitMuon_, RPCDetId::region(), regionMuonCollection, regionNoiseCollection, RPCDetId::ring(), RPCNameHelper::rollName(), RPCChamber::rolls(), rpcGeomToken_, sectorRingMuonCollection, sectorRingNoiseCollection, dqm::implementation::NavigatorBase::setCurrentFolder(), RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, useMuonDigis_, useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

44  {
45  edm::LogInfo("rpcmonitordigi") << "[RPCMonitorDigi]: Begin Run ";
46 
47  numberOfInnerRings_ = 4; // set default value
48 
49  std::set<int> disk_set;
50  const auto& rpcGeo = iSetup.getData(rpcGeomToken_);
51 
52  //loop on geometry to book all MEs
53  edm::LogInfo("rpcmonitordigi") << "[RPCMonitorDigi]: Booking histograms per roll. ";
54  for (auto ich : rpcGeo.dets()) {
55  const RPCChamber* ch = dynamic_cast<const RPCChamber*>(ich);
56  if (!ch)
57  continue;
58  const auto& roles = ch->rolls();
59 
60  if (useRollInfo_) {
61  for (auto roll : roles) {
62  const RPCDetId& rpcId = roll->id();
63 
64  //get station and inner ring
65  if (rpcId.region() != 0) {
66  disk_set.insert(rpcId.station());
68  }
69 
70  //booking all histograms
71  const std::string nameID = RPCNameHelper::rollName(rpcId);
72  if (useMuonDigis_)
73  bookRollME(ibooker, rpcId, &rpcGeo, muonFolder_, meMuonCollection[nameID]);
74  bookRollME(ibooker, rpcId, &rpcGeo, noiseFolder_, meNoiseCollection[nameID]);
75  }
76  } else {
77  const RPCDetId& rpcId = roles[0]->id(); //any roll would do - here I just take the first one
78  const std::string nameID = RPCNameHelper::chamberName(rpcId);
79  if (useMuonDigis_)
80  bookRollME(ibooker, rpcId, &rpcGeo, muonFolder_, meMuonCollection[nameID]);
81  bookRollME(ibooker, rpcId, &rpcGeo, noiseFolder_, meNoiseCollection[nameID]);
82  if (rpcId.region() != 0) {
83  disk_set.insert(rpcId.station());
85  }
86  }
87  } //end loop on geometry to book all MEs
88 
89  numberOfDisks_ = disk_set.size();
90 
91  //Book
95 
97 
98  noiseRPCEvents_ = ibooker.book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
99 
100  if (useMuonDigis_) {
104 
106 
107  muonRPCEvents_ = ibooker.book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
108  NumberOfMuon_ = ibooker.book1D("NumberOfMuons", "Number of Muons", 11, -0.5, 10.5);
109  NumberOfRecHitMuon_ = ibooker.book1D("NumberOfRecHitMuons", "Number of RPC RecHits per Muon", 8, -0.5, 7.5);
110  }
111 }
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
std::string muonFolder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
std::map< std::string, MonitorElement * > sectorRingMuonCollection
int ring() const
Definition: RPCDetId.h:59
MonitorElement * muonRPCEvents_
std::string noiseFolder_
static std::string rollName(const RPCDetId &detId)
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
Booking of MonitoringElement at Sector/Ring level.
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
MonitorElement * NumberOfRecHitMuon_
std::map< std::string, MonitorElement * > regionMuonCollection
Log< level::Info, false > LogInfo
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
Booking of MonitoringElemnt at Wheel/Disk level.
static std::string chamberName(const RPCDetId &detId)
int station() const
Definition: RPCDetId.h:78
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement *> &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
std::map< std::string, MonitorElement * > regionNoiseCollection
MonitorElement * noiseRPCEvents_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:40
MonitorElement * NumberOfMuon_
std::string subsystemFolder_
void bookRollME(DQMStore::IBooker &, const RPCDetId &, const RPCGeometry *rpcGeo, const std::string &, std::map< std::string, MonitorElement *> &)
Booking of MonitoringElement for one RPCDetId (= roll)

◆ bookRegionME()

void RPCMonitorDigi::bookRegionME ( DQMStore::IBooker ibooker,
const std::string &  recHitType,
std::map< std::string, MonitorElement *> &  meMap 
)
protected

Booking of MonitoringElemnt at region (Barrel/Endcap) level.

Definition at line 244 of file RPCBookDetUnitME.cc.

References newFWLiteAna::bin, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), globalFolder_, Skims_PA_cff::name, numberOfDisks_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and runGCPTkAlMap::title.

Referenced by bookHistograms().

246  {
247  std::string currentFolder = subsystemFolder_ + "/" + recHitType + "/" + globalFolder_;
248  ibooker.setCurrentFolder(currentFolder);
249 
250  std::stringstream name;
251  std::stringstream title;
252 
253  //Number of Digis
254  name.str("");
255  title.str("");
256  name << "Multiplicity_Barrel";
257  title << "Multiplicity per Event per Roll - Barrel";
258  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 50, 0.5, 50.5);
259 
260  name.str("");
261  title.str("");
262  name << "Multiplicity_Endcap+";
263  title << "Multiplicity per Event per Roll - Endcap+";
264  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
265 
266  name.str("");
267  title.str("");
268  name << "Multiplicity_Endcap-";
269  title << "Multiplicity per Event per Roll - Endcap-";
270  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
271 
272  meMap["Occupancy_for_Endcap"] = ibooker.book2D("Occupancy_for_Endcap",
273  "Occupancy Endcap",
275  0.5,
276  ((float)RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5,
277  2,
278  1.5,
279  3.5);
280  meMap["Occupancy_for_Endcap"]->setAxisTitle("Disk", 1);
281  meMap["Occupancy_for_Endcap"]->setAxisTitle("Ring", 2);
282 
283  std::stringstream binlabel;
284  for (int bin = 1; bin <= RPCMonitorDigi::numberOfDisks_ * 2; bin++) {
285  binlabel.str("");
286  if (bin < (RPCMonitorDigi::numberOfDisks_ + 1)) { //negative endcap
287  binlabel << (bin - (RPCMonitorDigi::numberOfDisks_ + 1));
288  } else { //positive endcaps
289  binlabel << (bin - RPCMonitorDigi::numberOfDisks_);
290  }
291  meMap["Occupancy_for_Endcap"]->setBinLabel(bin, binlabel.str(), 1);
292  }
293 
294  meMap["Occupancy_for_Endcap"]->setBinLabel(1, "2", 2);
295  meMap["Occupancy_for_Endcap"]->setBinLabel(2, "3", 2);
296 
297  meMap["Occupancy_for_Barrel"] =
298  ibooker.book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5, 12.5, 5, -2.5, 2.5);
299  meMap["Occupancy_for_Barrel"]->setAxisTitle("Sec", 1);
300  meMap["Occupancy_for_Barrel"]->setAxisTitle("Wheel", 2);
301 
302  for (int bin = 1; bin <= 12; bin++) {
303  binlabel.str("");
304  binlabel << bin;
305  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 1);
306  if (bin <= 5) {
307  binlabel.str("");
308  binlabel << (bin - 3);
309  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 2);
310  }
311  }
312 }
std::string globalFolder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
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
std::string subsystemFolder_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ bookRollME()

void RPCMonitorDigi::bookRollME ( DQMStore::IBooker ibooker,
const RPCDetId detId,
const RPCGeometry rpcGeo,
const std::string &  recHitType,
std::map< std::string, MonitorElement *> &  meMap 
)
protected

Booking of MonitoringElement for one RPCDetId (= roll)

Name components common to current RPCDetId

Definition at line 7 of file RPCBookDetUnitME.cc.

References funct::abs(), dqm::implementation::IBooker::book1D(), RPCBookFolderStructure::folderStructure(), dqm-mbProfile::format, RPCDetId::layer(), RPCNameHelper::name(), RPCDetId::region(), RPCDetId::ring(), dqm::implementation::NavigatorBase::setCurrentFolder(), RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, stripsInRoll(), subsystemFolder_, and useRollInfo_.

Referenced by bookHistograms().

11  {
12  ibooker.setCurrentFolder(
14 
15  //get number of strips in current roll
16  int nstrips = this->stripsInRoll(detId, rpcGeo);
17  if (nstrips == 0) {
18  nstrips = 1;
19  }
20 
22  const std::string nameRoll = RPCNameHelper::name(detId, useRollInfo_);
23 
25  if (detId.region() != 0 || //Endcaps
26  (abs(detId.ring()) == 2 && detId.station() == 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
27  (abs(detId.ring()) != 2 && detId.station() == 2 && detId.layer() == 1)) {
28  nstrips *= 3;
29  } //Wheel -1,0,+1 RB2in
30  else {
31  nstrips *= 2;
32  }
33  }
34 
35  std::string tmpStr;
36 
37  tmpStr = "Occupancy_" + nameRoll;
38  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, nstrips, 0.5, nstrips + 0.5);
39 
40  tmpStr = "BXDistribution_" + nameRoll;
41  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 7, -3.5, 3.5);
42 
43  if (detId.region() == 0) {
44  tmpStr = "Multiplicity_" + nameRoll;
45  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 30, 0.5, 30.5);
46 
47  } else {
48  tmpStr = "Multiplicity_" + nameRoll;
49  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 15, 0.5, 15.5);
50  }
51 
52  tmpStr = "NumberOfClusters_" + nameRoll;
53  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 10, 0.5, 10.5);
54 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int ring() const
Definition: RPCDetId.h:59
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static std::string name(const RPCDetId &detId, const bool useRoll)
Definition: RPCNameHelper.cc:6
static std::string folderStructure(const RPCDetId &detId)
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int layer() const
Definition: RPCDetId.h:85
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
int stripsInRoll(const RPCDetId &id, const RPCGeometry *rpcGeo) const
std::string subsystemFolder_

◆ bookSectorRingME()

void RPCMonitorDigi::bookSectorRingME ( DQMStore::IBooker ibooker,
const std::string &  recHitType,
std::map< std::string, MonitorElement *> &  meMap 
)
protected

Booking of MonitoringElement at Sector/Ring level.

Definition at line 56 of file RPCBookDetUnitME.cc.

References dqm::implementation::IBooker::book2D(), dqm-mbProfile::format, mps_fire::i, hlt_dqm_clientPB-live_cfg::me1, hlt_dqm_clientPB-live_cfg::me2, numberOfDisks_, numberOfInnerRings_, HLT_2022v15_cff::region, relativeConstraints::ring, dqm::impl::MonitorElement::setAxisTitle(), RPCRollMapHisto::setBarrelRollAxis(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, makeMuonMisalignmentScenario::wheel, and HistogramManager_cfi::ylabel.

Referenced by bookHistograms().

58  {
59  for (int wheel = -2; wheel <= 2; wheel++) {
60  ibooker.setCurrentFolder(
61  fmt::format("{}/{}/Barrel/Wheel_{}/SummaryBySectors", subsystemFolder_, recHitType, wheel));
62 
63  for (int sector = 1; sector <= 12; sector++) {
64  const std::string meName = fmt::format("Occupancy_Wheel_{}_Sector_{}", wheel, sector);
65  const std::string meClus = fmt::format("ClusterSize_Wheel_{}_Sector_{}", wheel, sector);
66 
67  if (sector == 9 || sector == 11) {
68  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 15, 0.5, 15.5);
69  meMap[meClus] = ibooker.book2D(meClus, meClus, 16, 1, 17, 15, 0.5, 15.5);
70  } else if (sector == 4) {
71  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 21, 0.5, 21.5);
72  meMap[meClus] = ibooker.book2D(meClus, meClus, 16, 1, 17, 21, 0.5, 21.5);
73  } else {
74  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 17, 0.5, 17.5);
75  meMap[meClus] = ibooker.book2D(meClus, meClus, 16, 1, 17, 17, 0.5, 17.5);
76  }
77 
78  meMap[meName]->setAxisTitle("strip", 1);
79  RPCRollMapHisto::setBarrelRollAxis(meMap[meName], wheel, 2, true);
80 
81  meMap[meClus]->setAxisTitle("Cluster size", 1);
82  meMap[meClus]->setBinLabel(1, "1", 1);
83  meMap[meClus]->setBinLabel(5, "5", 1);
84  meMap[meClus]->setBinLabel(10, "10", 1);
85  meMap[meClus]->setBinLabel(15, "15", 1);
86  meMap[meClus]->setBinLabel(meMap[meClus]->getNbinsX(), "Overflow", 1);
87  RPCRollMapHisto::setBarrelRollAxis(meMap[meClus], wheel, 2, true);
88  }
89  }
90 
91  for (int region = -1; region <= 1; region++) {
92  if (region == 0)
93  continue;
94 
95  std::string regionName = "Endcap-";
96  if (region == 1)
97  regionName = "Endcap+";
98 
99  for (int disk = 1; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
100  ibooker.setCurrentFolder(
101  fmt::format("{}/{}/{}/Disk_{}/SummaryByRings/", subsystemFolder_, recHitType, regionName, region * disk));
102 
103  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
104  //Occupancy
105  const std::string meName1 = fmt::format("Occupancy_Disk_{}_Ring_{}_CH01-CH18", (region * disk), ring);
106 
107  auto me1 = ibooker.book2D(meName1, meName1, 96, 0.5, 96.5, 18, 0.5, 18.5);
108  me1->setAxisTitle("strip", 1);
109 
110  for (int i = 1; i <= 18; i++) {
111  const std::string ylabel = fmt::format("R{}_CH{:02d}", ring, i);
112  me1->setBinLabel(i, ylabel, 2);
113  }
114 
115  me1->setBinLabel(1, "1", 1);
116  me1->setBinLabel(16, "RollA", 1);
117  me1->setBinLabel(32, "32", 1);
118  me1->setBinLabel(33, "1", 1);
119  me1->setBinLabel(48, "RollB", 1);
120  me1->setBinLabel(64, "32", 1);
121  me1->setBinLabel(65, "1", 1);
122  me1->setBinLabel(80, "RollC", 1);
123  me1->setBinLabel(96, "32", 1);
124 
125  const std::string meName2 = fmt::format("Occupancy_Disk_{}_Ring_{}_CH19-CH36", (region * disk), ring);
126 
127  auto me2 = ibooker.book2D(meName2, meName2, 96, 0.5, 96.5, 18, 18.5, 36.5);
128  me2->setAxisTitle("strip", 1);
129 
130  for (int i = 1; i <= 18; i++) {
131  const std::string ylabel = fmt::format("R{}_CH{:02d}", ring, i + 18);
132  me2->setBinLabel(i, ylabel, 2);
133  }
134 
135  me2->setBinLabel(1, "1", 1);
136  me2->setBinLabel(16, "RollA", 1);
137  me2->setBinLabel(32, "32", 1);
138  me2->setBinLabel(33, "1", 1);
139  me2->setBinLabel(48, "RollB", 1);
140  me2->setBinLabel(64, "32", 1);
141  me2->setBinLabel(65, "1", 1);
142  me2->setBinLabel(80, "RollC", 1);
143  me2->setBinLabel(96, "32", 1);
144 
145  meMap[meName1] = me1;
146  meMap[meName2] = me2;
147 
148  //Cluster size
149  const std::string meClus1 = fmt::format("ClusterSize_Disk_{}_Ring_{}_CH01-CH09", (region * disk), ring);
150  const std::string meClus2 = fmt::format("ClusterSize_Disk_{}_Ring_{}_CH10-CH18", (region * disk), ring);
151  const std::string meClus3 = fmt::format("ClusterSize_Disk_{}_Ring_{}_CH19-CH27", (region * disk), ring);
152  const std::string meClus4 = fmt::format("ClusterSize_Disk_{}_Ring_{}_CH28-CH36", (region * disk), ring);
153 
154  auto mecl1 = ibooker.book2D(meClus1, meClus1, 11, 1, 12, 27, 0.5, 27.5);
155  auto mecl2 = ibooker.book2D(meClus2, meClus2, 11, 1, 12, 27, 27.5, 54.5);
156  auto mecl3 = ibooker.book2D(meClus3, meClus3, 11, 1, 12, 27, 54.5, 81.5);
157  auto mecl4 = ibooker.book2D(meClus4, meClus4, 11, 1, 12, 27, 81.5, 108.5);
158 
159  std::array<MonitorElement*, 4> meCls = {{mecl1, mecl2, mecl3, mecl4}};
160 
161  for (unsigned int icl = 0; icl < meCls.size(); icl++) {
162  meCls[icl]->setAxisTitle("Cluster size", 1);
163 
164  for (int i = 1; i <= 9; i++) {
165  const std::string ylabel1 = fmt::format("R{}_CH{:02d}_C", ring, (icl * 9) + i);
166  const std::string ylabel2 = fmt::format("R{}_CH{:02d}_B", ring, (icl * 9) + i);
167  const std::string ylabel3 = fmt::format("R{}_CH{:02d}_A", ring, (icl * 9) + i);
168  meCls[icl]->setBinLabel(1 + (i - 1) * 3, ylabel1, 2);
169  meCls[icl]->setBinLabel(2 + (i - 1) * 3, ylabel2, 2);
170  meCls[icl]->setBinLabel(3 + (i - 1) * 3, ylabel3, 2);
171  }
172  meCls[icl]->setBinLabel(1, "1", 1);
173  meCls[icl]->setBinLabel(5, "5", 1);
174  meCls[icl]->setBinLabel(10, "10", 1);
175  meCls[icl]->setBinLabel(mecl1->getNbinsX(), "Overflow", 1);
176  }
177 
178  meMap[meClus1] = mecl1;
179  meMap[meClus2] = mecl2;
180  meMap[meClus3] = mecl3;
181  meMap[meClus4] = mecl4;
182  } //loop ring
183  } //loop disk
184  } //loop region
185 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static void setBarrelRollAxis(MonitorElement *me, const int wheel, const int axis, const bool useRollInfo)
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
std::string subsystemFolder_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ bookWheelDiskME()

void RPCMonitorDigi::bookWheelDiskME ( DQMStore::IBooker ibooker,
const std::string &  recHitType,
std::map< std::string, MonitorElement *> &  meMap 
)
protected

Booking of MonitoringElemnt at Wheel/Disk level.

Definition at line 187 of file RPCBookDetUnitME.cc.

References dqm::implementation::IBooker::book1D(), RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), dqm-mbProfile::format, globalFolder_, mps_fire::i, label, numberOfDisks_, numberOfInnerRings_, relativeConstraints::ring, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

189  {
190  ibooker.setCurrentFolder(subsystemFolder_ + "/" + recHitType + "/" + globalFolder_);
191 
192  std::string tmpStr;
193 
194  for (int wheel = -2; wheel <= 2; wheel++) { //Loop on wheel
195  tmpStr = fmt::format("1DOccupancy_Wheel_{}", wheel);
196  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 12, 0.5, 12.5);
197  for (int i = 1; i <= 12; ++i) {
198  meMap[tmpStr]->setBinLabel(i, fmt::format("Sec{}", i), 1);
199  }
200 
201  tmpStr = fmt::format("Occupancy_Roll_vs_Sector_Wheel_{}", wheel);
202  meMap[tmpStr] = RPCRollMapHisto::bookBarrel(ibooker, wheel, tmpStr, tmpStr, true);
203 
204  tmpStr = fmt::format("BxDistribution_Wheel_{}", wheel);
205  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 9, -4.5, 4.5);
206 
207  } //end loop on wheel
208 
209  for (int disk = -RPCMonitorDigi::numberOfDisks_; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
210  if (disk == 0)
211  continue;
212 
213  tmpStr = fmt::format("Occupancy_Ring_vs_Segment_Disk_{}", disk);
214  meMap[tmpStr] = RPCRollMapHisto::bookEndcap(ibooker, disk, tmpStr, tmpStr, true);
215 
216  tmpStr = fmt::format("BxDistribution_Disk_{}", disk);
217  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 9, -4.5, 4.5);
218  }
219 
220  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
221  const std::string meName = fmt::format("1DOccupancy_Ring_{}", ring);
222  meMap[meName] = ibooker.book1D(
223  meName, meName, RPCMonitorDigi::numberOfDisks_ * 2, 0.5, (RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5);
224  for (int xbin = 1; xbin <= RPCMonitorDigi::numberOfDisks_ * 2; xbin++) {
226  if (xbin < RPCMonitorDigi::numberOfDisks_ + 1)
227  label = fmt::format("Disk {}", (xbin - (RPCMonitorDigi::numberOfDisks_ + 1)));
228  else
229  label = fmt::format("Disk {}", (xbin - RPCMonitorDigi::numberOfDisks_));
230  meMap[meName]->setBinLabel(xbin, label, 1);
231  }
232  }
233 }
std::string globalFolder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
char const * label
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static MonitorElement * bookEndcap(IBooker &booker, const int disk, const std::string &prefix, const std::string &title, const bool useRollInfo)
std::string subsystemFolder_

◆ performSourceOperation()

void RPCMonitorDigi::performSourceOperation ( std::map< RPCDetId, std::vector< RPCRecHit > > &  recHitMap,
std::string  recHittype 
)
private

Definition at line 211 of file RPCMonitorDigi.cc.

References funct::abs(), simKBmtfDigis_cfi::bx, rpcdqm::utils::detId2RollNr(), HcalObjRepresent::Fill(), dqm-mbProfile::format, mps_fire::i, createfilelist::int, RPCDetId::layer(), genParticles_cff::map, meMuonCollection, meNoiseCollection, muonFolder_, RPCNameHelper::name(), noiseFolder_, EgHLTOffHistBins_cfi::nr, numberOfDisks_, rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, RPCDetId::region(), HLT_2022v15_cff::region, regionMuonCollection, regionNames_, regionNoiseCollection, RPCDetId::ring(), relativeConstraints::ring, RPCDetId::roll(), alignCSCRings::s, RPCDetId::sector(), sectorRingMuonCollection, sectorRingNoiseCollection, RPCGeomServ::segment(), relativeConstraints::station, RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

Referenced by analyze().

212  {
213  edm::LogInfo("rpcmonitordigi") << "[RPCMonitorDigi]: Performing DQM source operations for ";
214 
215  if (recHitMap.empty())
216  return;
217 
218  std::map<std::string, std::map<std::string, MonitorElement*> > meRollCollection;
219  std::map<std::string, MonitorElement*> meWheelDisk;
220  std::map<std::string, MonitorElement*> meRegion;
221  std::map<std::string, MonitorElement*> meSectorRing;
222 
223  if (recHittype == muonFolder_) {
224  meRollCollection = meMuonCollection;
225  meWheelDisk = wheelDiskMuonCollection;
226  meRegion = regionMuonCollection;
227  meSectorRing = sectorRingMuonCollection;
228  } else if (recHittype == noiseFolder_) {
229  meRollCollection = meNoiseCollection;
230  meWheelDisk = wheelDiskNoiseCollection;
231  meRegion = regionNoiseCollection;
232  meSectorRing = sectorRingNoiseCollection;
233  } else {
234  edm::LogWarning("rpcmonitordigi") << "[RPCMonitorDigi]: RecHit type not valid.";
235  return;
236  }
237 
238  int totalNumberOfRecHits[3] = {0, 0, 0};
239 
240  //Loop on Rolls
241  for (std::map<RPCDetId, std::vector<RPCRecHit> >::const_iterator detIdIter = recHitMap.begin();
242  detIdIter != recHitMap.end();
243  detIdIter++) {
244  RPCDetId detId = (*detIdIter).first;
245  RPCGeomServ geoServ(detId);
246 
247  //get roll number
248  rpcdqm::utils rpcUtils;
249  int nr = rpcUtils.detId2RollNr(detId);
250 
251  const std::string nameRoll = RPCNameHelper::name(detId, useRollInfo_);
252 
253  int region = (int)detId.region();
254  int wheelOrDiskNumber;
255  std::string wheelOrDiskType;
256  int ring = 0;
257  int sector = detId.sector();
258  int totalRolls = 3;
259  int roll = detId.roll();
260  if (region == 0) {
261  wheelOrDiskType = "Wheel";
262  wheelOrDiskNumber = (int)detId.ring();
263  int station = detId.station();
264 
265  if (station == 1) {
266  if (detId.layer() == 1) {
267  totalRolls = 2; //RB1in
268  } else {
269  totalRolls = 2; //RB1out
270  }
271  if (roll == 3)
272  roll = 2; // roll=3 is Forward
273  } else if (station == 2) {
274  if (detId.layer() == 1) {
275  //RB2in
276  if (abs(wheelOrDiskNumber) == 2 && roll == 3) {
277  roll = 2; //W -2, +2 RB2in has only 2 rolls
278  totalRolls = 2;
279  }
280  } else {
281  //RB2out
282  if (abs(wheelOrDiskNumber) != 2 && roll == 3) {
283  roll = 2; //W -1, 0, +1 RB2out has only 2 rolls
284  totalRolls = 2;
285  }
286  }
287  } else if (station == 3) {
288  totalRolls = 2; //RB3
289  if (roll == 3)
290  roll = 2;
291  } else {
292  totalRolls = 2; //RB4
293  if (roll == 3)
294  roll = 2;
295  }
296 
297  } else {
298  wheelOrDiskType = "Disk";
299  wheelOrDiskNumber = region * (int)detId.station();
300  ring = detId.ring();
301  }
302 
303  std::vector<RPCRecHit> recHits = (*detIdIter).second;
304  const int numberOfRecHits = recHits.size();
305  totalNumberOfRecHits[region + 1] += numberOfRecHits;
306 
307  std::set<int> bxSet;
308  int numDigi = 0;
309 
310  std::map<std::string, MonitorElement*> meMap = meRollCollection[nameRoll];
311 
312  //Loop on recHits
313  std::string tmpName;
314  for (std::vector<RPCRecHit>::const_iterator recHitIter = recHits.begin(); recHitIter != recHits.end();
315  recHitIter++) {
316  RPCRecHit recHit = (*recHitIter);
317 
318  int bx = recHit.BunchX();
319  bxSet.insert(bx);
320  int clusterSize = (int)recHit.clusterSize();
321  numDigi += clusterSize;
322  int firstStrip = recHit.firstClusterStrip();
323  int lastStrip = clusterSize + firstStrip - 1;
324 
325  // ###################### Roll Level #################################
326 
327  tmpName = "Occupancy_" + nameRoll;
328  if (meMap[tmpName]) {
329  for (int s = firstStrip; s <= lastStrip; s++) {
330  if (useRollInfo_) {
331  meMap[tmpName]->Fill(s);
332  } else {
333  const int nstrips = meMap[tmpName]->getNbinsX() / totalRolls;
334  meMap[tmpName]->Fill(s + nstrips * (roll - 1));
335  }
336  }
337  }
338 
339  tmpName = "BXDistribution_" + nameRoll;
340  if (meMap[tmpName])
341  meMap[tmpName]->Fill(bx);
342 
343  // ###################### Sector- Ring Level #################################
344 
345  tmpName = fmt::format("Occupancy_{}_{}_Sector_{}", wheelOrDiskType, wheelOrDiskNumber, sector);
346  if (meSectorRing[tmpName]) {
347  for (int s = firstStrip; s <= lastStrip; s++) { //Loop on digis
348  meSectorRing[tmpName]->Fill(s, nr);
349  }
350  }
351 
352  tmpName = fmt::format("ClusterSize_{}_{}_Sector_{}", wheelOrDiskType, wheelOrDiskNumber, sector);
353  if (meSectorRing[tmpName]) {
354  if (clusterSize >= meSectorRing[tmpName]->getNbinsX())
355  meSectorRing[tmpName]->Fill(meSectorRing[tmpName]->getNbinsX(), nr);
356  else
357  meSectorRing[tmpName]->Fill(clusterSize, nr);
358  }
359 
360  tmpName = fmt::format("Occupancy_{}_{}_Ring_{}", wheelOrDiskType, wheelOrDiskNumber, ring);
361  if (geoServ.segment() > 0 && geoServ.segment() <= 18) {
362  tmpName += "_CH01-CH18";
363  } else if (geoServ.segment() >= 19) {
364  tmpName += "_CH19-CH36";
365  }
366 
367  if (meSectorRing[tmpName]) {
368  for (int s = firstStrip; s <= lastStrip; s++) { //Loop on digis
369  meSectorRing[tmpName]->Fill(s + 32 * (detId.roll() - 1), geoServ.segment());
370  }
371  }
372 
373  tmpName = fmt::format("ClusterSize_{}_{}_Ring_{}", wheelOrDiskType, wheelOrDiskNumber, ring);
374  if (geoServ.segment() > 0 && geoServ.segment() <= 9) {
375  tmpName += "_CH01-CH09";
376  } else if (geoServ.segment() >= 10 && geoServ.segment() <= 18) {
377  tmpName += "_CH10-CH18";
378  } else if (geoServ.segment() >= 19 && geoServ.segment() <= 27) {
379  tmpName += "_CH19-CH27";
380  } else if (geoServ.segment() >= 28 && geoServ.segment() <= 36) {
381  tmpName += "_CH28-CH36";
382  }
383 
384  if (meSectorRing[tmpName]) {
385  if (clusterSize >= meSectorRing[tmpName]->getNbinsX())
386  meSectorRing[tmpName]->Fill(meSectorRing[tmpName]->getNbinsX(),
387  3 * (geoServ.segment() - 1) + (3 - detId.roll()) + 1);
388  else
389  meSectorRing[tmpName]->Fill(clusterSize, 3 * (geoServ.segment() - 1) + (3 - detId.roll()) + 1);
390  }
391 
392  // ###################### Wheel/Disk Level #########################
393  if (region == 0) {
394  tmpName = fmt::format("1DOccupancy_Wheel_{}", wheelOrDiskNumber);
395  if (meWheelDisk[tmpName])
396  meWheelDisk[tmpName]->Fill(sector, clusterSize);
397 
398  tmpName = fmt::format("Occupancy_Roll_vs_Sector_{}_{}", wheelOrDiskType, wheelOrDiskNumber);
399  if (meWheelDisk[tmpName])
400  meWheelDisk[tmpName]->Fill(sector, nr, clusterSize);
401 
402  } else {
403  tmpName = fmt::format("1DOccupancy_Ring_{}", ring);
404  if ((meWheelDisk[tmpName])) {
405  if (wheelOrDiskNumber > 0) {
406  meWheelDisk[tmpName]->Fill(wheelOrDiskNumber + numberOfDisks_, clusterSize);
407  } else {
408  meWheelDisk[tmpName]->Fill(wheelOrDiskNumber + numberOfDisks_ + 1, clusterSize);
409  }
410  }
411 
412  tmpName = fmt::format("Occupancy_Ring_vs_Segment_{}_{}", wheelOrDiskType, wheelOrDiskNumber);
413  if (meWheelDisk[tmpName])
414  meWheelDisk[tmpName]->Fill(geoServ.segment(), (ring - 1) * 3 - detId.roll() + 1, clusterSize);
415  }
416 
417  tmpName = fmt::format("BxDistribution_{}_{}", wheelOrDiskType, wheelOrDiskNumber);
418  if (meWheelDisk[tmpName])
419  meWheelDisk[tmpName]->Fill(bx);
420 
421  } //end loop on recHits
422 
423  tmpName = "BXWithData_" + nameRoll;
424  if (meMap[tmpName])
425  meMap[tmpName]->Fill(bxSet.size());
426 
427  tmpName = "NumberOfClusters_" + nameRoll;
428  if (meMap[tmpName])
429  meMap[tmpName]->Fill(numberOfRecHits);
430 
431  tmpName = "Multiplicity_" + RPCMonitorDigi::regionNames_[region + 1];
432  if (meRegion[tmpName])
433  meRegion[tmpName]->Fill(numDigi);
434 
435  if (region == 0) {
436  if (meRegion["Occupancy_for_Barrel"])
437  meRegion["Occupancy_for_Barrel"]->Fill(sector, wheelOrDiskNumber, numDigi);
438  } else {
439  int xbin = wheelOrDiskNumber + numberOfDisks_;
440  if (region == -1) {
441  xbin = wheelOrDiskNumber + numberOfDisks_ + 1;
442  }
443  if (meRegion["Occupancy_for_Endcap"]) {
444  meRegion["Occupancy_for_Endcap"]->Fill(xbin, ring, numDigi);
445  }
446  }
447 
448  tmpName = "Multiplicity_" + nameRoll;
449  if (meMap[tmpName])
450  meMap[tmpName]->Fill(numDigi);
451 
452  } //end loop on rolls
453 
454  for (int i = 0; i < 3; i++) {
455  const std::string tmpName = "NumberOfClusters_" + RPCMonitorDigi::regionNames_[i];
456  if (meRegion[tmpName])
457  meRegion[tmpName]->Fill(totalNumberOfRecHits[i]);
458  }
459 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
std::string muonFolder_
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
std::map< std::string, MonitorElement * > sectorRingMuonCollection
int ring() const
Definition: RPCDetId.h:59
std::string noiseFolder_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const std::array< std::string, 3 > regionNames_
int roll() const
Definition: RPCDetId.h:92
static std::string name(const RPCDetId &detId, const bool useRoll)
Definition: RPCNameHelper.cc:6
std::map< std::string, MonitorElement * > regionMuonCollection
Log< level::Info, false > LogInfo
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
int station() const
Definition: RPCDetId.h:78
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
std::map< std::string, MonitorElement * > regionNoiseCollection
int layer() const
Definition: RPCDetId.h:85
Log< level::Warning, false > LogWarning

◆ stripsInRoll()

int RPCMonitorDigi::stripsInRoll ( const RPCDetId id,
const RPCGeometry rpcGeo 
) const
private

Definition at line 236 of file RPCBookDetUnitME.cc.

References RPCRoll::nstrips(), and RPCGeometry::roll().

Referenced by bookRollME().

236  {
237  const RPCRoll* rpcRoll = rpcGeo->roll(id);
238  if (!rpcRoll)
239  return 1;
240 
241  return rpcRoll->nstrips();
242 }
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
int nstrips() const
Definition: RPCRoll.cc:24

Member Data Documentation

◆ counter

int RPCMonitorDigi::counter
private

Definition at line 50 of file RPCMonitorDigi.h.

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

◆ globalFolder_

std::string RPCMonitorDigi::globalFolder_
private

Definition at line 72 of file RPCMonitorDigi.h.

Referenced by bookRegionME(), bookWheelDiskME(), and RPCMonitorDigi().

◆ meMuonCollection

std::map<std::string, std::map<std::string, MonitorElement *> > RPCMonitorDigi::meMuonCollection
private

Definition at line 62 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ meNoiseCollection

std::map<std::string, std::map<std::string, MonitorElement *> > RPCMonitorDigi::meNoiseCollection
private

Definition at line 67 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ muEtaCut_

float RPCMonitorDigi::muEtaCut_
private

Definition at line 52 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

◆ muonFolder_

std::string RPCMonitorDigi::muonFolder_
private

Definition at line 48 of file RPCMonitorDigi.h.

Referenced by analyze(), bookHistograms(), performSourceOperation(), and RPCMonitorDigi().

◆ muonLabel_

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

Definition at line 75 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

◆ muonRPCEvents_

MonitorElement* RPCMonitorDigi::muonRPCEvents_
private

Definition at line 55 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

◆ muPtCut_

float RPCMonitorDigi::muPtCut_
private

Definition at line 52 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

◆ noiseFolder_

std::string RPCMonitorDigi::noiseFolder_
private

Definition at line 49 of file RPCMonitorDigi.h.

Referenced by analyze(), bookHistograms(), performSourceOperation(), and RPCMonitorDigi().

◆ noiseRPCEvents_

MonitorElement* RPCMonitorDigi::noiseRPCEvents_
private

Definition at line 54 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

◆ numberOfDisks_

int RPCMonitorDigi::numberOfDisks_
private

◆ numberOfInnerRings_

int RPCMonitorDigi::numberOfInnerRings_
private

Definition at line 60 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), bookSectorRingME(), and bookWheelDiskME().

◆ NumberOfMuon_

MonitorElement* RPCMonitorDigi::NumberOfMuon_
private

Definition at line 58 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

◆ NumberOfRecHitMuon_

MonitorElement* RPCMonitorDigi::NumberOfRecHitMuon_
private

Definition at line 57 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

◆ regionMuonCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::regionMuonCollection
private

Definition at line 64 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ regionNames_

const std::array< std::string, 3 > RPCMonitorDigi::regionNames_ = {{"Endcap-", "Barrel", "Endcap+"}}
staticprivate

Definition at line 47 of file RPCMonitorDigi.h.

Referenced by performSourceOperation().

◆ regionNoiseCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::regionNoiseCollection
private

Definition at line 69 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ rpcGeomToken_

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCMonitorDigi::rpcGeomToken_
private

Definition at line 79 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and RPCMonitorDigi().

◆ rpcRecHitLabel_

edm::EDGetTokenT<RPCRecHitCollection> RPCMonitorDigi::rpcRecHitLabel_
private

Definition at line 76 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

◆ scalersRawToDigiLabel_

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

Definition at line 77 of file RPCMonitorDigi.h.

Referenced by RPCMonitorDigi().

◆ sectorRingMuonCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::sectorRingMuonCollection
private

Definition at line 65 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ sectorRingNoiseCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::sectorRingNoiseCollection
private

Definition at line 70 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ subsystemFolder_

std::string RPCMonitorDigi::subsystemFolder_
private

◆ useMuonDigis_

bool RPCMonitorDigi::useMuonDigis_
private

Definition at line 42 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and RPCMonitorDigi().

◆ useRollInfo_

bool RPCMonitorDigi::useRollInfo_
private

◆ wheelDiskMuonCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::wheelDiskMuonCollection
private

Definition at line 63 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

◆ wheelDiskNoiseCollection

std::map<std::string, MonitorElement *> RPCMonitorDigi::wheelDiskNoiseCollection
private

Definition at line 68 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().