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 Referencefinal

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
 
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 ()
 

Private Attributes

DigiToRawdigiToRaw_
 
uint32_t eventCounter_
 
std::string inputDigiLabel_
 
std::string inputModuleLabel_
 
FEDReadoutMode mode_
 
bool rawdigi_
 
edm::EDGetTokenT
< edm::DetSetVector
< SiStripDigi > > 
tokenDigi
 
edm::EDGetTokenT
< edm::DetSetVector
< SiStripRawDigi > > 
tokenRawDigi
 

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 24 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 21 of file SiStripDigiToRawModule.cc.

References DigiToRaw_cff::DigiToRaw, digiToRaw_, edm::ParameterSet::getParameter(), inputDigiLabel_, inputModuleLabel_, edm::isDebugEnabled(), LogDebug, mode_, rawdigi_, sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_PREMIX_RAW, 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, AlCaHLTBitMon_QueryRunRegistry::string, tokenDigi, and tokenRawDigi.

21  :
22  inputModuleLabel_( pset.getParameter<std::string>( "InputModuleLabel" ) ),
23  inputDigiLabel_( pset.getParameter<std::string>( "InputDigiLabel" ) ),
24  mode_( fedReadoutModeFromString(pset.getParameter<std::string>( "FedReadoutMode" ))),
25  rawdigi_( false ),
26  digiToRaw_(0),
27  eventCounter_(0)
28  {
29  if ( edm::isDebugEnabled() ) {
30  LogDebug("DigiToRawModule")
31  << "[sistrip::DigiToRawModule::DigiToRawModule]"
32  << " Constructing object...";
33  }
34 
35 
36  switch(mode_) {
37  case READOUT_MODE_ZERO_SUPPRESSED_LITE: rawdigi_ = false; break;
38  case READOUT_MODE_ZERO_SUPPRESSED: rawdigi_ = false; break;
39  case READOUT_MODE_PREMIX_RAW: 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  if (rawdigi_) {
69  tokenRawDigi = consumes< edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, inputDigiLabel_));
70  } else {
71  tokenDigi = consumes< edm::DetSetVector<SiStripDigi> >(edm::InputTag(inputModuleLabel_, inputDigiLabel_));
72 
73  }
74 
75  produces<FEDRawDataCollection>();
76 
77  }
#define LogDebug(id)
T getParameter(std::string const &) const
bool isDebugEnabled()
FEDReadoutMode fedReadoutModeFromString(const std::string &readoutModeString)
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > tokenDigi
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > tokenRawDigi
sistrip::DigiToRawModule::~DigiToRawModule ( )

Definition at line 81 of file SiStripDigiToRawModule.cc.

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

81  {
82  if ( edm::isDebugEnabled() ) {
83  LogDebug("DigiToRaw")
84  << "[sistrip::DigiToRawModule::~DigiToRawModule]"
85  << " Destructing object...";
86  }
87  if ( digiToRaw_ ) delete digiToRaw_;
88  }
#define LogDebug(id)
bool isDebugEnabled()

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 31 of file SiStripDigiToRawModule.h.

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

Reimplemented from edm::EDProducer.

Definition at line 32 of file SiStripDigiToRawModule.h.

32 {}
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 97 of file SiStripDigiToRawModule.cc.

References sistrip::DigiToRaw::createFedBuffers(), digiToRaw_, eventCounter_, edm::EventSetup::get(), edm::Event::getByToken(), edm::Event::put(), rawdigi_, tokenDigi, and tokenRawDigi.

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

98  {
99 
100  eventCounter_++;
101 
102  std::auto_ptr<FEDRawDataCollection> buffers( new FEDRawDataCollection );
103 
105  iSetup.get<SiStripFedCablingRcd>().get( cabling );
106 
107  if( rawdigi_ ) {
109  iEvent.getByToken( tokenRawDigi, rawdigis );
110  digiToRaw_->createFedBuffers( iEvent, cabling, rawdigis, buffers );
111  } else {
113  iEvent.getByToken( tokenDigi, digis );
114  digiToRaw_->createFedBuffers( iEvent, cabling, digis, buffers );
115  }
116 
117  iEvent.put( buffers );
118 
119  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
void createFedBuffers(edm::Event &, edm::ESHandle< SiStripFedCabling > &cabling, edm::Handle< edm::DetSetVector< SiStripDigi > > &digis, std::auto_ptr< FEDRawDataCollection > &buffers)
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > tokenDigi
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > tokenRawDigi

Member Data Documentation

DigiToRaw* sistrip::DigiToRawModule::digiToRaw_
private

Definition at line 42 of file SiStripDigiToRawModule.h.

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

uint32_t sistrip::DigiToRawModule::eventCounter_
private

Definition at line 43 of file SiStripDigiToRawModule.h.

Referenced by produce().

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

Definition at line 39 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

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

Definition at line 38 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

FEDReadoutMode sistrip::DigiToRawModule::mode_
private

Definition at line 40 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

bool sistrip::DigiToRawModule::rawdigi_
private

Definition at line 41 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

edm::EDGetTokenT< edm::DetSetVector<SiStripDigi> > sistrip::DigiToRawModule::tokenDigi
private

Definition at line 45 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

edm::EDGetTokenT< edm::DetSetVector<SiStripRawDigi> > sistrip::DigiToRawModule::tokenRawDigi
private

Definition at line 44 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().