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

Public Member Functions

virtual void produce (edm::Event &event, const edm::EventSetup &) override
 
 SpyEventSummaryProducer (const edm::ParameterSet &config)
 
virtual ~SpyEventSummaryProducer ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void warnAboutUnsupportedRunType ()
 

Private Attributes

const edm::InputTag rawDataTag_
 
edm::EDGetTokenT
< FEDRawDataCollection
rawDataToken_
 
const sistrip::RunType runType_
 

Static Private Attributes

static const char * messageLabel_ = "SiStripSpyEventSummaryProducer"
 

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

Definition at line 34 of file SiStripSpyEventSummaryProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 54 of file SiStripSpyEventSummaryProducer.cc.

References rawDataTag_, rawDataToken_, and warnAboutUnsupportedRunType().

55  : rawDataTag_(config.getParameter<edm::InputTag>("RawDataTag")),
56  runType_(sistrip::RunType(config.getParameter<uint32_t>("RunType")))
57  {
58  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
59  produces<SiStripEventSummary>();
61  }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
sistrip::SpyEventSummaryProducer::~SpyEventSummaryProducer ( )
virtual

Definition at line 63 of file SiStripSpyEventSummaryProducer.cc.

63 {}

Member Function Documentation

void sistrip::SpyEventSummaryProducer::produce ( edm::Event event,
const edm::EventSetup  
)
overridevirtual

Implements edm::EDProducer.

Definition at line 65 of file SiStripSpyEventSummaryProducer.cc.

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

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

66  {
68 
69  //get the event number and Bx counter from the first valud FED buffer
71  // event.getByLabel(rawDataTag_,rawDataHandle);
72  event.getByToken(rawDataToken_,rawDataHandle);
73  const FEDRawDataCollection& rawData = *rawDataHandle;
74  bool fedFound = false;
75  uint32_t fedEventNumber = 0;
76  uint32_t fedBxNumber = 0;
77  for (uint16_t fedId = sistrip::FED_ID_MIN; fedId <= sistrip::FED_ID_MAX; ++fedId) {
78  const FEDRawData& fedData = rawData.FEDData(fedId);
79  if (fedData.size() && fedData.data()) {
80  std::auto_ptr<sistrip::FEDBufferBase> pBuffer;
81  try {
82  pBuffer.reset(new sistrip::FEDBufferBase(fedData.data(),fedData.size()));
83  } catch (const cms::Exception& e) {
84  LogInfo(messageLabel_) << "Skipping FED " << fedId << " because of exception: " << e.what();
85  continue;
86  }
87  fedEventNumber = pBuffer->daqLvl1ID();
88  fedBxNumber = pBuffer->daqBXID();
89  fedFound = true;
90  break;
91  }
92  }
93  if (!fedFound) {
94  LogError(messageLabel_) << "No SiStrip FED data found in raw data.";
95  return;
96  }
97 
98  //create summary object
99  std::auto_ptr<SiStripEventSummary> pSummary(new SiStripEventSummary);
100  //set the trigger FED number to zero to indicate that it doesn't exist
101  pSummary->triggerFed(0);
102  //set the event number and Bx from the FED packets
103  pSummary->event(fedEventNumber);
104  pSummary->bx(fedBxNumber);
105  //create a fake trigger FED buffer to take comissioning parameters from
106  const int maxTriggerFedBufferSize = 84;
107  boost::scoped_array<uint32_t> fakeTriggerFedData(new uint32_t[maxTriggerFedBufferSize]);
108  for (uint8_t i=0; i<maxTriggerFedBufferSize; ++i) {
109  fakeTriggerFedData[i] = 0;
110  }
111  //set the FED readout mode to virgin raw
112  fakeTriggerFedData[15] = 1;
113  //set the spill number
114  fakeTriggerFedData[0] = 0;
115  //set the number of data senders
116  fakeTriggerFedData[20] = 1;
117  //set the run type
118  fakeTriggerFedData[10] = runType_;
119  //fill the summarry using trigger FED buffer with no data
120  pSummary->commissioningInfo(fakeTriggerFedData.get(),fedEventNumber);
121 
122  //store in event
123  event.put(pSummary);
124  }
virtual char const * what() const
Definition: Exception.cc:141
int i
Definition: DBlmapReader.cc:9
static const uint16_t FED_ID_MIN
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
static const uint16_t FED_ID_MAX
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().

127  {
128  switch(runType_) {
130  case sistrip::PHYSICS:
131  case sistrip::PHYSICS_ZS:
132  case sistrip::PEDESTALS:
133  case sistrip::MULTI_MODE:
134  case sistrip::PEDS_ONLY:
135  case sistrip::NOISE:
139  break;
145  case sistrip::OPTO_SCAN:
146  case sistrip::APV_TIMING:
147  case sistrip::FED_TIMING:
148  case sistrip::FINE_DELAY:
154  case sistrip::VPSP_SCAN:
155  LogWarning(messageLabel_) << "Unsupported run type: " << runType_ << ". Parameters need to be set from real trigger FED. Parameters will be set to 0.";
156  break;
157  }
158  }

Member Data Documentation

const char * sistrip::SpyEventSummaryProducer::messageLabel_ = "SiStripSpyEventSummaryProducer"
staticprivate

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

edm::EDGetTokenT<FEDRawDataCollection> sistrip::SpyEventSummaryProducer::rawDataToken_
private

Definition at line 44 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and SpyEventSummaryProducer().

const sistrip::RunType sistrip::SpyEventSummaryProducer::runType_
private

Definition at line 45 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().