CMS 3D CMS Logo

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

#include <RPCMonitorDigi.h>

Inheritance diagram for RPCMonitorDigi:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void bookRegionME (const std::string &, std::map< std::string, MonitorElement * > &)
 Booking of MonitoringElemnt at region (Barrel/Endcap) level. More...
 
void bookRollME (RPCDetId &, const edm::EventSetup &, const std::string &, std::map< std::string, MonitorElement * > &)
 Booking of MonitoringElement for one RPCDetId (= roll) More...
 
void bookSectorRingME (const std::string &, std::map< std::string, MonitorElement * > &)
 Booking of MonitoringElement at Sector/Ring level. More...
 
void bookWheelDiskME (const std::string &, std::map< std::string, MonitorElement * > &)
 Booking of MonitoringElemnt at Wheel/Disk level. More...
 
virtual void endJob (void)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
 RPCMonitorDigi (const edm::ParameterSet &)
 
 ~RPCMonitorDigi ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
DQMStoredbe
 DQM store. More...
 
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::InputTag 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::InputTag rpcRecHitLabel_
 
bool saveRootFile
 
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+"}
 Data Format. More...
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 20 of file RPCMonitorDigi.h.

Member Enumeration Documentation

Enumerator
EM 
B 
EP 
ALL 

Definition at line 54 of file RPCMonitorDigi.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file RPCMonitorDigi.cc.

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

22  :counter(0){
23 
24  saveRootFile = pset.getUntrackedParameter<bool>("SaveRootFile", false);
25  RootFileName = pset.getUntrackedParameter<std::string>("RootFileName", "RPCMonitorDigiDQM.root");
26 
27  useMuonDigis_= pset.getUntrackedParameter<bool>("UseMuon", true);
28  useRollInfo_= pset.getUntrackedParameter<bool>("UseRollInfo", false);
29  muonLabel_ = pset.getParameter<edm::InputTag>("MuonLabel");
30  muPtCut_ = pset.getUntrackedParameter<double>("MuonPtCut", 3.0);
31  muEtaCut_ = pset.getUntrackedParameter<double>("MuonEtaCut", 1.9);
32 
33  subsystemFolder_ = pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
34  globalFolder_ = pset.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
35 
36  rpcRecHitLabel_ = pset.getParameter<edm::InputTag>("RecHitLabel");
37 
38  numberOfDisks_ = pset.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
39  numberOfInnerRings_ = pset.getUntrackedParameter<int>("NumberOfInnermostEndcapRings", 2);
40 
41  noiseFolder_ = pset.getUntrackedParameter<std::string>("NoiseFolder", "AllHits");
42  muonFolder_ = pset.getUntrackedParameter<std::string>("MuonFolder", "Muon");
43 
44 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string globalFolder_
std::string muonFolder_
std::string RootFileName
edm::InputTag muonLabel_
std::string noiseFolder_
edm::InputTag rpcRecHitLabel_
std::string subsystemFolder_
RPCMonitorDigi::~RPCMonitorDigi ( )

Definition at line 46 of file RPCMonitorDigi.cc.

46 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 135 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_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file RPCMonitorDigi.cc.

47 {}
void RPCMonitorDigi::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

get hold of back-end interface

Reimplemented from edm::EDAnalyzer.

Definition at line 49 of file RPCMonitorDigi.cc.

References DQMStore::book1D(), bookRegionME(), bookRollME(), bookSectorRingME(), bookWheelDiskME(), RPCGeomServ::chambername(), dbe, dcs_, edm::EventSetup::get(), DQMStore::get(), MonitorElement::getName(), meMuonCollection, meNoiseCollection, muonFolder_, muonRPCEvents_, RPCGeomServ::name(), noiseFolder_, noiseRPCEvents_, NumberOfMuon_, NumberOfRecHitMuon_, cppFunctionSkipper::operator, alignCSCRings::r, regionMuonCollection, regionNoiseCollection, DQMStore::removeElement(), RPCChamber::rolls(), sectorRingMuonCollection, sectorRingNoiseCollection, DQMStore::setCurrentFolder(), subsystemFolder_, useMuonDigis_, useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

49  {
50 
51  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Begin Run " ;
52 
55 
56  //Book
60 
61 
62 
63  std::string currentFolder = subsystemFolder_ +"/"+noiseFolder_;
64  dbe->setCurrentFolder(currentFolder);
65 
66  noiseRPCEvents_= dbe->get(currentFolder +"/RPCEvents");
68  noiseRPCEvents_ = dbe->book1D("RPCEvents","RPCEvents", 1, 0.5, 1.5);
69 
70 
71  if(useMuonDigis_ ){
75 
76  currentFolder = subsystemFolder_ +"/"+muonFolder_;
77  dbe->setCurrentFolder(currentFolder);
78 
79  muonRPCEvents_= dbe->get(currentFolder +"/RPCEvents");
81  muonRPCEvents_ = dbe->book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
82 
83  NumberOfMuon_ = dbe->get(currentFolder+"/NumberOfMuons");
85  NumberOfMuon_ = dbe->book1D("NumberOfMuons", "Number of Muons", 11, -0.5, 10.5);
86 
87 
88  NumberOfRecHitMuon_ = dbe->get(currentFolder+"/NumberOfRPCRecHitsMuons");
90  NumberOfRecHitMuon_ = dbe->book1D("NumberOfRecHitMuons", "Number of RPC RecHits per Muon", 8, -0.5, 7.5);
91  }
92 
93 
95  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
96  //loop on geometry to book all MEs
97  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Booking histograms per roll. " ;
98  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
99  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
100  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
101  std::vector< const RPCRoll*> roles = (ch->rolls());
102  if(useRollInfo_){
103  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
104  RPCDetId rpcId = (*r)->id();
105  //booking all histograms
106  RPCGeomServ rpcsrv(rpcId);
107  std::string nameID = rpcsrv.name();
108  if(useMuonDigis_) bookRollME(rpcId ,iSetup, muonFolder_, meMuonCollection[nameID]);
109  bookRollME(rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
110  }
111  }else{
112  RPCDetId rpcId = roles[0]->id(); //any roll would do - here I just take the first one
113  RPCGeomServ rpcsrv(rpcId);
114  std::string nameID = rpcsrv.chambername();
115  if(useMuonDigis_) bookRollME(rpcId,iSetup, muonFolder_, meMuonCollection[nameID]);
116  bookRollME(rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
117 
118  }
119  }
120  }//end loop on geometry to book all MEs
121 
122 
123  //Clear flags;
124  dcs_ = true;
125 }
std::map< std::string, MonitorElement * > regionMuonCollection
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
const std::string & getName(void) const
get name of ME
std::string muonFolder_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
std::map< std::string, MonitorElement * > regionNoiseCollection
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
MonitorElement * muonRPCEvents_
DQMStore * dbe
DQM store.
void bookRollME(RPCDetId &, const edm::EventSetup &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
std::string noiseFolder_
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
MonitorElement * NumberOfRecHitMuon_
void bookWheelDiskME(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 bookSectorRingME(const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
void bookRegionME(const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
MonitorElement * NumberOfMuon_
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RPCMonitorDigi::bookRegionME ( const std::string &  recHitType,
std::map< std::string, MonitorElement * > &  meMap 
)

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

Definition at line 319 of file RPCBookDetUnitME.cc.

References newFWLiteAna::bin, DQMStore::book1D(), dbe, DQMStore::get(), MonitorElement::getName(), globalFolder_, mergeVDriftHistosByStation::name, NULL, numberOfInnerRings_, alignCSCRings::r, regionNames_, DQMStore::removeElement(), relativeConstraints::ring, DQMStore::setCurrentFolder(), subsystemFolder_, and indexGen::title.

Referenced by beginRun().

319  {
320  //std::map<std::string, MonitorElement*> RPCMonitorDigi::bookRegionME(std::string recHitType) {
321 
322  // std::map<std::string, MonitorElement*> meMap;
323 
324  std::string currentFolder = subsystemFolder_ +"/"+recHitType+"/"+ globalFolder_;
325  dbe->setCurrentFolder(currentFolder);
326 
327  MonitorElement * me = NULL;
328  std::stringstream name;
329  std::stringstream title;
330  for(int r = 0; r < 3; r++){ //RPC regions are E-, B, and E+
331 
332  std::string regionName = RPCMonitorDigi::regionNames_[r];
333  //Cluster size
334  name.str("");
335  title.str("");
336  name<<"ClusterSize_"<< regionName;
337  title<< "ClusterSize - "<<regionName;
338  me = dbe->get(currentFolder+ "/" + name.str());
339  if (me) dbe->removeElement(me->getName());
340  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 16, 0.5, 16.5);
341 
342 
343  }
344 
345 
346  //Number of Cluster
347  name.str("");
348  title.str("");
349  name<<"NumberOfClusters_Barrel";
350  title<< "Number of Clusters per Event - Barrel";
351  me = dbe->get(currentFolder+ "/" + name.str());
352  if (me) dbe->removeElement(me->getName());
353  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 30, 0.5, 30.5);
354 
355  name.str("");
356  title.str("");
357  name<<"NumberOfClusters_Endcap+";
358  title<< "Number of Clusters per Event - Endcap+";
359  me = dbe->get(currentFolder+ "/" + name.str());
360  if (me) dbe->removeElement(me->getName());
361  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 15, 0.5, 15.5);
362 
363  name.str("");
364  title.str("");
365  name<<"NumberOfClusters_Endcap-";
366  title<< "Number of Clusters per Event - Endcap-";
367  me = dbe->get(currentFolder+ "/" + name.str());
368  if (me) dbe->removeElement(me->getName());
369  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 15, 0.5, 15.5);
370 
371  //Number of Digis
372  name.str("");
373  title.str("");
374  name<<"Multiplicity_Barrel";
375  title<< "Multiplicity per Event per Roll - Barrel";
376  me = dbe->get(currentFolder+ "/" + name.str());
377  if (me) dbe->removeElement(me->getName());
378  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 50, 0.5, 50.5);
379 
380 
381  name.str("");
382  title.str("");
383  name<<"Multiplicity_Endcap+";
384  title<< "Multiplicity per Event per Roll - Endcap+";
385  me = dbe->get(currentFolder+ "/" + name.str());
386  if (me) dbe->removeElement(me->getName());
387  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 32, 0.5, 32.5);
388 
389  name.str("");
390  title.str("");
391  name<<"Multiplicity_Endcap-";
392  title<< "Multiplicity per Event per Roll - Endcap-";
393  me = dbe->get(currentFolder+ "/" + name.str());
394  if (me) dbe->removeElement(me->getName());
395  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 32, 0.5, 32.5);
396 
397 
398  for(int layer = 1 ; layer <= 6 ; layer ++){
399 
400  name.str("");
401  title.str("");
402  name<<"ClusterSize_Layer"<< layer;
403  title<< "ClusterSize - Layer"<<layer;
404  me = dbe->get(currentFolder+ "/" + name.str());
405  if (me) dbe->removeElement(me->getName());
406  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 16, 0.5, 16.5);
407  }
408 
409  for(int ring = RPCMonitorDigi::numberOfInnerRings_ ; ring <= 3 ; ring ++){
410 
411  name.str("");
412  title.str("");
413  name<<"ClusterSize_Ring"<< ring;
414  title<< "ClusterSize - Ring"<<ring;
415  me = dbe->get(currentFolder+ "/" + name.str());
416  if (me) dbe->removeElement(me->getName());
417  meMap[name.str()] = dbe->book1D(name.str(), title.str(), 16, 0.5, 16.5);
418 
419  }
420 
421 
422  me = dbe->get(currentFolder+ "/Occupancy_for_Endcap");
423  if (me) dbe->removeElement(me->getName());
424  meMap["Occupancy_for_Endcap"] = dbe -> book2D("Occupancy_for_Endcap", "Occupancy Endcap", 6, 0.5, 6.5, 2, 1.5, 3.5);
425  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Disk", 1);
426  meMap["Occupancy_for_Endcap"] ->setAxisTitle("Ring", 2);
427 
428  std::stringstream binlabel;
429  for (int bin = 1 ; bin <= 6 ; bin++){
430  binlabel.str("");
431  if(bin<4) {//negative endcap
432  binlabel<<(bin-4);
433  }else{//positive endcaps
434  binlabel<<(bin-3);
435  }
436  meMap["Occupancy_for_Endcap"]->setBinLabel( bin , binlabel.str(), 1);
437  }
438 
439  meMap["Occupancy_for_Endcap"]->setBinLabel( 1 , "2", 2);
440  meMap["Occupancy_for_Endcap"]->setBinLabel( 2 , "3", 2);
441 
442 
443  me = dbe->get(currentFolder+ "/Occupancy_for_Barrel");
444  if (me) dbe->removeElement(me->getName());
445  meMap["Occupancy_for_Barrel"] = dbe -> book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5 , 12.5, 5, -2.5, 2.5 );
446  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Sec", 1);
447  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Wheel", 2);
448 
449  for (int bin = 1 ; bin <= 12 ; bin++){
450  binlabel.str("");
451  binlabel<<bin;
452  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 1);
453  if(bin <= 5 ){
454  binlabel.str("");
455  binlabel<< (bin - 3);
456  meMap["Occupancy_for_Barrel"]->setBinLabel( bin , binlabel.str(), 2);
457  }
458  }
459  // return meMap;
460 
461 }
const std::string & getName(void) const
get name of ME
std::string globalFolder_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
#define NULL
Definition: scimark2.h:8
DQMStore * dbe
DQM store.
static const std::string regionNames_[3]
Data Format.
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RPCMonitorDigi::bookRollME ( RPCDetId detId,
const edm::EventSetup iSetup,
const std::string &  recHitType,
std::map< std::string, MonitorElement * > &  meMap 
)

Booking of MonitoringElement for one RPCDetId (= roll)

Name components common to current RPCDetId

Definition at line 9 of file RPCBookDetUnitME.cc.

References abs, DQMStore::book1D(), RPCGeomServ::chambername(), rpcdqm::CLUSTERSIZE, dbe, RPCBookFolderStructure::folderStructure(), RPCDetId::layer(), rpcdqm::MULTIPLICITY, RPCGeomServ::name(), rpcdqm::OCCUPANCY, RPCDetId::region(), RPCDetId::ring(), DQMStore::setCurrentFolder(), RPCDetId::station(), stripsInRoll(), subsystemFolder_, DQMStore::tag(), and useRollInfo_.

Referenced by beginRun().

9  {
10  //std::map<std::string, MonitorElement*> RPCMonitorDigi::bookRollME(RPCDetId & detId, const edm::EventSetup & iSetup, std::string recHitType) {
11  //std::map<std::string, MonitorElement*> meMap;
12 
14  std::string folder = subsystemFolder_+ "/"+ recHitType +"/"+folderStr->folderStructure(detId);
15 
16  dbe->setCurrentFolder(folder);
17 
18  //get number of strips in current roll
19  int nstrips = this->stripsInRoll(detId, iSetup);
20  if (nstrips == 0 ) nstrips = 1;
21 
23  RPCGeomServ RPCname(detId);
24  std::string nameRoll = "";
25 
27  nameRoll = RPCname.name();
28  }else{
29  nameRoll = RPCname.chambername();
30  }
31 
32  if(detId.region() != 0 || //Endcaps
33  (abs(detId.ring()) == 2 && detId.station()== 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
34  (abs(detId.ring()) != 2 && detId.station()== 2 && detId.layer() == 1)){nstrips *= 3;} //Wheel -1,0,+1 RB2in
35  else {
36  nstrips *= 2;
37  }
38 
39 
40  std::stringstream os;
41  os.str("");
42  os<<"Occupancy_"<<nameRoll;
43  meMap[os.str()] = dbe->book1D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5);
44  dbe->tag( meMap[os.str()], rpcdqm::OCCUPANCY);
45 
46  os.str("");
47  os<<"BXDistribution_"<<nameRoll;
48  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 7, -3.5, 3.5);
49 
50 
51  if(detId.region() == 0){
52  os.str("");
53  os<<"ClusterSize_"<<nameRoll;
54  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 15, 0.5, 15.5);
55  dbe->tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
56 
57  os.str("");
58  os<<"Multiplicity_"<<nameRoll;
59  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 30, 0.5, 30.5);
60  dbe->tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
61 
62  }else{
63  os.str("");
64  os<<"ClusterSize_"<<nameRoll;
65  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
66  dbe->tag( meMap[os.str()], rpcdqm::CLUSTERSIZE);
67 
68  os.str("");
69  os<<"Multiplicity_"<<nameRoll;
70  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 15, 0.5, 15.5);
71  dbe->tag( meMap[os.str()], rpcdqm::MULTIPLICITY);
72  }
73 
74 
75 // os.str("");
76 // os<<"BXWithData_"<<nameRoll;
77 // meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
78 
79  os.str("");
80  os<<"NumberOfClusters_"<<nameRoll;
81  meMap[os.str()] = dbe->book1D(os.str(), os.str(),10,0.5,10.5);
82 
83 
84  delete folderStr;
85  // return meMap;
86 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
#define abs(x)
Definition: mlp_lapack.h:159
DQMStore * dbe
DQM store.
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1354
int ring() const
Definition: RPCDetId.h:76
int layer() const
Definition: RPCDetId.h:112
std::string folderStructure(RPCDetId detId)
int stripsInRoll(RPCDetId &, const edm::EventSetup &)
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
void RPCMonitorDigi::bookSectorRingME ( const std::string &  recHitType,
std::map< std::string, MonitorElement * > &  meMap 
)

Booking of MonitoringElement at Sector/Ring level.

Definition at line 89 of file RPCBookDetUnitME.cc.

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

Referenced by beginRun().

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

Booking of MonitoringElemnt at Wheel/Disk level.

Definition at line 205 of file RPCBookDetUnitME.cc.

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

Referenced by beginRun().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file RPCMonitorDigi.cc.

References dbe, RootFileName, DQMStore::save(), and saveRootFile.

127  {
129  dbe = 0;
130 }
std::string RootFileName
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
DQMStore * dbe
DQM store.
void RPCMonitorDigi::endLuminosityBlock ( edm::LuminosityBlock const &  L,
edm::EventSetup const &  E 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file RPCMonitorDigi.cc.

132 {}
void RPCMonitorDigi::makeDcsInfo ( const edm::Event e)
private

Definition at line 503 of file RPCMonitorDigi.cc.

References dcs_, edm::Event::getByLabel(), edm::HandleBase::isValid(), hitfit::return, and DcsStatus::RPC.

Referenced by analyze().

503  {
504 
506 
507  if ( ! e.getByLabel("scalersRawToDigi", dcsStatus) ){
508  dcs_ = true;
509  return;
510  }
511 
512  if ( ! dcsStatus.isValid() )
513  {
514  edm::LogWarning("RPCDcsInfo") << "scalersRawToDigi not found" ;
515  dcs_ = true; // info not available: set to true
516  return;
517  }
518 
519  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
520  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr){
521 
522  if (!dcsStatusItr->ready(DcsStatus::RPC)) dcs_=false;
523  }
524 
525  return ;
526 }
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void RPCMonitorDigi::performSourceOperation ( std::map< RPCDetId, std::vector< RPCRecHit > > &  recHitMap,
std::string  recHittype 
)
private

Definition at line 231 of file RPCMonitorDigi.cc.

References 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_, RPCDetId::region(), regionMuonCollection, regionNames_, regionNoiseCollection, relativeConstraints::ring, RPCDetId::ring(), RPCDetId::roll(), alignCSCRings::s, RPCDetId::sector(), sectorRingMuonCollection, sectorRingNoiseCollection, RPCGeomServ::segment(), relativeConstraints::station, RPCDetId::station(), useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

Referenced by analyze().

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

Definition at line 304 of file RPCBookDetUnitME.cc.

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

Referenced by bookRollME().

304  {
306  iSetup.get<MuonGeometryRecord>().get(rpcgeo);
307 
308  const RPCRoll * rpcRoll = rpcgeo->roll(id);
309 
310  if (!rpcRoll) return 1;
311 
312  return rpcRoll->nstrips();
313 
314 
315 
316 }
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 65 of file RPCMonitorDigi.h.

Referenced by analyze().

DQMStore* RPCMonitorDigi::dbe
private

DQM store.

Definition at line 68 of file RPCMonitorDigi.h.

Referenced by beginRun(), bookRegionME(), bookRollME(), bookSectorRingME(), bookWheelDiskME(), and endJob().

bool RPCMonitorDigi::dcs_
private

Definition at line 69 of file RPCMonitorDigi.h.

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

std::string RPCMonitorDigi::globalFolder_
private

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

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 86 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

float RPCMonitorDigi::muEtaCut_
private

Definition at line 70 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::muonFolder_
private

Definition at line 63 of file RPCMonitorDigi.h.

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

edm::InputTag RPCMonitorDigi::muonLabel_
private

Definition at line 98 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

MonitorElement* RPCMonitorDigi::muonRPCEvents_
private

Definition at line 73 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

float RPCMonitorDigi::muPtCut_
private

Definition at line 70 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::noiseFolder_
private

Definition at line 64 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::noiseRPCEvents_
private

Definition at line 72 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

int RPCMonitorDigi::numberOfDisks_
private

Definition at line 78 of file RPCMonitorDigi.h.

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

int RPCMonitorDigi::numberOfInnerRings_
private

Definition at line 78 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::NumberOfMuon_
private

Definition at line 76 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

MonitorElement* RPCMonitorDigi::NumberOfRecHitMuon_
private

Definition at line 75 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

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

Definition at line 83 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Data Format.

Geometry

Definition at line 62 of file RPCMonitorDigi.h.

Referenced by bookRegionME(), and performSourceOperation().

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

Definition at line 88 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

std::string RPCMonitorDigi::RootFileName
private

Definition at line 95 of file RPCMonitorDigi.h.

Referenced by endJob(), and RPCMonitorDigi().

edm::InputTag RPCMonitorDigi::rpcRecHitLabel_
private

Definition at line 97 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

bool RPCMonitorDigi::saveRootFile
private

Definition at line 94 of file RPCMonitorDigi.h.

Referenced by endJob(), and RPCMonitorDigi().

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

Definition at line 84 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 89 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 56 of file RPCMonitorDigi.h.

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

bool RPCMonitorDigi::useRollInfo_
private

Definition at line 71 of file RPCMonitorDigi.h.

Referenced by beginRun(), bookRollME(), performSourceOperation(), and RPCMonitorDigi().

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

Definition at line 82 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 87 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().