CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
SiPixelPhase1RawData Class Reference

#include <SiPixelPhase1RawData.h>

Inheritance diagram for SiPixelPhase1RawData:
SiPixelPhase1Base DQMEDAnalyzer HistogramManagerHolder edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiPixelPhase1RawData (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override=0
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup) override
 
 SiPixelPhase1Base (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase1Base () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
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
 
 ~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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig)
 

Private Types

enum  {
  NERRORS, FIFOFULL, TBMMESSAGE, TBMTYPE,
  TYPE_NERRORS
}
 

Private Attributes

edm::EDGetTokenT< DetSetVector< SiPixelRawDataError > > srcToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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)
 
- Protected Types inherited from SiPixelPhase1Base
enum  { DCS }
 
- Protected Member Functions inherited from SiPixelPhase1Base
bool checktrigger (const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
 
- 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)
 
- Protected Attributes inherited from HistogramManagerHolder
GeometryInterface geometryInterface
 
std::vector< HistogramManagerhisto
 

Detailed Description

Definition at line 17 of file SiPixelPhase1RawData.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

SiPixelPhase1RawData::SiPixelPhase1RawData ( const edm::ParameterSet conf)
explicit

Definition at line 16 of file SiPixelPhase1RawData.cc.

References edm::ParameterSet::getParameter(), and srcToken_.

16  :
17  SiPixelPhase1Base(iConfig)
18 {
19  srcToken_ = consumes<DetSetVector<SiPixelRawDataError>>(iConfig.getParameter<edm::InputTag>("src"));
20 }
edm::EDGetTokenT< DetSetVector< SiPixelRawDataError > > srcToken_
SiPixelPhase1Base(const edm::ParameterSet &iConfig)

Member Function Documentation

void SiPixelPhase1RawData::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 23 of file SiPixelPhase1RawData.cc.

References SiPixelPhase1Base::checktrigger(), SiPixelPhase1Base::DCS, DEFINE_FWK_MODULE, FIFOFULL, lumiContext::fill, edm::Event::getByToken(), HistogramManagerHolder::histo, mps_fire::i, input, edm::HandleBase::isValid(), NERRORS, srcToken_, TBMMESSAGE, TBMTYPE, and TYPE_NERRORS.

23  {
24  if( !checktrigger(iEvent,iSetup,DCS) ) return;
25 
27  iEvent.getByToken(srcToken_, input);
28  if (!input.isValid()) return;
29 
30  for (auto it = input->begin(); it != input->end(); ++it) {
31  for (auto& siPixelRawDataError : *it) {
32  int fed = siPixelRawDataError.getFedId();
33  int type = siPixelRawDataError.getType();
34  DetId id = it->detId();
35 
36  // encoding of the channel number within the FED error word
37  const uint32_t LINK_bits = 6;
38  const uint32_t LINK_shift = 26;
39  const uint64_t LINK_mask = (1 << LINK_bits) - 1;
40 
41  uint64_t errorWord = 0;
42  // use 64bit word for some error types
43  // invalid header, invalid trailer, size mismatch
44  if (type == 32 || type == 33 || type == 34) {
45  errorWord = siPixelRawDataError.getWord64();
46  } else {
47  errorWord = siPixelRawDataError.getWord32();
48  }
49 
50  int32_t chanNmbr = (errorWord >> LINK_shift) & LINK_mask;
51  // timeout
52  if (type == 29) chanNmbr = -1; // TODO: different formula needed.
53 
54  uint32_t error_data = errorWord & 0xFF;
55 
56  if (type == 28) { // overflow.
57  for (uint32_t i = 0; i < 8; i++) {
58  if (error_data & (1 << i)) histo[FIFOFULL].fill(i, id, &iEvent, fed, chanNmbr);
59  }
60  }
61 
62  if (type == 30) { // TBM stuff.
63  uint32_t statemachine_state = errorWord >> 8 & 0xF; // next 4 bits after data
64  const uint32_t tbm_types[16] = {
65  0, 1, 2, 4,
66  2, 4, 2, 4,
67  3, 1, 4, 4,
68  4, 4, 4, 4
69  };
70 
71  histo[TBMTYPE].fill(tbm_types[statemachine_state], id, &iEvent, fed, chanNmbr);
72 
73  for (uint32_t i = 0; i < 8; i++) {
74  if (error_data & (1 << i)) histo[TBMMESSAGE].fill(i, id, &iEvent, fed, chanNmbr);
75  }
76  continue; // we don't really consider these as errors.
77  }
78 
79  // note that a DetId of 0xFFFFFFFF can mean 'no DetId'.
80  // We hijack column and row for FED and chan in this case,
81  // the GeometryInterface does understand that.
82 
83  histo[NERRORS].fill(id, &iEvent, fed, chanNmbr);
84  histo[TYPE_NERRORS].fill(type, id, &iEvent, fed, chanNmbr);
85  }
86  }
87 
88  histo[NERRORS].executePerEventHarvesting(&iEvent);
89 }
edm::EDGetTokenT< DetSetVector< SiPixelRawDataError > > srcToken_
type
Definition: HCALResponse.h:21
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
static std::string const input
Definition: EdmProvDump.cc:44
bool checktrigger(const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
unsigned long long uint64_t
Definition: Time.h:15
std::vector< HistogramManager > histo

Member Data Documentation

edm::EDGetTokenT<DetSetVector<SiPixelRawDataError> > SiPixelPhase1RawData::srcToken_
private

Definition at line 31 of file SiPixelPhase1RawData.h.

Referenced by analyze(), and SiPixelPhase1RawData().