CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
sistrip::DigiToRawModule Class Reference

A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection. More...

#include <SiStripDigiToRawModule.h>

Inheritance diagram for sistrip::DigiToRawModule:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
 DigiToRawModule (const edm::ParameterSet &)
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~DigiToRawModule ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

DigiToRawdigiToRaw_
 
uint32_t eventCounter_
 
std::string inputDigiLabel_
 
std::string inputModuleLabel_
 
FEDReadoutMode mode_
 
bool rawdigi_
 

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

A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection.

Definition at line 21 of file SiStripDigiToRawModule.h.

Constructor & Destructor Documentation

sistrip::DigiToRawModule::DigiToRawModule ( const edm::ParameterSet pset)

Creates instance of DigiToRaw converter, defines EDProduct type.

Definition at line 24 of file SiStripDigiToRawModule.cc.

References DigiToRaw_cff::DigiToRaw, digiToRaw_, edm::ParameterSet::getParameter(), edm::isDebugEnabled(), LogDebug, mode_, rawdigi_, sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_SPY, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE, and AlCaHLTBitMon_QueryRunRegistry::string.

24  :
25  inputModuleLabel_( pset.getParameter<std::string>( "InputModuleLabel" ) ),
26  inputDigiLabel_( pset.getParameter<std::string>( "InputDigiLabel" ) ),
27  mode_( fedReadoutModeFromString(pset.getParameter<std::string>( "FedReadoutMode" ))),
28  rawdigi_( false ),
29  digiToRaw_(0),
30  eventCounter_(0)
31  {
32  if ( edm::isDebugEnabled() ) {
33  LogDebug("DigiToRawModule")
34  << "[sistrip::DigiToRawModule::DigiToRawModule]"
35  << " Constructing object...";
36  }
37 
38  switch(mode_) {
39  case READOUT_MODE_ZERO_SUPPRESSED_LITE: rawdigi_ = false; break;
40  case READOUT_MODE_ZERO_SUPPRESSED: rawdigi_ = false; break;
41  case READOUT_MODE_VIRGIN_RAW: rawdigi_ = true; break;
42  case READOUT_MODE_PROC_RAW: rawdigi_ = true; break;
43  case READOUT_MODE_SCOPE: rawdigi_ = true; break;
44  case READOUT_MODE_INVALID: {
45  if( edm::isDebugEnabled()) {
46  edm::LogWarning("DigiToRawModule")
47  << "[sistrip::DigiToRawModule::DigiToRawModule]"
48  << " UNKNOWN readout mode: " << pset.getParameter<std::string>("FedReadoutMode");
49  }} break;
50  case READOUT_MODE_SPY: {
51  if( edm::isDebugEnabled()) {
52  edm::LogWarning("DigiToRawModule")
53  << "[sistrip::DigiToRawModule::DigiToRawModule]"
54  << " Digi to raw is not supported for spy channel data";
55  }} break;
56  }
57  if(pset.getParameter<bool>("UseWrongDigiType")) {
58  rawdigi_ = !rawdigi_;
59  if( edm::isDebugEnabled()) {
60  edm::LogWarning("DigiToRawModule")
61  << "[sistrip::DigiToRawModule::DigiToRawModule]"
62  << " You are using the wrong type of digis!";
63  }
64  }
65 
66  // Create instance of DigiToRaw formatter
67  digiToRaw_ = new DigiToRaw( mode_, pset.getParameter<bool>("UseFedKey") );
68 
69  produces<FEDRawDataCollection>();
70 
71  }
#define LogDebug(id)
T getParameter(std::string const &) const
bool isDebugEnabled()
FEDReadoutMode fedReadoutModeFromString(const std::string &readoutModeString)
sistrip::DigiToRawModule::~DigiToRawModule ( )

Definition at line 75 of file SiStripDigiToRawModule.cc.

References digiToRaw_, edm::isDebugEnabled(), and LogDebug.

75  {
76  if ( edm::isDebugEnabled() ) {
77  LogDebug("DigiToRaw")
78  << "[sistrip::DigiToRawModule::~DigiToRawModule]"
79  << " Destructing object...";
80  }
81  if ( digiToRaw_ ) delete digiToRaw_;
82  }
#define LogDebug(id)
bool isDebugEnabled()

Member Function Documentation

virtual void sistrip::DigiToRawModule::beginJob ( void  )
inlinevirtual

Reimplemented from edm::EDProducer.

Definition at line 28 of file SiStripDigiToRawModule.h.

28 {}
virtual void sistrip::DigiToRawModule::endJob ( void  )
inlinevirtual

Reimplemented from edm::EDProducer.

Definition at line 29 of file SiStripDigiToRawModule.h.

29 {}
void sistrip::DigiToRawModule::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Retrieves cabling map from EventSetup, retrieves a DetSetVector of SiStripDigis from Event, creates a FEDRawDataCollection (EDProduct), uses DigiToRaw converter to fill FEDRawDataCollection, attaches FEDRawDataCollection to Event.

Implements edm::EDProducer.

Definition at line 91 of file SiStripDigiToRawModule.cc.

References sistrip::DigiToRaw::createFedBuffers(), digiToRaw_, eventCounter_, edm::EventSetup::get(), edm::Event::getByLabel(), inputDigiLabel_, inputModuleLabel_, edm::Event::put(), and rawdigi_.

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

92  {
93 
94  eventCounter_++;
95 
96  std::auto_ptr<FEDRawDataCollection> buffers( new FEDRawDataCollection );
97 
99  iSetup.get<SiStripFedCablingRcd>().get( cabling );
100 
101  if( rawdigi_ ) {
103  iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, rawdigis );
104  digiToRaw_->createFedBuffers( iEvent, cabling, rawdigis, buffers );
105  } else {
107  iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, digis );
108  digiToRaw_->createFedBuffers( iEvent, cabling, digis, buffers );
109  }
110 
111  iEvent.put( buffers );
112 
113  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void createFedBuffers(edm::Event &, edm::ESHandle< SiStripFedCabling > &cabling, edm::Handle< edm::DetSetVector< SiStripDigi > > &digis, std::auto_ptr< FEDRawDataCollection > &buffers)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

DigiToRaw* sistrip::DigiToRawModule::digiToRaw_
private

Definition at line 39 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), produce(), and ~DigiToRawModule().

uint32_t sistrip::DigiToRawModule::eventCounter_
private

Definition at line 40 of file SiStripDigiToRawModule.h.

Referenced by produce().

std::string sistrip::DigiToRawModule::inputDigiLabel_
private

Definition at line 36 of file SiStripDigiToRawModule.h.

Referenced by produce().

std::string sistrip::DigiToRawModule::inputModuleLabel_
private

Definition at line 35 of file SiStripDigiToRawModule.h.

Referenced by produce().

FEDReadoutMode sistrip::DigiToRawModule::mode_
private

Definition at line 37 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

bool sistrip::DigiToRawModule::rawdigi_
private

Definition at line 38 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().