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

Data Format. More...

#include <RPCMonitorDigi.h>

Inheritance diagram for RPCMonitorDigi:
edm::EDAnalyzer edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDGetTokenT
< reco::CandidateView
muonLabel_
 
MonitorElementmuonRPCEvents_
 
float muPtCut_
 
std::string noiseFolder_
 
MonitorElementnoiseRPCEvents_
 
int numberOfDisks_
 
int numberOfInnerRings_
 
MonitorElementNumberOfMuon_
 
MonitorElementNumberOfRecHitMuon_
 
std::map< std::string,
MonitorElement * > 
regionMuonCollection
 
std::map< std::string,
MonitorElement * > 
regionNoiseCollection
 
std::string RootFileName
 
edm::EDGetTokenT
< RPCRecHitCollection
rpcRecHitLabel_
 
bool saveRootFile
 
edm::EDGetTokenT
< DcsStatusCollection
scalersRawToDigiLabel_
 
std::map< std::string,
MonitorElement * > 
sectorRingMuonCollection
 
std::map< std::string,
MonitorElement * > 
sectorRingNoiseCollection
 
std::string subsystemFolder_
 
bool useMuonDigis_
 
bool useRollInfo_
 
std::map< std::string,
MonitorElement * > 
wheelDiskMuonCollection
 
std::map< std::string,
MonitorElement * > 
wheelDiskNoiseCollection
 

Static Private Attributes

static const std::string regionNames_ [3] = {"Endcap-", "Barrel", "Endcap+"}
 Geometry. More...
 

Additional Inherited Members

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

Detailed Description

Data Format.

Definition at line 23 of file RPCMonitorDigi.h.

Member Enumeration Documentation

Enumerator
EM 
B 
EP 
ALL 

Definition at line 57 of file RPCMonitorDigi.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file RPCMonitorDigi.cc.

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

19  :counter(0){
20 
21  saveRootFile = pset.getUntrackedParameter<bool>("SaveRootFile", false);
22  RootFileName = pset.getUntrackedParameter<std::string>("RootFileName", "RPCMonitorDigiDQM.root");
23 
24  useMuonDigis_= pset.getUntrackedParameter<bool>("UseMuon", true);
25  useRollInfo_= pset.getUntrackedParameter<bool>("UseRollInfo", false);
26 
27  muPtCut_ = pset.getUntrackedParameter<double>("MuonPtCut", 3.0);
28  muEtaCut_ = pset.getUntrackedParameter<double>("MuonEtaCut", 1.9);
29 
30  subsystemFolder_ = pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
31  globalFolder_ = pset.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
32 
33  //Parametersets for tokens
34  muonLabel_ = consumes<reco::CandidateView>(pset.getParameter<edm::InputTag>("MuonLabel"));
35  rpcRecHitLabel_ = consumes<RPCRecHitCollection>(pset.getParameter<edm::InputTag>("RecHitLabel"));
36  scalersRawToDigiLabel_ = consumes<DcsStatusCollection>(pset.getParameter<edm::InputTag>("ScalersRawToDigiLabel"));
37 
38  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
std::string noiseFolder_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
std::string subsystemFolder_
edm::EDGetTokenT< reco::CandidateView > muonLabel_
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 134 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_.

134  {
135  dcs_ = true;
136  //Check HV status
137  this->makeDcsInfo(event);
138  if( !dcs_){
139  edm::LogWarning ("rpcmonitordigi") <<"[RPCMonitorDigi]: DCS bit OFF" ;
140  return;//if RPC not ON there's no need to continue
141  }
142 
143  counter++;
144  edm::LogInfo ("rpcmonitordigi") <<"[RPCMonitorDigi]: Beginning analyzing event " << counter;
145 
146  //Muons
148  event.getByToken(muonLabel_, muonCands);
149 
150 
151  std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
152 
153  int numMuons = 0;
154  int numRPCRecHit = 0 ;
155 
156  if(muonCands.isValid()){
157 
158  int nStaMuons = muonCands->size();
159 
160  for( int i = 0; i < nStaMuons; i++ ) {
161 
162  const reco::Candidate & goodMuon = (*muonCands)[i];
163  const reco::Muon * muCand = dynamic_cast<const reco::Muon*>(&goodMuon);
164 
165  if(!muCand->isGlobalMuon())continue;
166  if(muCand->pt() < muPtCut_ || fabs(muCand->eta())>muEtaCut_) continue;
167  numMuons++;
168  reco::Track muTrack = (*(muCand->outerTrack()));
169  std::vector<TrackingRecHitRef > rpcTrackRecHits;
170  //loop on mu rechits
171  for ( trackingRecHit_iterator it= muTrack.recHitsBegin(); it != muTrack.recHitsEnd() ; it++) {
172  if (!(*it)->isValid ())continue;
173  int muSubDetId = (*it)->geographicalId().subdetId();
174  if(muSubDetId == MuonSubdetId::RPC) {
175  numRPCRecHit ++;
176  TrackingRecHit * tkRecHit = (*it)->clone();
177  RPCRecHit* rpcRecHit = dynamic_cast<RPCRecHit*>(tkRecHit);
178  int detId = (int)rpcRecHit->rpcId();
179  if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
180  std::vector<RPCRecHit> myVect(1,*rpcRecHit );
181  rechitMuon[detId]= myVect;
182  }else {
183  rechitMuon[detId].push_back(*rpcRecHit);
184  }
185  }
186  }// end loop on mu rechits
187 
188  }
189 
190  if( NumberOfMuon_) NumberOfMuon_->Fill(numMuons);
191  if( NumberOfRecHitMuon_) NumberOfRecHitMuon_->Fill( numRPCRecHit);
192 
193  }else{
194  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: Muons - Product not valid for event" << counter;
195  }
196 
197  //RecHits
199  event.getByToken( rpcRecHitLabel_ , rpcHits);
200  std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
201 
202 
203  if(rpcHits.isValid()){
204 
205  // RPC rec hits NOT associated to a muon
207  std::vector<RPCRecHit>::const_iterator muonRecHitIter;
208 
209  for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
210  RPCRecHit rpcRecHit = (*rpcRecHitIter);
211  int detId = (int)rpcRecHit.rpcId();
212  if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
213  std::vector<RPCRecHit> myVect(1,rpcRecHit );
214  rechitNoise[detId]= myVect;
215  }else {
216  rechitNoise[detId].push_back(rpcRecHit);
217  }
218  }
219  }else{
220  edm::LogError ("rpcmonitordigi") <<"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" << counter;
221  }
222 
223 
225  if( noiseRPCEvents_ != 0) noiseRPCEvents_->Fill(1);
226 
227  if(useMuonDigis_ ) this->performSourceOperation(rechitMuon, muonFolder_);
228  this->performSourceOperation(rechitNoise, noiseFolder_);
229 }
int i
Definition: DBlmapReader.cc:9
std::string muonFolder_
bool isGlobalMuon() const
Definition: Muon.h:218
MonitorElement * muonRPCEvents_
void makeDcsInfo(const edm::Event &)
std::string noiseFolder_
void Fill(long long x)
tuple numMuons
Definition: patZpeak.py:40
RPCDetId rpcId() const
Return the rpcId.
Definition: RPCRecHit.h:97
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:62
bool isValid() const
Definition: HandleBase.h:76
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
MonitorElement * NumberOfRecHitMuon_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual TrackingRecHit * clone() const =0
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
void performSourceOperation(std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
static const int RPC
Definition: MuonSubdetId.h:14
MonitorElement * noiseRPCEvents_
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * NumberOfMuon_
edm::EDGetTokenT< reco::CandidateView > muonLabel_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:64
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(), AlCaHLTBitMon_QueryRunRegistry::string, 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  //Clear flags;
123  dcs_ = true;
124 }
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:872
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:2772
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
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:584
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(), AlCaHLTBitMon_QueryRunRegistry::string, 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 
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:872
#define NULL
Definition: scimark2.h:8
DQMStore * dbe
DQM store.
static const std::string regionNames_[3]
Geometry.
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
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 funct::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(), AlCaHLTBitMon_QueryRunRegistry::string, 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:872
DQMStore * dbe
DQM store.
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
int ring() const
Definition: RPCDetId.h:72
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int layer() const
Definition: RPCDetId.h:108
std::string folderStructure(RPCDetId detId)
int stripsInRoll(RPCDetId &, const edm::EventSetup &)
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCMonitorDigi::bookSectorRingME ( 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(), AlCaHLTBitMon_QueryRunRegistry::string, 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:1000
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:584
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:872
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:1000
std::string subsystemFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void RPCMonitorDigi::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file RPCMonitorDigi.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file RPCMonitorDigi.cc.

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

Definition at line 504 of file RPCMonitorDigi.cc.

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

Referenced by analyze().

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

Definition at line 232 of file RPCMonitorDigi.cc.

References funct::abs(), RPCRecHit::BunchX(), RPCGeomServ::chambername(), RPCRecHit::clusterSize(), rpcdqm::utils::detId2RollNr(), HcalObjRepresent::Fill(), RPCRecHit::firstClusterStrip(), i, RPCDetId::layer(), python.multivaluedict::map(), meMuonCollection, meNoiseCollection, muonFolder_, RPCGeomServ::name(), noiseFolder_, RPCDetId::region(), regionMuonCollection, regionNames_, regionNoiseCollection, relativeConstraints::ring, RPCDetId::ring(), RPCDetId::roll(), alignCSCRings::s, RPCDetId::sector(), sectorRingMuonCollection, sectorRingNoiseCollection, RPCGeomServ::segment(), relativeConstraints::station, RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, useRollInfo_, wheelDiskMuonCollection, and wheelDiskNoiseCollection.

Referenced by analyze().

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

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

Referenced by analyze().

DQMStore* RPCMonitorDigi::dbe
private

DQM store.

Definition at line 71 of file RPCMonitorDigi.h.

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

bool RPCMonitorDigi::dcs_
private

Definition at line 72 of file RPCMonitorDigi.h.

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

std::string RPCMonitorDigi::globalFolder_
private

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

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 89 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

float RPCMonitorDigi::muEtaCut_
private

Definition at line 73 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::muonFolder_
private

Definition at line 66 of file RPCMonitorDigi.h.

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

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

Definition at line 100 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

MonitorElement* RPCMonitorDigi::muonRPCEvents_
private

Definition at line 76 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

float RPCMonitorDigi::muPtCut_
private

Definition at line 73 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

std::string RPCMonitorDigi::noiseFolder_
private

Definition at line 67 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::noiseRPCEvents_
private

Definition at line 75 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

int RPCMonitorDigi::numberOfDisks_
private

Definition at line 81 of file RPCMonitorDigi.h.

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

int RPCMonitorDigi::numberOfInnerRings_
private

Definition at line 81 of file RPCMonitorDigi.h.

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

MonitorElement* RPCMonitorDigi::NumberOfMuon_
private

Definition at line 79 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

MonitorElement* RPCMonitorDigi::NumberOfRecHitMuon_
private

Definition at line 78 of file RPCMonitorDigi.h.

Referenced by analyze(), and beginRun().

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

Definition at line 86 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Geometry.

Definition at line 65 of file RPCMonitorDigi.h.

Referenced by bookRegionME(), and performSourceOperation().

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

Definition at line 91 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

std::string RPCMonitorDigi::RootFileName
private

Definition at line 98 of file RPCMonitorDigi.h.

Referenced by endJob(), and RPCMonitorDigi().

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

Definition at line 101 of file RPCMonitorDigi.h.

Referenced by analyze(), and RPCMonitorDigi().

bool RPCMonitorDigi::saveRootFile
private

Definition at line 97 of file RPCMonitorDigi.h.

Referenced by endJob(), and RPCMonitorDigi().

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

Definition at line 102 of file RPCMonitorDigi.h.

Referenced by makeDcsInfo(), and RPCMonitorDigi().

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

Definition at line 87 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 92 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 59 of file RPCMonitorDigi.h.

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

bool RPCMonitorDigi::useRollInfo_
private

Definition at line 74 of file RPCMonitorDigi.h.

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

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

Definition at line 85 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().

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

Definition at line 90 of file RPCMonitorDigi.h.

Referenced by beginRun(), and performSourceOperation().