CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
sistrip::SpyDigiConverterModule Class Reference
Inheritance diagram for sistrip::SpyDigiConverterModule:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 SpyDigiConverterModule (const edm::ParameterSet &)
 
 ~SpyDigiConverterModule () 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::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
 
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 updateFedCabling (const SiStripFedCablingRcd &rcd)
 

Private Attributes

edm::ESWatcher< SiStripFedCablingRcdcablingWatcher_
 
const bool discardDigisWithAPVAddressError_
 
const uint32_t expectedHeaderBit_
 
const SiStripFedCablingfedCabling_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdfedCablingToken_
 
sistrip::SpyUtilities::FrameQuality frameQuality_
 
const edm::InputTag productLabel_
 
edm::EDGetTokenT< sistrip::SpyDigiConverter::DSVRawDigisproductToken_
 
const bool storeAPVAddress_
 True = store APVE address for each channel. More...
 
const bool storeModuleDigis_
 
const bool storePayloadDigis_
 
const bool storeReorderedDigis_
 

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 35 of file SiStripSpyDigiConverterModule.cc.

Constructor & Destructor Documentation

◆ SpyDigiConverterModule()

sistrip::SpyDigiConverterModule::SpyDigiConverterModule ( const edm::ParameterSet pset)

Definition at line 61 of file SiStripSpyDigiConverterModule.cc.

62  : productLabel_(pset.getParameter<edm::InputTag>("InputProductLabel")),
63  storeAPVAddress_(pset.getParameter<bool>("StoreAPVAddress")),
64  storePayloadDigis_(pset.getParameter<bool>("StorePayloadDigis")),
65  storeReorderedDigis_(pset.getParameter<bool>("StoreReorderedDigis")),
66  storeModuleDigis_(pset.getParameter<bool>("StoreModuleDigis")),
67  discardDigisWithAPVAddressError_(pset.getParameter<bool>("DiscardDigisWithWrongAPVAddress")),
68  expectedHeaderBit_(pset.getParameter<uint32_t>("ExpectedPositionOfFirstHeaderBit")),
69  fedCablingToken_(esConsumes<>()),
71  productToken_ = consumes<sistrip::SpyDigiConverter::DSVRawDigis>(productLabel_);
72  if (edm::isDebugEnabled()) {
73  LogTrace("SiStripSpyDigiConverter") << "[sistrip::SpyDigiConverterModule::" << __func__ << "]"
74  << " Constructing object...";
75  }
76 
78  produces<edm::DetSetVector<SiStripRawDigi> >("SpyPayload");
80  produces<edm::DetSetVector<SiStripRawDigi> >("SpyReordered");
82  produces<edm::DetSetVector<SiStripRawDigi> >("SpyVirginRaw");
83 
84  if (storeAPVAddress_) {
85  produces<std::vector<uint32_t> >("APVAddress");
86  //produces<uint8_t>("APVAddress");
87  }
88 
89  frameQuality_.minDigiRange = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinDigiRange"));
90  frameQuality_.maxDigiRange = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxDigiRange"));
91  frameQuality_.minZeroLight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinZeroLight"));
92  frameQuality_.maxZeroLight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxZeroLight"));
93  frameQuality_.minTickHeight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MinTickHeight"));
94  frameQuality_.maxTickHeight = static_cast<uint16_t>(pset.getParameter<uint32_t>("MaxTickHeight"));
95 
96  } // end of constructor.

References frameQuality_, edm::isDebugEnabled(), LogTrace, sistrip::SpyUtilities::FrameQuality::maxDigiRange, sistrip::SpyUtilities::FrameQuality::maxTickHeight, sistrip::SpyUtilities::FrameQuality::maxZeroLight, sistrip::SpyUtilities::FrameQuality::minDigiRange, sistrip::SpyUtilities::FrameQuality::minTickHeight, sistrip::SpyUtilities::FrameQuality::minZeroLight, productLabel_, productToken_, muonDTDigis_cfi::pset, storeAPVAddress_, storeModuleDigis_, storePayloadDigis_, and storeReorderedDigis_.

◆ ~SpyDigiConverterModule()

sistrip::SpyDigiConverterModule::~SpyDigiConverterModule ( )
override

Definition at line 98 of file SiStripSpyDigiConverterModule.cc.

98  {
99  if (edm::isDebugEnabled()) {
100  LogTrace("SiStripSpyDigiConverter") << "[sistrip::SpyDigiConverterModule::" << __func__ << "]"
101  << " Destructing object...";
102  }
103  } // end of destructor.

References edm::isDebugEnabled(), and LogTrace.

Member Function Documentation

◆ produce()

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

Retrieves cabling map from EventSetup and spy channel scope mode digis from Event, creates DetSetVectors of SiStripRawDigis, at verious levels of processing, using the SiStripSpyDigiConverter class and attaches the containers to the Event.

Implements edm::EDProducer.

Definition at line 115 of file SiStripSpyDigiConverterModule.cc.

115  {
116  static bool lFirstEvent = true;
117 
119 
121  return;
122 
123  //retrieve the scope mode digis
125  event.getByToken(productToken_, scopeDigisHandle);
126 
127  //32-bit to accomodate known CMSSW container
128  std::unique_ptr<std::vector<uint32_t> > pAPVAddresses(new std::vector<uint32_t>);
129 
130  std::unique_ptr<sistrip::SpyDigiConverter::DSVRawDigis> payloadDigis, reorderedDigis, moduleDigis;
131 
132  //get the majority value for expected position of first header bit
133  //from first event, compare to expected one, else output warning.
134  if (lFirstEvent) {
135  uint16_t lFirstHeaderBit;
136  sistrip::SpyUtilities::getMajorityHeader(scopeDigisHandle.product(), lFirstHeaderBit);
137 
138  if (lFirstHeaderBit != static_cast<uint16_t>(expectedHeaderBit_)) {
139  edm::LogWarning("") << " -- Majority position for firstHeaderBit in first event (" << lFirstHeaderBit
140  << ") is not where expected: " << static_cast<uint16_t>(expectedHeaderBit_) << std::endl;
141  }
142  }
143 
144  //extract frame digis and APV addresses
145  payloadDigis = sistrip::SpyDigiConverter::extractPayloadDigis(scopeDigisHandle.product(),
146  pAPVAddresses.get(),
149  static_cast<uint16_t>(expectedHeaderBit_));
150 
151  // Reorder
153  reorderedDigis = sistrip::SpyDigiConverter::reorderDigis(payloadDigis.get());
154  }
155 
156  // Merge into modules
157  if (storeModuleDigis_) {
158  moduleDigis = sistrip::SpyDigiConverter::mergeModuleChannels(reorderedDigis.get(), *fedCabling_);
159  }
160 
161  //add to event
162  if (storePayloadDigis_)
163  event.put(std::move(payloadDigis), "SpyPayload");
165  event.put(std::move(reorderedDigis), "SpyReordered");
166  if (storeModuleDigis_)
167  event.put(std::move(moduleDigis), "SpyVirginRaw");
168  if (storeAPVAddress_) {
169  event.put(std::move(pAPVAddresses), "APVAddress");
170  }
171 
172  lFirstEvent = false;
173 
174  } // end of SpyDigiConverter::produce method.

References cablingWatcher_, edm::ESWatcher< T >::check(), discardDigisWithAPVAddressError_, expectedHeaderBit_, sistrip::SpyDigiConverter::extractPayloadDigis(), fedCabling_, frameQuality_, sistrip::SpyUtilities::getMajorityHeader(), sistrip::SpyDigiConverter::mergeModuleChannels(), eostools::move(), edm::Handle< T >::product(), productToken_, sistrip::SpyDigiConverter::reorderDigis(), singleTopDQM_cfi::setup, storeAPVAddress_, storeModuleDigis_, storePayloadDigis_, and storeReorderedDigis_.

◆ updateFedCabling()

void sistrip::SpyDigiConverterModule::updateFedCabling ( const SiStripFedCablingRcd rcd)
private

Member Data Documentation

◆ cablingWatcher_

edm::ESWatcher<SiStripFedCablingRcd> sistrip::SpyDigiConverterModule::cablingWatcher_
private

Definition at line 53 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

◆ discardDigisWithAPVAddressError_

const bool sistrip::SpyDigiConverterModule::discardDigisWithAPVAddressError_
private

Definition at line 47 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

◆ expectedHeaderBit_

const uint32_t sistrip::SpyDigiConverterModule::expectedHeaderBit_
private

Definition at line 48 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce().

◆ fedCabling_

const SiStripFedCabling* sistrip::SpyDigiConverterModule::fedCabling_
private

Definition at line 52 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and updateFedCabling().

◆ fedCablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> sistrip::SpyDigiConverterModule::fedCablingToken_
private

Definition at line 51 of file SiStripSpyDigiConverterModule.cc.

Referenced by updateFedCabling().

◆ frameQuality_

sistrip::SpyUtilities::FrameQuality sistrip::SpyDigiConverterModule::frameQuality_
private

Definition at line 46 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

◆ productLabel_

const edm::InputTag sistrip::SpyDigiConverterModule::productLabel_
private

Definition at line 42 of file SiStripSpyDigiConverterModule.cc.

Referenced by SpyDigiConverterModule().

◆ productToken_

edm::EDGetTokenT<sistrip::SpyDigiConverter::DSVRawDigis> sistrip::SpyDigiConverterModule::productToken_
private

Definition at line 43 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

◆ storeAPVAddress_

const bool sistrip::SpyDigiConverterModule::storeAPVAddress_
private

True = store APVE address for each channel.

Definition at line 44 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

◆ storeModuleDigis_

const bool sistrip::SpyDigiConverterModule::storeModuleDigis_
private

Definition at line 45 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

◆ storePayloadDigis_

const bool sistrip::SpyDigiConverterModule::storePayloadDigis_
private

Definition at line 45 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

◆ storeReorderedDigis_

const bool sistrip::SpyDigiConverterModule::storeReorderedDigis_
private

Definition at line 45 of file SiStripSpyDigiConverterModule.cc.

Referenced by produce(), and SpyDigiConverterModule().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::Handle::product
T const * product() const
Definition: Handle.h:70
sistrip::SpyDigiConverterModule::storeAPVAddress_
const bool storeAPVAddress_
True = store APVE address for each channel.
Definition: SiStripSpyDigiConverterModule.cc:44
sistrip::SpyUtilities::getMajorityHeader
void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
Definition: SiStripSpyUtilities.cc:97
sistrip::SpyDigiConverterModule::frameQuality_
sistrip::SpyUtilities::FrameQuality frameQuality_
Definition: SiStripSpyDigiConverterModule.cc:46
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
sistrip::SpyDigiConverter::extractPayloadDigis
static std::unique_ptr< DSVRawDigis > extractPayloadDigis(const DSVRawDigis *inputScopeDigis, std::vector< uint32_t > *pAPVAddresses, const bool discardDigisWithAPVAddrErr, const sistrip::SpyUtilities::FrameQuality &aQuality, const uint16_t expectedPos)
Extract frames from the scope digis.
Definition: SiStripSpyDigiConverter.cc:25
sistrip::SpyDigiConverterModule::productToken_
edm::EDGetTokenT< sistrip::SpyDigiConverter::DSVRawDigis > productToken_
Definition: SiStripSpyDigiConverterModule.cc:43
sistrip::SpyDigiConverter::reorderDigis
static std::unique_ptr< DSVRawDigis > reorderDigis(const DSVRawDigis *inputPayloadDigis)
Definition: SiStripSpyDigiConverter.cc:177
sistrip::SpyDigiConverterModule::storePayloadDigis_
const bool storePayloadDigis_
Definition: SiStripSpyDigiConverterModule.cc:45
sistrip::SpyDigiConverterModule::productLabel_
const edm::InputTag productLabel_
Definition: SiStripSpyDigiConverterModule.cc:42
sistrip::SpyDigiConverter::mergeModuleChannels
static std::unique_ptr< DSVRawDigis > mergeModuleChannels(const DSVRawDigis *inputPhysicalOrderChannelDigis, const SiStripFedCabling &cabling)
Definition: SiStripSpyDigiConverter.cc:203
sistrip::SpyDigiConverterModule::storeReorderedDigis_
const bool storeReorderedDigis_
Definition: SiStripSpyDigiConverterModule.cc:45
sistrip::SpyDigiConverterModule::storeModuleDigis_
const bool storeModuleDigis_
Definition: SiStripSpyDigiConverterModule.cc:45
sistrip::SpyDigiConverterModule::updateFedCabling
void updateFedCabling(const SiStripFedCablingRcd &rcd)
Definition: SiStripSpyDigiConverterModule.cc:105
sistrip::SpyUtilities::FrameQuality::maxTickHeight
uint16_t maxTickHeight
Definition: SiStripSpyUtilities.h:37
sistrip::SpyUtilities::FrameQuality::minZeroLight
uint16_t minZeroLight
Definition: SiStripSpyUtilities.h:34
sistrip::SpyDigiConverterModule::fedCabling_
const SiStripFedCabling * fedCabling_
Definition: SiStripSpyDigiConverterModule.cc:52
sistrip::SpyDigiConverterModule::cablingWatcher_
edm::ESWatcher< SiStripFedCablingRcd > cablingWatcher_
Definition: SiStripSpyDigiConverterModule.cc:53
eostools.move
def move(src, dest)
Definition: eostools.py:511
sistrip::SpyUtilities::FrameQuality::minDigiRange
uint16_t minDigiRange
Definition: SiStripSpyUtilities.h:32
sistrip::SpyDigiConverterModule::expectedHeaderBit_
const uint32_t expectedHeaderBit_
Definition: SiStripSpyDigiConverterModule.cc:48
sistrip::SpyDigiConverterModule::fedCablingToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
Definition: SiStripSpyDigiConverterModule.cc:51
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
sistrip::SpyUtilities::FrameQuality::maxZeroLight
uint16_t maxZeroLight
Definition: SiStripSpyUtilities.h:35
sistrip::SpyUtilities::FrameQuality::maxDigiRange
uint16_t maxDigiRange
Definition: SiStripSpyUtilities.h:33
sistrip::SpyDigiConverterModule::discardDigisWithAPVAddressError_
const bool discardDigisWithAPVAddressError_
Definition: SiStripSpyDigiConverterModule.cc:47
edm::InputTag
Definition: InputTag.h:15
sistrip::SpyUtilities::FrameQuality::minTickHeight
uint16_t minTickHeight
Definition: SiStripSpyUtilities.h:36
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27