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)
 
- 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", "Noise");
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 146 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_.

146  {
147  dcs_ = true;
148  //Check HV status
149  this->makeDcsInfo(event);
150  if( !dcs_){
151  edm::LogWarning ("rpcmonitordigi") <<"[RPCMonitorDigi]: DCS bit OFF" ;
152  return;//if RPC not ON there's no need to continue
153  }
154 
155  counter++;
156  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Beginning analyzing event " << counter;
157 
158  //Muons
160  event.getByLabel(muonLabel_, muonCands);
161  std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
162 
163  int numMuons = 0;
164  int numRPCRecHit = 0 ;
165 
166  if(muonCands.isValid()){
167 
168  int nStaMuons = muonCands->size();
169 
170  for( int i = 0; i < nStaMuons; i++ ) {
171 
172  const reco::Candidate & goodMuon = (*muonCands)[i];
173  const reco::Muon * muCand = dynamic_cast<const reco::Muon*>(&goodMuon);
174 
175  if(!muCand->isGlobalMuon())continue;
176  if(muCand->pt() < muPtCut_ || fabs(muCand->eta())>muEtaCut_) continue;
177  numMuons++;
178  reco::Track muTrack = (*(muCand->outerTrack()));
179  std::vector<TrackingRecHitRef > rpcTrackRecHits;
180  //loop on mu rechits
181  for ( trackingRecHit_iterator it= muTrack.recHitsBegin(); it != muTrack.recHitsEnd() ; it++) {
182  if (!(*it)->isValid ())continue;
183  int muSubDetId = (*it)->geographicalId().subdetId();
184  if(muSubDetId == MuonSubdetId::RPC) {
185  numRPCRecHit ++;
186  TrackingRecHit * tkRecHit = (*it)->clone();
187  RPCRecHit* rpcRecHit = dynamic_cast<RPCRecHit*>(tkRecHit);
188  int detId = (int)rpcRecHit->rpcId();
189  if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
190  std::vector<RPCRecHit> myVect(1,*rpcRecHit );
191  rechitMuon[detId]= myVect;
192  }else {
193  rechitMuon[detId].push_back(*rpcRecHit);
194  }
195  }
196  }// end loop on mu rechits
197 
198  }
199 
200  if( NumberOfMuon_) NumberOfMuon_->Fill(numMuons);
201  if( NumberOfRecHitMuon_) NumberOfRecHitMuon_->Fill( numRPCRecHit);
202 
203  }else{
204  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: Muons - Product not valid for event" << counter;
205  }
206 
207  //RecHits
209  event.getByLabel( rpcRecHitLabel_ , rpcHits);
210  std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
211 
212 
213  if(rpcHits.isValid()){
214 
215  // RPC rec hits NOT associated to a muon
217  std::vector<RPCRecHit>::const_iterator muonRecHitIter;
218 
219  for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
220  RPCRecHit rpcRecHit = (*rpcRecHitIter);
221  int detId = (int)rpcRecHit.rpcId();
222  if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
223  std::vector<RPCRecHit> myVect(1,rpcRecHit );
224  rechitNoise[detId]= myVect;
225  }else {
226  rechitNoise[detId].push_back(rpcRecHit);
227  }
228  }
229  }else{
230  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" << counter;
231  }
232 
233 
235  if( noiseRPCEvents_ != 0) noiseRPCEvents_->Fill(1);
236 
237  if(useMuonDigis_ ) this->performSourceOperation(rechitMuon, muonFolder_);
238  this->performSourceOperation(rechitNoise, noiseFolder_);
239 }
int i
Definition: DBlmapReader.cc:9
std::string muonFolder_
edm::InputTag muonLabel_
bool isGlobalMuon() const
Definition: Muon.h:148
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:46
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:41
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_, cmsCodeRules.cppFunctionSkipper::operator, csvReporter::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
57 
58  //regionNoiseCollection = this->bookRegionME(noiseFolder_);
59  //sectorRingNoiseCollection = this->bookSectorRingME(noiseFolder_);
60  //wheelDiskNoiseCollection = this->bookWheelDiskME(noiseFolder_);
61 
65 
66 
67 
68  std::string currentFolder = subsystemFolder_ +"/"+noiseFolder_;
69  dbe->setCurrentFolder(currentFolder);
70 
71  noiseRPCEvents_= dbe->get(currentFolder +"/RPCEvents");
73  noiseRPCEvents_ = dbe->book1D("RPCEvents","RPCEvents", 1, 0.5, 1.5);
74 
75 
76  if(useMuonDigis_ ){
77  // regionMuonCollection = this->bookRegionME(muonFolder_);
78 // sectorRingMuonCollection = this->bookSectorRingME(muonFolder_);
79 // wheelDiskMuonCollection = this->bookWheelDiskME(muonFolder_);
83 
84  currentFolder = subsystemFolder_ +"/"+muonFolder_;
85  dbe->setCurrentFolder(currentFolder);
86 
87  muonRPCEvents_= dbe->get(currentFolder +"/RPCEvents");
89  muonRPCEvents_ = dbe->book1D("RPCEvents", "RPCEvents", 1, 0.5, 1.5);
90 
91  NumberOfMuon_ = dbe->get(currentFolder+"/NumberOfMuons");
93  NumberOfMuon_ = dbe->book1D("NumberOfMuons", "Number of Muons", 11, -0.5, 10.5);
94 
95 
96  NumberOfRecHitMuon_ = dbe->get(currentFolder+"/NumberOfRPCRecHitsMuons");
98  NumberOfRecHitMuon_ = dbe->book1D("NumberOfRecHitMuons", "Number of RPC RecHits per Muon", 8, -0.5, 7.5);
99  }
100 
101 
103  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
104  //loop on geometry to book all MEs
105  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Booking histograms per roll. " ;
106  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
107  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
108  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
109  std::vector< const RPCRoll*> roles = (ch->rolls());
110  if(useRollInfo_){
111  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
112  RPCDetId rpcId = (*r)->id();
113  //booking all histograms
114  RPCGeomServ rpcsrv(rpcId);
115  std::string nameID = rpcsrv.name();
116  if(useMuonDigis_) bookRollME(rpcId ,iSetup, muonFolder_, meMuonCollection[nameID]);
117  bookRollME(rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
118 
119  // if(useMuonDigis_) meMuonCollection[(uint32_t)rpcId] = bookRollME(rpcId,iSetup, muonFolder_);
120  // meNoiseCollection[(uint32_t)rpcId] = bookRollME(rpcId,iSetup, noiseFolder_);
121  }
122  }else{
123  RPCDetId rpcId = roles[0]->id(); //any roll would do - here I just take the first one
124  RPCGeomServ rpcsrv(rpcId);
125  std::string nameID = rpcsrv.chambername();
126  if(useMuonDigis_) bookRollME(rpcId,iSetup, muonFolder_, meMuonCollection[nameID]);
127  bookRollME(rpcId, iSetup, noiseFolder_, meNoiseCollection[nameID]);
128 
129  }
130  }
131  }//end loop on geometry to book all MEs
132 
133 
134  //Clear flags;
135  dcs_ = true;
136 }
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:514
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:2353
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:1265
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:232
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 DQMStore::book1D(), dbe, DQMStore::get(), MonitorElement::getName(), globalFolder_, mergeVDriftHistosByStation::name, NULL, numberOfInnerRings_, csvReporter::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 
429 
430  me = dbe->get(currentFolder+ "/Occupancy_for_Barrel");
431  if (me) dbe->removeElement(me->getName());
432  meMap["Occupancy_for_Barrel"] = dbe -> book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5 , 12.5, 5, -2.5, 2.5 );
433  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Sec", 1);
434  meMap["Occupancy_for_Barrel"] ->setAxisTitle("Wheel", 2);
435 
436 
437  // return meMap;
438 
439 }
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:514
#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:2353
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
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:514
#define abs(x)
Definition: mlp_lapack.h:159
DQMStore * dbe
DQM store.
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1151
int ring() const
Definition: RPCDetId.h:74
int layer() const
Definition: RPCDetId.h:110
std::string folderStructure(RPCDetId detId)
int stripsInRoll(RPCDetId &, const edm::EventSetup &)
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
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);
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, 12 , 18.5, 36.5);
170  meMap[os.str()]->setAxisTitle("strip", 1);
171 
172  for (int i = 1 ; i<= 12; i++) {
173  yLabel.str("");
174  yLabel<<"R"<<ring<<"_CH"<<i+12;
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
DQMStore * dbe
DQM store.
void labelYAxisRoll(MonitorElement *myMe, int region, int ring)
Definition: utils.h:239
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:642
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:232
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, 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);
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);
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_
const std::string & label
Definition: MVAComputer.cc:186
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
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:221
DQMStore * dbe
DQM store.
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:206
void labelYAxisRoll(MonitorElement *myMe, int region, int ring)
Definition: utils.h:239
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:642
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void labelYAxisRing(MonitorElement *myMe, int numberOfRings)
Definition: utils.h:266
void RPCMonitorDigi::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file RPCMonitorDigi.cc.

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

138  {
140  dbe = 0;
141 }
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:1898
DQMStore * dbe
DQM store.
void RPCMonitorDigi::endLuminosityBlock ( edm::LuminosityBlock const &  L,
edm::EventSetup const &  E 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file RPCMonitorDigi.cc.

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

Definition at line 514 of file RPCMonitorDigi.cc.

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

Referenced by analyze().

514  {
515 
517 
518  if ( ! e.getByLabel("scalersRawToDigi", dcsStatus) ){
519  dcs_ = true;
520  return;
521  }
522 
523  if ( ! dcsStatus.isValid() )
524  {
525  edm::LogWarning("RPCDcsInfo") << "scalersRawToDigi not found" ;
526  dcs_ = true; // info not available: set to true
527  return;
528  }
529 
530  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
531  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr){
532 
533  if (!dcsStatusItr->ready(DcsStatus::RPC)) dcs_=false;
534  }
535 
536  return ;
537 }
return((rh^lh)&mask)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
void RPCMonitorDigi::performSourceOperation ( std::map< RPCDetId, std::vector< RPCRecHit > > &  recHitMap,
std::string  recHittype 
)
private

Definition at line 242 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(), asciidump::s, RPCDetId::sector(), sectorRingMuonCollection, sectorRingNoiseCollection, RPCGeomServ::segment(), relativeConstraints::station, RPCDetId::station(), useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

Referenced by analyze().

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