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
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 ()
 

Protected Member Functions

virtual TObjArray histos () 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::EDGetTokenT
< RPCRawSynchro::ProdItem
rpcRawSynchroProdItemTag_
 

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 &)
 

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.

References edm::ParameterSet::getParameter(), and rpcRawSynchroProdItemTag_.

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

Definition at line 40 of file RPCMonitorLinkSynchro.cc.

40 { }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 109 of file RPCMonitorLinkSynchro.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file RPCMonitorLinkSynchro.cc.

41 {}
void RPCMonitorLinkSynchro::beginRun ( const edm::Run ,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file RPCMonitorLinkSynchro.cc.

References DQMStore::book1D(), DQMStore::book2D(), edm::ESWatcher< T >::check(), edm::EventSetup::get(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), edm::ParameterSet::getUntrackedParameter(), i, RPCLinkSynchroStat::init(), me_delaySpread, me_delaySummary, me_notComplete, me_topOccup, me_topSpread, cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), theCablingWatcher, theConfig, theSynchroStat, and RPCReadOutMapping::version().

53  {
54 
55  if (theCablingWatcher.check(es)) {
56  edm::ESTransientHandle<RPCEMap> readoutMapping;
57  es.get<RPCEMapRcd>().get(readoutMapping);
58  RPCReadOutMapping const* cabling = readoutMapping->convert();
59  edm::LogInfo("RPCMonitorLinkSynchro") << "RPCMonitorLinkSynchro - record has CHANGED!!, read map, VERSION: " << cabling->version();
60  theSynchroStat.init(cabling, theConfig.getUntrackedParameter<bool>("dumpDelays"));
61  delete cabling;
62  }
63 
65  dmbe->setCurrentFolder("RPC/LinkMonitor/");
66 
67  me_delaySummary = dmbe->book1D("delaySummary","LinkDelaySummary",8,-3.5, 4.5);
68  me_delaySummary->getTH1F()->SetStats(111);
69 
70  me_delaySpread = dmbe->book2D("delaySpread","LinkDelaySpread",71,-3.05, 4.05, 31,-0.05,3.05);
71  me_delaySpread->getTH2F()->SetStats(0);
72 
73  me_notComplete[0] = dmbe->book2D("notComplete790","FED790: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
74  me_notComplete[1] = dmbe->book2D("notComplete791","FED791: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
75  me_notComplete[2] = dmbe->book2D("notComplete792","FED792: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
76  for (unsigned int i=0;i<3;++i) {
77  me_notComplete[i]->getTH2F()->GetXaxis()->SetNdivisions(512);
78  me_notComplete[i]->getTH2F()->GetYaxis()->SetNdivisions(505);
79  me_notComplete[i]->getTH2F()->SetXTitle("rmb");
80  me_notComplete[i]->getTH2F()->SetYTitle("link");
81  me_notComplete[i]->getTH2F()->SetStats(0);
82  }
83  me_topOccup = dmbe->book2D("topOccup","Top10 LinkBoard occupancy",8,-0.5,7.5, 10,0.,10.);
84  me_topSpread = dmbe->book2D("topSpread","Top10 LinkBoard delay spread",8,-0.5,7.5, 10,0.,10.);
85  me_topOccup->getTH2F()->GetXaxis()->SetNdivisions(110);
86  me_topSpread->getTH2F()->GetXaxis()->SetNdivisions(110);
87  me_topOccup->getTH2F()->SetStats(0);
88  me_topSpread->getTH2F()->SetStats(0);
89 
90 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void init(const RPCReadOutMapping *theCabling, bool addChamberInfo)
MonitorElement * me_topOccup
MonitorElement * me_topSpread
RPCLinkSynchroStat theSynchroStat
MonitorElement * me_delaySpread
edm::ESWatcher< RPCEMapRcd > theCablingWatcher
const std::string & version() const
version as string
MonitorElement * me_notComplete[3]
const T & get() const
Definition: EventSetup.h:55
TH1F * getTH1F(void) const
edm::ParameterSet theConfig
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:58
TH2F * getTH2F(void) const
MonitorElement * me_delaySummary
void RPCMonitorLinkSynchro::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 104 of file RPCMonitorLinkSynchro.cc.

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

105 {
106  if (theConfig.getUntrackedParameter<bool>("dumpDelays")) edm::LogInfo("RPCMonitorLinkSynchro DumpDelays") << theSynchroStat.dumpDelays();
107 }
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 92 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__().

93 {
94  TObjArray result;
95  result.Add(me_delaySummary->getTH1F());
96  result.Add(me_delaySpread->getTH2F());
97  result.Add(me_topOccup->getTH2F());
98  result.Add(me_topSpread->getTH2F());
99  for (unsigned int i=0;i<=2;i++) result.Add(me_notComplete[i]->getTH2F());
100  return result;
101 }
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 beginRun(), endLuminosityBlock(), and histos().

MonitorElement* RPCMonitorLinkSynchro::me_delaySummary
protected

Definition at line 38 of file RPCMonitorLinkSynchro.h.

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

MonitorElement* RPCMonitorLinkSynchro::me_notComplete[3]
protected

Definition at line 42 of file RPCMonitorLinkSynchro.h.

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

MonitorElement* RPCMonitorLinkSynchro::me_topOccup
protected

Definition at line 40 of file RPCMonitorLinkSynchro.h.

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

MonitorElement* RPCMonitorLinkSynchro::me_topSpread
protected

Definition at line 41 of file RPCMonitorLinkSynchro.h.

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

edm::EDGetTokenT<RPCRawSynchro::ProdItem> RPCMonitorLinkSynchro::rpcRawSynchroProdItemTag_
private

Definition at line 45 of file RPCMonitorLinkSynchro.h.

Referenced by analyze(), and RPCMonitorLinkSynchro().

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().