CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

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(), beam_dqm_sourceclient-live_cfg::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:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 25 of file ShallowDigisProducer.cc.

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

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

25  {
26  e.put(p.id, "id");
27  e.put(p.subdet, "subdet");
28  e.put(p.strip, "strip");
29  e.put(p.adc, "adc");
30  e.put(p.noise, "noise");
31 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
void ShallowDigisProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
privatevirtual

Implements edm::EDProducer.

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(), and HTMLExport.HTMLExportStatic::export().

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:189
void recordDigis(const T &, products &)
const T & get() const
Definition: EventSetup.h:56
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(), ShallowDigisProducer::products::id, ShallowDigisProducer::products::noise, noiseHandle, ShallowDigisProducer::products::strip, SiStripDigi::strip(), and ShallowDigisProducer::products::subdet.

Referenced by 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
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
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:48
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().