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::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 APVCyclePhaseDebuggerFromL1TS (const edm::ParameterSet &)
 
 ~APVCyclePhaseDebuggerFromL1TS () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (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::one::EDAnalyzerBase
typedef EDAnalyzerBase 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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::APVCyclePhaseDebuggerFromL1TS ( const edm::ParameterSet iConfig)
explicit

Definition at line 109 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

111  consumes<Level1TriggerScalersCollection>(iConfig.getParameter<edm::InputTag>("l1TSCollection"))),
112  m_maxLS(iConfig.getUntrackedParameter<unsigned int>("maxLSBeforeRebin", 250)),
113  m_LSfrac(iConfig.getUntrackedParameter<unsigned int>("startingLSFraction", 16)),
115  _hsize(nullptr),
116  _hlresync(nullptr),
117  _hlOC0(nullptr),
118  _hlTE(nullptr),
119  _hlstart(nullptr),
120  _hlEC0(nullptr),
121  _hlHR(nullptr),
122  _hdlec0lresync(nullptr),
123  _hdlresynclHR(nullptr),
124  _lastResync(-1),
125  _lastHardReset(-1),
126  _lastStart(-1),
127  _lastEventCounter0(-1),
128  _lastOrbitCounter0(-1),
129  _lastTestEnable(-1) {
130  //now do what ever other initialization is needed
131 
132  _hsize = m_rhm.makeTH1F("size", "Level1TriggerScalers Collection size", 20, -0.5, 19.5);
133 
134  _hlresync = m_rhm.makeTH1F("lresync", "Orbit of last resync", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
135  _hlOC0 = m_rhm.makeTH1F("lOC0", "Orbit of last OC0", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
136  _hlTE = m_rhm.makeTH1F("lTE", "Orbit of last TestEnable", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
137  _hlstart = m_rhm.makeTH1F("lstart", "Orbit of last Start", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
138  _hlEC0 = m_rhm.makeTH1F("lEC0", "Orbit of last EC0", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
139  _hlHR = m_rhm.makeTH1F("lHR", "Orbit of last HardReset", m_LSfrac * m_maxLS, 0, m_maxLS * 262144);
140  _hdlec0lresync = m_rhm.makeTH1F("dlec0lresync", "Orbit difference EC0-Resync", 4000, -1999.5, 2000.5);
141  _hdlresynclHR = m_rhm.makeTH1F("dlresynclHR", "Orbit difference Resync-HR", 4000, -1999.5, 2000.5);
142 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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::~APVCyclePhaseDebuggerFromL1TS ( )
override

Definition at line 144 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 206 of file APVCyclePhaseDebuggerFromL1TS.cc.

References _hdlec0lresync, _hdlresynclHR, _hlEC0, _hlHR, _hlOC0, _hlresync, _hlstart, _hlTE, _hsize, _l1tscollectionToken, _lastEventCounter0, _lastHardReset, _lastOrbitCounter0, _lastResync, _lastStart, _lastTestEnable, iEvent, and LogDebug.

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

◆ beginRun()

void APVCyclePhaseDebuggerFromL1TS::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 154 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

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

◆ endRun()

void APVCyclePhaseDebuggerFromL1TS::endRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverrideprivate

Definition at line 69 of file APVCyclePhaseDebuggerFromL1TS.cc.

69 {}

◆ fillDescriptions()

void APVCyclePhaseDebuggerFromL1TS::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 262 of file APVCyclePhaseDebuggerFromL1TS.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_2022v15_cff::InputTag.

262  {
264  desc.add<edm::InputTag>("l1TSCollection", edm::InputTag("scalersRawToDigi"));
265  descriptions.add("l1TSDebugger", desc);
266 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ _hdlec0lresync

TH1F** APVCyclePhaseDebuggerFromL1TS::_hdlec0lresync
private

◆ _hdlresynclHR

TH1F** APVCyclePhaseDebuggerFromL1TS::_hdlresynclHR
private

◆ _hlEC0

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlEC0
private

◆ _hlHR

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlHR
private

◆ _hlOC0

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlOC0
private

◆ _hlresync

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlresync
private

◆ _hlstart

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlstart
private

◆ _hlTE

TH1F** APVCyclePhaseDebuggerFromL1TS::_hlTE
private

◆ _hsize

TH1F** APVCyclePhaseDebuggerFromL1TS::_hsize
private

Definition at line 79 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze(), and APVCyclePhaseDebuggerFromL1TS().

◆ _l1tscollectionToken

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

Definition at line 73 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastEventCounter0

long long APVCyclePhaseDebuggerFromL1TS::_lastEventCounter0
private

Definition at line 93 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastHardReset

long long APVCyclePhaseDebuggerFromL1TS::_lastHardReset
private

Definition at line 91 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastOrbitCounter0

long long APVCyclePhaseDebuggerFromL1TS::_lastOrbitCounter0
private

Definition at line 94 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastResync

long long APVCyclePhaseDebuggerFromL1TS::_lastResync
private

Definition at line 90 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastStart

long long APVCyclePhaseDebuggerFromL1TS::_lastStart
private

Definition at line 92 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ _lastTestEnable

long long APVCyclePhaseDebuggerFromL1TS::_lastTestEnable
private

Definition at line 95 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

◆ m_LSfrac

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_LSfrac
private

Definition at line 75 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

◆ m_maxLS

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_maxLS
private

Definition at line 74 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

◆ m_rhm

RunHistogramManager APVCyclePhaseDebuggerFromL1TS::m_rhm
private

Definition at line 77 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS(), and beginRun().