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 () 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 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 14 of file ShallowDigisProducer.cc.

References insert().

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

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

Referenced by produce().

64  {
65  BOOST_FOREACH( const edm::InputTag inputTag, inputTags) {
66  e.getByLabel(inputTag, handle);
67  if( handle.isValid() && !handle->empty() ) {
68  LogDebug("Input") << inputTag;
69  return true;
70  }
71  }
72  return false;
73 }
#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:475
void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 25 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().

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

Definition at line 50 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().

50  {
51  products p;
54  es.get<SiStripNoisesRcd>().get(noiseHandle);
55  if( findInput(inputOld, e) ) recordDigis(*inputOld, p); else
56  if( findInput(inputNew, e) ) recordDigis(*inputNew, p); else
57  edm::LogWarning("Input Not Found");
58  insert(p,e);
59 }
edm::ESHandle< SiStripNoises > noiseHandle
void insert(products &, edm::Event &)
ESProducts< T, S > products(const T &i1, const S &i2)
Definition: ESProducts.h:191
void recordDigis(const T &, products &)
const T & get() const
Definition: EventSetup.h:59
bool findInput(edm::Handle< T > &, const edm::Event &)
template<class T >
void ShallowDigisProducer::recordDigis ( const T digiCollection,
products p 
)
inlineprivate

Definition at line 36 of file ShallowDigisProducer.cc.

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

Referenced by insert(), and produce().

36  {
37  BOOST_FOREACH(const typename T::value_type set, digiCollection) {
38  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId());
39  BOOST_FOREACH(const SiStripDigi digi, set) {
40  p.id->push_back(set.detId());
41  p.subdet->push_back((set.detId()>>25)&0x7);
42  p.strip->push_back(digi.strip());
43  p.adc->push_back(digi.adc());
44  p.noise->push_back(noiseHandle->getNoise( digi.strip(), detNoiseRange));
45  }
46  }
47 }
edm::ESHandle< SiStripNoises > noiseHandle
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:74
const uint16_t & strip() const
Definition: SiStripDigi.h:40
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50
const uint16_t & adc() const
Definition: SiStripDigi.h:41

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().