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

#include <EventFilter/LTCRawToDigi/src/LTCRawToDigi.cc>

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

Public Member Functions

 LTCRawToDigi (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~LTCRawToDigi ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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: Unpack FED data to LTC bank. LTCs are FED id 816-823.

Implementation: No comments

Definition at line 42 of file LTCRawToDigi.cc.

Constructor & Destructor Documentation

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

Definition at line 64 of file LTCRawToDigi.cc.

65 {
66  //register your products
67  produces<LTCDigiCollection>();
68 }
LTCRawToDigi::~LTCRawToDigi ( )

Definition at line 71 of file LTCRawToDigi.cc.

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

Member Function Documentation

void LTCRawToDigi::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Take a reference to this FED's data

Implements edm::EDProducer.

Definition at line 86 of file LTCRawToDigi.cc.

References FEDRawData::data(), edm::Event::getByLabel(), edm::Event::put(), lumiPlot::rawdata, and FEDRawData::size().

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

87 {
88  using namespace edm;
89  const int LTCFedIDLo = 815;
90  const int LTCFedIDHi = 823;
91 
92  // Get a handle to the FED data collection
94  iEvent.getByLabel("source" , rawdata);
95 
96  // create collection we'll save in the event record
97  std::auto_ptr<LTCDigiCollection> pOut(new LTCDigiCollection());
98 
99  // Loop over all possible FED's with the appropriate FED ID
100  for ( int id = LTCFedIDLo; id <= LTCFedIDHi; ++id ) {
102  const FEDRawData & fedData = rawdata->FEDData(id);
103  unsigned short int length = fedData.size();
104  if ( ! length )
105  continue; // bank does not exist
106  LTCDigi ltcDigi(fedData.data());
107  pOut->push_back(ltcDigi);
108  }
109  iEvent.put(pOut);
110 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:106
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