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::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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

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

Definition at line 22 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, and sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE.

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 29 of file SiStripDigiToRawModule.h.

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

Reimplemented from edm::EDProducer.

Definition at line 30 of file SiStripDigiToRawModule.h.

30 {}
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:85
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:356
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

DigiToRaw* sistrip::DigiToRawModule::digiToRaw_
private

Definition at line 40 of file SiStripDigiToRawModule.h.

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

uint32_t sistrip::DigiToRawModule::eventCounter_
private

Definition at line 41 of file SiStripDigiToRawModule.h.

Referenced by produce().

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

Definition at line 37 of file SiStripDigiToRawModule.h.

Referenced by produce().

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

Definition at line 36 of file SiStripDigiToRawModule.h.

Referenced by produce().

FEDReadoutMode sistrip::DigiToRawModule::mode_
private

Definition at line 38 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

bool sistrip::DigiToRawModule::rawdigi_
private

Definition at line 39 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().