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
 
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 common_process (const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 
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 > &)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
void vr_process (const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 
void zs_process (const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 

Private Attributes

edm::ESHandle< SiStripGaingainHandle
 
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 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>
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)
 
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 22 of file SiStripProcessedRawDigiProducer.h.

Constructor & Destructor Documentation

◆ SiStripProcessedRawDigiProducer()

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

Definition at line 20 of file SiStripProcessedRawDigiProducer.cc.

21  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")),
23  inputTags, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripDigi> >(tag); })),
25  inputTags, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripRawDigi> >(tag); })),
28  produces<edm::DetSetVector<SiStripProcessedRawDigi> >("");
29 }

References GlobalPosition_Frontier_DevDB_cff::tag.

Member Function Documentation

◆ common_process()

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

Definition at line 103 of file SiStripProcessedRawDigiProducer.cc.

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

References filterCSVwithJSON::copy, edm::DetSet< T >::data, gainHandle, SiStripGain::getRange(), SiStripGain::getStripGain(), 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 54 of file SiStripProcessedRawDigiProducer.cc.

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

References MillePedeFileConverter_cfg::e, patZpeak::handle, inputTags, and unpackBuffers-CaloStage2::token.

Referenced by produce().

◆ pr_process()

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

Definition at line 82 of file SiStripProcessedRawDigiProducer.cc.

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

References SiStripRawDigi::adc(), common_process(), 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 31 of file SiStripProcessedRawDigiProducer.cc.

31  {
32  std::unique_ptr<edm::DetSetVector<SiStripProcessedRawDigi> > output(new edm::DetSetVector<SiStripProcessedRawDigi>());
35 
37  subtractorPed->init(es);
38  subtractorCMN->init(es);
39 
40  std::string label = findInput(inputRawdigis, inputTokensRawDigi, e);
41  if ("VirginRaw" == label)
42  vr_process(*inputRawdigis, *output);
43  else if ("ProcessedRaw" == label)
44  pr_process(*inputRawdigis, *output);
45  else if ("ZeroSuppressed" == findInput(inputDigis, inputTokensDigi, e))
47  else
48  edm::LogError("Input Not Found");
49 
50  e.put(std::move(output));
51 }

References MillePedeFileConverter_cfg::e, findInput(), gainHandle, edm::EventSetup::get(), get, 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 
)
private

Definition at line 92 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);
100  }
101 }

References common_process(), 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 
)
private

Definition at line 69 of file SiStripProcessedRawDigiProducer.cc.

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

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

Referenced by produce().

Member Data Documentation

◆ gainHandle

edm::ESHandle<SiStripGain> SiStripProcessedRawDigiProducer::gainHandle
private

Definition at line 39 of file SiStripProcessedRawDigiProducer.h.

Referenced by common_process(), and produce().

◆ inputTags

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

Definition at line 36 of file SiStripProcessedRawDigiProducer.h.

Referenced by findInput().

◆ inputTokensDigi

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

Definition at line 37 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce().

◆ inputTokensRawDigi

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

Definition at line 38 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce().

◆ subtractorCMN

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

Definition at line 42 of file SiStripProcessedRawDigiProducer.h.

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

◆ subtractorPed

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

Definition at line 41 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce(), and vr_process().

SiStripRawProcessingFactory::create_SubtractorPed
static std::unique_ptr< SiStripPedestalsSubtractor > create_SubtractorPed(const edm::ParameterSet &)
Definition: SiStripRawProcessingFactory.cc:23
edm::DetSetVector
Definition: DetSetVector.h:61
SiStripGainRcd
Definition: SiStripDependentRecords.h:29
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripProcessedRawDigiProducer::vr_process
void vr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
Definition: SiStripProcessedRawDigiProducer.cc:92
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm::LogInfo
Definition: MessageLogger.h:254
edm::Handle
Definition: AssociativeIterator.h:50
SiStripProcessedRawDigiProducer::zs_process
void zs_process(const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
Definition: SiStripProcessedRawDigiProducer.cc:69
SiStripGain::getStripGain
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:73
SiStripProcessedRawDigiProducer::inputTokensDigi
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > > inputTokensDigi
Definition: SiStripProcessedRawDigiProducer.h:37
SiStripProcessedRawDigiProducer::inputTags
std::vector< edm::InputTag > inputTags
Definition: SiStripProcessedRawDigiProducer.h:36
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
SiStripGain::getRange
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:71
SiStripRawDigi::adc
uint16_t adc() const
Definition: SiStripRawDigi.h:22
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
SiStripProcessedRawDigiProducer::subtractorPed
std::unique_ptr< SiStripPedestalsSubtractor > subtractorPed
Definition: SiStripProcessedRawDigiProducer.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
SiStripProcessedRawDigiProducer::inputTokensRawDigi
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > > inputTokensRawDigi
Definition: SiStripProcessedRawDigiProducer.h:38
edm::LogError
Definition: MessageLogger.h:183
SiStripProcessedRawDigiProducer::subtractorCMN
std::unique_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
Definition: SiStripProcessedRawDigiProducer.h:42
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
SiStripProcessedRawDigiProducer::pr_process
void pr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
Definition: SiStripProcessedRawDigiProducer.cc:82
SiStripProcessedRawDigiProducer::gainHandle
edm::ESHandle< SiStripGain > gainHandle
Definition: SiStripProcessedRawDigiProducer.h:39
get
#define get
SiStripRawProcessingFactory::create_SubtractorCMN
static std::unique_ptr< SiStripCommonModeNoiseSubtractor > create_SubtractorCMN(const edm::ParameterSet &)
Definition: SiStripRawProcessingFactory.cc:29
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
SiStripProcessedRawDigiProducer::common_process
void common_process(const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
Definition: SiStripProcessedRawDigiProducer.cc:103
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:54
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