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 | Static Private Attributes
sistrip::SpyUnpackerModule Class Reference
Inheritance diagram for sistrip::SpyUnpackerModule:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Scope mode digis and event counter producer. Retrieves cabling map from EventSetup and FEDRawDataCollection from Event, creates a DetSetVector of SiStripRawDigis, uses the SiStripSpyUnpacker class to fill the DetSetVector, and attaches the container to the Event. More...
 
 SpyUnpackerModule (const edm::ParameterSet &)
 
virtual ~SpyUnpackerModule ()
 
- 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

const bool allowIncompleteEvents_
 Allow inconsistent (by event count, APV address) event storage. More...
 
std::vector< uint32_t > fed_ids_
 Vector of FED IDs to examine (FEDs). More...
 
const edm::InputTag productLabel_
 The product label of the FEDRawDataCollection input. More...
 
const bool storeCounters_
 True = store L1ID and TotalEventCount by FED key. More...
 
const bool storeScopeRawDigis_
 True = store the scope mode raw digis. More...
 
SpyUnpackerunpacker_
 
SpyUtilities utility_
 

Static Private Attributes

static const char * msgLb_ = "SiStripSpyUnpackerModule"
 

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

Definition at line 56 of file SiStripSpyUnpackerModule.cc.

Constructor & Destructor Documentation

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

Definition at line 89 of file SiStripSpyUnpackerModule.cc.

References allowIncompleteEvents_, fed_ids_, edm::isDebugEnabled(), LogTrace, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, msgLb_, storeCounters_, storeScopeRawDigis_, and unpacker_.

89  :
90  fed_ids_( pset.getParameter< std::vector<uint32_t> >("FEDIDs")),
91  productLabel_(pset.getParameter<edm::InputTag>("InputProductLabel")),
92  allowIncompleteEvents_(pset.getParameter<bool>("AllowIncompleteEvents")),
93  storeCounters_(pset.getParameter<bool>("StoreCounters")),
94  storeScopeRawDigis_(pset.getParameter<bool>("StoreScopeRawDigis")),
96  {
97 
98  if ((fed_ids_.size()==0)) {
99  LogInfo(msgLb_) << "No FED IDs specified, so will try to unpack all FEDs with data" << std::endl;
101  for ( uint32_t ifed = FEDNumbering::MINSiStripFEDID; ifed <= FEDNumbering::MAXSiStripFEDID; ifed++ ) {
102  fed_ids_.push_back( ifed );
103  }
104  } // end of FED ID specified check.
105 
106  if ( edm::isDebugEnabled() ) LogTrace(msgLb_) << "["<< __func__ << "]:" << " Constructing object...";
107 
109 
110  if (storeScopeRawDigis_) produces< edm::DetSetVector<SiStripRawDigi> >("ScopeRawDigis");
111 
112  if (storeCounters_) {
113  produces< std::vector<uint32_t> >("L1ACount");
114  produces< std::vector<uint32_t> >("TotalEventCount");
115  }
116 
117  produces<uint32_t>("GlobalRunNumber");
118 
119  } // end of SpyUnpackerModule constructor.
std::vector< uint32_t > fed_ids_
Vector of FED IDs to examine (FEDs).
T getParameter(std::string const &) const
bool isDebugEnabled()
const bool storeScopeRawDigis_
True = store the scope mode raw digis.
Unpacks spy channel data into scope mode-like digis.
#define NULL
Definition: scimark2.h:8
const bool allowIncompleteEvents_
Allow inconsistent (by event count, APV address) event storage.
const bool storeCounters_
True = store L1ID and TotalEventCount by FED key.
#define LogTrace(id)
const edm::InputTag productLabel_
The product label of the FEDRawDataCollection input.
sistrip::SpyUnpackerModule::~SpyUnpackerModule ( )
virtual

Definition at line 121 of file SiStripSpyUnpackerModule.cc.

References edm::isDebugEnabled(), LogTrace, and unpacker_.

121  {
122  if ( unpacker_ ) { delete unpacker_; }
123  if ( edm::isDebugEnabled() ) {
124  LogTrace("SiStripSpyUnpacker")
125  << "[sistrip::SpyUnpackerModule::" << __func__ << "]"
126  << " Destructing object...";
127  }
128  }
bool isDebugEnabled()
#define LogTrace(id)

Member Function Documentation

void sistrip::SpyUnpackerModule::beginRun ( edm::Run run,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 130 of file SiStripSpyUnpackerModule.cc.

130  {
131  }
void sistrip::SpyUnpackerModule::produce ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Scope mode digis and event counter producer. Retrieves cabling map from EventSetup and FEDRawDataCollection from Event, creates a DetSetVector of SiStripRawDigis, uses the SiStripSpyUnpacker class to fill the DetSetVector, and attaches the container to the Event.

Implements edm::EDProducer.

Definition at line 141 of file SiStripSpyUnpackerModule.cc.

References sistrip::SpyUnpacker::createDigis(), fed_ids_, sistrip::SpyUtilities::getCabling(), productLabel_, storeCounters_, storeScopeRawDigis_, unpacker_, and utility_.

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

141  {
142 
143 
144  const SiStripFedCabling* lCabling = utility_.getCabling( setup );
145 
146  //retrieve FED raw data (by label, which is "source" by default)
148  event.getByLabel( productLabel_, buffers );
149 
150  //create container for digis
151  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > digis(new edm::DetSetVector<SiStripRawDigi>);
152 
153  //if necessary, create container for event counters
154  std::auto_ptr< std::vector<uint32_t> > pTotalCounts(new std::vector<uint32_t>);
155  std::auto_ptr< std::vector<uint32_t> > pL1ACounts(new std::vector<uint32_t>);
156  //and for run number
157  std::auto_ptr<uint32_t> pGlobalRun(new uint32_t);
158  //create digis
159  // Using FED IDs...
160  unpacker_->createDigis(*lCabling,
161  *buffers,
162  digis.get(),
163  fed_ids_,
164  pTotalCounts.get(),
165  pL1ACounts.get(),
166  pGlobalRun.get()
167  );
168 
169  // Add digis to event
170  if (storeScopeRawDigis_) event.put( digis, "ScopeRawDigis" );
171 
172  //add counters to event
173  if (storeCounters_) {
174  event.put(pTotalCounts, "TotalEventCount");
175  event.put(pL1ACounts, "L1ACount");
176  }
177 
178  //add global run to the event
179  event.put(pGlobalRun, "GlobalRunNumber");
180 
181  } // end of SpyUnpackerModule::produce method.
std::vector< uint32_t > fed_ids_
Vector of FED IDs to examine (FEDs).
void createDigis(const SiStripFedCabling &, const FEDRawDataCollection &, RawDigis *pDigis, const std::vector< uint32_t > &ids, Counters *pTotalEventCounts, Counters *pL1ACounts, uint32_t *aRunRef)
Creates the scope mode digis for the supplied FED IDs or detIds and stores event counters.
const bool storeScopeRawDigis_
True = store the scope mode raw digis.
const bool storeCounters_
True = store L1ID and TotalEventCount by FED key.
const edm::InputTag productLabel_
The product label of the FEDRawDataCollection input.
const SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...

Member Data Documentation

const bool sistrip::SpyUnpackerModule::allowIncompleteEvents_
private

Allow inconsistent (by event count, APV address) event storage.

Definition at line 71 of file SiStripSpyUnpackerModule.cc.

Referenced by SpyUnpackerModule().

std::vector<uint32_t> sistrip::SpyUnpackerModule::fed_ids_
private

Vector of FED IDs to examine (FEDs).

Definition at line 69 of file SiStripSpyUnpackerModule.cc.

Referenced by produce(), and SpyUnpackerModule().

const char * sistrip::SpyUnpackerModule::msgLb_ = "SiStripSpyUnpackerModule"
staticprivate

Definition at line 64 of file SiStripSpyUnpackerModule.cc.

Referenced by SpyUnpackerModule().

const edm::InputTag sistrip::SpyUnpackerModule::productLabel_
private

The product label of the FEDRawDataCollection input.

Definition at line 70 of file SiStripSpyUnpackerModule.cc.

Referenced by produce().

const bool sistrip::SpyUnpackerModule::storeCounters_
private

True = store L1ID and TotalEventCount by FED key.

Definition at line 72 of file SiStripSpyUnpackerModule.cc.

Referenced by produce(), and SpyUnpackerModule().

const bool sistrip::SpyUnpackerModule::storeScopeRawDigis_
private

True = store the scope mode raw digis.

Definition at line 73 of file SiStripSpyUnpackerModule.cc.

Referenced by produce(), and SpyUnpackerModule().

SpyUnpacker* sistrip::SpyUnpackerModule::unpacker_
private

Definition at line 76 of file SiStripSpyUnpackerModule.cc.

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

SpyUtilities sistrip::SpyUnpackerModule::utility_
private

Definition at line 79 of file SiStripSpyUnpackerModule.cc.

Referenced by produce().