CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripProcessedRawDigiProducer Class Reference

#include <SiStripProcessedRawDigiProducer.h>

Inheritance diagram for SiStripProcessedRawDigiProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiStripProcessedRawDigiProducer (edm::ParameterSet const &)
 
- 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 common_process (const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
 
template<class T >
std::string findInput (edm::Handle< T > &handle, const std::vector< edm::EDGetTokenT< T > > &tokens, const edm::Event &e)
 
void pr_process (const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
void vr_process (const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
 
void zs_process (const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
 

Private Attributes

edm::ESGetToken< SiStripGain, SiStripGainRcdgainToken_
 
std::vector< edm::InputTaginputTags_
 
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > > inputTokensDigi_
 
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > > inputTokensRawDigi_
 
std::unique_ptr< SiStripCommonModeNoiseSubtractorsubtractorCMN_
 
std::unique_ptr< SiStripPedestalsSubtractorsubtractorPed_
 

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 23 of file SiStripProcessedRawDigiProducer.h.

Constructor & Destructor Documentation

◆ SiStripProcessedRawDigiProducer()

SiStripProcessedRawDigiProducer::SiStripProcessedRawDigiProducer ( edm::ParameterSet const &  conf)
explicit

Definition at line 15 of file SiStripProcessedRawDigiProducer.cc.

16  : inputTags_(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")),
18  inputTags_, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripDigi> >(tag); })),
20  inputTags_, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripRawDigi> >(tag); })),
24  produces<edm::DetSetVector<SiStripProcessedRawDigi> >("");
25 }

References makeGlobalPositionRcd_cfg::tag.

Member Function Documentation

◆ common_process()

void SiStripProcessedRawDigiProducer::common_process ( const uint32_t  detId,
std::vector< float > &  digis,
edm::DetSetVector< SiStripProcessedRawDigi > &  output,
const SiStripGain gain 
)
private

Definition at line 103 of file SiStripProcessedRawDigiProducer.cc.

106  {
107  //Apply Gains
108  SiStripApvGain::Range detGainRange = gain.getRange(detId);
109  for (std::vector<float>::iterator it = digis.begin(); it < digis.end(); ++it)
110  (*it) /= (gain.getStripGain(it - digis.begin(), detGainRange));
111 
112  //Insert as DetSet
114  copy(digis.begin(), digis.end(), back_inserter(ds.data));
115  output.insert(ds);
116 }

References filterCSVwithJSON::copy, edm::DetSet< T >::data, PedestalClient_cfi::gain, and convertSQLitetoXML_cfg::output.

Referenced by pr_process(), vr_process(), and zs_process().

◆ findInput()

template<class T >
std::string SiStripProcessedRawDigiProducer::findInput ( edm::Handle< T > &  handle,
const std::vector< edm::EDGetTokenT< T > > &  tokens,
const edm::Event e 
)
inlineprivate

Definition at line 50 of file SiStripProcessedRawDigiProducer.cc.

52  {
53  for (typename std::vector<edm::EDGetTokenT<T> >::const_iterator token = tokens.begin(); token != tokens.end();
54  ++token) {
55  unsigned index(token - tokens.begin());
56  e.getByToken(*token, handle);
57  if (handle.isValid() && !handle->empty()) {
58  edm::LogInfo("Input") << inputTags_.at(index);
59  return inputTags_.at(index).instance();
60  }
61  }
62  return "Input Not Found";
63 }

References MillePedeFileConverter_cfg::e, patZpeak::handle, inputTags_, unpackBuffers-CaloStage2::token, and trackerHitRTTI::vector.

Referenced by produce().

◆ pr_process()

void SiStripProcessedRawDigiProducer::pr_process ( const edm::DetSetVector< SiStripRawDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output,
const SiStripGain gain 
)
private

Definition at line 79 of file SiStripProcessedRawDigiProducer.cc.

81  {
82  for (edm::DetSetVector<SiStripRawDigi>::const_iterator detset = input.begin(); detset != input.end(); ++detset) {
83  std::vector<float> digis;
84  transform(
85  detset->begin(), detset->end(), back_inserter(digis), std::bind(&SiStripRawDigi::adc, std::placeholders::_1));
86  subtractorCMN_->subtract(detset->id, 0, digis);
87  common_process(detset->id, digis, output, gain);
88  }
89 }

References SiStripRawDigi::adc(), common_process(), PedestalClient_cfi::gain, input, convertSQLitetoXML_cfg::output, subtractorCMN_, and HcalDetIdTransform::transform().

Referenced by produce().

◆ produce()

void SiStripProcessedRawDigiProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 27 of file SiStripProcessedRawDigiProducer.cc.

27  {
28  std::unique_ptr<edm::DetSetVector<SiStripProcessedRawDigi> > output(new edm::DetSetVector<SiStripProcessedRawDigi>());
31 
32  const auto& gain = es.getData(gainToken_);
33  subtractorPed_->init(es);
34  subtractorCMN_->init(es);
35 
36  std::string label = findInput(inputRawdigis, inputTokensRawDigi_, e);
37  if ("VirginRaw" == label)
38  vr_process(*inputRawdigis, *output, gain);
39  else if ("ProcessedRaw" == label)
40  pr_process(*inputRawdigis, *output, gain);
41  else if ("ZeroSuppressed" == findInput(inputDigis, inputTokensDigi_, e))
43  else
44  edm::LogError("Input Not Found");
45 
46  e.put(std::move(output));
47 }

References MillePedeFileConverter_cfg::e, findInput(), PedestalClient_cfi::gain, gainToken_, edm::EventSetup::getData(), CommPDSkim_cfg::inputDigis, inputTokensDigi_, inputTokensRawDigi_, label, eostools::move(), convertSQLitetoXML_cfg::output, pr_process(), AlCaHLTBitMon_QueryRunRegistry::string, subtractorCMN_, subtractorPed_, vr_process(), and zs_process().

◆ vr_process()

void SiStripProcessedRawDigiProducer::vr_process ( const edm::DetSetVector< SiStripRawDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output,
const SiStripGain gain 
)
private

Definition at line 91 of file SiStripProcessedRawDigiProducer.cc.

93  {
94  for (edm::DetSetVector<SiStripRawDigi>::const_iterator detset = input.begin(); detset != input.end(); ++detset) {
95  std::vector<int16_t> int_digis(detset->size());
96  subtractorPed_->subtract(*detset, int_digis);
97  std::vector<float> digis(int_digis.begin(), int_digis.end());
98  subtractorCMN_->subtract(detset->id, 0, digis);
99  common_process(detset->id, digis, output, gain);
100  }
101 }

References common_process(), PedestalClient_cfi::gain, input, convertSQLitetoXML_cfg::output, subtractorCMN_, and subtractorPed_.

Referenced by produce().

◆ zs_process()

void SiStripProcessedRawDigiProducer::zs_process ( const edm::DetSetVector< SiStripDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output,
const SiStripGain gain 
)
private

Definition at line 65 of file SiStripProcessedRawDigiProducer.cc.

67  {
68  std::vector<float> digis;
69  for (edm::DetSetVector<SiStripDigi>::const_iterator detset = input.begin(); detset != input.end(); ++detset) {
70  digis.clear();
71  for (edm::DetSet<SiStripDigi>::const_iterator digi = detset->begin(); digi != detset->end(); ++digi) {
72  digis.resize(digi->strip(), 0);
73  digis.push_back(digi->adc());
74  }
75  common_process(detset->id, digis, output, gain);
76  }
77 }

References common_process(), PedestalClient_cfi::gain, input, and convertSQLitetoXML_cfg::output.

Referenced by produce().

Member Data Documentation

◆ gainToken_

edm::ESGetToken<SiStripGain, SiStripGainRcd> SiStripProcessedRawDigiProducer::gainToken_
private

Definition at line 49 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce().

◆ inputTags_

std::vector<edm::InputTag> SiStripProcessedRawDigiProducer::inputTags_
private

Definition at line 46 of file SiStripProcessedRawDigiProducer.h.

Referenced by findInput().

◆ inputTokensDigi_

std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > > SiStripProcessedRawDigiProducer::inputTokensDigi_
private

Definition at line 47 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce().

◆ inputTokensRawDigi_

std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > > SiStripProcessedRawDigiProducer::inputTokensRawDigi_
private

Definition at line 48 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce().

◆ subtractorCMN_

std::unique_ptr<SiStripCommonModeNoiseSubtractor> SiStripProcessedRawDigiProducer::subtractorCMN_
private

Definition at line 52 of file SiStripProcessedRawDigiProducer.h.

Referenced by pr_process(), produce(), and vr_process().

◆ subtractorPed_

std::unique_ptr<SiStripPedestalsSubtractor> SiStripProcessedRawDigiProducer::subtractorPed_
private

Definition at line 51 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce(), and vr_process().

edm::DetSetVector
Definition: DetSetVector.h:61
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripProcessedRawDigiProducer::inputTokensDigi_
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > > inputTokensDigi_
Definition: SiStripProcessedRawDigiProducer.h:47
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
patZpeak.handle
handle
Definition: patZpeak.py:23
SiStripProcessedRawDigiProducer::subtractorCMN_
std::unique_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN_
Definition: SiStripProcessedRawDigiProducer.h:52
edm::EDGetTokenT
Definition: EDGetToken.h:33
SiStripProcessedRawDigiProducer::subtractorPed_
std::unique_ptr< SiStripPedestalsSubtractor > subtractorPed_
Definition: SiStripProcessedRawDigiProducer.h:51
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
SiStripProcessedRawDigiProducer::zs_process
void zs_process(const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
Definition: SiStripProcessedRawDigiProducer.cc:65
SiStripProcessedRawDigiProducer::inputTags_
std::vector< edm::InputTag > inputTags_
Definition: SiStripProcessedRawDigiProducer.h:46
SiStripProcessedRawDigiProducer::pr_process
void pr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
Definition: SiStripProcessedRawDigiProducer.cc:79
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripProcessedRawDigiProducer::common_process
void common_process(const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
Definition: SiStripProcessedRawDigiProducer.cc:103
edm::Handle
Definition: AssociativeIterator.h:50
SiStripProcessedRawDigiProducer::vr_process
void vr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &, const SiStripGain &)
Definition: SiStripProcessedRawDigiProducer.cc:91
SiStripRawDigi::adc
uint16_t adc() const
Definition: SiStripRawDigi.h:22
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
SiStripRawProcessingFactory::create_SubtractorCMN
static std::unique_ptr< SiStripCommonModeNoiseSubtractor > create_SubtractorCMN(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:34
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
SiStripProcessedRawDigiProducer::inputTokensRawDigi_
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > > inputTokensRawDigi_
Definition: SiStripProcessedRawDigiProducer.h:48
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
SiStripProcessedRawDigiProducer::gainToken_
edm::ESGetToken< SiStripGain, SiStripGainRcd > gainToken_
Definition: SiStripProcessedRawDigiProducer.h:49
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
CommPDSkim_cfg.inputDigis
inputDigis
Definition: CommPDSkim_cfg.py:68
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
SiStripRawProcessingFactory::create_SubtractorPed
static std::unique_ptr< SiStripPedestalsSubtractor > create_SubtractorPed(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:28
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
SiStripProcessedRawDigiProducer::findInput
std::string findInput(edm::Handle< T > &handle, const std::vector< edm::EDGetTokenT< T > > &tokens, const edm::Event &e)
Definition: SiStripProcessedRawDigiProducer.cc:50
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31