CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
APVCyclePhaseDebuggerFromL1TS Class Reference

#include <DPGAnalysis/SiStripTools/plugins/APVCyclePhaseDebuggerFromL1TS.cc>

Inheritance diagram for APVCyclePhaseDebuggerFromL1TS:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 APVCyclePhaseDebuggerFromL1TS (const edm::ParameterSet &)
 
 ~APVCyclePhaseDebuggerFromL1TS () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

TH1F ** _hdlec0lresync
 
TH1F ** _hdlresynclHR
 
TH1F ** _hlEC0
 
TH1F ** _hlHR
 
TH1F ** _hlOC0
 
TH1F ** _hlresync
 
TH1F ** _hlstart
 
TH1F ** _hlTE
 
TH1F ** _hsize
 
edm::EDGetTokenT< Level1TriggerScalersCollection_l1tscollectionToken
 
long long _lastEventCounter0
 
long long _lastHardReset
 
long long _lastOrbitCounter0
 
long long _lastResync
 
long long _lastStart
 
long long _lastTestEnable
 
const unsigned int m_LSfrac
 
const unsigned int m_maxLS
 
RunHistogramManager m_rhm
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Description: EDproducer for APVCyclePhaseCollection which uses the configuration file to assign a phase to the run

Implementation: <Notes on="" implementation>="">

Definition at line 59 of file APVCyclePhaseDebuggerFromL1TS.cc.

Constructor & Destructor Documentation

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

Definition at line 108 of file APVCyclePhaseDebuggerFromL1TS.cc.

References _hdlec0lresync, _hdlresynclHR, _hlEC0, _hlHR, _hlOC0, _hlresync, _hlstart, _hlTE, _hsize, m_LSfrac, m_maxLS, m_rhm, and RunHistogramManager::makeTH1F().

110  consumes<Level1TriggerScalersCollection>(iConfig.getParameter<edm::InputTag>("l1TSCollection"))),
111  m_maxLS(iConfig.getUntrackedParameter<unsigned int>("maxLSBeforeRebin", 250)),
112  m_LSfrac(iConfig.getUntrackedParameter<unsigned int>("startingLSFraction", 16)),
114  _hsize(nullptr),
115  _hlresync(nullptr),
116  _hlOC0(nullptr),
117  _hlTE(nullptr),
118  _hlstart(nullptr),
119  _hlEC0(nullptr),
120  _hlHR(nullptr),
121  _hdlec0lresync(nullptr),
122  _hdlresynclHR(nullptr),
123  _lastResync(-1),
124  _lastHardReset(-1),
125  _lastStart(-1),
126  _lastEventCounter0(-1),
127  _lastOrbitCounter0(-1),
128  _lastTestEnable(-1) {
129  //now do what ever other initialization is needed
130 
131  _hsize = m_rhm.makeTH1F("size", "Level1TriggerScalers Collection size", 20, -0.5, 19.5);
132 
133  _hlresync = m_rhm.makeTH1F("lresync", "Orbit of last resync", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
134  _hlOC0 = m_rhm.makeTH1F("lOC0", "Orbit of last OC0", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
135  _hlTE = m_rhm.makeTH1F("lTE", "Orbit of last TestEnable", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
136  _hlstart = m_rhm.makeTH1F("lstart", "Orbit of last Start", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
137  _hlEC0 = m_rhm.makeTH1F("lEC0", "Orbit of last EC0", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
138  _hlHR = m_rhm.makeTH1F("lHR", "Orbit of last HardReset", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
139  _hdlec0lresync = m_rhm.makeTH1F("dlec0lresync", "Orbit difference EC0-Resync", 4000, -1999.5, 2000.5);
140  _hdlresynclHR = m_rhm.makeTH1F("dlresynclHR", "Orbit difference Resync-HR", 4000, -1999.5, 2000.5);
141 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< Level1TriggerScalersCollection > _l1tscollectionToken
APVCyclePhaseDebuggerFromL1TS::~APVCyclePhaseDebuggerFromL1TS ( )
override

Definition at line 143 of file APVCyclePhaseDebuggerFromL1TS.cc.

143  {
144  // do anything here that needs to be done at desctruction time
145  // (e.g. close files, deallocate resources etc.)
146 }

Member Function Documentation

void APVCyclePhaseDebuggerFromL1TS::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 205 of file APVCyclePhaseDebuggerFromL1TS.cc.

References _hdlec0lresync, _hdlresynclHR, _hlEC0, _hlHR, _hlOC0, _hlresync, _hlstart, _hlTE, _hsize, _l1tscollectionToken, _lastEventCounter0, _lastHardReset, _lastOrbitCounter0, _lastResync, _lastStart, _lastTestEnable, edm::Event::getByToken(), and LogDebug.

205  {
206  using namespace edm;
207 
209  iEvent.getByToken(_l1tscollectionToken, l1ts);
210 
211  if (_hsize && *_hsize)
212  (*_hsize)->Fill(l1ts->size());
213 
214  // offset computation
215 
216  if (!l1ts->empty()) {
217  if (_hlresync && *_hlresync)
218  (*_hlresync)->Fill((*l1ts)[0].lastResync());
219  if (_hlOC0 && *_hlOC0)
220  (*_hlOC0)->Fill((*l1ts)[0].lastOrbitCounter0());
221  if (_hlTE && *_hlTE)
222  (*_hlTE)->Fill((*l1ts)[0].lastTestEnable());
223  if (_hlstart && *_hlstart)
224  (*_hlstart)->Fill((*l1ts)[0].lastStart());
225  if (_hlEC0 && *_hlEC0)
226  (*_hlEC0)->Fill((*l1ts)[0].lastEventCounter0());
227  if (_hlHR && *_hlHR)
228  (*_hlHR)->Fill((*l1ts)[0].lastHardReset());
229 
230  if (_lastResync != (*l1ts)[0].lastResync()) {
231  _lastResync = (*l1ts)[0].lastResync();
233  (*_hdlec0lresync)->Fill((*l1ts)[0].lastEventCounter0() - (*l1ts)[0].lastResync());
234  LogDebug("TTCSignalReceived") << "New Resync at orbit " << _lastResync;
235  }
236  if (_lastHardReset != (*l1ts)[0].lastHardReset()) {
237  _lastHardReset = (*l1ts)[0].lastHardReset();
239  (*_hdlresynclHR)->Fill((*l1ts)[0].lastResync() - (*l1ts)[0].lastHardReset());
240  LogDebug("TTCSignalReceived") << "New HardReset at orbit " << _lastHardReset;
241  }
242  if (_lastTestEnable != (*l1ts)[0].lastTestEnable()) {
243  _lastTestEnable = (*l1ts)[0].lastTestEnable();
244  // LogDebug("TTCSignalReceived") << "New TestEnable at orbit " << _lastTestEnable ;
245  }
246  if (_lastOrbitCounter0 != (*l1ts)[0].lastOrbitCounter0()) {
247  _lastOrbitCounter0 = (*l1ts)[0].lastOrbitCounter0();
248  LogDebug("TTCSignalReceived") << "New OrbitCounter0 at orbit " << _lastOrbitCounter0;
249  }
250  if (_lastEventCounter0 != (*l1ts)[0].lastEventCounter0()) {
251  _lastEventCounter0 = (*l1ts)[0].lastEventCounter0();
252  LogDebug("TTCSignalReceived") << "New EventCounter0 at orbit " << _lastEventCounter0;
253  }
254  if (_lastStart != (*l1ts)[0].lastStart()) {
255  _lastStart = (*l1ts)[0].lastStart();
256  LogDebug("TTCSignalReceived") << "New Start at orbit " << _lastStart;
257  }
258  }
259 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< Level1TriggerScalersCollection > _l1tscollectionToken
HLT enums.
void APVCyclePhaseDebuggerFromL1TS::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 153 of file APVCyclePhaseDebuggerFromL1TS.cc.

References _hdlec0lresync, _hdlresynclHR, _hlEC0, _hlHR, _hlOC0, _hlresync, _hlstart, _hlTE, RunHistogramManager::beginRun(), and m_rhm.

155 {
156  // update the parameters from DB
157 
158  m_rhm.beginRun(iRun);
159 
160  if (_hlresync && *_hlresync) {
161  (*_hlresync)->GetXaxis()->SetTitle("Orbit");
162  (*_hlresync)->GetYaxis()->SetTitle("Events");
163  (*_hlresync)->SetCanExtend(TH1::kXaxis);
164  }
165 
166  if (_hlOC0 && *_hlOC0) {
167  (*_hlOC0)->GetXaxis()->SetTitle("Orbit");
168  (*_hlOC0)->GetYaxis()->SetTitle("Events");
169  (*_hlOC0)->SetCanExtend(TH1::kXaxis);
170  }
171 
172  if (_hlTE && *_hlTE) {
173  (*_hlTE)->GetXaxis()->SetTitle("Orbit");
174  (*_hlTE)->GetYaxis()->SetTitle("Events");
175  (*_hlTE)->SetCanExtend(TH1::kXaxis);
176  }
177 
178  if (_hlstart && *_hlstart) {
179  (*_hlstart)->GetXaxis()->SetTitle("Orbit");
180  (*_hlstart)->GetYaxis()->SetTitle("Events");
181  (*_hlstart)->SetCanExtend(TH1::kXaxis);
182  }
183 
184  if (_hlEC0 && *_hlEC0) {
185  (*_hlEC0)->GetXaxis()->SetTitle("Orbit");
186  (*_hlEC0)->GetYaxis()->SetTitle("Events");
187  (*_hlEC0)->SetCanExtend(TH1::kXaxis);
188  }
189 
190  if (_hlHR && *_hlHR) {
191  (*_hlHR)->GetXaxis()->SetTitle("Orbit");
192  (*_hlHR)->GetYaxis()->SetTitle("Events");
193  (*_hlHR)->SetCanExtend(TH1::kXaxis);
194  }
195 
196  if (_hdlec0lresync && *_hdlec0lresync) {
197  (*_hdlec0lresync)->GetXaxis()->SetTitle("lastEC0-lastResync");
198  }
199 
200  if (_hdlresynclHR && *_hdlresynclHR) {
201  (*_hdlresynclHR)->GetXaxis()->SetTitle("lastEC0-lastResync");
202  }
203 }
void beginRun(const edm::Run &iRun)
void APVCyclePhaseDebuggerFromL1TS::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 261 of file APVCyclePhaseDebuggerFromL1TS.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and HLT_2018_cff::InputTag.

261  {
263  desc.add<edm::InputTag>("l1TSCollection", edm::InputTag("scalersRawToDigi"));
264  descriptions.add("l1TSDebugger", desc);
265 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

TH1F** APVCyclePhaseDebuggerFromL1TS::_hdlec0lresync
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hdlresynclHR
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlEC0
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlHR
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlOC0
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlresync
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlstart
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hlTE
private
TH1F** APVCyclePhaseDebuggerFromL1TS::_hsize
private

Definition at line 78 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze(), and APVCyclePhaseDebuggerFromL1TS().

edm::EDGetTokenT<Level1TriggerScalersCollection> APVCyclePhaseDebuggerFromL1TS::_l1tscollectionToken
private

Definition at line 72 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastEventCounter0
private

Definition at line 92 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastHardReset
private

Definition at line 90 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastOrbitCounter0
private

Definition at line 93 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastResync
private

Definition at line 89 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastStart
private

Definition at line 91 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastTestEnable
private

Definition at line 94 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_LSfrac
private

Definition at line 74 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_maxLS
private

Definition at line 73 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

RunHistogramManager APVCyclePhaseDebuggerFromL1TS::m_rhm
private

Definition at line 76 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS(), and beginRun().