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
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 34 of file SiStripSpyEventSummaryProducer.cc.

Constructor & Destructor Documentation

◆ SpyEventSummaryProducer()

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

Definition at line 54 of file SiStripSpyEventSummaryProducer.cc.

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  }

References rawDataTag_, rawDataToken_, and warnAboutUnsupportedRunType().

◆ ~SpyEventSummaryProducer()

sistrip::SpyEventSummaryProducer::~SpyEventSummaryProducer ( )
override

Definition at line 62 of file SiStripSpyEventSummaryProducer.cc.

62 {}

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 64 of file SiStripSpyEventSummaryProducer.cc.

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  const auto st_buffer = preconstructCheckFEDBufferBase(fedData);
78  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
79  LogInfo(messageLabel_) << "Skipping FED " << fedId << " because of exception: "
80  << "An exception of category 'FEDBuffer' occurred.\n"
81  << st_buffer;
82  continue;
83  }
84  const sistrip::FEDBufferBase buffer{fedData};
85  fedEventNumber = buffer.daqLvl1ID();
86  fedBxNumber = buffer.daqBXID();
87  fedFound = true;
88  break;
89  }
90  }
91  if (!fedFound) {
92  LogError(messageLabel_) << "No SiStrip FED data found in raw data.";
93  return;
94  }
95 
96  //create summary object
97  std::unique_ptr<SiStripEventSummary> pSummary(new SiStripEventSummary);
98  //set the trigger FED number to zero to indicate that it doesn't exist
99  pSummary->triggerFed(0);
100  //set the event number and Bx from the FED packets
101  pSummary->event(fedEventNumber);
102  pSummary->bx(fedBxNumber);
103  //create a fake trigger FED buffer to take comissioning parameters from
104  const int maxTriggerFedBufferSize = 84;
105  std::vector<uint32_t> fakeTriggerFedData(maxTriggerFedBufferSize);
106  for (uint8_t i = 0; i < maxTriggerFedBufferSize; ++i) {
107  fakeTriggerFedData[i] = 0;
108  }
109  //set the FED readout mode to virgin raw
110  fakeTriggerFedData[15] = 1;
111  //set the spill number
112  fakeTriggerFedData[0] = 0;
113  //set the number of data senders
114  fakeTriggerFedData[20] = 1;
115  //set the run type
116  fakeTriggerFedData[10] = runType_;
117  //fill the summarry using trigger FED buffer with no data
118  pSummary->commissioningInfo(fakeTriggerFedData.data(), fedEventNumber);
119 
120  //store in event
121  event.put(std::move(pSummary));
122  }

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

◆ warnAboutUnsupportedRunType()

void sistrip::SpyEventSummaryProducer::warnAboutUnsupportedRunType ( )
private

Definition at line 124 of file SiStripSpyEventSummaryProducer.cc.

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

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

◆ messageLabel_

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

Definition at line 42 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().

◆ rawDataTag_

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

Definition at line 43 of file SiStripSpyEventSummaryProducer.cc.

Referenced by SpyEventSummaryProducer().

◆ rawDataToken_

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

Definition at line 44 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and SpyEventSummaryProducer().

◆ runType_

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

Definition at line 45 of file SiStripSpyEventSummaryProducer.cc.

Referenced by produce(), and warnAboutUnsupportedRunType().

sistrip::CALIBRATION_SCAN
Definition: ConstantsForRunType.h:87
sistrip::PHYSICS_ZS
Definition: ConstantsForRunType.h:86
sistrip::DAQ_SCOPE_MODE
Definition: ConstantsForRunType.h:83
mps_fire.i
i
Definition: mps_fire.py:428
sistrip::CALIBRATION
Definition: ConstantsForRunType.h:73
sistrip::PEDS_FULL_NOISE
Definition: ConstantsForRunType.h:92
sistrip::VPSP_SCAN
Definition: ConstantsForRunType.h:82
sistrip::FAST_CABLING
Definition: ConstantsForRunType.h:89
sistrip::APV_TIMING
Definition: ConstantsForRunType.h:75
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
sistrip::OPTO_SCAN
Definition: ConstantsForRunType.h:74
sistrip::SpyEventSummaryProducer::rawDataToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
Definition: SiStripSpyEventSummaryProducer.cc:44
sistrip::FED_ID_MIN
static const uint16_t FED_ID_MIN
Definition: ConstantsForHardwareSystems.h:21
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
sistrip::SpyEventSummaryProducer::warnAboutUnsupportedRunType
void warnAboutUnsupportedRunType()
Definition: SiStripSpyEventSummaryProducer.cc:124
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
sistrip::FEDBufferBase
Definition: SiStripFEDBufferComponents.h:643
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
sistrip::FINE_DELAY
Definition: ConstantsForRunType.h:85
config
Definition: config.py:1
sistrip::FED_CABLING
Definition: ConstantsForRunType.h:81
sistrip::FINE_DELAY_TTC
Definition: ConstantsForRunType.h:78
sistrip::SpyEventSummaryProducer::runType_
const sistrip::RunType runType_
Definition: SiStripSpyEventSummaryProducer.cc:45
sistrip::CALIBRATION_DECO
Definition: ConstantsForRunType.h:93
sistrip::QUITE_FAST_CABLING
Definition: ConstantsForRunType.h:84
sistrip::PEDESTALS
Definition: ConstantsForRunType.h:72
sistrip::UNKNOWN_RUN_TYPE
Definition: ConstantsForRunType.h:94
sistrip::FEDBufferStatusCode::SUCCESS
sistrip::FED_TIMING
Definition: ConstantsForRunType.h:80
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
sistrip::FED_ID_MAX
static const uint16_t FED_ID_MAX
Definition: ConstantsForHardwareSystems.h:22
sistrip::MULTI_MODE
Definition: ConstantsForRunType.h:79
sistrip::preconstructCheckFEDBufferBase
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Definition: SiStripFEDBufferComponents.h:757
sistrip::FINE_DELAY_PLL
Definition: ConstantsForRunType.h:77
sistrip::CALIBRATION_SCAN_DECO
Definition: ConstantsForRunType.h:88
eostools.move
def move(src, dest)
Definition: eostools.py:511
sistrip::PHYSICS
Definition: ConstantsForRunType.h:71
sistrip::SpyEventSummaryProducer::rawDataTag_
const edm::InputTag rawDataTag_
Definition: SiStripSpyEventSummaryProducer.cc:43
sistrip::APV_LATENCY
Definition: ConstantsForRunType.h:76
sistrip::UNDEFINED_RUN_TYPE
Definition: ConstantsForRunType.h:95
sistrip::SpyEventSummaryProducer::messageLabel_
static const char * messageLabel_
Definition: SiStripSpyEventSummaryProducer.cc:42
sistrip::NOISE
Definition: ConstantsForRunType.h:91
SiStripEventSummary
Definition: SiStripEventSummary.h:22
edm::InputTag
Definition: InputTag.h:15