CMS 3D CMS Logo

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

void produce (edm::Event &event, const edm::EventSetup &) override
 
 SpyEventSummaryProducer (const edm::ParameterSet &config)
 
 ~SpyEventSummaryProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void warnAboutUnsupportedRunType ()
 

Private Attributes

const edm::InputTag rawDataTag_
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
58  produces<SiStripEventSummary>();
60  }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
sistrip::SpyEventSummaryProducer::~SpyEventSummaryProducer ( )
override

Definition at line 62 of file SiStripSpyEventSummaryProducer.cc.

62 {}

Member Function Documentation

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

Definition at line 64 of file SiStripSpyEventSummaryProducer.cc.

References FEDRawData::data(), MillePedeFileConverter_cfg::e, sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, mps_fire::i, messageLabel_, eostools::move(), l1tstage2_dqm_sourceclient-live_cfg::rawData, rawDataToken_, runType_, FEDRawData::size(), warnAboutUnsupportedRunType(), and cms::Exception::what().

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

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

Definition at line 123 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().

123  {
124  switch (runType_) {
126  case sistrip::PHYSICS:
127  case sistrip::PHYSICS_ZS:
128  case sistrip::PEDESTALS:
129  case sistrip::MULTI_MODE:
130  case sistrip::PEDS_ONLY:
131  case sistrip::NOISE:
135  break;
141  case sistrip::OPTO_SCAN:
142  case sistrip::APV_TIMING:
143  case sistrip::FED_TIMING:
144  case sistrip::FINE_DELAY:
150  case sistrip::VPSP_SCAN:
151  LogWarning(messageLabel_) << "Unsupported run type: " << runType_
152  << ". Parameters need to be set from real trigger FED. Parameters will be set to 0.";
153  break;
154  }
155  }

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