CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

sistrip::SpyUnpackerModule Class Reference

Inheritance diagram for sistrip::SpyUnpackerModule:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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.
 SpyUnpackerModule (const edm::ParameterSet &)
virtual ~SpyUnpackerModule ()

Private Attributes

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

Static Private Attributes

static const char * msgLb_ = "SiStripSpyUnpackerModule"

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

                                                                    :
    fed_ids_( pset.getParameter< std::vector<uint32_t> >("FEDIDs")),
    productLabel_(pset.getParameter<edm::InputTag>("InputProductLabel")),
    allowIncompleteEvents_(pset.getParameter<bool>("AllowIncompleteEvents")),
    storeCounters_(pset.getParameter<bool>("StoreCounters")),
    storeScopeRawDigis_(pset.getParameter<bool>("StoreScopeRawDigis")),
    unpacker_(NULL)
  {

    if ((fed_ids_.size()==0)) {
      LogInfo(msgLb_) << "No FED IDs specified, so will try to unpack all FEDs with data" << std::endl;
      fed_ids_.reserve(FEDNumbering::MAXSiStripFEDID-FEDNumbering::MINSiStripFEDID+1);
      for ( uint32_t ifed = FEDNumbering::MINSiStripFEDID; ifed <= FEDNumbering::MAXSiStripFEDID; ifed++ ) {
        fed_ids_.push_back( ifed );    
      }
    } // end of FED ID specified check.
    
    if ( edm::isDebugEnabled() ) LogTrace(msgLb_) << "["<< __func__ << "]:" << " Constructing object...";
    
    unpacker_ = new sistrip::SpyUnpacker(allowIncompleteEvents_);
    
    if (storeScopeRawDigis_) produces< edm::DetSetVector<SiStripRawDigi> >("ScopeRawDigis");
    
    if (storeCounters_) {
      produces< std::vector<uint32_t> >("L1ACount");
      produces< std::vector<uint32_t> >("TotalEventCount");
    }
    
    produces<uint32_t>("GlobalRunNumber");
    
  } // end of SpyUnpackerModule constructor.
sistrip::SpyUnpackerModule::~SpyUnpackerModule ( ) [virtual]

Definition at line 121 of file SiStripSpyUnpackerModule.cc.

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

                                        {
    if ( unpacker_ ) { delete unpacker_; }
    if ( edm::isDebugEnabled() ) {
      LogTrace("SiStripSpyUnpacker")
        << "[sistrip::SpyUnpackerModule::" << __func__ << "]"
        << " Destructing object...";
    }
  }

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.

                                                                            {
  }  
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_.

                                                                               {
    

    const SiStripFedCabling* lCabling = utility_.getCabling( setup );

    //retrieve FED raw data (by label, which is "source" by default)
    edm::Handle<FEDRawDataCollection> buffers;
    event.getByLabel( productLabel_, buffers ); 
    
    //create container for digis
    std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > digis(new edm::DetSetVector<SiStripRawDigi>);
    
    //if necessary, create container for event counters
    std::auto_ptr< std::vector<uint32_t> > pTotalCounts(new std::vector<uint32_t>);
    std::auto_ptr< std::vector<uint32_t> > pL1ACounts(new std::vector<uint32_t>);
    //and for run number
    std::auto_ptr<uint32_t> pGlobalRun(new uint32_t);
    //create digis
    // Using FED IDs...
    unpacker_->createDigis(*lCabling, 
                           *buffers, 
                           digis.get(), 
                           fed_ids_, 
                           pTotalCounts.get(), 
                           pL1ACounts.get(),
                           pGlobalRun.get()
                           );
    
    // Add digis to event
    if (storeScopeRawDigis_) event.put( digis, "ScopeRawDigis" );
    
    //add counters to event
    if (storeCounters_) {
      event.put(pTotalCounts, "TotalEventCount");
      event.put(pL1ACounts, "L1ACount");
    }

    //add global run to the event
    event.put(pGlobalRun, "GlobalRunNumber");

  } // end of SpyUnpackerModule::produce method.

Member Data Documentation

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" [static, private]

Definition at line 64 of file SiStripSpyUnpackerModule.cc.

Referenced by SpyUnpackerModule().

The product label of the FEDRawDataCollection input.

Definition at line 70 of file SiStripSpyUnpackerModule.cc.

Referenced by produce().

True = store L1ID and TotalEventCount by FED key.

Definition at line 72 of file SiStripSpyUnpackerModule.cc.

Referenced by produce(), and SpyUnpackerModule().

True = store the scope mode raw digis.

Definition at line 73 of file SiStripSpyUnpackerModule.cc.

Referenced by produce(), and SpyUnpackerModule().

Definition at line 76 of file SiStripSpyUnpackerModule.cc.

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

Definition at line 79 of file SiStripSpyUnpackerModule.cc.

Referenced by produce().