CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ESZeroSuppressionProducer Class Reference

#include <ESZeroSuppressionProducer.h>

Inheritance diagram for ESZeroSuppressionProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESZeroSuppressionProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 ~ESZeroSuppressionProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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 Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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 20 of file ESZeroSuppressionProducer.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file ESZeroSuppressionProducer.cc.

References digiProducer_, ES_token, ESdigiCollection_, ESZSdigiCollection_, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

5  {
6 
7  digiProducer_ = ps.getParameter<std::string>("digiProducer");
8  ESdigiCollection_ = ps.getParameter<std::string>("ESdigiCollection");
9  ESZSdigiCollection_ = ps.getParameter<std::string>("ESZSdigiCollection");
10 
11  produces<ESDigiCollection>(ESZSdigiCollection_);
12 
13  ES_token = consumes<ESDigiCollection>(edm::InputTag(digiProducer_));;
14 
15 }
T getParameter(std::string const &) const
edm::EDGetTokenT< ESDigiCollection > ES_token
ESZeroSuppressionProducer::~ESZeroSuppressionProducer ( )
override

Definition at line 17 of file ESZeroSuppressionProducer.cc.

17  {
18 
19 }

Member Function Documentation

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

Produces the EDM products,

Definition at line 21 of file ESZeroSuppressionProducer.cc.

References ESSample::adc(), edm::DataFrameContainer::begin(), edm::DataFrameContainer::end(), ES_token, ESdigiCollection_, espeds_, esthresholds_, ESZSdigiCollection_, ESCondObjectContainer< T >::find(), edm::EventSetup::get(), ESThresholds::getTS2Threshold(), mps_fire::i, ESDataFrame::id(), edm::HandleBase::isValid(), eostools::move(), edm::ESHandle< T >::product(), ESDataFrame::sample(), and particleFlowRecHitECAL_cfi::thresholds.

21  {
22 
23  eventSetup.get<ESThresholdsRcd>().get(esthresholds_);
25 
26  eventSetup.get<ESPedestalsRcd>().get(espeds_);
27  const ESPedestals *pedestals = espeds_.product();
28 
29  float ts2Threshold = thresholds->getTS2Threshold();
30 
32 
33  bool fullESDigis = true;
34  event.getByToken(ES_token, ESDigis);
35  if (!ESDigis.isValid()) {
36  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << ESdigiCollection_.c_str() ;
37  fullESDigis = false;
38  }
39 
40  std::unique_ptr<ESDigiCollection> ESZSDigis(new ESDigiCollection());
41 
42  if (fullESDigis) {
43  for (ESDigiCollection::const_iterator i (ESDigis->begin());
44  i!=ESDigis->end(); ++i) {
45 
46  ESDataFrame dataframe = (*i);
47 
48  ESPedestals::const_iterator it_ped = pedestals->find(dataframe.id());
49 
50  if (dataframe.sample(1).adc() > (ts2Threshold+it_ped->getMean())) {
51  //std::cout<<dataframe.sample(1).adc()<<" "<<ts2Threshold+it_ped->getMean()<<std::endl;
52  (*ESZSDigis).push_back(*i);
53  }
54  }
55  }
56 
57  event.put(std::move(ESZSDigis), ESZSdigiCollection_);
58 }
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::ESHandle< ESPedestals > espeds_
const ESDetId & id() const
Definition: ESDataFrame.h:21
edm::EDGetTokenT< ESDigiCollection > ES_token
const_iterator begin() const
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:74
float getTS2Threshold() const
Definition: ESThresholds.h:16
const T & get() const
Definition: EventSetup.h:58
std::vector< Item >::const_iterator const_iterator
const_iterator end() const
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::string ESZeroSuppressionProducer::digiProducer_
private

Definition at line 33 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer().

edm::EDGetTokenT<ESDigiCollection> ESZeroSuppressionProducer::ES_token
private

Definition at line 40 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

std::string ESZeroSuppressionProducer::ESdigiCollection_
private

Definition at line 34 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

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

Definition at line 38 of file ESZeroSuppressionProducer.h.

Referenced by produce().

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

Definition at line 37 of file ESZeroSuppressionProducer.h.

Referenced by produce().

std::string ESZeroSuppressionProducer::ESZSdigiCollection_
private

Definition at line 35 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().