CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
RPCMonitorDigi Class Reference

Data Format. More...

#include <RPCMonitorDigi.h>

Inheritance diagram for RPCMonitorDigi:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 RPCMonitorDigi (const edm::ParameterSet &)
 
 ~RPCMonitorDigi ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
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 &, RPCDetId &, const edm::EventSetup &, 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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 Types

enum  detectorRegions { EM = 0, B = 1, EP = 2, ALL =3 }
 

Private Member Functions

void makeDcsInfo (const edm::Event &)
 
void performSourceOperation (std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
 
int stripsInRoll (RPCDetId &, const edm::EventSetup &)
 

Private Attributes

int counter
 
bool dcs_
 
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::CandidateView
muonLabel_
 
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
 
std::string RootFileName
 
edm::EDGetTokenT
< RPCRecHitCollection
rpcRecHitLabel_
 
bool saveRootFile
 
edm::EDGetTokenT
< DcsStatusCollection
scalersRawToDigiLabel_
 
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::string regionNames_ [3] = {"Endcap-", "Barrel", "Endcap+"}
 Geometry. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Data Format.

Definition at line 25 of file RPCMonitorDigi.h.

Member Enumeration Documentation

Enumerator
EM 
B 
EP 
ALL 

Definition at line 46 of file RPCMonitorDigi.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file RPCMonitorDigi.cc.

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

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

Definition at line 47 of file RPCMonitorDigi.cc.

47 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 124 of file RPCMonitorDigi.cc.

References TrackingRecHit::clone(), counter, dcs_, reco::LeafCandidate::eta(), MonitorElement::Fill(), i, reco::Muon::isGlobalMuon(), edm::HandleBase::isValid(), makeDcsInfo(), 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 useMuonDigis_.

124  {
125  dcs_ = true;
126  //Check HV status
127  this->makeDcsInfo(event);
128  if( !dcs_){
129  edm::LogWarning ("rpcmonitordigi") <<"[RPCMonitorDigi]: DCS bit OFF" ;
130  return;//if RPC not ON there's no need to continue
131  }
132 
133  counter++;
134  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Beginning analyzing event " << counter;
135 
136  //Muons
138  event.getByToken(muonLabel_, muonCands);
139 
140 
141  std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
142 
143  int numMuons = 0;
144  int numRPCRecHit = 0 ;
145 
146  if(muonCands.isValid()){
147 
148  int nStaMuons = muonCands->size();
149 
150  for( int i = 0; i < nStaMuons; i++ ) {
151 
152  const reco::Candidate & goodMuon = (*muonCands)[i];
153  const reco::Muon * muCand = dynamic_cast<const reco::Muon*>(&goodMuon);
154 
155  if(!muCand->isGlobalMuon())continue;
156  if(muCand->pt() < muPtCut_ || fabs(muCand->eta())>muEtaCut_) continue;
157  numMuons++;
158  reco::Track muTrack = (*(muCand->outerTrack()));
159  std::vector<TrackingRecHitRef > rpcTrackRecHits;
160  //loop on mu rechits
161  for ( trackingRecHit_iterator it= muTrack.recHitsBegin(); it != muTrack.recHitsEnd() ; it++) {
162  if (!(*it)->isValid ())continue;
163  int muSubDetId = (*it)->geographicalId().subdetId();
164  if(muSubDetId == MuonSubdetId::RPC) {
165  numRPCRecHit ++;
166  TrackingRecHit * tkRecHit = (*it)->clone();
167  RPCRecHit* rpcRecHit = dynamic_cast<RPCRecHit*>(tkRecHit);
168  int detId = (int)rpcRecHit->rpcId();
169  if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
170  std::vector<RPCRecHit> myVect(1,*rpcRecHit );
171  rechitMuon[detId]= myVect;
172  }else {
173  rechitMuon[detId].push_back(*rpcRecHit);
174  }
175  }
176  }// end loop on mu rechits
177 
178  }
179 
180  if( NumberOfMuon_) NumberOfMuon_->Fill(numMuons);
181  if( NumberOfRecHitMuon_) NumberOfRecHitMuon_->Fill( numRPCRecHit);
182 
183  }else{
184  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: Muons - Product not valid for event" << counter;
185  }
186 
187  //RecHits
189  event.getByToken( rpcRecHitLabel_ , rpcHits);
190  std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
191 
192 
193  if(rpcHits.isValid()){
194 
195  // RPC rec hits NOT associated to a muon
197  std::vector<RPCRecHit>::const_iterator muonRecHitIter;
198 
199  for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
200  RPCRecHit rpcRecHit = (*rpcRecHitIter);
201  int detId = (int)rpcRecHit.rpcId();
202  if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
203  std::vector<RPCRecHit> myVect(1,rpcRecHit );
204  rechitNoise[detId]= myVect;
205  }else {
206  rechitNoise[detId].push_back(rpcRecHit);
207  }
208  }
209  }else{
210  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" << counter;
211  }
212 
213 
215  if( noiseRPCEvents_ != 0) noiseRPCEvents_->Fill(1);
216 
217  if(useMuonDigis_ ) this->performSourceOperation(rechitMuon, muonFolder_);
218  this->performSourceOperation(rechitNoise, noiseFolder_);
219 }
int i
Definition: DBlmapReader.cc:9
std::string muonFolder_
virtual float pt() const
transverse momentum
bool isGlobalMuon() const
Definition: Muon.h:218
MonitorElement * muonRPCEvents_
void makeDcsInfo(const edm::Event &)
std::string noiseFolder_
void Fill(long long x)
tuple numMuons
Definition: patZpeak.py:40
RPCDetId rpcId() const
Return the rpcId.
Definition: RPCRecHit.h:97
virtual float eta() const
momentum pseudorapidity
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
bool isValid() const
Definition: HandleBase.h:76
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
MonitorElement * NumberOfRecHitMuon_
virtual TrackingRecHit * clone() const =0
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_
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
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 50 of file RPCMonitorDigi.cc.

References DQMStore::IBooker::book1D(), bookRegionME(), bookRollME(), bookSectorRingME(), bookWheelDiskME(), RPCGeomServ::chambername(), dcs_, edm::EventSetup::get(), meMuonCollection, meNoiseCollection, muonFolder_, muonRPCEvents_, RPCGeomServ::name(), noiseFolder_, noiseRPCEvents_, numberOfDisks_, numberOfInnerRings_, NumberOfMuon_, NumberOfRecHitMuon_, 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.

50  {
51 
52  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Begin Run " ;
53 
54  std::set<int> disk_set, ring_set;
56  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
57 
58  //loop on geometry to book all MEs
59  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Booking histograms per roll. " ;
60  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
61  if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
62  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
63  std::vector< const RPCRoll*> roles = (ch->rolls());
64  if(useRollInfo_){
65  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
66  RPCDetId rpcId = (*r)->id();
67 
68  //get station and inner ring
69  if(rpcId.region()!=0){
70  disk_set.insert(rpcId.station());
71  ring_set.insert(rpcId.ring());
72  }
73 
74  //booking all histograms
75  RPCGeomServ rpcsrv(rpcId);
76  std::string nameID = rpcsrv.name();
77  if(useMuonDigis_) bookRollME(ibooker,rpcId ,iSetup, muonFolder_, meMuonCollection[nameID]);
78  bookRollME(ibooker, rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
79  }
80  }else{
81  RPCDetId rpcId = roles[0]->id(); //any roll would do - here I just take the first one
82  RPCGeomServ rpcsrv(rpcId);
83  std::string nameID = rpcsrv.chambername();
84  if(useMuonDigis_) bookRollME(ibooker, rpcId,iSetup, muonFolder_, meMuonCollection[nameID]);
85  bookRollME(ibooker, rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
86  if(rpcId.region()!=0){
87  disk_set.insert(rpcId.station());
88  ring_set.insert(rpcId.ring());
89  }
90  }
91  }
92  }//end loop on geometry to book all MEs
93 
94  numberOfDisks_ = disk_set.size();
95  numberOfInnerRings_ = (*ring_set.begin());
96 
97  //Book
101 
102  std::string currentFolder = subsystemFolder_ +"/"+noiseFolder_;
103  ibooker.setCurrentFolder(currentFolder);
104 
105  noiseRPCEvents_ = ibooker.book1D("RPCEvents","RPCEvents", 1, 0.5, 1.5);
106 
107  if(useMuonDigis_ ){
111 
112  currentFolder = subsystemFolder_ +"/"+muonFolder_;
113  ibooker.setCurrentFolder(currentFolder);
114 
115  muonRPCEvents_ = ibooker.book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
116  NumberOfMuon_ = ibooker.book1D("NumberOfMuons", "Number of Muons", 11, -0.5, 10.5);
117  NumberOfRecHitMuon_ = ibooker.book1D("NumberOfRecHitMuons", "Number of RPC RecHits per Muon", 8, -0.5, 7.5);
118  }
119 
120  //Clear flags;
121  dcs_ = true;
122 }
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.
std::string noiseFolder_
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
int ring() const
Definition: RPCDetId.h:72
void bookRollME(DQMStore::IBooker &, RPCDetId &, const edm::EventSetup &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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:274
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_
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 314 of file RPCBookDetUnitME.cc.

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

Referenced by bookHistograms().

314  {
315  //std::map<std::string, MonitorElement*> RPCMonitorDigi::bookRegionME(std::string recHitType) {
316 
317  // std::map<std::string, MonitorElement*> meMap;
318 
319  std::string currentFolder = subsystemFolder_ +"/"+recHitType+"/"+ globalFolder_;
320  ibooker.setCurrentFolder(currentFolder);
321 
322  std::stringstream name;
323  std::stringstream title;
324  for(int r = 0; r < 3; r++){ //RPC regions are E-, B, and E+
325 
327  //Cluster size
328  name.str("");
329  title.str("");
330  name<<"ClusterSize_"<< regionName;
331  title<< "ClusterSize - "<<regionName;
332  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
333 
334 
335  }
336 
337 
338  //Number of Cluster
339  name.str("");
340  title.str("");
341  name<<"NumberOfClusters_Barrel";
342  title<< "Number of Clusters per Event - Barrel";
343  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 30, 0.5, 30.5);
344 
345  name.str("");
346  title.str("");
347  name<<"NumberOfClusters_Endcap+";
348  title<< "Number of Clusters per Event - Endcap+";
349  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
350 
351  name.str("");
352  title.str("");
353  name<<"NumberOfClusters_Endcap-";
354  title<< "Number of Clusters per Event - Endcap-";
355  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
356 
357  //Number of Digis
358  name.str("");
359  title.str("");
360  name<<"Multiplicity_Barrel";
361  title<< "Multiplicity per Event per Roll - Barrel";
362  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 50, 0.5, 50.5);
363 
364 
365  name.str("");
366  title.str("");
367  name<<"Multiplicity_Endcap+";
368  title<< "Multiplicity per Event per Roll - Endcap+";
369  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
370 
371  name.str("");
372  title.str("");
373  name<<"Multiplicity_Endcap-";
374  title<< "Multiplicity per Event per Roll - Endcap-";
375  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
376 
377 
378  for(int layer = 1 ; layer <= 6 ; layer ++){
379 
380  name.str("");
381  title.str("");
382  name<<"ClusterSize_Layer"<< layer;
383  title<< "ClusterSize - Layer"<<layer;
384  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
385  }
386 
387  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
388 
389  name.str("");
390  title.str("");
391  name<<"ClusterSize_Ring"<< ring;
392  title<< "ClusterSize - Ring"<<ring;
393  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
394 
395  }
396 
397 
398  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);
399  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Disk", 1);
400  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Ring", 2);
401 
402  std::stringstream binlabel;
403  for (int bin = 1 ; bin <= RPCMonitorDigi::numberOfDisks_*2 ; bin++){
404  binlabel.str("");
405  if(bin< (RPCMonitorDigi::numberOfDisks_+1)) {//negative endcap
406  binlabel<<(bin-( RPCMonitorDigi::numberOfDisks_+1));
407  }else{//positive endcaps
408  binlabel<<(bin- RPCMonitorDigi::numberOfDisks_);
409  }
410  meMap["Occupancy_for_Endcap"]->setBinLabel( bin , binlabel.str(), 1);
411  }
412 
413  meMap["Occupancy_for_Endcap"]->setBinLabel( 1 , "2", 2);
414  meMap["Occupancy_for_Endcap"]->setBinLabel( 2 , "3", 2);
415 
416  meMap["Occupancy_for_Barrel"] = ibooker.book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5 , 12.5, 5, -2.5, 2.5 );
417  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Sec", 1);
418  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Wheel", 2);
419 
420  for (int bin = 1 ; bin <= 12 ; bin++){
421  binlabel.str("");
422  binlabel<<bin;
423  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 1);
424  if(bin <= 5 ){
425  binlabel.str("");
426  binlabel<< (bin - 3);
427  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 2);
428  }
429  }
430  // return meMap;
431 
432 }
std::string globalFolder_
static const std::string regionNames_[3]
Geometry.
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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,
RPCDetId detId,
const edm::EventSetup iSetup,
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 9 of file RPCBookDetUnitME.cc.

References funct::abs(), DQMStore::IBooker::book1D(), rpcdqm::BX, RPCGeomServ::chambername(), rpcdqm::CLUSTERSIZE, 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 
12  std::string folder = subsystemFolder_+ "/"+ recHitType +"/"+folderStr->folderStructure(detId);
13 
14  ibooker.setCurrentFolder(folder);
15 
16  //get number of strips in current roll
17  int nstrips = this->stripsInRoll(detId, iSetup);
18  if (nstrips == 0 ){ nstrips = 1;}
19 
21  RPCGeomServ RPCname(detId);
22  std::string nameRoll = "";
23 
25  nameRoll = RPCname.name();
26  }else{
27  nameRoll = RPCname.chambername();
28 
29  if(detId.region() != 0 || //Endcaps
30  (abs(detId.ring()) == 2 && detId.station()== 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
31  (abs(detId.ring()) != 2 && detId.station()== 2 && detId.layer() == 1)){nstrips *= 3;} //Wheel -1,0,+1 RB2in
32  else {
33  nstrips *= 2;
34  }
35 
36  }
37 
38 
39  std::stringstream os;
40  os.str("");
41  os<<"Occupancy_"<<nameRoll;
42  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5);
43  ibooker.tag( meMap[os.str()], rpcdqm::OCCUPANCY);
44 
45  os.str("");
46  os<<"BXDistribution_"<<nameRoll;
47  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 7, -3.5, 3.5);
48  ibooker.tag( meMap[os.str()], rpcdqm::BX);
49 
50  if(detId.region() == 0){
51  os.str("");
52  os<<"ClusterSize_"<<nameRoll;
53  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
54  ibooker.tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
55 
56  os.str("");
57  os<<"Multiplicity_"<<nameRoll;
58  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 30, 0.5, 30.5);
59  ibooker.tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
60 
61  }else{
62  os.str("");
63  os<<"ClusterSize_"<<nameRoll;
64  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 10, 0.5, 10.5);
65  ibooker.tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
66 
67  os.str("");
68  os<<"Multiplicity_"<<nameRoll;
69  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
70  ibooker.tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
71  }
72 
73 
74  os.str("");
75  os<<"NumberOfClusters_"<<nameRoll;
76  meMap[os.str()] = ibooker.book1D(os.str(), os.str(),10,0.5,10.5);
77 
78 
79  delete folderStr;
80  // return meMap;
81 }
int ring() const
Definition: RPCDetId.h:72
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
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:274
std::string folderStructure(RPCDetId detId)
int stripsInRoll(RPCDetId &, const edm::EventSetup &)
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 84 of file RPCBookDetUnitME.cc.

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

Referenced by bookHistograms().

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

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

Referenced by bookHistograms().

200  {
201  //std::map<std::string, MonitorElement*> RPCMonitorDigi::bookWheelDiskME(std::string recHitType) {
202 
203  // std::map<std::string, MonitorElement*> meMap;
204  ibooker.setCurrentFolder(subsystemFolder_ +"/"+recHitType+"/"+ globalFolder_);
205 
206  std::stringstream os, label, name, title ;
207  rpcdqm::utils rpcUtils;
208 
209  for (int wheel = -2 ; wheel<= 2; wheel++ ) {//Loop on wheel
210 
211  // os<<"OccupancyXY_"<<ringType<<"_"<<ring;
212  // meMap[os.str()] = ibooker.book2D(os.str(), os.str(),63, -800, 800, 63, -800, 800);
213  // meMap[os.str()] = ibooker.book2D(os.str(), os.str(),1000, -800, 800, 1000, -800, 800);
214 
215 
216  os.str("");
217  os<<"1DOccupancy_Wheel_"<<wheel;
218  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 12, 0.5, 12.5);
219  for(int i=1; i<12; i++) {
220  label.str("");
221  label<<"Sec"<<i;
222  meMap[os.str()] ->setBinLabel(i, label.str(), 1);
223  }
224 
225  os.str("");
226  os<<"Occupancy_Roll_vs_Sector_Wheel_"<<wheel;
227  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 12, 0.5,12.5, 21, 0.5, 21.5);
228  rpcUtils.labelXAxisSector(meMap[os.str()]);
229  rpcUtils.labelYAxisRoll( meMap[os.str()], 0, wheel, true);
230 
231  os.str("");
232  os<<"BxDistribution_Wheel_"<<wheel;
233  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
234 
235 
236  for(int layer = 1 ; layer <= 6 ; layer ++){
237  name.str("");
238  title.str("");
239  name<<"ClusterSize_Wheel_"<<wheel<<"_Layer"<< layer;
240  title<< "ClusterSize - Wheel "<<wheel<<" Layer"<<layer;
241  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
242  }
243 
244 
245 
246  }//end loop on wheel
247 
248 
249  for (int disk = - RPCMonitorDigi::numberOfDisks_; disk <= RPCMonitorDigi::numberOfDisks_; disk++){
250 
251  if(disk == 0) continue;
252 
253 
254  os.str("");
255  os<<"Occupancy_Ring_vs_Segment_Disk_"<<disk;
256  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 36, 0.5,36.5, 6, 0.5, 6.5);
257 
258  rpcUtils.labelXAxisSegment(meMap[os.str()]);
259  rpcUtils.labelYAxisRing(meMap[os.str()], 2, true);
260 
261  os.str("");
262  os<<"BxDistribution_Disk_"<<disk;
263  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
264 
265 
266  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
267 
268  name.str("");
269  title.str("");
270  name<<"ClusterSize_Disk_"<<disk<<"_Ring"<< ring;
271  title<< "ClusterSize - Disk"<<disk<<" Ring"<<ring;
272  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
273 
274  }
275 
276  }
277 
278  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
279  os.str("");
280  os<<"1DOccupancy_Ring_"<<ring;
281  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), RPCMonitorDigi::numberOfDisks_*2 , 0.5, ((double)RPCMonitorDigi::numberOfDisks_*2.0)+0.5);
282  for(int xbin= 1 ; xbin<= RPCMonitorDigi::numberOfDisks_*2 ; xbin++) {
283  label.str("");
284  if (xbin < RPCMonitorDigi::numberOfDisks_+1) label<<"Disk "<< (xbin -(RPCMonitorDigi::numberOfDisks_+1));
285  else label<<"Disk "<< (xbin - RPCMonitorDigi::numberOfDisks_);
286  meMap[os.str()] ->setBinLabel(xbin, label.str(), 1);
287  }
288  }
289 
290 
291 
292 
293  // return meMap;
294 }
int i
Definition: DBlmapReader.cc:9
std::string globalFolder_
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string subsystemFolder_
void RPCMonitorDigi::makeDcsInfo ( const edm::Event e)
private

Definition at line 494 of file RPCMonitorDigi.cc.

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

Referenced by analyze().

494  {
495 
497 
498  if ( ! e.getByToken(scalersRawToDigiLabel_, dcsStatus) ){
499  dcs_ = true;
500  return;
501  }
502 
503  if ( ! dcsStatus.isValid() )
504  {
505  edm::LogWarning("RPCDcsInfo") << "scalersRawToDigi not found" ;
506  dcs_ = true; // info not available: set to true
507  return;
508  }
509 
510  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
511  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr){
512 
513  if (!dcsStatusItr->ready(DcsStatus::RPC)) dcs_=false;
514  }
515 
516  return ;
517 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
return((rh^lh)&mask)
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
void RPCMonitorDigi::performSourceOperation ( std::map< RPCDetId, std::vector< RPCRecHit > > &  recHitMap,
std::string  recHittype 
)
private

Definition at line 222 of file RPCMonitorDigi.cc.

References funct::abs(), RPCRecHit::BunchX(), RPCGeomServ::chambername(), RPCRecHit::clusterSize(), rpcdqm::utils::detId2RollNr(), HcalObjRepresent::Fill(), RPCRecHit::firstClusterStrip(), i, RPCDetId::layer(), python.multivaluedict::map(), meMuonCollection, meNoiseCollection, muonFolder_, RPCGeomServ::name(), noiseFolder_, numberOfDisks_, 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().

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

Definition at line 299 of file RPCBookDetUnitME.cc.

References edm::EventSetup::get(), and RPCRoll::nstrips().

Referenced by bookRollME().

299  {
301  iSetup.get<MuonGeometryRecord>().get(rpcgeo);
302 
303  const RPCRoll * rpcRoll = rpcgeo->roll(id);
304 
305  if (!rpcRoll) return 1;
306 
307  return rpcRoll->nstrips();
308 
309 
310 
311 }
int nstrips() const
Definition: RPCRoll.cc:46
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

int RPCMonitorDigi::counter
private

Definition at line 57 of file RPCMonitorDigi.h.

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

bool RPCMonitorDigi::dcs_
private

Definition at line 59 of file RPCMonitorDigi.h.

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

std::string RPCMonitorDigi::globalFolder_
private

Definition at line 81 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 71 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 76 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

float RPCMonitorDigi::muEtaCut_
private

Definition at line 60 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::muonFolder_
private

Definition at line 55 of file RPCMonitorDigi.h.

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

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

Definition at line 87 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

MonitorElement* RPCMonitorDigi::muonRPCEvents_
private

Definition at line 63 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

float RPCMonitorDigi::muPtCut_
private

Definition at line 60 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::noiseFolder_
private

Definition at line 56 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::noiseRPCEvents_
private

Definition at line 62 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 68 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::NumberOfMuon_
private

Definition at line 66 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCMonitorDigi::NumberOfRecHitMuon_
private

Definition at line 65 of file RPCMonitorDigi.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 73 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Geometry.

Definition at line 54 of file RPCMonitorDigi.h.

Referenced by bookRegionME(), and performSourceOperation().

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

Definition at line 78 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

std::string RPCMonitorDigi::RootFileName
private

Definition at line 85 of file RPCMonitorDigi.h.

Referenced by RPCMonitorDigi().

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

Definition at line 88 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

bool RPCMonitorDigi::saveRootFile
private

Definition at line 84 of file RPCMonitorDigi.h.

Referenced by RPCMonitorDigi().

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

Definition at line 89 of file RPCMonitorDigi.h.

Referenced by makeDcsInfo(), and RPCMonitorDigi().

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

Definition at line 74 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 79 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 48 of file RPCMonitorDigi.h.

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

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

Definition at line 72 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().

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

Definition at line 77 of file RPCMonitorDigi.h.

Referenced by bookHistograms(), and performSourceOperation().