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
TcdsRawToDigi Class Reference

#include <ProdTutorial/TcdsRawToDigi/plugins/TcdsRawToDigi.cc>

Inheritance diagram for TcdsRawToDigi:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TcdsRawToDigi (const edm::ParameterSet &)
 
 ~TcdsRawToDigi ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT
< FEDRawDataCollection
dataToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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: Producer to unpack lumi nibble from TCDS

Definition at line 50 of file TcdsRawToDigi.cc.

Constructor & Destructor Documentation

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

Definition at line 64 of file TcdsRawToDigi.cc.

References edm::ParameterSet::getParameter().

65 {
66  edm::InputTag dataLabel = iConfig.getParameter<edm::InputTag>("InputLabel");
67  dataToken_=consumes<FEDRawDataCollection>(dataLabel);
68  produces<int>( "nibble" ).setBranchAlias( "nibble");
69  produces<int>( "triggerCount" ).setBranchAlias( "triggerCount");
70 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
TcdsRawToDigi::~TcdsRawToDigi ( )

Definition at line 73 of file TcdsRawToDigi.cc.

74 {
75 }

Member Function Documentation

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

Definition at line 115 of file TcdsRawToDigi.cc.

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

115  {
116  //The following says we do not know what parameters are allowed so do no validation
117  // Please change this to state exactly what you do use, even if it is no parameters
119  desc.add<edm::InputTag>("InputLabel",edm::InputTag("rawDataCollector"));
120  descriptions.add("tcdsRawToDigi", desc);
121 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TcdsRawToDigi::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 83 of file TcdsRawToDigi.cc.

References FEDRawData::data(), edm::Event::getByToken(), evf::evtn::TCDSHeader::getData(), evf::evtn::TCDSRecord::getHeader(), evf::evtn::TCDSHeader::tcdsheader::header, FEDNumbering::MINTCDSuTCAFEDID, evf::evtn::TCDSHeader::tcdsheader::nibble, edm::Event::put(), lumiPlot::rawdata, and FEDRawData::size().

Referenced by JSONExport.JsonExport::export().

84 {
85  using namespace edm;
86 
89 
90  int nibble=-99;
91  int triggerCount = -99;
92  if( rawdata.isValid() ) {
93  const FEDRawData& tcdsData = rawdata->FEDData(FEDNumbering::MINTCDSuTCAFEDID);
94  if(tcdsData.size()>0){
95  evf::evtn::TCDSRecord tcdsRecord(tcdsData.data());
96  nibble = (int)tcdsRecord.getHeader().getData().header.nibble;
97  triggerCount = (int)tcdsRecord.getHeader().getData().header.triggerCount;
98  } else {
99  nibble=-2;
100  triggerCount=-2;
101  }
102  } else {
103  nibble=-1;
104  triggerCount=-1;
105  }
106  //std::cout<<"nibble is "<<nibble<<std::endl;
107 
108  iEvent.put(std::make_unique<int>(nibble), "nibble");
109  iEvent.put(std::make_unique<int>(triggerCount), "triggerCount");
110 }
TCDSHeader & getHeader()
Definition: FED1024.h:150
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const tcdsheader & getData()
Definition: FED1024.h:84
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
struct evf::evtn::TCDSHeader::tcdsheader::@322 header
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
dictionary rawdata
Definition: lumiPlot.py:393

Member Data Documentation

edm::EDGetTokenT<FEDRawDataCollection> TcdsRawToDigi::dataToken_
private

Definition at line 60 of file TcdsRawToDigi.cc.