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" |
Definition at line 33 of file SiStripSpyEventSummaryProducer.cc.
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.
{}
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().
{ switch(runType_) { case sistrip::DAQ_SCOPE_MODE: case sistrip::PHYSICS: case sistrip::PHYSICS_ZS: case sistrip::PEDESTALS: case sistrip::MULTI_MODE: case sistrip::PEDS_ONLY: case sistrip::NOISE: case sistrip::PEDS_FULL_NOISE: case sistrip::UNKNOWN_RUN_TYPE: case sistrip::UNDEFINED_RUN_TYPE: break; case sistrip::CALIBRATION: case sistrip::CALIBRATION_DECO: case sistrip::CALIBRATION_SCAN: case sistrip::CALIBRATION_SCAN_DECO: case sistrip::APV_LATENCY: case sistrip::OPTO_SCAN: case sistrip::APV_TIMING: case sistrip::FED_TIMING: case sistrip::FINE_DELAY: case sistrip::FINE_DELAY_PLL: case sistrip::FINE_DELAY_TTC: case sistrip::FAST_CABLING: case sistrip::FED_CABLING: case sistrip::QUITE_FAST_CABLING: case sistrip::VPSP_SCAN: LogWarning(messageLabel_) << "Unsupported run type: " << runType_ << ". Parameters need to be set from real trigger FED. Parameters will be set to 0."; break; } }
const char * sistrip::SpyEventSummaryProducer::messageLabel_ = "SiStripSpyEventSummaryProducer" [static, private] |
Definition at line 42 of file SiStripSpyEventSummaryProducer.cc.
Referenced by produce(), and warnAboutUnsupportedRunType().
const edm::InputTag sistrip::SpyEventSummaryProducer::rawDataTag_ [private] |
Definition at line 43 of file SiStripSpyEventSummaryProducer.cc.
Referenced by produce().
const sistrip::RunType sistrip::SpyEventSummaryProducer::runType_ [private] |
Definition at line 44 of file SiStripSpyEventSummaryProducer.cc.
Referenced by produce(), and warnAboutUnsupportedRunType().