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::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::StreamID, edm::Event &event, const edm::EventSetup &) const override
 
 SpyEventSummaryProducer (const edm::ParameterSet &config)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void warnAboutUnsupportedRunType () const
 

Private Attributes

const edm::InputTag rawDataTag_
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
const sistrip::RunType runType_
 

Static Private Attributes

static const char *const messageLabel_ = "SiStripSpyEventSummaryProducer"
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 34 of file SiStripSpyEventSummaryProducer.cc.

Constructor & Destructor Documentation

◆ SpyEventSummaryProducer()

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

Definition at line 53 of file SiStripSpyEventSummaryProducer.cc.

References rawDataTag_, rawDataToken_, and warnAboutUnsupportedRunType().

54  : rawDataTag_(config.getParameter<edm::InputTag>("RawDataTag")),
55  runType_(sistrip::RunType(config.getParameter<uint32_t>("RunType"))) {
56  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
57  produces<SiStripEventSummary>();
59  }
Definition: config.py:1
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_

Member Function Documentation

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 61 of file SiStripSpyEventSummaryProducer.cc.

References edmScanValgrind::buffer, FEDRawData::data(), sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, l1tstage2_dqm_sourceclient-live_cfg::fedId, mps_fire::i, messageLabel_, eostools::move(), sistrip::preconstructCheckFEDBufferBase(), l1tstage2_dqm_sourceclient-live_cfg::rawData, rawDataToken_, runType_, FEDRawData::size(), sistrip::SUCCESS, and warnAboutUnsupportedRunType().

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

◆ warnAboutUnsupportedRunType()

void sistrip::SpyEventSummaryProducer::warnAboutUnsupportedRunType ( ) const
private

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

121  {
122  switch (runType_) {
124  case sistrip::PHYSICS:
125  case sistrip::PHYSICS_ZS:
126  case sistrip::PEDESTALS:
127  case sistrip::MULTI_MODE:
128  case sistrip::PEDS_ONLY:
129  case sistrip::NOISE:
133  break;
139  case sistrip::OPTO_SCAN:
140  case sistrip::APV_TIMING:
141  case sistrip::FED_TIMING:
142  case sistrip::FINE_DELAY:
148  case sistrip::VPSP_SCAN:
149  LogWarning(messageLabel_) << "Unsupported run type: " << runType_
150  << ". Parameters need to be set from real trigger FED. Parameters will be set to 0.";
151  break;
152  }
153  }
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ messageLabel_

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

Definition at line 41 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().

◆ rawDataTag_

const edm::InputTag sistrip::SpyEventSummaryProducer::rawDataTag_
private

Definition at line 42 of file SiStripSpyEventSummaryProducer.cc.

Referenced by SpyEventSummaryProducer().

◆ rawDataToken_

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

Definition at line 43 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and SpyEventSummaryProducer().

◆ runType_

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

Definition at line 44 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().