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 Member Functions | Private Attributes
RPCMon_SS_Dbx_Global Class Reference

#include <RPCMon_SS_Dbx_Global.h>

Inheritance diagram for RPCMon_SS_Dbx_Global:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 RPCMon_SS_Dbx_Global (const edm::ParameterSet &)
 
 ~RPCMon_SS_Dbx_Global ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 

Private Attributes

DQMStoredbe_
 
std::string digiLabel_
 
std::string globalFolder_
 
int numberOfRings_
 
std::string rootFileName_
 
edm::EDGetTokenT
< RPCDigiCollection
rpcDigiCollectionTag_
 
bool saveRootFile_
 

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

Definition at line 18 of file RPCMon_SS_Dbx_Global.h.

Constructor & Destructor Documentation

RPCMon_SS_Dbx_Global::RPCMon_SS_Dbx_Global ( const edm::ParameterSet iConfig)
explicit

Definition at line 19 of file RPCMon_SS_Dbx_Global.cc.

References digiLabel_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalFolder_, numberOfRings_, rootFileName_, rpcDigiCollectionTag_, saveRootFile_, and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20 
21  rpcDigiCollectionTag_ = consumes<RPCDigiCollection>(iConfig.getParameter<edm::InputTag>("rpcDigiCollectionTag")) ;
22 
23  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Constructor";
24 
25 
26  globalFolder_ = iConfig.getUntrackedParameter<std::string>("GlobalHistogramsFolder","RPC/RecHits/SummaryHistograms");
27 
28  saveRootFile_ = iConfig.getUntrackedParameter<bool>("SaveRootFile", false);
29  rootFileName_ = iConfig.getUntrackedParameter<std::string>("RootFileName","out.root");
30  digiLabel_ = iConfig.getUntrackedParameter<std::string>("DigiLabel","muonRPCDigis");
31  numberOfRings_ = iConfig.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
32 
33 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< RPCDigiCollection > rpcDigiCollectionTag_
RPCMon_SS_Dbx_Global::~RPCMon_SS_Dbx_Global ( )

Definition at line 35 of file RPCMon_SS_Dbx_Global.cc.

References dbe_.

35  {
36  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Destructor ";
37  dbe_=0;
38 }

Member Function Documentation

void RPCMon_SS_Dbx_Global::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 62 of file RPCMon_SS_Dbx_Global.cc.

References funct::abs(), DQMStore::book2D(), RPCGeomServ::chambernr(), dbe_, MonitorElement::Fill(), edm::EventSetup::get(), DQMStore::get(), edm::Event::getByToken(), globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), RPCGeomServ::name(), mergeVDriftHistosByStation::name, RPCRoll::nstrips(), numberOfRings_, relativeConstraints::ring, rpcDigiCollectionTag_, RPCGeomServ::segment(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and cuy::yBin.

62  {
63 
65  iEvent.getByToken(rpcDigiCollectionTag_, rpcDigis);
66 
68  iSetup.get<MuonGeometryRecord>().get( pDD );
69  rpcdqm::utils rpcUtils;
70 
72 
74 
75  // Loop over DetUnit's
76  for (detUnitIt=rpcDigis->begin();detUnitIt!=rpcDigis->end();++detUnitIt){
77  const RPCDetId& id = (*detUnitIt).first;
78  const RPCRoll* roll = dynamic_cast<const RPCRoll* >( pDD->roll(id));
79  const RPCDigiCollection::Range& range = (*detUnitIt).second;
80  // std::cout <<" detector "<< id.region()<< std::endl;
81  std::ostringstream tag;
82  std::ostringstream name;
83  MonitorElement* me;
84 
85  //get roll name
86  RPCGeomServ RPCname(id);
87  std::string nameRoll = RPCname.name();
88  //get roll number
89  RPCGeomServ RPCnumber(id);
90  int nr = RPCnumber.chambernr();
91  //get segment (valid only if endcap)
92  RPCGeomServ RPCsegment(id);
93  int seg = RPCsegment.segment();
94 
95  // Loop over the digis of this DetUnit
96  for (RPCDigiCollection::const_iterator digiIt = range.first;digiIt!=range.second;++digiIt) {
97  if (digiIt->strip() < 1 || digiIt->strip() > roll->nstrips() )
98  edm::LogVerbatim ("rpcmonitorerror") <<" XXXX Problem with detector "<< id << ", strip # " << digiIt->strip();
99  else { //Loop on digi2
100  for (RPCDigiCollection::const_iterator digiIt2 = digiIt; digiIt2!=range.second; ++digiIt2) {
101  int dstrip = digiIt->strip() - digiIt2->strip();
102  int dbx = digiIt->bx() - digiIt2->bx();
103  if ( dstrip == 0 && abs(dbx) != 0 ) {
104  // std::cout <<" detector 3333 "<< id.region()<<" " << id.ring()<<std::endl;
105  me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff");
106  if(!me) continue;
107  me->Fill(dbx);
108 
109  if (id.region()!=0){//Endcap
110  name.str("");
111  tag.str("");
112  tag << "AfterPulse_Ring_vs_Segment_Disk_" << id.region()*id.station();
113  name << "Endcap, After Pulse, Diff bx, Disk # " << id.region()*id.station();
114  me = dbe_->get(globalFolder_ + "/"+tag.str());
115  if (!me){
116  me = dbe_->book2D (tag.str(),name.str(),36,0.5,36.5, 3*numberOfRings_, 0.0, 3*numberOfRings_);
117 
118  rpcUtils.labelXAxisSegment(me);
119  rpcUtils.labelYAxisRing(me, numberOfRings_, true);
120 
121  }
122  int yBin;
123  (numberOfRings_ == 3 ? yBin= id.ring()*3-id.roll()+1 : yBin= (id.ring()-1)*3-id.roll()+1);
124  me->Fill(seg, yBin);
125  } else { // Barrel ( region == 0 ).
126 
127  name.str("");
128  tag.str("");
129  tag << "AfterPulse_Roll_vs_Sector_Wheel_" << std::setw(2) << std::setfill('+') << id.ring();
130  name << "Barrel, After Pulse, Diff. bx, Wheel # " << std::setw(2) << std::setfill('+') << id.ring();
131  me = dbe_->get(globalFolder_ + "/"+tag.str());
132  if (!me){
133  me = dbe_->book2D (tag.str(),name.str(),12,0.5,12.5,21,0.5,21.5);
134  rpcUtils.labelXAxisSector( me);
135  rpcUtils.labelYAxisRoll(me, 0, id.ring(), true);
136  }
137  me->Fill(id.sector(),nr);
138  }//Barrel
139  }
140  }
141  }
142  }
143  }
144 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
tuple yBin
Definition: cuy.py:891
int nstrips() const
Definition: RPCRoll.cc:46
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
edm::EDGetTokenT< RPCDigiCollection > rpcDigiCollectionTag_
void Fill(long long x)
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
const T & get() const
Definition: EventSetup.h:55
std::vector< RPCDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
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:1082
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void RPCMon_SS_Dbx_Global::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 40 of file RPCMon_SS_Dbx_Global.cc.

40  {
41 
42  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin job ";
43 
44 }
void RPCMon_SS_Dbx_Global::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file RPCMon_SS_Dbx_Global.cc.

References DQMStore::book1D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, cppFunctionSkipper::operator, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

48  {
49  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin run";
50 
53 
54  MonitorElement* me;
55  me =0;
56  me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff");
57  if ( 0!=me)
58  dbe_->removeElement(me->getName());
59  me = dbe_->book1D("AfterPulseBxDiff","After Pulse Bx Difference",13,-6.5,6.5);
60 }
const std::string & getName(void) const
get name of ME
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
void removeElement(const std::string &name)
Definition: DQMStore.cc:3143
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void RPCMon_SS_Dbx_Global::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file RPCMon_SS_Dbx_Global.cc.

46 {}

Member Data Documentation

DQMStore* RPCMon_SS_Dbx_Global::dbe_
private

Definition at line 33 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), beginRun(), and ~RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::digiLabel_
private

Definition at line 30 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::globalFolder_
private

Definition at line 30 of file RPCMon_SS_Dbx_Global.h.

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

int RPCMon_SS_Dbx_Global::numberOfRings_
private

Definition at line 34 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), and RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::rootFileName_
private

Definition at line 32 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

edm::EDGetTokenT<RPCDigiCollection> RPCMon_SS_Dbx_Global::rpcDigiCollectionTag_
private

Definition at line 35 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), and RPCMon_SS_Dbx_Global().

bool RPCMon_SS_Dbx_Global::saveRootFile_
private

Definition at line 31 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().