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::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCMonitorDigi (const edm::ParameterSet &)
 
 ~RPCMonitorDigi () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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::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 edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 22 of file RPCMonitorDigi.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file RPCMonitorDigi.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalFolder_, muEtaCut_, muonFolder_, muonLabel_, muPtCut_, noiseFolder_, rpcRecHitLabel_, scalersRawToDigiLabel_, AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, useMuonDigis_, and useRollInfo_.

19  : counter(0),
20  numberOfDisks_(0),
22 
23  useMuonDigis_= pset.getUntrackedParameter<bool>("UseMuon", true);
24  useRollInfo_= pset.getUntrackedParameter<bool>("UseRollInfo", false);
25 
26  muPtCut_ = pset.getUntrackedParameter<double>("MuonPtCut", 3.0);
27  muEtaCut_ = pset.getUntrackedParameter<double>("MuonEtaCut", 1.9);
28 
29  subsystemFolder_ = pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
30  globalFolder_ = pset.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
31 
32  //Parametersets for tokens
33  muonLabel_ = consumes<reco::CandidateView>(pset.getParameter<edm::InputTag>("MuonLabel"));
34  rpcRecHitLabel_ = consumes<RPCRecHitCollection>(pset.getParameter<edm::InputTag>("RecHitLabel"));
35  scalersRawToDigiLabel_ = consumes<DcsStatusCollection>(pset.getParameter<edm::InputTag>("ScalersRawToDigiLabel"));
36 
37  noiseFolder_ = pset.getUntrackedParameter<std::string>("NoiseFolder", "AllHits");
38  muonFolder_ = pset.getUntrackedParameter<std::string>("MuonFolder", "Muon");
39 
40 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string globalFolder_
std::string muonFolder_
std::string noiseFolder_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
std::string subsystemFolder_
edm::EDGetTokenT< reco::CandidateView > muonLabel_
RPCMonitorDigi::~RPCMonitorDigi ( )
overridedefault

Member Function Documentation

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

Definition at line 115 of file RPCMonitorDigi.cc.

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

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

Implements DQMEDAnalyzer.

Definition at line 42 of file RPCMonitorDigi.cc.

References DQMStore::IBooker::book1D(), bookRegionME(), bookRollME(), bookSectorRingME(), bookWheelDiskME(), RPCGeomServ::chambername(), RPCGeometry::dets(), edm::EventSetup::get(), meMuonCollection, meNoiseCollection, muonFolder_, muonRPCEvents_, RPCGeomServ::name(), noiseFolder_, noiseRPCEvents_, nullptr, numberOfDisks_, numberOfInnerRings_, NumberOfMuon_, NumberOfRecHitMuon_, edm::ESHandle< T >::product(), alignCSCRings::r, RPCDetId::region(), regionMuonCollection, regionNoiseCollection, RPCDetId::ring(), RPCChamber::rolls(), sectorRingMuonCollection, sectorRingNoiseCollection, DQMStore::IBooker::setCurrentFolder(), RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, useMuonDigis_, useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

42  {
43 
44  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Begin Run " ;
45 
46  std::set<int> disk_set, ring_set;
47  edm::ESHandle<RPCGeometry> rpcGeoHandle;
48  iSetup.get<MuonGeometryRecord>().get(rpcGeoHandle);
49  const RPCGeometry* rpcGeo = rpcGeoHandle.product();
50 
51  //loop on geometry to book all MEs
52  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Booking histograms per roll. " ;
53  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
54  if(dynamic_cast< const RPCChamber* >( *it ) != nullptr ){
55  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
56  std::vector< const RPCRoll*> roles = (ch->rolls());
57  if(useRollInfo_){
58  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
59  RPCDetId rpcId = (*r)->id();
60 
61  //get station and inner ring
62  if(rpcId.region()!=0){
63  disk_set.insert(rpcId.station());
64  ring_set.insert(rpcId.ring());
65  }
66 
67  //booking all histograms
68  RPCGeomServ rpcsrv(rpcId);
69  std::string nameID = rpcsrv.name();
70  if(useMuonDigis_) bookRollME(ibooker,rpcId , rpcGeo, muonFolder_, meMuonCollection[nameID]);
71  bookRollME(ibooker, rpcId, rpcGeo, noiseFolder_, meNoiseCollection[nameID]);
72  }
73  }else{
74  RPCDetId rpcId = roles[0]->id(); //any roll would do - here I just take the first one
75  RPCGeomServ rpcsrv(rpcId);
76  std::string nameID = rpcsrv.chambername();
77  if(useMuonDigis_) bookRollME(ibooker, rpcId, rpcGeo, muonFolder_, meMuonCollection[nameID]);
78  bookRollME(ibooker, rpcId, rpcGeo, noiseFolder_, meNoiseCollection[nameID]);
79  if(rpcId.region()!=0){
80  disk_set.insert(rpcId.station());
81  ring_set.insert(rpcId.ring());
82  }
83  }
84  }
85  }//end loop on geometry to book all MEs
86 
87  numberOfDisks_ = disk_set.size();
88  numberOfInnerRings_ = (*ring_set.begin());
89 
90  //Book
94 
95  std::string currentFolder = subsystemFolder_ +"/"+noiseFolder_;
96  ibooker.setCurrentFolder(currentFolder);
97 
98  noiseRPCEvents_ = ibooker.book1D("RPCEvents","RPCEvents", 1, 0.5, 1.5);
99 
100  if(useMuonDigis_ ){
104 
105  currentFolder = subsystemFolder_ +"/"+muonFolder_;
106  ibooker.setCurrentFolder(currentFolder);
107 
108  muonRPCEvents_ = ibooker.book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
109  NumberOfMuon_ = ibooker.book1D("NumberOfMuons", "Number of Muons", 11, -0.5, 10.5);
110  NumberOfRecHitMuon_ = ibooker.book1D("NumberOfRecHitMuons", "Number of RPC RecHits per Muon", 8, -0.5, 7.5);
111  }
112 
113 }
std::map< std::string, MonitorElement * > regionMuonCollection
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
std::string muonFolder_
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
std::map< std::string, MonitorElement * > regionNoiseCollection
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
MonitorElement * muonRPCEvents_
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
#define nullptr
std::string noiseFolder_
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
int ring() const
Definition: RPCDetId.h:72
void bookRollME(DQMStore::IBooker &, const RPCDetId &, const RPCGeometry *rpcGeo, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
MonitorElement * NumberOfRecHitMuon_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:33
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
MonitorElement * noiseRPCEvents_
std::map< std::string, MonitorElement * > sectorRingMuonCollection
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
MonitorElement * NumberOfMuon_
T const * product() const
Definition: ESHandle.h:86
std::string subsystemFolder_
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
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 279 of file RPCBookDetUnitME.cc.

References stringResolutionProvider_cfi::bin, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), globalFolder_, dataset::name, numberOfDisks_, numberOfInnerRings_, alignCSCRings::r, regionNames_, relativeConstraints::ring, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and fftjetcommon_cfi::title.

Referenced by bookHistograms().

280 {
281  std::string currentFolder = subsystemFolder_ +"/"+recHitType+"/"+ globalFolder_;
282  ibooker.setCurrentFolder(currentFolder);
283 
284  std::stringstream name;
285  std::stringstream title;
286  for(int r = 0; r < 3; r++){ //RPC regions are E-, B, and E+
287 
289  //Cluster size
290  name.str("");
291  title.str("");
292  name<<"ClusterSize_"<< regionName;
293  title<< "ClusterSize - "<<regionName;
294  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
295 
296 
297  }
298 
299 
300  //Number of Cluster
301  name.str("");
302  title.str("");
303  name<<"NumberOfClusters_Barrel";
304  title<< "Number of Clusters per Event - Barrel";
305  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 30, 0.5, 30.5);
306 
307  name.str("");
308  title.str("");
309  name<<"NumberOfClusters_Endcap+";
310  title<< "Number of Clusters per Event - Endcap+";
311  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
312 
313  name.str("");
314  title.str("");
315  name<<"NumberOfClusters_Endcap-";
316  title<< "Number of Clusters per Event - Endcap-";
317  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
318 
319  //Number of Digis
320  name.str("");
321  title.str("");
322  name<<"Multiplicity_Barrel";
323  title<< "Multiplicity per Event per Roll - Barrel";
324  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 50, 0.5, 50.5);
325 
326 
327  name.str("");
328  title.str("");
329  name<<"Multiplicity_Endcap+";
330  title<< "Multiplicity per Event per Roll - Endcap+";
331  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
332 
333  name.str("");
334  title.str("");
335  name<<"Multiplicity_Endcap-";
336  title<< "Multiplicity per Event per Roll - Endcap-";
337  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
338 
339 
340  for(int layer = 1 ; layer <= 6 ; layer ++){
341 
342  name.str("");
343  title.str("");
344  name<<"ClusterSize_Layer"<< layer;
345  title<< "ClusterSize - Layer"<<layer;
346  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
347  }
348 
349  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
350 
351  name.str("");
352  title.str("");
353  name<<"ClusterSize_Ring"<< ring;
354  title<< "ClusterSize - Ring"<<ring;
355  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
356 
357  }
358 
359 
360  meMap["Occupancy_for_Endcap"] = ibooker.book2D("Occupancy_for_Endcap", "Occupancy Endcap", (int)RPCMonitorDigi::numberOfDisks_*2.0 , 0.5, ((float)RPCMonitorDigi::numberOfDisks_*2.0)+0.5, 2, 1.5, 3.5);
361  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Disk", 1);
362  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Ring", 2);
363 
364  std::stringstream binlabel;
365  for (int bin = 1 ; bin <= RPCMonitorDigi::numberOfDisks_*2 ; bin++){
366  binlabel.str("");
367  if(bin< (RPCMonitorDigi::numberOfDisks_+1)) {//negative endcap
368  binlabel<<(bin-( RPCMonitorDigi::numberOfDisks_+1));
369  }else{//positive endcaps
370  binlabel<<(bin- RPCMonitorDigi::numberOfDisks_);
371  }
372  meMap["Occupancy_for_Endcap"]->setBinLabel( bin , binlabel.str(), 1);
373  }
374 
375  meMap["Occupancy_for_Endcap"]->setBinLabel( 1 , "2", 2);
376  meMap["Occupancy_for_Endcap"]->setBinLabel( 2 , "3", 2);
377 
378  meMap["Occupancy_for_Barrel"] = ibooker.book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5 , 12.5, 5, -2.5, 2.5 );
379  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Sec", 1);
380  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Wheel", 2);
381 
382  for (int bin = 1 ; bin <= 12 ; bin++){
383  binlabel.str("");
384  binlabel<<bin;
385  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 1);
386  if(bin <= 5 ){
387  binlabel.str("");
388  binlabel<< (bin - 3);
389  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 2);
390  }
391  }
392 }
std::string globalFolder_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
static const std::array< std::string, 3 > regionNames_
bin
set the eta bin as selection string.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string subsystemFolder_
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 8 of file RPCBookDetUnitME.cc.

References funct::abs(), DQMStore::IBooker::book1D(), rpcdqm::BX, RPCGeomServ::chambername(), rpcdqm::CLUSTERSIZE, printsummarytable::folder, RPCBookFolderStructure::folderStructure(), RPCDetId::layer(), rpcdqm::MULTIPLICITY, RPCGeomServ::name(), rpcdqm::OCCUPANCY, RPCDetId::region(), RPCDetId::ring(), DQMStore::IBooker::setCurrentFolder(), RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, stripsInRoll(), subsystemFolder_, DQMStore::IBooker::tag(), and useRollInfo_.

Referenced by bookHistograms().

9 {
10  RPCBookFolderStructure folderStr;
11  std::string folder = subsystemFolder_+ "/"+ recHitType +"/"+folderStr.folderStructure(detId);
12 
13  ibooker.setCurrentFolder(folder);
14 
15  //get number of strips in current roll
16  int nstrips = this->stripsInRoll(detId, rpcGeo);
17  if (nstrips == 0 ){ nstrips = 1;}
18 
20  RPCGeomServ RPCname(detId);
21  std::string nameRoll = "";
22 
24  nameRoll = RPCname.name();
25  }else{
26  nameRoll = RPCname.chambername();
27 
28  if(detId.region() != 0 || //Endcaps
29  (abs(detId.ring()) == 2 && detId.station()== 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
30  (abs(detId.ring()) != 2 && detId.station()== 2 && detId.layer() == 1)){nstrips *= 3;} //Wheel -1,0,+1 RB2in
31  else {
32  nstrips *= 2;
33  }
34  }
35 
36  std::stringstream os;
37  os.str("");
38  os<<"Occupancy_"<<nameRoll;
39  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5);
40  ibooker.tag( meMap[os.str()], rpcdqm::OCCUPANCY);
41 
42  os.str("");
43  os<<"BXDistribution_"<<nameRoll;
44  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 7, -3.5, 3.5);
45  ibooker.tag( meMap[os.str()], rpcdqm::BX);
46 
47  if(detId.region() == 0){
48  os.str("");
49  os<<"ClusterSize_"<<nameRoll;
50  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
51  ibooker.tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
52 
53  os.str("");
54  os<<"Multiplicity_"<<nameRoll;
55  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 30, 0.5, 30.5);
56  ibooker.tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
57 
58  }else{
59  os.str("");
60  os<<"ClusterSize_"<<nameRoll;
61  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 10, 0.5, 10.5);
62  ibooker.tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
63 
64  os.str("");
65  os<<"Multiplicity_"<<nameRoll;
66  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
67  ibooker.tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
68  }
69 
70 
71  os.str("");
72  os<<"NumberOfClusters_"<<nameRoll;
73  meMap[os.str()] = ibooker.book1D(os.str(), os.str(),10,0.5,10.5);
74 }
int stripsInRoll(const RPCDetId &id, const RPCGeometry *rpcGeo) const
int ring() const
Definition: RPCDetId.h:72
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:291
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int layer() const
Definition: RPCDetId.h:108
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
std::string folderStructure(RPCDetId detId)
std::string subsystemFolder_
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
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 77 of file RPCBookDetUnitME.cc.

References DQMStore::IBooker::book2D(), mps_fire::i, rpcdqm::utils::labelYAxisRoll(), numberOfDisks_, numberOfInnerRings_, relativeConstraints::ring, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), rpcdqm::RPCMEHelper::setNoAlphanumeric(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

78 {
79  std::stringstream os;
80 
81  for(int wheel = -2 ; wheel <= 2; wheel++){
82  os.str("");
83  os<< subsystemFolder_<< "/"<<recHitType<<"/Barrel/Wheel_"<<wheel<<"/SummaryBySectors";
84  ibooker.setCurrentFolder(os.str());
85 
86  for (int sector = 1 ; sector <= 12 ; sector++){
87 
88  os.str("");
89  os<<"Occupancy_Wheel_"<<wheel<<"_Sector_"<<sector;
90 
91  if (sector==9 || sector==11)
92  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 15, 0.5, 15.5);
93  else if (sector==4)
94  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 21, 0.5, 21.5);
95  else
96  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 17, 0.5, 17.5);
97 
98  meMap[os.str()]->setAxisTitle("strip", 1);
99  rpcdqm::utils rpcUtils;
100  rpcUtils.labelYAxisRoll( meMap[os.str()], 0, wheel, true);
101 
102  }
103  }
104 
105 
106  for (int region = -1 ; region <= 1; region++){
107  if( region == 0 ) continue;
108 
109  std::string regionName = "Endcap-";
110  if(region == 1) regionName = "Endcap+";
111 
112  for (int disk = 1; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
113  os.str("");
114  os<< subsystemFolder_<< "/"<<recHitType<<"/"<<regionName<<"/Disk_"<<(region * disk)<<"/SummaryByRings/";
115 
116  ibooker.setCurrentFolder(os.str());
117 
118  for (int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3; ring ++) {
119 
120  os.str("");
121  os<<"Occupancy_Disk_"<<(region * disk)<<"_Ring_"<<ring<<"_CH01-CH18";
122 
123  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 96, 0.5, 96.5, 18 , 0.5, 18.5);
124  meMap[os.str()]->setAxisTitle("strip", 1);
126 
127  std::stringstream yLabel;
128  for (int i = 1 ; i<=18; i++) {
129  yLabel.str("");
130  yLabel<<"R"<<ring<<"_CH"<<std::setw(2)<<std::setfill('0')<<i;
131  meMap[os.str()]->setBinLabel(i, yLabel.str(), 2);
132  }
133 
134 
135  for(int i = 1; i <= 96 ; i++) {
136  if (i ==1) meMap[os.str()]->setBinLabel(i, "1", 1);
137  else if (i==16) meMap[os.str()]->setBinLabel(i, "RollA", 1);
138  else if (i==32) meMap[os.str()]->setBinLabel(i, "32", 1);
139  else if (i==33) meMap[os.str()]->setBinLabel(i, "1", 1);
140  else if (i==48) meMap[os.str()]->setBinLabel(i, "RollB", 1);
141  else if (i==64) meMap[os.str()]->setBinLabel(i, "32", 1);
142  else if (i==65) meMap[os.str()]->setBinLabel(i, "1", 1);
143  else if (i==80) meMap[os.str()]->setBinLabel(i, "RollC", 1);
144  else if (i==96) meMap[os.str()]->setBinLabel(i, "32", 1);
145  else meMap[os.str()]->setBinLabel(i, "", 1);
146  }
147 
148 
149  os.str("");
150  os<<"Occupancy_Disk_"<<(region * disk)<<"_Ring_"<<ring<<"_CH19-CH36";
151 
152  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 96, 0.5, 96.5, 18 , 18.5, 36.5);
153  meMap[os.str()]->setAxisTitle("strip", 1);
155 
156  for (int i = 1 ; i<= 18; i++) {
157  yLabel.str("");
158  yLabel<<"R"<<ring<<"_CH"<<i+18;
159  meMap[os.str()]->setBinLabel(i, yLabel.str(), 2);
160  }
161 
162 
163  for(int i = 1; i <= 96 ; i++) {
164  if (i ==1) meMap[os.str()]->setBinLabel(i, "1", 1);
165  else if (i==16) meMap[os.str()]->setBinLabel(i, "RollA", 1);
166  else if (i==32) meMap[os.str()]->setBinLabel(i, "32", 1);
167  else if (i==33) meMap[os.str()]->setBinLabel(i, "1", 1);
168  else if (i==48) meMap[os.str()]->setBinLabel(i, "RollB", 1);
169  else if (i==64) meMap[os.str()]->setBinLabel(i, "32", 1);
170  else if (i==65) meMap[os.str()]->setBinLabel(i, "1", 1);
171  else if (i==80) meMap[os.str()]->setBinLabel(i, "RollC", 1);
172  else if (i==96) meMap[os.str()]->setBinLabel(i, "32", 1);
173  else meMap[os.str()]->setBinLabel(i, "", 1);
174  }
175 
176  } //loop ring
177  } //loop disk
178  } //loop region
179 }
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:283
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string subsystemFolder_
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 182 of file RPCBookDetUnitME.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), globalFolder_, mps_fire::i, diffTwoXMLs::label, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), dataset::name, numberOfDisks_, numberOfInnerRings_, relativeConstraints::ring, DQMStore::IBooker::setCurrentFolder(), subsystemFolder_, fftjetcommon_cfi::title, and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

183 {
184  ibooker.setCurrentFolder(subsystemFolder_ +"/"+recHitType+"/"+ globalFolder_);
185 
186  std::stringstream os, label, name, title ;
187  rpcdqm::utils rpcUtils;
188 
189  for (int wheel = -2 ; wheel<= 2; wheel++ ) {//Loop on wheel
190  os.str("");
191  os<<"1DOccupancy_Wheel_"<<wheel;
192  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 12, 0.5, 12.5);
193  for(int i=1; i<12; i++) {
194  label.str("");
195  label<<"Sec"<<i;
196  meMap[os.str()] ->setBinLabel(i, label.str(), 1);
197  }
198 
199  os.str("");
200  os<<"Occupancy_Roll_vs_Sector_Wheel_"<<wheel;
201  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 12, 0.5,12.5, 21, 0.5, 21.5);
202  rpcUtils.labelXAxisSector(meMap[os.str()]);
203  rpcUtils.labelYAxisRoll( meMap[os.str()], 0, wheel, true);
204 
205  os.str("");
206  os<<"BxDistribution_Wheel_"<<wheel;
207  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
208 
209 
210  for(int layer = 1 ; layer <= 6 ; layer ++){
211  name.str("");
212  title.str("");
213  name<<"ClusterSize_Wheel_"<<wheel<<"_Layer"<< layer;
214  title<< "ClusterSize - Wheel "<<wheel<<" Layer"<<layer;
215  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
216  }
217 
218 
219 
220  }//end loop on wheel
221 
222 
223  for (int disk = - RPCMonitorDigi::numberOfDisks_; disk <= RPCMonitorDigi::numberOfDisks_; disk++){
224 
225  if(disk == 0) continue;
226 
227 
228  os.str("");
229  os<<"Occupancy_Ring_vs_Segment_Disk_"<<disk;
230  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 36, 0.5,36.5, 6, 0.5, 6.5);
231 
232  rpcUtils.labelXAxisSegment(meMap[os.str()]);
233  rpcUtils.labelYAxisRing(meMap[os.str()], 2, true);
234 
235  os.str("");
236  os<<"BxDistribution_Disk_"<<disk;
237  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
238 
239 
240  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
241 
242  name.str("");
243  title.str("");
244  name<<"ClusterSize_Disk_"<<disk<<"_Ring"<< ring;
245  title<< "ClusterSize - Disk"<<disk<<" Ring"<<ring;
246  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
247 
248  }
249 
250  }
251 
252  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
253  os.str("");
254  os<<"1DOccupancy_Ring_"<<ring;
255  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), RPCMonitorDigi::numberOfDisks_*2 , 0.5, ((double)RPCMonitorDigi::numberOfDisks_*2.0)+0.5);
256  for(int xbin= 1 ; xbin<= RPCMonitorDigi::numberOfDisks_*2 ; xbin++) {
257  label.str("");
258  if (xbin < RPCMonitorDigi::numberOfDisks_+1) label<<"Disk "<< (xbin -(RPCMonitorDigi::numberOfDisks_+1));
259  else label<<"Disk "<< (xbin - RPCMonitorDigi::numberOfDisks_);
260  meMap[os.str()] ->setBinLabel(xbin, label.str(), 1);
261  }
262  }
263 
264 
265 }
std::string globalFolder_
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:264
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:283
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:311
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:249
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::string subsystemFolder_
void RPCMonitorDigi::performSourceOperation ( std::map< RPCDetId, std::vector< RPCRecHit > > &  recHitMap,
std::string  recHittype 
)
private

Definition at line 214 of file RPCMonitorDigi.cc.

References funct::abs(), RPCRecHit::BunchX(), RPCGeomServ::chambername(), RPCRecHit::clusterSize(), rpcdqm::utils::detId2RollNr(), HcalObjRepresent::Fill(), RPCRecHit::firstClusterStrip(), mps_fire::i, createfilelist::int, RPCDetId::layer(), genParticles_cff::map, meMuonCollection, meNoiseCollection, muonFolder_, RPCGeomServ::name(), noiseFolder_, numberOfDisks_, rpcPointValidation_cfi::recHit, RPCDetId::region(), regionMuonCollection, regionNames_, regionNoiseCollection, relativeConstraints::ring, RPCDetId::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().

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

Definition at line 270 of file RPCBookDetUnitME.cc.

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

Referenced by bookRollME().

271 {
272  const RPCRoll * rpcRoll = rpcGeo->roll(id);
273  if (!rpcRoll) return 1;
274 
275  return rpcRoll->nstrips();
276 }
int nstrips() const
Definition: RPCRoll.cc:46
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75

Member Data Documentation

int RPCMonitorDigi::counter
private

Definition at line 50 of file RPCMonitorDigi.h.

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

std::string RPCMonitorDigi::globalFolder_
private

Definition at line 72 of file RPCMonitorDigi.h.

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

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().

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().

float RPCMonitorDigi::muEtaCut_
private

Definition at line 52 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::muonFolder_
private

Definition at line 48 of file RPCMonitorDigi.h.

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

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

Definition at line 75 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

MonitorElement* RPCMonitorDigi::muonRPCEvents_
private

Definition at line 55 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

float RPCMonitorDigi::muPtCut_
private

Definition at line 52 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::noiseFolder_
private

Definition at line 49 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::noiseRPCEvents_
private

Definition at line 54 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

int RPCMonitorDigi::numberOfDisks_
private
int RPCMonitorDigi::numberOfInnerRings_
private

Definition at line 60 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::NumberOfMuon_
private

Definition at line 58 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCMonitorDigi::NumberOfRecHitMuon_
private

Definition at line 57 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 64 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 47 of file RPCMonitorDigi.h.

Referenced by bookRegionME(), and performSourceOperation().

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

Definition at line 69 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 76 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

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

Definition at line 77 of file RPCMonitorDigi.h.

Referenced by RPCMonitorDigi().

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

Definition at line 65 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 70 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

std::string RPCMonitorDigi::subsystemFolder_
private
bool RPCMonitorDigi::useMuonDigis_
private

Definition at line 42 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and RPCMonitorDigi().

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

Definition at line 63 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 68 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().