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 23 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.

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

Definition at line 74 of file SiStripDigiToRawModule.cc.

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

74  {
75  if ( edm::isDebugEnabled() ) {
76  LogDebug("DigiToRaw")
77  << "[sistrip::DigiToRawModule::~DigiToRawModule]"
78  << " Destructing object...";
79  }
80  if ( digiToRaw_ ) delete digiToRaw_;
81  }
#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 90 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().

91  {
92 
93  eventCounter_++;
94 
95  std::auto_ptr<FEDRawDataCollection> buffers( new FEDRawDataCollection );
96 
98  iSetup.get<SiStripFedCablingRcd>().get( cabling );
99 
100  if( rawdigi_ ) {
102  iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, rawdigis );
103  digiToRaw_->createFedBuffers( iEvent, cabling, rawdigis, buffers );
104  } else {
106  iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, digis );
107  digiToRaw_->createFedBuffers( iEvent, cabling, digis, buffers );
108  }
109 
110  iEvent.put( buffers );
111 
112  }
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().