CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripProcessedRawDigiProducer Class Reference

#include <SiStripProcessedRawDigiProducer.h>

Inheritance diagram for SiStripProcessedRawDigiProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 SiStripProcessedRawDigiProducer (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void common_process (const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 
template<class T >
std::string findInput (edm::Handle< T > &handle, const edm::Event &e)
 
void pr_process (const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 
void produce (edm::Event &e, const edm::EventSetup &es)
 
void vr_process (const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 
void zs_process (const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
 

Private Attributes

edm::ESHandle< SiStripGaingainHandle
 
std::vector< edm::InputTaginputTags
 
std::auto_ptr
< SiStripCommonModeNoiseSubtractor
subtractorCMN
 
std::auto_ptr
< SiStripPedestalsSubtractor
subtractorPed
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 22 of file SiStripProcessedRawDigiProducer.h.

Constructor & Destructor Documentation

SiStripProcessedRawDigiProducer::SiStripProcessedRawDigiProducer ( edm::ParameterSet const &  conf)
explicit

Definition at line 17 of file SiStripProcessedRawDigiProducer.cc.

18  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")),
21 
22  produces< edm::DetSetVector<SiStripProcessedRawDigi> >("");
23 }
std::auto_ptr< SiStripPedestalsSubtractor > subtractorPed
static std::auto_ptr< SiStripCommonModeNoiseSubtractor > create_SubtractorCMN(const edm::ParameterSet &)
tuple conf
Definition: dbtoconf.py:185
std::auto_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
static std::auto_ptr< SiStripPedestalsSubtractor > create_SubtractorPed(const edm::ParameterSet &)

Member Function Documentation

void SiStripProcessedRawDigiProducer::common_process ( const uint32_t  detId,
std::vector< float > &  digis,
edm::DetSetVector< SiStripProcessedRawDigi > &  output 
)
private

Definition at line 99 of file SiStripProcessedRawDigiProducer.cc.

References filterCSVwithJSON::copy, edm::DetSet< T >::data, gainHandle, and edm::DetSetVector< T >::insert().

Referenced by pr_process(), vr_process(), and zs_process().

99  {
100 
101  //Apply Gains
102  SiStripApvGain::Range detGainRange = gainHandle->getRange(detId);
103  for(std::vector<float>::iterator it=digis.begin(); it<digis.end(); it++)
104  (*it)/= (gainHandle->getStripGain(it-digis.begin(), detGainRange));
105 
106  //Insert as DetSet
108  copy(digis.begin(), digis.end(), back_inserter(ds.data) );
109  output.insert(ds);
110 }
std::pair< ContainerIterator, ContainerIterator > Range
void insert(detset const &s)
Insert the given DetSet.
Definition: DetSetVector.h:234
template<class T >
std::string SiStripProcessedRawDigiProducer::findInput ( edm::Handle< T > &  handle,
const edm::Event e 
)
inlineprivate

Definition at line 49 of file SiStripProcessedRawDigiProducer.cc.

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

Referenced by produce().

49  {
50 
51  for( std::vector<edm::InputTag>::const_iterator
52  inputTag = inputTags.begin(); inputTag != inputTags.end(); ++inputTag ) {
53 
54  e.getByLabel(*inputTag, handle);
55  if( handle.isValid() && !handle->empty() ) {
56  edm::LogInfo("Input") << *inputTag;
57  return inputTag->instance();
58  }
59  }
60  return "Input Not Found";
61 }
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void SiStripProcessedRawDigiProducer::pr_process ( const edm::DetSetVector< SiStripRawDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output 
)
private

Definition at line 78 of file SiStripProcessedRawDigiProducer.cc.

References SiStripRawDigi::adc(), edm::DetSetVector< T >::begin(), common_process(), edm::DetSetVector< T >::end(), subtractorCMN, and create_public_pileup_plots::transform.

Referenced by produce().

78  {
79  for(edm::DetSetVector<SiStripRawDigi>::const_iterator detset=input.begin(); detset!=input.end(); detset++) {
80  std::vector<float> digis;
81  transform(detset->begin(), detset->end(), back_inserter(digis), boost::bind(&SiStripRawDigi::adc , _1));
82  subtractorCMN->subtract(detset->id, 0, digis);
83  common_process( detset->id, digis, output);
84  }
85 }
const uint16_t & adc() const
void common_process(const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
std::auto_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
void SiStripProcessedRawDigiProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 26 of file SiStripProcessedRawDigiProducer.cc.

References findInput(), gainHandle, edm::EventSetup::get(), CommPDSkim_cfg::inputDigis, diffTwoXMLs::label, convertSQLitetoXML_cfg::output, pr_process(), edm::Event::put(), subtractorCMN, subtractorPed, vr_process(), and zs_process().

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

26  {
27 
28  std::auto_ptr< edm::DetSetVector<SiStripProcessedRawDigi> > output(new edm::DetSetVector<SiStripProcessedRawDigi>());
31 
32  es.get<SiStripGainRcd>().get(gainHandle);
33  subtractorPed->init(es);
34  subtractorCMN->init(es);
35 
36  std::string label = findInput(inputRawdigis, e);
37  if( "VirginRaw" == label ) vr_process(*inputRawdigis, *output);
38  else if( "ProcessedRaw" == label ) pr_process(*inputRawdigis, *output);
39  else if( "ZeroSuppressed" == findInput(inputDigis,e) ) zs_process(*inputDigis, *output);
40  else
41  edm::LogError("Input Not Found");
42 
43  e.put(output);
44 }
std::auto_ptr< SiStripPedestalsSubtractor > subtractorPed
void pr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::string findInput(edm::Handle< T > &handle, const edm::Event &e)
std::auto_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
const T & get() const
Definition: EventSetup.h:55
void zs_process(const edm::DetSetVector< SiStripDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
void vr_process(const edm::DetSetVector< SiStripRawDigi > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
void SiStripProcessedRawDigiProducer::vr_process ( const edm::DetSetVector< SiStripRawDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output 
)
private

Definition at line 88 of file SiStripProcessedRawDigiProducer.cc.

References edm::DetSetVector< T >::begin(), common_process(), edm::DetSetVector< T >::end(), subtractorCMN, and subtractorPed.

Referenced by produce().

88  {
89  for(edm::DetSetVector<SiStripRawDigi>::const_iterator detset=input.begin(); detset!=input.end(); detset++) {
90  std::vector<int16_t> int_digis(detset->size());
91  subtractorPed->subtract(*detset,int_digis);
92  std::vector<float> digis(int_digis.begin(), int_digis.end());
93  subtractorCMN->subtract(detset->id, 0, digis);
94  common_process( detset->id, digis, output);
95  }
96 }
std::auto_ptr< SiStripPedestalsSubtractor > subtractorPed
void common_process(const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
std::auto_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
void SiStripProcessedRawDigiProducer::zs_process ( const edm::DetSetVector< SiStripDigi > &  input,
edm::DetSetVector< SiStripProcessedRawDigi > &  output 
)
private

Definition at line 65 of file SiStripProcessedRawDigiProducer.cc.

References edm::DetSetVector< T >::begin(), common_process(), and edm::DetSetVector< T >::end().

Referenced by produce().

65  {
66  std::vector<float> digis;
67  for(edm::DetSetVector<SiStripDigi>::const_iterator detset = input.begin(); detset != input.end(); detset++ ) {
68  digis.clear();
69  for(edm::DetSet<SiStripDigi>::const_iterator digi = detset->begin(); digi != detset->end(); digi++) {
70  digis.resize( digi->strip(), 0);
71  digis.push_back( digi->adc() );
72  }
73  common_process( detset->id, digis, output);
74  }
75 }
void common_process(const uint32_t, std::vector< float > &, edm::DetSetVector< SiStripProcessedRawDigi > &)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106

Member Data Documentation

edm::ESHandle<SiStripGain> SiStripProcessedRawDigiProducer::gainHandle
private

Definition at line 40 of file SiStripProcessedRawDigiProducer.h.

Referenced by common_process(), and produce().

std::vector<edm::InputTag> SiStripProcessedRawDigiProducer::inputTags
private
std::auto_ptr<SiStripCommonModeNoiseSubtractor> SiStripProcessedRawDigiProducer::subtractorCMN
private

Definition at line 43 of file SiStripProcessedRawDigiProducer.h.

Referenced by pr_process(), produce(), and vr_process().

std::auto_ptr<SiStripPedestalsSubtractor> SiStripProcessedRawDigiProducer::subtractorPed
private

Definition at line 42 of file SiStripProcessedRawDigiProducer.h.

Referenced by produce(), and vr_process().