CMS 3D CMS Logo

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

#include <ESZeroSuppressionProducer.h>

Inheritance diagram for ESZeroSuppressionProducer:
edm::stream::EDProducer<>

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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const std::string digiProducer_
 
const edm::EDGetTokenT
< ESDigiCollection
ES_token
 
const std::string ESdigiCollection_
 
const edm::ESGetToken
< ESPedestals, ESPedestalsRcd
espedsToken_
 
const edm::ESGetToken
< ESThresholds,
ESThresholdsRcd
esthresholdsToken_
 
const std::string ESZSdigiCollection_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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 ESZSdigiCollection_.

6  : digiProducer_(ps.getParameter<std::string>("digiProducer")),
7  ESdigiCollection_(ps.getParameter<std::string>("ESdigiCollection")),
8  ESZSdigiCollection_(ps.getParameter<std::string>("ESZSdigiCollection")),
9  ES_token(consumes<ESDigiCollection>(edm::InputTag(digiProducer_))),
12  produces<ESDigiCollection>(ESZSdigiCollection_);
13 }
const edm::ESGetToken< ESThresholds, ESThresholdsRcd > esthresholdsToken_
const edm::ESGetToken< ESPedestals, ESPedestalsRcd > espedsToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< ESDigiCollection > ES_token
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
ESZeroSuppressionProducer::~ESZeroSuppressionProducer ( )
override

Definition at line 15 of file ESZeroSuppressionProducer.cc.

15 {}

Member Function Documentation

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

Produces the EDM products,

Definition at line 17 of file ESZeroSuppressionProducer.cc.

References ESSample::adc(), ES_token, ESdigiCollection_, espedsToken_, esthresholdsToken_, ESZSdigiCollection_, ESCondObjectContainer< T >::find(), edm::EventSetup::getData(), ESThresholds::getTS2Threshold(), mps_fire::i, ESDataFrame::id(), edm::HandleBase::isValid(), eostools::move(), ESDataFrame::sample(), and lowPtGsfElectronSeeds_cfi::thresholds().

17  {
19  const ESPedestals &pedestals = eventSetup.getData(espedsToken_);
20 
21  float ts2Threshold = thresholds.getTS2Threshold();
22 
24 
25  bool fullESDigis = true;
26  event.getByToken(ES_token, ESDigis);
27  if (!ESDigis.isValid()) {
28  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << ESdigiCollection_.c_str();
29  fullESDigis = false;
30  }
31 
32  std::unique_ptr<ESDigiCollection> ESZSDigis(new ESDigiCollection());
33 
34  if (fullESDigis) {
35  for (ESDigiCollection::const_iterator i(ESDigis->begin()); i != ESDigis->end(); ++i) {
36  ESDataFrame dataframe = (*i);
37 
38  ESPedestals::const_iterator it_ped = pedestals.find(dataframe.id());
39 
40  if (dataframe.sample(1).adc() > (ts2Threshold + it_ped->getMean())) {
41  // std::cout<<dataframe.sample(1).adc()<<"
42  // "<<ts2Threshold+it_ped->getMean()<<std::endl;
43  (*ESZSDigis).push_back(*i);
44  }
45  }
46  }
47 
48  event.put(std::move(ESZSDigis), ESZSdigiCollection_);
49 }
const ESDetId & id() const
Definition: ESDataFrame.h:19
Log< level::Error, false > LogError
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const edm::ESGetToken< ESThresholds, ESThresholdsRcd > esthresholdsToken_
def move
Definition: eostools.py:511
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
Definition: ESDataFrame.h:24
bool isValid() const
Definition: HandleBase.h:70
float getTS2Threshold() const
Definition: ESThresholds.h:14
const edm::ESGetToken< ESPedestals, ESPedestalsRcd > espedsToken_
std::vector< Item >::const_iterator const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:16
const edm::EDGetTokenT< ESDigiCollection > ES_token

Member Data Documentation

const std::string ESZeroSuppressionProducer::digiProducer_
private

Definition at line 29 of file ESZeroSuppressionProducer.h.

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

Definition at line 33 of file ESZeroSuppressionProducer.h.

Referenced by produce().

const std::string ESZeroSuppressionProducer::ESdigiCollection_
private

Definition at line 30 of file ESZeroSuppressionProducer.h.

Referenced by produce().

const edm::ESGetToken<ESPedestals, ESPedestalsRcd> ESZeroSuppressionProducer::espedsToken_
private

Definition at line 35 of file ESZeroSuppressionProducer.h.

Referenced by produce().

const edm::ESGetToken<ESThresholds, ESThresholdsRcd> ESZeroSuppressionProducer::esthresholdsToken_
private

Definition at line 34 of file ESZeroSuppressionProducer.h.

Referenced by produce().

const std::string ESZeroSuppressionProducer::ESZSdigiCollection_
private

Definition at line 31 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().