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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 10 of file ShallowDigisProducer.h.

Constructor & Destructor Documentation

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 }
T getParameter(std::string const &) const
std::vector< edm::InputTag > inputTags

Member Function Documentation

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

Definition at line 59 of file ShallowDigisProducer.cc.

References edm::Event::getByLabel(), SimL1EmulatorRepack_Full_cff::inputTag, inputTags, edm::HandleBase::isValid(), and LogDebug.

Referenced by produce().

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 }
#define LogDebug(id)
std::vector< edm::InputTag > inputTags
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 22 of file ShallowDigisProducer.cc.

References ShallowDigisProducer::products::adc, ShallowDigisProducer::products::id, eostools::move(), ShallowDigisProducer::products::noise, edm::Event::put(), ShallowDigisProducer::products::strip, and ShallowDigisProducer::products::subdet.

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

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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
def move(src, dest)
Definition: eostools.py:511
void ShallowDigisProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
overrideprivate

Definition at line 44 of file ShallowDigisProducer.cc.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

44  {
45  products p;
48  es.get<SiStripNoisesRcd>().get(noiseHandle);
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 }
edm::ESHandle< SiStripNoises > noiseHandle
void insert(products &, edm::Event &)
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&...args)
Definition: ESProducts.h:128
void recordDigis(const T &, products &)
bool findInput(edm::Handle< T > &, const edm::Event &)
T get() const
Definition: EventSetup.h:73
template<class T >
void ShallowDigisProducer::recordDigis ( const T digiCollection,
products p 
)
inlineprivate

Definition at line 31 of file ShallowDigisProducer.cc.

References ShallowDigisProducer::products::adc, SiStripNoises::getNoise(), SiStripNoises::getRange(), ShallowDigisProducer::products::id, ShallowDigisProducer::products::noise, noiseHandle, ShallowDigisProducer::products::strip, and ShallowDigisProducer::products::subdet.

Referenced by produce().

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 }
edm::ESHandle< SiStripNoises > noiseHandle
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:71
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47

Member Data Documentation

std::vector<edm::InputTag> ShallowDigisProducer::inputTags
private
edm::ESHandle<SiStripNoises> ShallowDigisProducer::noiseHandle
private

Definition at line 29 of file ShallowDigisProducer.h.

Referenced by produce(), and recordDigis().