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
 
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)
 
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::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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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.

References insert().

14  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList"))
15 {
16  produces<std::vector<unsigned> >("id");
17  produces<std::vector<unsigned> >("subdet");
18  produces<std::vector<unsigned> >("strip");
19  produces<std::vector<unsigned> >("adc");
20  produces<std::vector<float> >("noise");
21 }
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 63 of file ShallowDigisProducer.cc.

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

Referenced by produce().

63  {
64  for(auto const& inputTag : inputTags) {
65  e.getByLabel(inputTag, handle);
66  if( handle.isValid() && !handle->empty() ) {
67  LogDebug("Input") << inputTag;
68  return true;
69  }
70  }
71  return false;
72 }
#define LogDebug(id)
std::vector< edm::InputTag > inputTags
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 24 of file ShallowDigisProducer.cc.

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

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

24  {
25  e.put(std::move(p.id), "id");
26  e.put(std::move(p.subdet), "subdet");
27  e.put(std::move(p.strip), "strip");
28  e.put(std::move(p.adc), "adc");
29  e.put(std::move(p.noise), "noise");
30 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
def move(src, dest)
Definition: eostools.py:511
void ShallowDigisProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
overrideprivate

Definition at line 49 of file ShallowDigisProducer.cc.

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

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

49  {
50  products p;
53  es.get<SiStripNoisesRcd>().get(noiseHandle);
54  if( findInput(inputOld, e) ) recordDigis(*inputOld, p); else
55  if( findInput(inputNew, e) ) recordDigis(*inputNew, p); else
56  edm::LogWarning("Input Not Found");
57  insert(p,e);
58 }
edm::ESHandle< SiStripNoises > noiseHandle
void insert(products &, edm::Event &)
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&...args)
Definition: ESProducts.h:129
void recordDigis(const T &, products &)
bool findInput(edm::Handle< T > &, const edm::Event &)
T get() const
Definition: EventSetup.h:68
template<class T >
void ShallowDigisProducer::recordDigis ( const T digiCollection,
products p 
)
inlineprivate

Definition at line 35 of file ShallowDigisProducer.cc.

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

Referenced by insert(), and produce().

35  {
36  for(auto const& set : digiCollection) {
37  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId());
38  for(auto const& digi : set) {
39  p.id->push_back(set.detId());
40  p.subdet->push_back((set.detId()>>25)&0x7);
41  p.strip->push_back(digi.strip());
42  p.adc->push_back(digi.adc());
43  p.noise->push_back(noiseHandle->getNoise( digi.strip(), detNoiseRange));
44  }
45  }
46 }
edm::ESHandle< SiStripNoises > noiseHandle
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:74
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50

Member Data Documentation

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

Definition at line 31 of file ShallowDigisProducer.h.

Referenced by produce(), and recordDigis().