CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
TotemDAQTriggerDQMSource Class Reference
Inheritance diagram for TotemDAQTriggerDQMSource:

Public Member Functions

 TotemDAQTriggerDQMSource (const edm::ParameterSet &ps)
 
 ~TotemDAQTriggerDQMSource () override
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

MonitorElementdaq_bx_diff
 
MonitorElementdaq_event_bx_diff
 
MonitorElementdaq_event_bx_diff_vs_fed
 
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
 
unsigned int verbosity
 

Detailed Description

Definition at line 26 of file TotemDAQTriggerDQMSource.cc.

Constructor & Destructor Documentation

◆ TotemDAQTriggerDQMSource()

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

Definition at line 53 of file TotemDAQTriggerDQMSource.cc.

References edm::ParameterSet::getUntrackedParameter(), and tokenFEDInfo.

54  : verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0)) {
55  tokenFEDInfo = consumes<vector<TotemFEDInfo>>(ps.getUntrackedParameter<edm::InputTag>("tagFEDInfo"));
56 }
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
T getUntrackedParameter(std::string const &, T const &) const

◆ ~TotemDAQTriggerDQMSource()

TotemDAQTriggerDQMSource::~TotemDAQTriggerDQMSource ( )
override

Definition at line 60 of file TotemDAQTriggerDQMSource.cc.

60 {}

Member Function Documentation

◆ analyze()

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

Definition at line 77 of file TotemDAQTriggerDQMSource.cc.

References daq_bx_diff, daq_event_bx_diff, daq_event_bx_diff_vs_fed, dqm::impl::MonitorElement::Fill(), edm::HandleBase::isValid(), tokenFEDInfo, and verbosity.

77  {
78  // get input
80  event.getByToken(tokenFEDInfo, fedInfo);
81 
82  // check validity
83  bool daqValid = fedInfo.isValid();
84 
85  if (!daqValid) {
86  if (verbosity) {
87  LogPrint("TotemDAQTriggerDQMSource")
88  << "WARNING in TotemDAQTriggerDQMSource::analyze > some of the inputs are not valid.\n"
89  << " fedInfo.isValid = " << fedInfo.isValid();
90  }
91  }
92 
93  // DAQ plots
94  if (daqValid) {
95  for (auto &it1 : *fedInfo) {
96  daq_event_bx_diff->Fill(it1.bx() - event.bunchCrossing());
97  daq_event_bx_diff_vs_fed->Fill(it1.fedId(), it1.bx() - event.bunchCrossing());
98 
99  for (auto &it2 : *fedInfo) {
100  if (it2.fedId() <= it1.fedId())
101  continue;
102 
103  daq_bx_diff->Fill(it2.bx() - it1.bx());
104  }
105  }
106  }
107 }
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
void Fill(long long x)
Log< level::Warning, true > LogPrint
bool isValid() const
Definition: HandleBase.h:70

◆ bookHistograms()

void TotemDAQTriggerDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 64 of file TotemDAQTriggerDQMSource.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), daq_bx_diff, daq_event_bx_diff, daq_event_bx_diff_vs_fed, and dqm::implementation::NavigatorBase::setCurrentFolder().

64  {
65  ibooker.cd();
66 
67  ibooker.setCurrentFolder("CTPPS/DAQ/");
68 
69  daq_bx_diff = ibooker.book1D("bx_diff", ";OptoRx_{i}.BX - OptoRx_{j}.BX", 21, -10.5, +10.5);
70  daq_event_bx_diff = ibooker.book1D("daq_event_bx_diff", ";OptoRx_{i}.BX - Event.BX", 21, -10.5, +10.5);
72  ibooker.book2D("daq_event_bx_diff_vs_fed", ";OptoRx.ID;OptoRx.BX - Event.BX", 10, 575.5, 585.5, 21, -10.5, +10.5);
73 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

◆ daq_bx_diff

MonitorElement* TotemDAQTriggerDQMSource::daq_bx_diff
private

Definition at line 40 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ daq_event_bx_diff

MonitorElement* TotemDAQTriggerDQMSource::daq_event_bx_diff
private

Definition at line 41 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ daq_event_bx_diff_vs_fed

MonitorElement* TotemDAQTriggerDQMSource::daq_event_bx_diff_vs_fed
private

Definition at line 42 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ tokenFEDInfo

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

Definition at line 38 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze(), and TotemDAQTriggerDQMSource().

◆ verbosity

unsigned int TotemDAQTriggerDQMSource::verbosity
private

Definition at line 36 of file TotemDAQTriggerDQMSource.cc.

Referenced by analyze().