CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalRealisticZS Class Reference
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
 
 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::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<>
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 24 of file HcalRealisticZS.cc.

Constructor & Destructor Documentation

◆ HcalRealisticZS()

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

Definition at line 41 of file HcalRealisticZS.cc.

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

42  : inputLabel_(conf.getParameter<std::string>("digiLabel")) {
43  bool markAndPass = conf.getParameter<bool>("markAndPass");
44  bool useInstanceLabels = conf.getParameter<bool>("useInstanceLabels");
45 
46  // register for data access
47  tok_hbhe_ = consumes<HBHEDigiCollection>(edm::InputTag(inputLabel_));
48  tok_ho_ = consumes<HODigiCollection>(edm::InputTag(inputLabel_));
49  tok_hf_ = consumes<HFDigiCollection>(edm::InputTag(inputLabel_));
50  tok_hfQIE10_ =
51  consumes<QIE10DigiCollection>(edm::InputTag(inputLabel_, useInstanceLabels ? "HFQIE10DigiCollection" : ""));
53  consumes<QIE11DigiCollection>(edm::InputTag(inputLabel_, useInstanceLabels ? "HBHEQIE11DigiCollection" : ""));
54  tok_dbService_ = esConsumes<HcalDbService, HcalDbRecord>();
55 
56  bool use1ts_ = conf.getParameter<bool>("use1ts");
57 
58  std::vector<int> tmp = conf.getParameter<std::vector<int>>("HBregion");
59 
60  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
61  edm::LogError("HcalZeroSuppression") << "ZS(HB) region error: " << tmp[0] << ":" << tmp[1];
62  tmp[0] = 0;
63  tmp[1] = 9;
64  }
65 
66  std::pair<int, int> HBsearchTS(tmp[0], tmp[1]);
67 
68  tmp = conf.getParameter<std::vector<int>>("HEregion");
69  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
70  edm::LogError("HcalZeroSuppression") << "ZS(HE) region error: " << tmp[0] << ":" << tmp[1];
71  tmp[0] = 0;
72  tmp[1] = 9;
73  }
74  std::pair<int, int> HEsearchTS(tmp[0], tmp[1]);
75 
76  tmp = conf.getParameter<std::vector<int>>("HOregion");
77  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
78  edm::LogError("HcalZeroSuppression") << "ZS(HO) region error: " << tmp[0] << ":" << tmp[1];
79  tmp[0] = 0;
80  tmp[1] = 9;
81  }
82  std::pair<int, int> HOsearchTS(tmp[0], tmp[1]);
83 
84  tmp = conf.getParameter<std::vector<int>>("HFregion");
85  if (tmp[0] < 0 || tmp[0] > 9 || tmp[1] < 0 || tmp[1] > 9 || tmp[0] > tmp[1]) {
86  edm::LogError("HcalZeroSuppression") << "ZS(HF) region error: " << tmp[0] << ":" << tmp[1];
87  tmp[0] = 0;
88  tmp[1] = 9;
89  }
90  std::pair<int, int> HFsearchTS(tmp[0], tmp[1]);
91 
92  // this constructor will be called if useConfigZSvalues is set to 1 in
93  // HcalZeroSuppressionProducers/python/hcalDigisRealistic_cfi.py
94  // which means that channel-by-channel ZS thresholds from DB will NOT be used
95  if (conf.getParameter<int>("useConfigZSvalues")) {
96  algo_ = std::make_unique<HcalZSAlgoRealistic>(markAndPass,
97  use1ts_,
98  conf.getParameter<int>("HBlevel"),
99  conf.getParameter<int>("HElevel"),
100  conf.getParameter<int>("HOlevel"),
101  conf.getParameter<int>("HFlevel"),
102  HBsearchTS,
103  HEsearchTS,
104  HOsearchTS,
105  HFsearchTS);
106 
107  } else {
108  algo_ = std::make_unique<HcalZSAlgoRealistic>(markAndPass, use1ts_, HBsearchTS, HEsearchTS, HOsearchTS, HFsearchTS);
109  }
110 
111  produces<HBHEDigiCollection>();
112  produces<HODigiCollection>();
113  produces<HFDigiCollection>();
114  produces<QIE10DigiCollection>("HFQIE10DigiCollection");
115  produces<QIE11DigiCollection>("HBHEQIE11DigiCollection");
116 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbService_
std::unique_ptr< HcalZSAlgoRealistic > algo_
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
Log< level::Error, false > LogError
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
std::string inputLabel_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< QIE11DigiCollection > tok_hbheQIE11_
tmp
align.sh
Definition: createJobs.py:716

◆ ~HcalRealisticZS()

HcalRealisticZS::~HcalRealisticZS ( )
override

Definition at line 118 of file HcalRealisticZS.cc.

References algo_.

118 { algo_->clearDbService(); }
std::unique_ptr< HcalZSAlgoRealistic > algo_

Member Function Documentation

◆ produce()

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

Definition at line 120 of file HcalRealisticZS.cc.

References algo_, submitPVValidationJobs::conditions, MillePedeFileConverter_cfg::e, options_cfi::eventSetup, 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_.

120  {
126 
128  algo_->setDbService(conditions.product());
129 
130  e.getByToken(tok_hbhe_, hbhe);
131 
132  // create empty output
133  std::unique_ptr<HBHEDigiCollection> zs_hbhe(new HBHEDigiCollection);
134 
135  e.getByToken(tok_ho_, ho);
136 
137  // create empty output
138  std::unique_ptr<HODigiCollection> zs_ho(new HODigiCollection);
139 
140  e.getByToken(tok_hf_, hf);
141 
142  // create empty output
143  std::unique_ptr<HFDigiCollection> zs_hf(new HFDigiCollection);
144 
145  e.getByToken(tok_hfQIE10_, hfQIE10);
146  e.getByToken(tok_hbheQIE11_, hbheQIE11);
147 
148  // create empty output
149  std::unique_ptr<HBHEDigiCollection> zs_hbheUpgrade(new HBHEDigiCollection);
150  std::unique_ptr<HFDigiCollection> zs_hfUpgrade(new HFDigiCollection);
151  std::unique_ptr<QIE10DigiCollection> zs_hfQIE10(new QIE10DigiCollection(hfQIE10->samples()));
152  std::unique_ptr<QIE11DigiCollection> zs_hbheQIE11(new QIE11DigiCollection(hbheQIE11->samples()));
153 
154  // run the algorithm
155  algo_->suppress(*(hbhe.product()), *zs_hbhe);
156  algo_->suppress(*(ho.product()), *zs_ho);
157  algo_->suppress(*(hf.product()), *zs_hf);
158  algo_->suppress(*(hfQIE10.product()), *zs_hfQIE10);
159  algo_->suppress(*(hbheQIE11.product()), *zs_hbheQIE11);
160 
161  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << hbhe->size() << " digis, output "
162  << zs_hbhe->size() << " digis"
163  << " (HO) input " << ho->size() << " digis, output " << zs_ho->size() << " digis"
164  << " (HF) input " << hf->size() << " digis, output " << zs_hf->size() << " digis"
165  << " (HFQIE10) input " << hfQIE10->size() << " digis, output "
166  << zs_hfQIE10->size() << " digis"
167  << " (HBHEQIE11) input " << hbheQIE11->size() << " digis, output "
168  << zs_hbheQIE11->size() << " digis";
169 
170  // return result
171  e.put(std::move(zs_hbhe));
172  e.put(std::move(zs_ho));
173  e.put(std::move(zs_hf));
174  e.put(std::move(zs_hfQIE10), "HFQIE10DigiCollection");
175  e.put(std::move(zs_hbheQIE11), "HBHEQIE11DigiCollection");
176 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbService_
std::unique_ptr< HcalZSAlgoRealistic > algo_
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
Log< level::Info, false > LogInfo
edm::EDGetTokenT< QIE11DigiCollection > tok_hbheQIE11_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

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

Definition at line 31 of file HcalRealisticZS.cc.

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

◆ inputLabel_

std::string HcalRealisticZS::inputLabel_
private

Definition at line 32 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS().

◆ tok_dbService_

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

Definition at line 38 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hbhe_

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

Definition at line 33 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hbheQIE11_

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

Definition at line 37 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hf_

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

Definition at line 35 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().

◆ tok_hfQIE10_

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

Definition at line 36 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().

◆ tok_ho_

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

Definition at line 34 of file HcalRealisticZS.cc.

Referenced by HcalRealisticZS(), and produce().