CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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

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<>
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::ESZeroSuppressionProducer ( const edm::ParameterSet ps)
explicit

Definition at line 5 of file ESZeroSuppressionProducer.cc.

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

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

◆ ~ESZeroSuppressionProducer()

ESZeroSuppressionProducer::~ESZeroSuppressionProducer ( )
override

Definition at line 16 of file ESZeroSuppressionProducer.cc.

16 {}

Member Function Documentation

◆ produce()

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

Produces the EDM products,

Definition at line 18 of file ESZeroSuppressionProducer.cc.

18  {
19  eventSetup.get<ESThresholdsRcd>().get(esthresholds_);
21 
22  eventSetup.get<ESPedestalsRcd>().get(espeds_);
23  const ESPedestals *pedestals = espeds_.product();
24 
25  float ts2Threshold = thresholds->getTS2Threshold();
26 
28 
29  bool fullESDigis = true;
30  event.getByToken(ES_token, ESDigis);
31  if (!ESDigis.isValid()) {
32  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << ESdigiCollection_.c_str();
33  fullESDigis = false;
34  }
35 
36  std::unique_ptr<ESDigiCollection> ESZSDigis(new ESDigiCollection());
37 
38  if (fullESDigis) {
39  for (ESDigiCollection::const_iterator i(ESDigis->begin()); i != ESDigis->end(); ++i) {
40  ESDataFrame dataframe = (*i);
41 
42  ESPedestals::const_iterator it_ped = pedestals->find(dataframe.id());
43 
44  if (dataframe.sample(1).adc() > (ts2Threshold + it_ped->getMean())) {
45  // std::cout<<dataframe.sample(1).adc()<<"
46  // "<<ts2Threshold+it_ped->getMean()<<std::endl;
47  (*ESZSDigis).push_back(*i);
48  }
49  }
50  }
51 
52  event.put(std::move(ESZSDigis), ESZSdigiCollection_);
53 }

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

Member Data Documentation

◆ digiProducer_

std::string ESZeroSuppressionProducer::digiProducer_
private

Definition at line 29 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer().

◆ ES_token

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

Definition at line 36 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

◆ ESdigiCollection_

std::string ESZeroSuppressionProducer::ESdigiCollection_
private

Definition at line 30 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

◆ espeds_

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

Definition at line 34 of file ESZeroSuppressionProducer.h.

Referenced by produce().

◆ esthresholds_

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

Definition at line 33 of file ESZeroSuppressionProducer.h.

Referenced by produce().

◆ ESZSdigiCollection_

std::string ESZeroSuppressionProducer::ESZSdigiCollection_
private

Definition at line 31 of file ESZeroSuppressionProducer.h.

Referenced by ESZeroSuppressionProducer(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
ESPedestalsRcd
Definition: ESPedestalsRcd.h:5
mps_fire.i
i
Definition: mps_fire.py:428
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
ESSample::adc
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:16
ESThresholds
Definition: ESThresholds.h:7
ESZeroSuppressionProducer::ESZSdigiCollection_
std::string ESZSdigiCollection_
Definition: ESZeroSuppressionProducer.h:31
ESCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: ESCondObjectContainer.h:33
edm::Handle
Definition: AssociativeIterator.h:50
ESZeroSuppressionProducer::ESdigiCollection_
std::string ESdigiCollection_
Definition: ESZeroSuppressionProducer.h:30
ESDataFrame
Definition: ESDataFrame.h:10
ESDataFrame::sample
const ESSample & sample(int i) const
Definition: ESDataFrame.h:24
ESThresholdsRcd
Definition: ESThresholdsRcd.h:5
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
ESCondObjectContainer< ESPedestal >::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: ESCondObjectContainer.h:17
ESZeroSuppressionProducer::espeds_
edm::ESHandle< ESPedestals > espeds_
Definition: ESZeroSuppressionProducer.h:34
ESDigiCollection
Definition: EcalDigiCollections.h:82
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
ESCondObjectContainer< ESPedestal >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ESZeroSuppressionProducer::ES_token
edm::EDGetTokenT< ESDigiCollection > ES_token
Definition: ESZeroSuppressionProducer.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
ESZeroSuppressionProducer::esthresholds_
edm::ESHandle< ESThresholds > esthresholds_
Definition: ESZeroSuppressionProducer.h:33
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESZeroSuppressionProducer::digiProducer_
std::string digiProducer_
Definition: ESZeroSuppressionProducer.h:29
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
ESDataFrame::id
const ESDetId & id() const
Definition: ESDataFrame.h:19