CMS 3D CMS Logo

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

#include <EcalZeroSuppressionProducer.h>

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

Public Member Functions

 EcalZeroSuppressionProducer (const edm::ParameterSet &params)
 
void initCalibrations (const edm::EventSetup &eventSetup)
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 ~EcalZeroSuppressionProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

std::string digiProducer_
 
edm::EDGetTokenT< EBDigiCollectionEB_token
 
std::string EBdigiCollection_
 
std::string EBZSdigiCollection_
 
edm::EDGetTokenT< EEDigiCollectionEE_token
 
std::string EEdigiCollection_
 
std::string EEZSdigiCollection_
 
double glbBarrelThreshold_
 
double glbEndcapThreshold_
 
EcalZeroSuppressor< EBDataFrametheBarrelZeroSuppressor_
 
EcalZeroSuppressor< EEDataFrametheEndcapZeroSuppressor_
 

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
 

Detailed Description

Definition at line 23 of file EcalZeroSuppressionProducer.h.

Constructor & Destructor Documentation

◆ EcalZeroSuppressionProducer()

EcalZeroSuppressionProducer::EcalZeroSuppressionProducer ( const edm::ParameterSet params)
explicit

Definition at line 4 of file EcalZeroSuppressionProducer.cc.

4  {
5  digiProducer_ = params.getParameter<std::string>("digiProducer");
6  EBdigiCollection_ = params.getParameter<std::string>("EBdigiCollection");
7  EEdigiCollection_ = params.getParameter<std::string>("EEdigiCollection");
8  EBZSdigiCollection_ = params.getParameter<std::string>("EBZSdigiCollection");
9  EEZSdigiCollection_ = params.getParameter<std::string>("EEZSdigiCollection");
10 
11  // initialize the default values for the thresholds in number of noise sigmas
12 
13  glbBarrelThreshold_ = params.getUntrackedParameter<double>("glbBarrelThreshold", 0.2);
14  glbEndcapThreshold_ = params.getUntrackedParameter<double>("glbEndcapThreshold", 0.4);
15 
16  produces<EBDigiCollection>(EBZSdigiCollection_);
17  produces<EEDigiCollection>(EEZSdigiCollection_);
18 
19  EB_token = consumes<EBDigiCollection>(edm::InputTag(digiProducer_));
20  EE_token = consumes<EEDigiCollection>(edm::InputTag(digiProducer_));
21  ;
22 }

References digiProducer_, EB_token, EBdigiCollection_, EBZSdigiCollection_, EE_token, EEdigiCollection_, EEZSdigiCollection_, glbBarrelThreshold_, glbEndcapThreshold_, CalibrationSummaryClient_cfi::params, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~EcalZeroSuppressionProducer()

EcalZeroSuppressionProducer::~EcalZeroSuppressionProducer ( )
override

Definition at line 24 of file EcalZeroSuppressionProducer.cc.

24 {}

Member Function Documentation

◆ initCalibrations()

void EcalZeroSuppressionProducer::initCalibrations ( const edm::EventSetup eventSetup)

Definition at line 106 of file EcalZeroSuppressionProducer.cc.

106  {
107  // Pedestals from event setup
108 
110  eventSetup.get<EcalPedestalsRcd>().get(dbPed);
111  const EcalPedestals *thePedestals = dbPed.product();
112 
115 }

References options_cfi::eventSetup, get, edm::ESHandle< T >::product(), EcalZeroSuppressor< C >::setPedestals(), theBarrelZeroSuppressor_, and theEndcapZeroSuppressor_.

Referenced by produce().

◆ produce()

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

Produces the EDM products,

Definition at line 26 of file EcalZeroSuppressionProducer.cc.

26  {
27  // Get Inputs
28 
30 
33 
34  const EBDigiCollection *fullBarrelDigis = nullptr;
35  const EEDigiCollection *fullEndcapDigis = nullptr;
36 
37  event.getByToken(EB_token, pEBDigis);
38  if (pEBDigis.isValid()) {
39  fullBarrelDigis = pEBDigis.product(); // get a ptr to the produc
40  edm::LogInfo("ZeroSuppressionInfo") << "total # fullBarrelDigis: " << fullBarrelDigis->size();
41  } else {
42  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << EBdigiCollection_.c_str();
43  }
44 
45  event.getByToken(EE_token, pEEDigis);
46  if (pEEDigis.isValid()) {
47  fullEndcapDigis = pEEDigis.product(); // get a ptr to the product
48  edm::LogInfo("ZeroSuppressionInfo") << "total # fullEndcapDigis: " << fullEndcapDigis->size();
49  } else {
50  edm::LogError("ZeroSuppressionError") << "Error! can't get the product " << EEdigiCollection_.c_str();
51  }
52 
53  // collection of zero suppressed digis to put in the event
54 
55  std::unique_ptr<EBDigiCollection> gzsBarrelDigis(new EBDigiCollection());
56  std::unique_ptr<EEDigiCollection> gzsEndcapDigis(new EEDigiCollection());
57 
59 
60  // Barrel zero suppression
61 
62  if (fullBarrelDigis) {
63  for (EBDigiCollection::const_iterator digiItr = (*fullBarrelDigis).begin(); digiItr != (*fullBarrelDigis).end();
64  ++digiItr) {
65  bool isAccepted = theBarrelZeroSuppressor_.accept(*digiItr, glbBarrelThreshold_);
66  if (isAccepted) {
67  (*gzsBarrelDigis).push_back(digiItr->id(), digiItr->begin());
68  }
69  }
70  edm::LogInfo("ZeroSuppressionInfo") << "EB Digis: " << gzsBarrelDigis->size();
71 
72  // std::vector<EBDataFrame> sortedDigisEB =
73  // sorter.sortedVector(*gzsBarrelDigis); LogDebug("ZeroSuppressionDump") <<
74  // "Top 10 EB digis"; for(int i = 0; i < std::min(10,(int)
75  // sortedDigisEB.size()); ++i)
76  // {
77  // LogDebug("ZeroSuppressionDump") << sortedDigisEB[i];
78  // }
79  }
80 
81  // Endcap zero suppression
82 
83  if (fullEndcapDigis) {
84  for (EEDigiCollection::const_iterator digiItr = (*fullEndcapDigis).begin(); digiItr != (*fullEndcapDigis).end();
85  ++digiItr) {
86  bool isAccepted = theEndcapZeroSuppressor_.accept(*digiItr, glbEndcapThreshold_);
87  if (isAccepted) {
88  (*gzsEndcapDigis).push_back(digiItr->id(), digiItr->begin());
89  }
90  }
91  edm::LogInfo("ZeroSuppressionInfo") << "EB Digis: " << gzsBarrelDigis->size();
92 
93  // std::vector<EEDataFrame> sortedDigisEE =
94  // sorter.sortedVector(*gzsEndcapDigis);
95  // LogDebug("ZeroSuppressionDump") << "Top 10 EE digis";
96  // for(int i = 0; i < std::min(10,(int) sortedDigisEE.size()); ++i)
97  // {
98  // LogDebug("ZeroSuppressionDump") << sortedDigisEE[i];
99  // }
100  }
101  // Step D: Put outputs into event
102  event.put(std::move(gzsBarrelDigis), EBZSdigiCollection_);
103  event.put(std::move(gzsEndcapDigis), EEZSdigiCollection_);
104 }

References EcalZeroSuppressor< C >::accept(), EB_token, EBdigiCollection_, EBZSdigiCollection_, EE_token, EEdigiCollection_, EEZSdigiCollection_, options_cfi::eventSetup, glbBarrelThreshold_, glbEndcapThreshold_, initCalibrations(), edm::HandleBase::isValid(), eostools::move(), edm::Handle< T >::product(), edm::DataFrameContainer::size(), MCScenario_CRAFT1_22X::sorter(), theBarrelZeroSuppressor_, and theEndcapZeroSuppressor_.

Member Data Documentation

◆ digiProducer_

std::string EcalZeroSuppressionProducer::digiProducer_
private

Definition at line 40 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer().

◆ EB_token

edm::EDGetTokenT<EBDigiCollection> EcalZeroSuppressionProducer::EB_token
private

Definition at line 49 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ EBdigiCollection_

std::string EcalZeroSuppressionProducer::EBdigiCollection_
private

Definition at line 41 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ EBZSdigiCollection_

std::string EcalZeroSuppressionProducer::EBZSdigiCollection_
private

Definition at line 43 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ EE_token

edm::EDGetTokenT<EEDigiCollection> EcalZeroSuppressionProducer::EE_token
private

Definition at line 50 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ EEdigiCollection_

std::string EcalZeroSuppressionProducer::EEdigiCollection_
private

Definition at line 42 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ EEZSdigiCollection_

std::string EcalZeroSuppressionProducer::EEZSdigiCollection_
private

Definition at line 44 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ glbBarrelThreshold_

double EcalZeroSuppressionProducer::glbBarrelThreshold_
private

Definition at line 37 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ glbEndcapThreshold_

double EcalZeroSuppressionProducer::glbEndcapThreshold_
private

Definition at line 38 of file EcalZeroSuppressionProducer.h.

Referenced by EcalZeroSuppressionProducer(), and produce().

◆ theBarrelZeroSuppressor_

EcalZeroSuppressor<EBDataFrame> EcalZeroSuppressionProducer::theBarrelZeroSuppressor_
private

Definition at line 46 of file EcalZeroSuppressionProducer.h.

Referenced by initCalibrations(), and produce().

◆ theEndcapZeroSuppressor_

EcalZeroSuppressor<EEDataFrame> EcalZeroSuppressionProducer::theEndcapZeroSuppressor_
private

Definition at line 47 of file EcalZeroSuppressionProducer.h.

Referenced by initCalibrations(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
EcalZeroSuppressor::setPedestals
void setPedestals(const EcalPedestals *pedestals)
can be fetched every event from the EventSetup
Definition: EcalZeroSuppressor.h:40
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
edm::LogInfo
Definition: MessageLogger.h:254
EcalZeroSuppressor::accept
bool accept(const C &frame, const double &threshold)
EcalZeroSuppressionProducer::EB_token
edm::EDGetTokenT< EBDigiCollection > EB_token
Definition: EcalZeroSuppressionProducer.h:49
EcalZeroSuppressionProducer::EBdigiCollection_
std::string EBdigiCollection_
Definition: EcalZeroSuppressionProducer.h:41
EcalZeroSuppressionProducer::EBZSdigiCollection_
std::string EBZSdigiCollection_
Definition: EcalZeroSuppressionProducer.h:43
EcalCondObjectContainer< EcalPedestal >
edm::Handle< EBDigiCollection >
edm::ESHandle
Definition: DTSurvey.h:22
EcalZeroSuppressionProducer::EE_token
edm::EDGetTokenT< EEDigiCollection > EE_token
Definition: EcalZeroSuppressionProducer.h:50
EcalZeroSuppressionProducer::initCalibrations
void initCalibrations(const edm::EventSetup &eventSetup)
Definition: EcalZeroSuppressionProducer.cc:106
EcalZeroSuppressionProducer::EEdigiCollection_
std::string EEdigiCollection_
Definition: EcalZeroSuppressionProducer.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
EBDigiCollection
Definition: EcalDigiCollections.h:32
EEDigiCollection
Definition: EcalDigiCollections.h:45
EcalZeroSuppressionProducer::EEZSdigiCollection_
std::string EEZSdigiCollection_
Definition: EcalZeroSuppressionProducer.h:44
EcalZeroSuppressionProducer::glbEndcapThreshold_
double glbEndcapThreshold_
Definition: EcalZeroSuppressionProducer.h:38
EcalZeroSuppressionProducer::digiProducer_
std::string digiProducer_
Definition: EcalZeroSuppressionProducer.h:40
get
#define get
EcalZeroSuppressionProducer::theEndcapZeroSuppressor_
EcalZeroSuppressor< EEDataFrame > theEndcapZeroSuppressor_
Definition: EcalZeroSuppressionProducer.h:47
MCScenario_CRAFT1_22X.sorter
def sorter(a, b)
Definition: MCScenario_CRAFT1_22X.py:97
eostools.move
def move(src, dest)
Definition: eostools.py:511
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
CaloDigiCollectionSorter
Definition: CaloDigiCollectionSorter.h:16
EcalZeroSuppressionProducer::theBarrelZeroSuppressor_
EcalZeroSuppressor< EBDataFrame > theBarrelZeroSuppressor_
Definition: EcalZeroSuppressionProducer.h:46
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
EcalZeroSuppressionProducer::glbBarrelThreshold_
double glbBarrelThreshold_
Definition: EcalZeroSuppressionProducer.h:37