CMS 3D CMS Logo

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

#include <RPCMonitorLinkSynchro.h>

Inheritance diagram for RPCMonitorLinkSynchro:
edm::EDAnalyzer edm::EDConsumerBase

Public 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 ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
 RPCMonitorLinkSynchro (const edm::ParameterSet &cfg)
 
virtual const
RPCRawSynchro::ProdItem
select (const RPCRawSynchro::ProdItem &v, const edm::Event &, const edm::EventSetup &)
 
virtual ~RPCMonitorLinkSynchro ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual TObjArray histos () const
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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)
 

Protected Attributes

MonitorElementme_delaySpread
 
MonitorElementme_delaySummary
 
MonitorElementme_notComplete [3]
 
MonitorElementme_topOccup
 
MonitorElementme_topSpread
 
edm::ESWatcher< RPCEMapRcdtheCablingWatcher
 
edm::ParameterSet theConfig
 
RPCLinkSynchroStat theSynchroStat
 

Private Attributes

edm::InputTag rpcRawSynchroProdItemTag_
 

Additional Inherited Members

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

Detailed Description

Monitor and anlyse synchro counts () produced by R2D.

Definition at line 21 of file RPCMonitorLinkSynchro.h.

Constructor & Destructor Documentation

RPCMonitorLinkSynchro::RPCMonitorLinkSynchro ( const edm::ParameterSet cfg)
explicit

Definition at line 30 of file RPCMonitorLinkSynchro.cc.

31  : theConfig(cfg),
32  theSynchroStat(RPCLinkSynchroStat(theConfig.getUntrackedParameter<bool>("useFirstHitOnly", false))),
33  rpcRawSynchroProdItemTag_(cfg.getParameter<edm::InputTag>("rpcRawSynchroProdItemTag"))
34 {
35 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag rpcRawSynchroProdItemTag_
RPCLinkSynchroStat theSynchroStat
edm::ParameterSet theConfig
RPCMonitorLinkSynchro::~RPCMonitorLinkSynchro ( )
virtual

Definition at line 37 of file RPCMonitorLinkSynchro.cc.

38 {
39 }

Member Function Documentation

void RPCMonitorLinkSynchro::analyze ( const edm::Event ev,
const edm::EventSetup es 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 107 of file RPCMonitorLinkSynchro.cc.

References RPCLinkSynchroStat::add(), MonitorElement::Fill(), edm::Event::getByLabel(), me_notComplete, edmOneToOneComparison::problems, edm::Handle< T >::product(), rpcRawSynchroProdItemTag_, select(), and theSynchroStat.

108 {
110  ev.getByLabel(rpcRawSynchroProdItemTag_, synchroCounts);
111  std::vector<LinkBoardElectronicIndex> problems;
112  const RPCRawSynchro::ProdItem &vItem = select(*synchroCounts.product(), ev,es);
113  theSynchroStat.add(vItem, problems);
114 
115  for (std::vector<LinkBoardElectronicIndex>::const_iterator it=problems.begin(); it != problems.end(); ++it) {
116  me_notComplete[it->dccId-790]->Fill(it->dccInputChannelNum,it->tbLinkInputNum);
117  }
118 }
std::vector< std::pair< LinkBoardElectronicIndex, int > > ProdItem
Definition: RPCRawSynchro.h:9
edm::InputTag rpcRawSynchroProdItemTag_
RPCLinkSynchroStat theSynchroStat
virtual const RPCRawSynchro::ProdItem & select(const RPCRawSynchro::ProdItem &v, const edm::Event &, const edm::EventSetup &)
void Fill(long long x)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
MonitorElement * me_notComplete[3]
void add(const RPCRawSynchro::ProdItem &counts, std::vector< LinkBoardElectronicIndex > &problems)
T const * product() const
Definition: Handle.h:74
void RPCMonitorLinkSynchro::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file RPCMonitorLinkSynchro.cc.

References DQMStore::book1D(), DQMStore::book2D(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), i, me_delaySpread, me_delaySummary, me_notComplete, me_topOccup, me_topSpread, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

61 {
63  dmbe->setCurrentFolder("RPC/LinkMonitor/");
64 
65  me_delaySummary = dmbe->book1D("delaySummary","LinkDelaySummary",8,-3.5, 4.5);
66  me_delaySummary->getTH1F()->SetStats(111);
67 
68  me_delaySpread = dmbe->book2D("delaySpread","LinkDelaySpread",71,-3.05, 4.05, 31,-0.05,3.05);
69  me_delaySpread->getTH2F()->SetStats(0);
70 
71  me_notComplete[0] = dmbe->book2D("notComplete790","FED790: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
72  me_notComplete[1] = dmbe->book2D("notComplete791","FED791: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
73  me_notComplete[2] = dmbe->book2D("notComplete792","FED792: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
74  for (unsigned int i=0;i<3;++i) {
75  me_notComplete[i]->getTH2F()->GetXaxis()->SetNdivisions(512);
76  me_notComplete[i]->getTH2F()->GetYaxis()->SetNdivisions(505);
77  me_notComplete[i]->getTH2F()->SetXTitle("rmb");
78  me_notComplete[i]->getTH2F()->SetYTitle("link");
79  me_notComplete[i]->getTH2F()->SetStats(0);
80  }
81  me_topOccup = dmbe->book2D("topOccup","Top10 LinkBoard occupancy",8,-0.5,7.5, 10,0.,10.);
82  me_topSpread = dmbe->book2D("topSpread","Top10 LinkBoard delay spread",8,-0.5,7.5, 10,0.,10.);
83  me_topOccup->getTH2F()->GetXaxis()->SetNdivisions(110);
84  me_topSpread->getTH2F()->GetXaxis()->SetNdivisions(110);
85  me_topOccup->getTH2F()->SetStats(0);
86  me_topSpread->getTH2F()->SetStats(0);
87 
88 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_topOccup
MonitorElement * me_topSpread
MonitorElement * me_delaySpread
MonitorElement * me_notComplete[3]
TH1F * getTH1F(void) const
TH2F * getTH2F(void) const
MonitorElement * me_delaySummary
void RPCMonitorLinkSynchro::beginRun ( const edm::Run ,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file RPCMonitorLinkSynchro.cc.

References edm::ESWatcher< T >::check(), edm::EventSetup::get(), edm::ParameterSet::getUntrackedParameter(), RPCLinkSynchroStat::init(), theCablingWatcher, theConfig, theSynchroStat, and RPCReadOutMapping::version().

42 {
43  if (theCablingWatcher.check(es)) {
44  edm::ESTransientHandle<RPCEMap> readoutMapping;
45  es.get<RPCEMapRcd>().get(readoutMapping);
46  RPCReadOutMapping * cabling = readoutMapping->convert();
47  edm::LogInfo("RPCMonitorLinkSynchro") << "RPCMonitorLinkSynchro - record has CHANGED!!, read map, VERSION: " << cabling->version();
48  theSynchroStat.init(cabling, theConfig.getUntrackedParameter<bool>("dumpDelays"));
49  delete cabling;
50  }
51 }
T getUntrackedParameter(std::string const &, T const &) const
void init(const RPCReadOutMapping *theCabling, bool addChamberInfo)
RPCLinkSynchroStat theSynchroStat
edm::ESWatcher< RPCEMapRcd > theCablingWatcher
const std::string & version() const
version as string
const T & get() const
Definition: EventSetup.h:55
edm::ParameterSet theConfig
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
void RPCMonitorLinkSynchro::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file RPCMonitorLinkSynchro.cc.

References RPCLinkSynchroStat::dumpDelays(), edm::ParameterSet::getUntrackedParameter(), theConfig, and theSynchroStat.

103 {
104  if (theConfig.getUntrackedParameter<bool>("dumpDelays")) edm::LogInfo("RPCMonitorLinkSynchro DumpDelays") << theSynchroStat.dumpDelays();
105 }
T getUntrackedParameter(std::string const &, T const &) const
RPCLinkSynchroStat theSynchroStat
edm::ParameterSet theConfig
void RPCMonitorLinkSynchro::endLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
virtual
TObjArray RPCMonitorLinkSynchro::histos ( ) const
protectedvirtual

Definition at line 90 of file RPCMonitorLinkSynchro.cc.

References MonitorElement::getTH1F(), MonitorElement::getTH2F(), i, me_delaySpread, me_delaySummary, me_notComplete, me_topOccup, me_topSpread, and query::result.

Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), and cuy.graphElement::__init__().

91 {
92  TObjArray result;
93  result.Add(me_delaySummary->getTH1F());
94  result.Add(me_delaySpread->getTH2F());
95  result.Add(me_topOccup->getTH2F());
96  result.Add(me_topSpread->getTH2F());
97  for (unsigned int i=0;i<=2;i++) result.Add(me_notComplete[i]->getTH2F());
98  return result;
99 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_topOccup
MonitorElement * me_topSpread
MonitorElement * me_delaySpread
tuple result
Definition: query.py:137
MonitorElement * me_notComplete[3]
TH1F * getTH1F(void) const
TH2F * getTH2F(void) const
MonitorElement * me_delaySummary
virtual const RPCRawSynchro::ProdItem& RPCMonitorLinkSynchro::select ( const RPCRawSynchro::ProdItem v,
const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Member Data Documentation

MonitorElement* RPCMonitorLinkSynchro::me_delaySpread
protected

Definition at line 39 of file RPCMonitorLinkSynchro.h.

Referenced by beginJob(), endLuminosityBlock(), and histos().

MonitorElement* RPCMonitorLinkSynchro::me_delaySummary
protected

Definition at line 38 of file RPCMonitorLinkSynchro.h.

Referenced by beginJob(), endLuminosityBlock(), and histos().

MonitorElement* RPCMonitorLinkSynchro::me_notComplete[3]
protected

Definition at line 42 of file RPCMonitorLinkSynchro.h.

Referenced by analyze(), beginJob(), and histos().

MonitorElement* RPCMonitorLinkSynchro::me_topOccup
protected

Definition at line 40 of file RPCMonitorLinkSynchro.h.

Referenced by beginJob(), endLuminosityBlock(), and histos().

MonitorElement* RPCMonitorLinkSynchro::me_topSpread
protected

Definition at line 41 of file RPCMonitorLinkSynchro.h.

Referenced by beginJob(), endLuminosityBlock(), and histos().

edm::InputTag RPCMonitorLinkSynchro::rpcRawSynchroProdItemTag_
private

Definition at line 45 of file RPCMonitorLinkSynchro.h.

Referenced by analyze().

edm::ESWatcher<RPCEMapRcd> RPCMonitorLinkSynchro::theCablingWatcher
protected

Definition at line 35 of file RPCMonitorLinkSynchro.h.

Referenced by beginRun().

edm::ParameterSet RPCMonitorLinkSynchro::theConfig
protected

Definition at line 34 of file RPCMonitorLinkSynchro.h.

Referenced by beginRun(), and endJob().

RPCLinkSynchroStat RPCMonitorLinkSynchro::theSynchroStat
protected

Definition at line 36 of file RPCMonitorLinkSynchro.h.

Referenced by analyze(), beginRun(), endJob(), and endLuminosityBlock().