CMS 3D CMS Logo

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