CMS 3D CMS Logo

HcalSimpleAmplitudeZS.cc
Go to the documentation of this file.
11 #include "HcalSimpleAmplitudeZS.h"
12 using namespace std;
13 
14 #include <iostream>
15 
17  : inputLabel_(conf.getParameter<std::string>("digiLabel")) {
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_ = consumes<QIE10DigiCollection>(edm::InputTag(inputLabel_, "HFQIE10DigiCollection"));
23  tok_hbheQIE11_ = consumes<QIE11DigiCollection>(edm::InputTag(inputLabel_, "HBHEQIE11DigiCollection"));
24 
25  const edm::ParameterSet &psHBHE = conf.getParameter<edm::ParameterSet>("hbhe");
26  bool markAndPass = psHBHE.getParameter<bool>("markAndPass");
27  hbhe_ = std::unique_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
28  psHBHE.getParameter<int>("level"),
29  psHBHE.getParameter<int>("firstSample"),
30  psHBHE.getParameter<int>("samplesToAdd"),
31  psHBHE.getParameter<bool>("twoSided")));
32  produces<HBHEDigiCollection>();
33  hbheQIE11_ = std::unique_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
34  psHBHE.getParameter<int>("level"),
35  psHBHE.getParameter<int>("firstSample"),
36  psHBHE.getParameter<int>("samplesToAdd"),
37  psHBHE.getParameter<bool>("twoSided")));
38  produces<QIE11DigiCollection>("HBHEQIE11DigiCollection");
39 
40  const edm::ParameterSet &psHO = conf.getParameter<edm::ParameterSet>("ho");
41  markAndPass = psHO.getParameter<bool>("markAndPass");
42  ho_ = std::unique_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
43  psHO.getParameter<int>("level"),
44  psHO.getParameter<int>("firstSample"),
45  psHO.getParameter<int>("samplesToAdd"),
46  psHO.getParameter<bool>("twoSided")));
47  produces<HODigiCollection>();
48 
49  const edm::ParameterSet &psHF = conf.getParameter<edm::ParameterSet>("hf");
50  markAndPass = psHF.getParameter<bool>("markAndPass");
51  hf_ = std::unique_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
52  psHF.getParameter<int>("level"),
53  psHF.getParameter<int>("firstSample"),
54  psHF.getParameter<int>("samplesToAdd"),
55  psHF.getParameter<bool>("twoSided")));
56  produces<HFDigiCollection>();
57  hfQIE10_ = std::unique_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
58  psHF.getParameter<int>("level"),
59  psHF.getParameter<int>("firstSample"),
60  psHF.getParameter<int>("samplesToAdd"),
61  psHF.getParameter<bool>("twoSided")));
62  produces<QIE10DigiCollection>("HFQIE10DigiCollection");
63 }
64 
66 
68  // get conditions
70  eventSetup.get<HcalDbRecord>().get(conditions);
71 
72  {
73  hbhe_->prepare(&(*conditions));
75  e.getByToken(tok_hbhe_, digi);
76 
77  // create empty output
78  std::unique_ptr<HBHEDigiCollection> zs(new HBHEDigiCollection);
79  // run the algorithm
80  hbhe_->suppress(*(digi.product()), *zs);
81 
82  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << digi->size() << " digis, output "
83  << zs->size() << " digis";
84 
85  // return result
86  e.put(std::move(zs));
87  hbhe_->done();
88  }
89  {
90  ho_->prepare(&(*conditions));
92  e.getByToken(tok_ho_, digi);
93 
94  // create empty output
95  std::unique_ptr<HODigiCollection> zs(new HODigiCollection);
96  // run the algorithm
97  ho_->suppress(*(digi.product()), *zs);
98 
99  edm::LogInfo("HcalZeroSuppression") << "Suppression (HO) input " << digi->size() << " digis, output " << zs->size()
100  << " digis";
101 
102  // return result
103  e.put(std::move(zs));
104  ho_->done();
105  }
106  {
107  hf_->prepare(&(*conditions));
109  e.getByToken(tok_hf_, digi);
110 
111  // create empty output
112  std::unique_ptr<HFDigiCollection> zs(new HFDigiCollection);
113  // run the algorithm
114  hf_->suppress(*(digi.product()), *zs);
115 
116  edm::LogInfo("HcalZeroSuppression") << "Suppression (HF) input " << digi->size() << " digis, output " << zs->size()
117  << " digis";
118 
119  // return result
120  e.put(std::move(zs));
121  hf_->done();
122  }
123  {
124  hfQIE10_->prepare(&(*conditions));
126  e.getByToken(tok_hfQIE10_, digi);
127 
128  // create empty output
129  std::unique_ptr<QIE10DigiCollection> zs(new QIE10DigiCollection(digi->samples()));
130  // run the algorithm
131  hfQIE10_->suppress(*(digi.product()), *zs);
132 
133  edm::LogInfo("HcalZeroSuppression") << "Suppression (HFQIE10) input " << digi->size() << " digis, output "
134  << zs->size() << " digis";
135 
136  // return result
137  e.put(std::move(zs), "HFQIE10DigiCollection");
138  hfQIE10_->done();
139  }
140  {
141  hbheQIE11_->prepare(&(*conditions));
143  e.getByToken(tok_hbheQIE11_, digi);
144 
145  // create empty output
146  std::unique_ptr<QIE11DigiCollection> zs(new QIE11DigiCollection(digi->samples()));
147  // run the algorithm
148  hbheQIE11_->suppress(*(digi.product()), *zs);
149 
150  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHEQIE11) input " << digi->size() << " digis, output "
151  << zs->size() << " digis";
152 
153  // return result
154  e.put(std::move(zs), "HBHEQIE11DigiCollection");
155  hbheQIE11_->done();
156  }
157 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::EDGetTokenT< QIE11DigiCollection > tok_hbheQIE11_
void produce(edm::Event &e, const edm::EventSetup &c) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::unique_ptr< HcalZSAlgoEnergy > hbheQIE11_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
std::unique_ptr< HcalZSAlgoEnergy > hf_
std::unique_ptr< HcalZSAlgoEnergy > hbhe_
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< HODigiCollection > tok_ho_
size_type size() const
T get() const
Definition: EventSetup.h:73
HcalSimpleAmplitudeZS(const edm::ParameterSet &ps)
std::unique_ptr< HcalZSAlgoEnergy > ho_
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< HcalZSAlgoEnergy > hfQIE10_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_