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

Definition at line 23 of file SiPixelPhase1RawData.cc.

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