CMS 3D CMS Logo

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

#include <HcalRealisticZS.h>

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

Public Member Functions

 HcalRealisticZS (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~HcalRealisticZS () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

std::unique_ptr< HcalZSAlgoRealisticalgo_
 
std::string inputLabel_
 
edm::ESGetToken< HcalDbService, HcalDbRecordtok_dbService_
 
edm::EDGetTokenT< HBHEDigiCollectiontok_hbhe_
 
edm::EDGetTokenT< QIE11DigiCollectiontok_hbheQIE11_
 
edm::EDGetTokenT< HFDigiCollectiontok_hf_
 
edm::EDGetTokenT< QIE10DigiCollectiontok_hfQIE10_
 
edm::EDGetTokenT< HODigiCollectiontok_ho_
 

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 21 of file HcalRealisticZS.h.

Constructor & Destructor Documentation

◆ HcalRealisticZS()

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

Definition at line 13 of file HcalRealisticZS.cc.

14  : inputLabel_(conf.getParameter<std::string>("digiLabel")) {
15  bool markAndPass = conf.getParameter<bool>("markAndPass");
16  bool useInstanceLabels = conf.getParameter<bool>("useInstanceLabels");
17 
18  // register for data access
19  tok_hbhe_ = consumes<HBHEDigiCollection>(edm::InputTag(inputLabel_));
20  tok_ho_ = consumes<HODigiCollection>(edm::InputTag(inputLabel_));
21  tok_hf_ = consumes<HFDigiCollection>(edm::InputTag(inputLabel_));
22  tok_hfQIE10_ =
23  consumes<QIE10DigiCollection>(edm::InputTag(inputLabel_, useInstanceLabels ? "HFQIE10DigiCollection" : ""));
25  consumes<QIE11DigiCollection>(edm::InputTag(inputLabel_, useInstanceLabels ? "HBHEQIE11DigiCollection" : ""));
26  tok_dbService_ = esConsumes<HcalDbService, HcalDbRecord>();
27 
28  bool use1ts_ = conf.getParameter<bool>("use1ts");
29 
30  std::vector<int> tmp = conf.getParameter<std::vector<int>>("HBregion");
31 
32  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
33  edm::LogError("HcalZeroSuppression") << "ZS(HB) region error: " << tmp[0] << ":" << tmp[1];
34  tmp[0] = 0;
35  tmp[1] = 9;
36  }
37 
38  std::pair<int, int> HBsearchTS(tmp[0], tmp[1]);
39 
40  tmp = conf.getParameter<std::vector<int>>("HEregion");
41  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
42  edm::LogError("HcalZeroSuppression") << "ZS(HE) region error: " << tmp[0] << ":" << tmp[1];
43  tmp[0] = 0;
44  tmp[1] = 9;
45  }
46  std::pair<int, int> HEsearchTS(tmp[0], tmp[1]);
47 
48  tmp = conf.getParameter<std::vector<int>>("HOregion");
49  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
50  edm::LogError("HcalZeroSuppression") << "ZS(HO) region error: " << tmp[0] << ":" << tmp[1];
51  tmp[0] = 0;
52  tmp[1] = 9;
53  }
54  std::pair<int, int> HOsearchTS(tmp[0], tmp[1]);
55 
56  tmp = conf.getParameter<std::vector<int>>("HFregion");
57  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
58  edm::LogError("HcalZeroSuppression") << "ZS(HF) region error: " << tmp[0] << ":" << tmp[1];
59  tmp[0] = 0;
60  tmp[1] = 9;
61  }
62  std::pair<int, int> HFsearchTS(tmp[0], tmp[1]);
63 
64  // this constructor will be called if useConfigZSvalues is set to 1 in
65  // HcalZeroSuppressionProducers/python/hcalDigisRealistic_cfi.py
66  // which means that channel-by-channel ZS thresholds from DB will NOT be used
67  if (conf.getParameter<int>("useConfigZSvalues")) {
68  algo_ = std::make_unique<HcalZSAlgoRealistic>(markAndPass,
69  use1ts_,
70  conf.getParameter<int>("HBlevel"),
71  conf.getParameter<int>("HElevel"),
72  conf.getParameter<int>("HOlevel"),
73  conf.getParameter<int>("HFlevel"),
74  HBsearchTS,
75  HEsearchTS,
76  HOsearchTS,
77  HFsearchTS);
78 
79  } else {
80  algo_ = std::make_unique<HcalZSAlgoRealistic>(markAndPass, use1ts_, HBsearchTS, HEsearchTS, HOsearchTS, HFsearchTS);
81  }
82 
83  produces<HBHEDigiCollection>();
84  produces<HODigiCollection>();
85  produces<HFDigiCollection>();
86  produces<QIE10DigiCollection>("HFQIE10DigiCollection");
87  produces<QIE11DigiCollection>("HBHEQIE11DigiCollection");
88 }

References algo_, edm::ParameterSet::getParameter(), inputLabel_, DigiNZS_cff::markAndPass, createJobs::tmp, tok_dbService_, tok_hbhe_, tok_hbheQIE11_, tok_hf_, tok_hfQIE10_, tok_ho_, and hcalDigisRealistic_cfi::useInstanceLabels.

◆ ~HcalRealisticZS()

HcalRealisticZS::~HcalRealisticZS ( )
override

Definition at line 90 of file HcalRealisticZS.cc.

90 { algo_->clearDbService(); }

References algo_.

Member Function Documentation

◆ produce()

void HcalRealisticZS::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 92 of file HcalRealisticZS.cc.

92  {
98 
100  algo_->setDbService(conditions.product());
101 
102  e.getByToken(tok_hbhe_, hbhe);
103 
104  // create empty output
105  std::unique_ptr<HBHEDigiCollection> zs_hbhe(new HBHEDigiCollection);
106 
107  e.getByToken(tok_ho_, ho);
108 
109  // create empty output
110  std::unique_ptr<HODigiCollection> zs_ho(new HODigiCollection);
111 
112  e.getByToken(tok_hf_, hf);
113 
114  // create empty output
115  std::unique_ptr<HFDigiCollection> zs_hf(new HFDigiCollection);
116 
117  e.getByToken(tok_hfQIE10_, hfQIE10);
118  e.getByToken(tok_hbheQIE11_, hbheQIE11);
119 
120  // create empty output
121  std::unique_ptr<HBHEDigiCollection> zs_hbheUpgrade(new HBHEDigiCollection);
122  std::unique_ptr<HFDigiCollection> zs_hfUpgrade(new HFDigiCollection);
123  std::unique_ptr<QIE10DigiCollection> zs_hfQIE10(new QIE10DigiCollection(hfQIE10->samples()));
124  std::unique_ptr<QIE11DigiCollection> zs_hbheQIE11(new QIE11DigiCollection(hbheQIE11->samples()));
125 
126  // run the algorithm
127  algo_->suppress(*(hbhe.product()), *zs_hbhe);
128  algo_->suppress(*(ho.product()), *zs_ho);
129  algo_->suppress(*(hf.product()), *zs_hf);
130  algo_->suppress(*(hfQIE10.product()), *zs_hfQIE10);
131  algo_->suppress(*(hbheQIE11.product()), *zs_hbheQIE11);
132 
133  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << hbhe->size() << " digis, output "
134  << zs_hbhe->size() << " digis"
135  << " (HO) input " << ho->size() << " digis, output " << zs_ho->size() << " digis"
136  << " (HF) input " << hf->size() << " digis, output " << zs_hf->size() << " digis"
137  << " (HFQIE10) input " << hfQIE10->size() << " digis, output "
138  << zs_hfQIE10->size() << " digis"
139  << " (HBHEQIE11) input " << hbheQIE11->size() << " digis, output "
140  << zs_hbheQIE11->size() << " digis";
141 
142  // return result
143  e.put(std::move(zs_hbhe));
144  e.put(std::move(zs_ho));
145  e.put(std::move(zs_hf));
146  e.put(std::move(zs_hfQIE10), "HFQIE10DigiCollection");
147  e.put(std::move(zs_hbheQIE11), "HBHEQIE11DigiCollection");
148 }

References algo_, submitPVValidationJobs::conditions, MillePedeFileConverter_cfg::e, edm::EventSetup::getHandle(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, eostools::move(), edm::Handle< T >::product(), HcalDataFrameContainer< Digi >::samples(), edm::DataFrameContainer::size(), tok_dbService_, tok_hbhe_, tok_hbheQIE11_, tok_hf_, tok_hfQIE10_, and tok_ho_.

Member Data Documentation

◆ algo_

std::unique_ptr<HcalZSAlgoRealistic> HcalRealisticZS::algo_
private

Definition at line 28 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), produce(), and ~HcalRealisticZS().

◆ inputLabel_

std::string HcalRealisticZS::inputLabel_
private

Definition at line 29 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS().

◆ tok_dbService_

edm::ESGetToken<HcalDbService, HcalDbRecord> HcalRealisticZS::tok_dbService_
private

Definition at line 35 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hbhe_

edm::EDGetTokenT<HBHEDigiCollection> HcalRealisticZS::tok_hbhe_
private

Definition at line 30 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hbheQIE11_

edm::EDGetTokenT<QIE11DigiCollection> HcalRealisticZS::tok_hbheQIE11_
private

Definition at line 34 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hf_

edm::EDGetTokenT<HFDigiCollection> HcalRealisticZS::tok_hf_
private

Definition at line 32 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hfQIE10_

edm::EDGetTokenT<QIE10DigiCollection> HcalRealisticZS::tok_hfQIE10_
private

Definition at line 33 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

◆ tok_ho_

edm::EDGetTokenT<HODigiCollection> HcalRealisticZS::tok_ho_
private

Definition at line 31 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

HcalRealisticZS::tok_hbhe_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalRealisticZS.h:30
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HcalRealisticZS::tok_ho_
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalRealisticZS.h:31
edm::SortedCollection
Definition: SortedCollection.h:49
HcalRealisticZS::tok_dbService_
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbService_
Definition: HcalRealisticZS.h:35
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Handle
Definition: AssociativeIterator.h:50
QIE10DigiCollection
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
Definition: HcalDigiCollections.h:52
HcalDataFrameContainer::samples
int samples() const
Definition: HcalDigiCollections.h:47
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
edm::ESHandle< HcalDbService >
DigiNZS_cff.markAndPass
markAndPass
Definition: DigiNZS_cff.py:6
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcalDigisRealistic_cfi.useInstanceLabels
useInstanceLabels
Definition: hcalDigisRealistic_cfi.py:12
HcalRealisticZS::tok_hbheQIE11_
edm::EDGetTokenT< QIE11DigiCollection > tok_hbheQIE11_
Definition: HcalRealisticZS.h:34
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
QIE11DigiCollection
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
Definition: HcalDigiCollections.h:53
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
eostools.move
def move(src, dest)
Definition: eostools.py:511
HcalRealisticZS::inputLabel_
std::string inputLabel_
Definition: HcalRealisticZS.h:29
HcalRealisticZS::algo_
std::unique_ptr< HcalZSAlgoRealistic > algo_
Definition: HcalRealisticZS.h:28
HcalRealisticZS::tok_hfQIE10_
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
Definition: HcalRealisticZS.h:33
HcalRealisticZS::tok_hf_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalRealisticZS.h:32
edm::InputTag
Definition: InputTag.h:15
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37