test
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 | Private Attributes
TotemDAQTriggerDQMSource Class Reference
Inheritance diagram for TotemDAQTriggerDQMSource:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TotemDAQTriggerDQMSource (const edm::ParameterSet &ps)
 
virtual ~TotemDAQTriggerDQMSource ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
- 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)
 

Private Attributes

MonitorElementdaq_bx_diff
 
MonitorElementdaq_event_bx_diff
 
MonitorElementdaq_event_bx_diff_vs_fed
 
MonitorElementdaq_trigger_bx_diff
 
edm::EDGetTokenT< std::vector
< TotemFEDInfo > > 
tokenFEDInfo
 
edm::EDGetTokenT
< TotemTriggerCounters
tokenTriggerCounters
 
MonitorElementtrigger_bunch_num
 
MonitorElementtrigger_event_num
 
MonitorElementtrigger_inhibited_triggers_num
 
MonitorElementtrigger_input_status_bits
 
MonitorElementtrigger_orbit_num
 
MonitorElementtrigger_revision_num
 
MonitorElementtrigger_run_num
 
MonitorElementtrigger_src_id
 
MonitorElementtrigger_trigger_num
 
MonitorElementtrigger_type
 
unsigned int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 28 of file TotemDAQTriggerDQMSource.cc.

Constructor & Destructor Documentation

TotemDAQTriggerDQMSource::TotemDAQTriggerDQMSource ( const edm::ParameterSet ps)

Definition at line 73 of file TotemDAQTriggerDQMSource.cc.

References edm::ParameterSet::getParameter(), tokenFEDInfo, and tokenTriggerCounters.

73  :
74  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0))
75 {
76  tokenFEDInfo = consumes<vector<TotemFEDInfo>>(ps.getParameter<edm::InputTag>("tagFEDInfo"));
77  tokenTriggerCounters = consumes<TotemTriggerCounters>(ps.getParameter<edm::InputTag>("tagTriggerCounters"));
78 }
T getParameter(std::string const &) const
edm::EDGetTokenT< TotemTriggerCounters > tokenTriggerCounters
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
TotemDAQTriggerDQMSource::~TotemDAQTriggerDQMSource ( )
virtual

Definition at line 82 of file TotemDAQTriggerDQMSource.cc.

83 {
84 }

Member Function Documentation

void TotemDAQTriggerDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 128 of file TotemDAQTriggerDQMSource.cc.

References daq_bx_diff, daq_event_bx_diff, daq_event_bx_diff_vs_fed, daq_trigger_bx_diff, MonitorElement::Fill(), edm::HandleBase::isValid(), tokenFEDInfo, tokenTriggerCounters, trigger_bunch_num, trigger_event_num, trigger_inhibited_triggers_num, trigger_input_status_bits, trigger_orbit_num, trigger_revision_num, trigger_run_num, trigger_src_id, trigger_trigger_num, trigger_type, and verbosity.

129 {
130  // get input
132  event.getByToken(tokenFEDInfo, fedInfo);
133 
134  Handle<TotemTriggerCounters> triggerCounters;
135  event.getByToken(tokenTriggerCounters, triggerCounters);
136 
137  // check validity
138  bool daqValid = fedInfo.isValid();
139  bool triggerValid = triggerCounters.isValid();
140 
141  if (!daqValid || !triggerValid)
142  {
143  if (verbosity)
144  {
145  LogPrint("TotemDAQTriggerDQMSource") <<
146  "WARNING in TotemDAQTriggerDQMSource::analyze > some of the inputs are not valid.\n"
147  << " fedInfo.isValid = " << fedInfo.isValid() << "\n"
148  << " triggerCounters.isValid = " << triggerCounters.isValid();
149  }
150  }
151 
152  // DAQ plots
153  if (daqValid)
154  {
155  for (auto &it1 : *fedInfo)
156  {
157  daq_event_bx_diff->Fill(it1.getBX() - event.bunchCrossing());
158  daq_event_bx_diff_vs_fed->Fill(it1.getFEDId(), it1.getBX() - event.bunchCrossing());
159 
160  for (auto &it2 : *fedInfo)
161  {
162  if (it2.getFEDId() <= it1.getFEDId())
163  continue;
164 
165  daq_bx_diff->Fill(it2.getBX() - it1.getBX());
166  }
167  }
168  }
169 
170  // trigger plots
171  if (triggerValid)
172  {
173  trigger_type->Fill(triggerCounters->type);
174  trigger_event_num->Fill(triggerCounters->event_num);
175  trigger_bunch_num->Fill(triggerCounters->bunch_num);
176  trigger_src_id->Fill(triggerCounters->src_id);
177  trigger_orbit_num->Fill(triggerCounters->orbit_num);
178  trigger_revision_num->Fill(triggerCounters->revision_num);
179  trigger_run_num->Fill(triggerCounters->run_num);
180  trigger_trigger_num->Fill(triggerCounters->trigger_num);
181  trigger_inhibited_triggers_num->Fill(triggerCounters->inhibited_triggers_num);
182  trigger_input_status_bits->Fill(triggerCounters->input_status_bits);
183  }
184 
185  // combined DAQ + trigger plots
186  if (daqValid && triggerValid)
187  {
188  for (auto &it : *fedInfo)
189  daq_trigger_bx_diff->Fill(it.getBX() - triggerCounters->orbit_num);
190  }
191 }
edm::EDGetTokenT< TotemTriggerCounters > tokenTriggerCounters
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
MonitorElement * trigger_input_status_bits
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * trigger_inhibited_triggers_num
void TotemDAQTriggerDQMSource::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 122 of file TotemDAQTriggerDQMSource.cc.

123 {
124 }
void TotemDAQTriggerDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 94 of file TotemDAQTriggerDQMSource.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), daq_bx_diff, daq_event_bx_diff, daq_event_bx_diff_vs_fed, daq_trigger_bx_diff, DQMStore::IBooker::setCurrentFolder(), trigger_bunch_num, trigger_event_num, trigger_inhibited_triggers_num, trigger_input_status_bits, trigger_orbit_num, trigger_revision_num, trigger_run_num, trigger_src_id, trigger_trigger_num, and trigger_type.

95 {
96  ibooker.cd();
97 
98  ibooker.setCurrentFolder("CTPPS/DAQ/");
99 
100  daq_bx_diff = ibooker.book1D("bx_diff", ";OptoRx_{i}.BX - OptoRx_{j}.BX", 21, -10.5, +10.5);
101  daq_event_bx_diff = ibooker.book1D("daq_event_bx_diff", ";OptoRx_{i}.BX - Event.BX", 21, -10.5, +10.5);
102  daq_event_bx_diff_vs_fed = ibooker.book2D("daq_event_bx_diff_vs_fed", ";OptoRx.ID;OptoRx.BX - Event.BX", 10, 575.5, 585.5, 21, -10.5, +10.5);
103 
104  daq_trigger_bx_diff = ibooker.book1D("trigger_bx_diff", ";OptoRx_{i}.BX - LoneG.BX", 100, 0., 4000.);
105 
106  ibooker.setCurrentFolder("CTPPS/Trigger/");
107 
108  trigger_type = ibooker.book1D("type", ";type", 100, 0., 1000.);
109  trigger_event_num = ibooker.book1D("event_num", ";event_num", 100, 0., 1000.);
110  trigger_bunch_num = ibooker.book1D("bunch_num", ";bunch_num", 100, 0., 1000.);
111  trigger_src_id = ibooker.book1D("src_id", ";src_id", 100, 0., 1000.);
112  trigger_orbit_num = ibooker.book1D("orbit_num", ";orbit_num", 100, 0., 1000.);
113  trigger_revision_num = ibooker.book1D("revision_num", ";revision_num", 100, 0., 1000.);
114  trigger_run_num = ibooker.book1D("run_num", ";run_num", 100, 0., 1000.);
115  trigger_trigger_num = ibooker.book1D("trigger_num", ";trigger_num", 100, 0., 1000.);
116  trigger_inhibited_triggers_num = ibooker.book1D("inhibited_triggers_num", ";inhibited_triggers_num", 100, 0., 1000.);
117  trigger_input_status_bits = ibooker.book1D("input_status_bits", ";input_status_bits", 100, 0., 1000.);
118 }
void cd(void)
Definition: DQMStore.cc:268
MonitorElement * trigger_input_status_bits
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * trigger_inhibited_triggers_num
void TotemDAQTriggerDQMSource::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 88 of file TotemDAQTriggerDQMSource.cc.

89 {
90 }
void TotemDAQTriggerDQMSource::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 195 of file TotemDAQTriggerDQMSource.cc.

196 {
197 }
void TotemDAQTriggerDQMSource::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 201 of file TotemDAQTriggerDQMSource.cc.

202 {
203 }

Member Data Documentation

MonitorElement* TotemDAQTriggerDQMSource::daq_bx_diff
private

Definition at line 48 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::daq_event_bx_diff
private

Definition at line 49 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::daq_event_bx_diff_vs_fed
private

Definition at line 50 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::daq_trigger_bx_diff
private

Definition at line 51 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<std::vector<TotemFEDInfo> > TotemDAQTriggerDQMSource::tokenFEDInfo
private

Definition at line 45 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and TotemDAQTriggerDQMSource().

edm::EDGetTokenT<TotemTriggerCounters> TotemDAQTriggerDQMSource::tokenTriggerCounters
private

Definition at line 46 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and TotemDAQTriggerDQMSource().

MonitorElement* TotemDAQTriggerDQMSource::trigger_bunch_num
private

Definition at line 55 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_event_num
private

Definition at line 54 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_inhibited_triggers_num
private

Definition at line 61 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_input_status_bits
private

Definition at line 62 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_orbit_num
private

Definition at line 57 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_revision_num
private

Definition at line 58 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_run_num
private

Definition at line 59 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_src_id
private

Definition at line 56 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_trigger_num
private

Definition at line 60 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* TotemDAQTriggerDQMSource::trigger_type
private

Definition at line 53 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

unsigned int TotemDAQTriggerDQMSource::verbosity
private

Definition at line 43 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze().