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 | 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 ()
 
- 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
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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual 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 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 60 of file APVCyclePhaseDebuggerFromL1TS.cc.

Constructor & Destructor Documentation

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

Definition at line 112 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

112  :
113  _l1tscollectionToken(consumes<Level1TriggerScalersCollection>(iConfig.getParameter<edm::InputTag>("l1TSCollection"))),
114  m_maxLS(iConfig.getUntrackedParameter<unsigned int>("maxLSBeforeRebin",250)),
115  m_LSfrac(iConfig.getUntrackedParameter<unsigned int>("startingLSFraction",16)),
120 {
121 
122  //now do what ever other initialization is needed
123 
124  _hsize = m_rhm.makeTH1F("size","Level1TriggerScalers Collection size",20,-0.5,19.5);
125 
126  _hlresync = m_rhm.makeTH1F("lresync","Orbit of last resync",m_LSfrac*m_maxLS,0,m_maxLS*262144);
127  _hlOC0 = m_rhm.makeTH1F("lOC0","Orbit of last OC0",m_LSfrac*m_maxLS,0,m_maxLS*262144);
128  _hlTE = m_rhm.makeTH1F("lTE","Orbit of last TestEnable",m_LSfrac*m_maxLS,0,m_maxLS*262144);
129  _hlstart = m_rhm.makeTH1F("lstart","Orbit of last Start",m_LSfrac*m_maxLS,0,m_maxLS*262144);
130  _hlEC0 = m_rhm.makeTH1F("lEC0","Orbit of last EC0",m_LSfrac*m_maxLS,0,m_maxLS*262144);
131  _hlHR = m_rhm.makeTH1F("lHR","Orbit of last HardReset",m_LSfrac*m_maxLS,0,m_maxLS*262144);
132  _hdlec0lresync = m_rhm.makeTH1F("dlec0lresync","Orbit difference EC0-Resync",4000,-1999.5,2000.5);
133  _hdlresynclHR = m_rhm.makeTH1F("dlresynclHR","Orbit difference Resync-HR",4000,-1999.5,2000.5);
134 
135 }
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 ( )

Definition at line 138 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 204 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.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

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

Definition at line 258 of file APVCyclePhaseDebuggerFromL1TS.cc.

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

258  {
260  desc.add<edm::InputTag>("l1TSCollection",edm::InputTag("scalersRawToDigi"));
261  descriptions.add("l1TSDebugger",desc);
262 }
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 79 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze(), and APVCyclePhaseDebuggerFromL1TS().

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

Definition at line 73 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastEventCounter0
private

Definition at line 93 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastHardReset
private

Definition at line 91 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastOrbitCounter0
private

Definition at line 94 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastResync
private

Definition at line 90 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastStart
private

Definition at line 92 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

long long APVCyclePhaseDebuggerFromL1TS::_lastTestEnable
private

Definition at line 95 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by analyze().

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_LSfrac
private

Definition at line 75 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

const unsigned int APVCyclePhaseDebuggerFromL1TS::m_maxLS
private

Definition at line 74 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS().

RunHistogramManager APVCyclePhaseDebuggerFromL1TS::m_rhm
private

Definition at line 77 of file APVCyclePhaseDebuggerFromL1TS.cc.

Referenced by APVCyclePhaseDebuggerFromL1TS(), and beginRun().