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 Attributes
ESZeroSuppressionProducer Class Reference

#include <ESZeroSuppressionProducer.h>

Inheritance diagram for ESZeroSuppressionProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESZeroSuppressionProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual ~ESZeroSuppressionProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string digiProducer_
 
std::string ESdigiCollection_
 
edm::ESHandle< ESPedestalsespeds_
 
edm::ESHandle< ESThresholdsesthresholds_
 
std::string ESZSdigiCollection_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 19 of file ESZeroSuppressionProducer.h.

Constructor & Destructor Documentation

ESZeroSuppressionProducer::ESZeroSuppressionProducer ( const edm::ParameterSet ps)
explicit
ESZeroSuppressionProducer::~ESZeroSuppressionProducer ( )
virtual

Definition at line 14 of file ESZeroSuppressionProducer.cc.

14  {
15 
16 }

Member Function Documentation

void ESZeroSuppressionProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 18 of file ESZeroSuppressionProducer.cc.

References ESSample::adc(), digiProducer_, ESdigiCollection_, espeds_, esthresholds_, ESZSdigiCollection_, ESCondObjectContainer< T >::find(), edm::EventSetup::get(), ESThresholds::getTS2Threshold(), i, ESDataFrame::id(), edm::HandleBase::isValid(), edm::ESHandle< class >::product(), and ESDataFrame::sample().

18  {
19 
20  eventSetup.get<ESThresholdsRcd>().get(esthresholds_);
21  const ESThresholds *thresholds = esthresholds_.product();
22 
23  eventSetup.get<ESPedestalsRcd>().get(espeds_);
24  const ESPedestals *pedestals = espeds_.product();
25 
26  float ts2Threshold = thresholds->getTS2Threshold();
27 
29 
30  bool fullESDigis = true;
31  event.getByLabel(digiProducer_, ESDigis);
32  if (!ESDigis.isValid()) {
33  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << ESdigiCollection_.c_str() ;
34  fullESDigis = false;
35  }
36 
37  std::auto_ptr<ESDigiCollection> ESZSDigis(new ESDigiCollection());
38 
39  if (fullESDigis) {
40  for (ESDigiCollection::const_iterator i (ESDigis->begin());
41  i!=ESDigis->end(); ++i) {
42 
43  ESDataFrame dataframe = (*i);
44 
45  ESPedestals::const_iterator it_ped = pedestals->find(dataframe.id());
46 
47  if (dataframe.sample(1).adc() > (ts2Threshold+it_ped->getMean())) {
48  //std::cout<<dataframe.sample(1).adc()<<" "<<ts2Threshold+it_ped->getMean()<<std::endl;
49  (*ESZSDigis).push_back(*i);
50  }
51  }
52  }
53 
54  event.put(ESZSDigis, ESZSdigiCollection_);
55 }
int i
Definition: DBlmapReader.cc:9
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::ESHandle< ESPedestals > espeds_
const ESDetId & id() const
Definition: ESDataFrame.h:21
edm::ESHandle< ESThresholds > esthresholds_
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
Definition: ESDataFrame.h:26
bool isValid() const
Definition: HandleBase.h:76
float getTS2Threshold() const
Definition: ESThresholds.h:14
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::vector< Item >::const_iterator const_iterator
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18

Member Data Documentation

std::string ESZeroSuppressionProducer::digiProducer_
private

Definition at line 32 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

std::string ESZeroSuppressionProducer::ESdigiCollection_
private

Definition at line 33 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

edm::ESHandle<ESPedestals> ESZeroSuppressionProducer::espeds_
private

Definition at line 37 of file ESZeroSuppressionProducer.h.

Referenced by produce().

edm::ESHandle<ESThresholds> ESZeroSuppressionProducer::esthresholds_
private

Definition at line 36 of file ESZeroSuppressionProducer.h.

Referenced by produce().

std::string ESZeroSuppressionProducer::ESZSdigiCollection_
private

Definition at line 34 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().