CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

sistrip::SpyEventSummaryProducer Class Reference

Inheritance diagram for sistrip::SpyEventSummaryProducer:
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 &event, const edm::EventSetup &)
 SpyEventSummaryProducer (const edm::ParameterSet &config)
virtual ~SpyEventSummaryProducer ()

Private Member Functions

void warnAboutUnsupportedRunType ()

Private Attributes

const edm::InputTag rawDataTag_
const sistrip::RunType runType_

Static Private Attributes

static const char * messageLabel_ = "SiStripSpyEventSummaryProducer"

Detailed Description

Definition at line 33 of file SiStripSpyEventSummaryProducer.cc.


Constructor & Destructor Documentation

sistrip::SpyEventSummaryProducer::SpyEventSummaryProducer ( const edm::ParameterSet config)

Definition at line 53 of file SiStripSpyEventSummaryProducer.cc.

References warnAboutUnsupportedRunType().

    : rawDataTag_(config.getParameter<edm::InputTag>("RawDataTag")),
      runType_(sistrip::RunType(config.getParameter<uint32_t>("RunType")))
  {
    produces<SiStripEventSummary>();
    warnAboutUnsupportedRunType();
  }
sistrip::SpyEventSummaryProducer::~SpyEventSummaryProducer ( ) [virtual]

Definition at line 61 of file SiStripSpyEventSummaryProducer.cc.

{}

Member Function Documentation

void sistrip::SpyEventSummaryProducer::beginRun ( edm::Run ,
const edm::EventSetup  
) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 63 of file SiStripSpyEventSummaryProducer.cc.

  {}
void sistrip::SpyEventSummaryProducer::produce ( edm::Event event,
const edm::EventSetup  
) [virtual]

Implements edm::EDProducer.

Definition at line 66 of file SiStripSpyEventSummaryProducer.cc.

References FEDRawData::data(), alignCSCRings::e, sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, FEDRawDataCollection::FEDData(), i, messageLabel_, rawDataTag_, runType_, FEDRawData::size(), warnAboutUnsupportedRunType(), and cms::Exception::what().

  {
    warnAboutUnsupportedRunType();
    
    //get the event number and Bx counter from the first valud FED buffer
    edm::Handle<FEDRawDataCollection> rawDataHandle;
    event.getByLabel(rawDataTag_,rawDataHandle);
    const FEDRawDataCollection& rawData = *rawDataHandle;
    bool fedFound = false;
    uint32_t fedEventNumber = 0;
    uint32_t fedBxNumber = 0;
    for (uint16_t fedId = sistrip::FED_ID_MIN; fedId <= sistrip::FED_ID_MAX; ++fedId) {
      const FEDRawData& fedData = rawData.FEDData(fedId);
      if (fedData.size() && fedData.data()) {
        std::auto_ptr<sistrip::FEDBufferBase> pBuffer;
        try {
          pBuffer.reset(new sistrip::FEDBufferBase(fedData.data(),fedData.size()));
        } catch (const cms::Exception& e) {
          LogInfo(messageLabel_) << "Skipping FED " << fedId << " because of exception: " << e.what();
          continue;
        }
        fedEventNumber = pBuffer->daqLvl1ID();
        fedBxNumber = pBuffer->daqBXID();
        fedFound = true;
        break;
      }
    }
    if (!fedFound) {
      LogError(messageLabel_) << "No SiStrip FED data found in raw data.";
      return;
    }
    
    //create summary object
    std::auto_ptr<SiStripEventSummary> pSummary(new SiStripEventSummary);
    //set the trigger FED number to zero to indicate that it doesn't exist
    pSummary->triggerFed(0);
    //set the event number and Bx from the FED packets
    pSummary->event(fedEventNumber);
    pSummary->bx(fedBxNumber);
    //create a fake trigger FED buffer to take comissioning parameters from
    const int maxTriggerFedBufferSize = 84;
    boost::scoped_array<uint32_t> fakeTriggerFedData(new uint32_t[maxTriggerFedBufferSize]);
    for (uint8_t i=0; i<maxTriggerFedBufferSize; ++i) {
      fakeTriggerFedData[i] = 0;
    }
    //set the FED readout mode to virgin raw
    fakeTriggerFedData[15] = 1;
    //set the spill number
    fakeTriggerFedData[0] = 0;
    //set the number of data senders
    fakeTriggerFedData[20] = 1;
    //set the run type
    fakeTriggerFedData[10] = runType_;
    //fill the summarry using trigger FED buffer  with no data
    pSummary->commissioningInfo(fakeTriggerFedData.get(),fedEventNumber);
    
    //store in event
    event.put(pSummary);
  }
void sistrip::SpyEventSummaryProducer::warnAboutUnsupportedRunType ( ) [private]

Definition at line 126 of file SiStripSpyEventSummaryProducer.cc.

References sistrip::APV_LATENCY, sistrip::APV_TIMING, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, sistrip::DAQ_SCOPE_MODE, sistrip::FAST_CABLING, sistrip::FED_CABLING, sistrip::FED_TIMING, sistrip::FINE_DELAY, sistrip::FINE_DELAY_PLL, sistrip::FINE_DELAY_TTC, messageLabel_, sistrip::MULTI_MODE, sistrip::NOISE, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_FULL_NOISE, sistrip::PEDS_ONLY, sistrip::PHYSICS, sistrip::PHYSICS_ZS, sistrip::QUITE_FAST_CABLING, runType_, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, and sistrip::VPSP_SCAN.

Referenced by produce(), and SpyEventSummaryProducer().


Member Data Documentation

const char * sistrip::SpyEventSummaryProducer::messageLabel_ = "SiStripSpyEventSummaryProducer" [static, private]

Definition at line 42 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().

Definition at line 43 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce().

Definition at line 44 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().