CMS 3D CMS Logo

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

#include <ShallowDigisProducer.h>

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

Classes

struct  products
 

Public Member Functions

 ShallowDigisProducer (const edm::ParameterSet &)
 
- 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

template<class T >
bool findInput (edm::Handle< T > &, const edm::Event &)
 
void insert (products &, edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
template<class T >
void recordDigis (const T &, products &)
 

Private Attributes

std::vector< edm::InputTaginputTags
 
edm::ESHandle< SiStripNoisesnoiseHandle
 

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 10 of file ShallowDigisProducer.h.

Constructor & Destructor Documentation

◆ ShallowDigisProducer()

ShallowDigisProducer::ShallowDigisProducer ( const edm::ParameterSet conf)
explicit

Definition at line 13 of file ShallowDigisProducer.cc.

14  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")) {
15  produces<std::vector<unsigned> >("id");
16  produces<std::vector<unsigned> >("subdet");
17  produces<std::vector<unsigned> >("strip");
18  produces<std::vector<unsigned> >("adc");
19  produces<std::vector<float> >("noise");
20 }

Member Function Documentation

◆ findInput()

template<class T >
bool ShallowDigisProducer::findInput ( edm::Handle< T > &  handle,
const edm::Event e 
)
inlineprivate

Definition at line 59 of file ShallowDigisProducer.cc.

59  {
60  for (auto const& inputTag : inputTags) {
61  e.getByLabel(inputTag, handle);
62  if (handle.isValid() && !handle->empty()) {
63  LogDebug("Input") << inputTag;
64  return true;
65  }
66  }
67  return false;
68 }

References MillePedeFileConverter_cfg::e, patZpeak::handle, SimL1EmulatorRepack_Full_cff::inputTag, inputTags, and LogDebug.

Referenced by produce().

◆ insert()

void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 22 of file ShallowDigisProducer.cc.

22  {
23  e.put(std::move(p.id), "id");
24  e.put(std::move(p.subdet), "subdet");
25  e.put(std::move(p.strip), "strip");
26  e.put(std::move(p.adc), "adc");
27  e.put(std::move(p.noise), "noise");
28 }

References MillePedeFileConverter_cfg::e, eostools::move(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.PageElement::append(), and produce().

◆ produce()

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

Implements edm::EDProducer.

Definition at line 44 of file ShallowDigisProducer.cc.

44  {
45  products p;
49  if (findInput(inputOld, e))
50  recordDigis(*inputOld, p);
51  else if (findInput(inputNew, e))
52  recordDigis(*inputNew, p);
53  else
54  edm::LogWarning("Input Not Found");
55  insert(p, e);
56 }

References MillePedeFileConverter_cfg::e, findInput(), edm::EventSetup::get(), get, insert(), noiseHandle, AlCaHLTBitMon_ParallelJobs::p, and recordDigis().

◆ recordDigis()

template<class T >
void ShallowDigisProducer::recordDigis ( const T digiCollection,
products p 
)
inlineprivate

Definition at line 31 of file ShallowDigisProducer.cc.

31  {
32  for (auto const& set : digiCollection) {
33  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId());
34  for (auto const& digi : set) {
35  p.id->push_back(set.detId());
36  p.subdet->push_back((set.detId() >> 25) & 0x7);
37  p.strip->push_back(digi.strip());
38  p.adc->push_back(digi.adc());
39  p.noise->push_back(noiseHandle->getNoise(digi.strip(), detNoiseRange));
40  }
41  }
42 }

References apvshotsanalyzer_cfi::digiCollection, SiStripNoises::getNoise(), SiStripNoises::getRange(), noiseHandle, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by produce().

Member Data Documentation

◆ inputTags

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

Definition at line 28 of file ShallowDigisProducer.h.

Referenced by findInput().

◆ noiseHandle

edm::ESHandle<SiStripNoises> ShallowDigisProducer::noiseHandle
private

Definition at line 29 of file ShallowDigisProducer.h.

Referenced by produce(), and recordDigis().

ShallowDigisProducer::recordDigis
void recordDigis(const T &, products &)
Definition: ShallowDigisProducer.cc:31
patZpeak.handle
handle
Definition: patZpeak.py:23
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ShallowDigisProducer::insert
void insert(products &, edm::Event &)
Definition: ShallowDigisProducer.cc:22
SiStripNoises::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripNoises.cc:34
edm::Handle
Definition: AssociativeIterator.h:50
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
edm::es::products
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ShallowDigisProducer::findInput
bool findInput(edm::Handle< T > &, const edm::Event &)
Definition: ShallowDigisProducer.cc:59
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
edm::LogWarning
Definition: MessageLogger.h:141
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
ShallowDigisProducer::inputTags
std::vector< edm::InputTag > inputTags
Definition: ShallowDigisProducer.h:28
SiStripNoises::getNoise
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:71
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
ShallowDigisProducer::noiseHandle
edm::ESHandle< SiStripNoises > noiseHandle
Definition: ShallowDigisProducer.h:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37