CMS 3D CMS Logo

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

#include <filter/EcalFEDWithCRCErrorProducer/src/EcalFEDWithCRCErrorProducer.cc>

Inheritance diagram for EcalFEDWithCRCErrorProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalFEDWithCRCErrorProducer (const edm::ParameterSet &)
 
 ~EcalFEDWithCRCErrorProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::InputTag DataLabel_
 
std::vector< int > fedUnpackList_
 
bool writeAllEcalFEDs_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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: <one line="" class="" summary>="">

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

Definition at line 44 of file EcalFEDWithCRCErrorProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 62 of file EcalFEDWithCRCErrorProducer.cc.

References DataLabel_, fedUnpackList_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, FEDNumbering::MAXECALFEDID, FEDNumbering::MINECALFEDID, and writeAllEcalFEDs_.

62  {
63  //now do what ever initialization is needed
64 
65  DataLabel_ = iConfig.getParameter<edm::InputTag>("InputLabel");
66  fedUnpackList_ = iConfig.getUntrackedParameter<std::vector<int> >("FEDs", std::vector<int>());
67  writeAllEcalFEDs_ = iConfig.getUntrackedParameter<bool>("writeAllEcalFED", false);
68  if (fedUnpackList_.empty())
70  fedUnpackList_.push_back(i);
71 
72  produces<FEDRawDataCollection>();
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalFEDWithCRCErrorProducer::~EcalFEDWithCRCErrorProducer ( )
override

Definition at line 75 of file EcalFEDWithCRCErrorProducer.cc.

75  {
76  // do anything here that needs to be done at desctruction time
77  // (e.g. close files, deallocate resources etc.)
78 }

Member Function Documentation

void EcalFEDWithCRCErrorProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 85 of file EcalFEDWithCRCErrorProducer.cc.

References FEDRawData::data(), data, DataLabel_, DEFINE_FWK_MODULE, FEDRawDataCollection::FEDData(), fedUnpackList_, edm::Event::getByLabel(), mps_fire::i, gen::k, eostools::move(), edm::Event::put(), matplotRender::rawdata, FEDRawData::resize(), FEDRawData::size(), writeAllEcalFEDs_, and globals_cff::x1.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

85  {
86  using namespace edm;
87 
89  iEvent.getByLabel(DataLabel_, rawdata);
90 
91  auto producedData = std::make_unique<FEDRawDataCollection>();
92  // get fed raw data and SM id
93 
94  // loop over FEDS
95  for (std::vector<int>::const_iterator i = fedUnpackList_.begin(); i != fedUnpackList_.end(); i++) {
96  // get fed raw data and SM id
97  const FEDRawData& fedData = rawdata->FEDData(*i);
98  int length = fedData.size() / sizeof(uint64_t);
99 
100  // LogDebug("EcalRawToDigi") << "raw data length: " << length ;
101  //if data size is not null interpret data
102  if (length >= 1) {
103  uint64_t* pData = (uint64_t*)(fedData.data());
104  //When crc error is found return true
105  uint64_t* fedTrailer = pData + (length - 1);
106  bool crcError = (*fedTrailer >> 2) & 0x1;
107  // this fed has data -- lets copy it
108  if (writeAllEcalFEDs_ || crcError) {
109  FEDRawData& fedDataProd = producedData->FEDData(*i);
110  if (fedDataProd.size() != 0) {
111  // std::cout << " More than one FEDRawDataCollection with data in FED ";
112  // std::cout << j << " Skipping the 2nd\n";
113  continue;
114  }
115  fedDataProd.resize(fedData.size());
116  unsigned char* dataProd = fedDataProd.data();
117  const unsigned char* data = fedData.data();
118  for (unsigned int k = 0; k < fedData.size(); ++k) {
119  dataProd[k] = data[k];
120  }
121  }
122  }
123  }
124 
125  iEvent.put(std::move(producedData));
126 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:32
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
int k[5][pyjets_maxn]
unsigned long long uint64_t
Definition: Time.h:15
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::InputTag EcalFEDWithCRCErrorProducer::DataLabel_
private

Definition at line 54 of file EcalFEDWithCRCErrorProducer.cc.

Referenced by EcalFEDWithCRCErrorProducer(), and produce().

std::vector<int> EcalFEDWithCRCErrorProducer::fedUnpackList_
private

Definition at line 55 of file EcalFEDWithCRCErrorProducer.cc.

Referenced by EcalFEDWithCRCErrorProducer(), and produce().

bool EcalFEDWithCRCErrorProducer::writeAllEcalFEDs_
private

Definition at line 56 of file EcalFEDWithCRCErrorProducer.cc.

Referenced by EcalFEDWithCRCErrorProducer(), and produce().