CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_hbheUpgrade_ = consumes<HBHEUpgradeDigiCollection>(edm::InputTag(inputLabel_, "HBHEUpgradeDigiCollection"));
25  tok_hfUpgrade_ = consumes<HFUpgradeDigiCollection>(edm::InputTag(inputLabel_, "HFUpgradeDigiCollection"));
26  tok_hfQIE10_ = consumes<QIE10DigiCollection>(edm::InputTag(inputLabel_, "HFQIE10DigiCollection"));
27 
28  const edm::ParameterSet& psHBHE=conf.getParameter<edm::ParameterSet>("hbhe");
29  bool markAndPass=psHBHE.getParameter<bool>("markAndPass");
30  hbhe_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
31  psHBHE.getParameter<int>("level"),
32  psHBHE.getParameter<int>("firstSample"),
33  psHBHE.getParameter<int>("samplesToAdd"),
34  psHBHE.getParameter<bool>("twoSided")));
35  produces<HBHEDigiCollection>();
36  hbheUpgrade_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
37  psHBHE.getParameter<int>("level"),
38  psHBHE.getParameter<int>("firstSample"),
39  psHBHE.getParameter<int>("samplesToAdd"),
40  psHBHE.getParameter<bool>("twoSided")));
41  produces<HBHEUpgradeDigiCollection>("HBHEUpgradeDigiCollection");
42 
43  const edm::ParameterSet& psHO=conf.getParameter<edm::ParameterSet>("ho");
44  markAndPass=psHO.getParameter<bool>("markAndPass");
45  ho_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
46  psHO.getParameter<int>("level"),
47  psHO.getParameter<int>("firstSample"),
48  psHO.getParameter<int>("samplesToAdd"),
49  psHO.getParameter<bool>("twoSided")));
50  produces<HODigiCollection>();
51 
52  const edm::ParameterSet& psHF=conf.getParameter<edm::ParameterSet>("hf");
53  markAndPass=psHF.getParameter<bool>("markAndPass");
54  hf_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
55  psHF.getParameter<int>("level"),
56  psHF.getParameter<int>("firstSample"),
57  psHF.getParameter<int>("samplesToAdd"),
58  psHF.getParameter<bool>("twoSided")));
59  produces<HFDigiCollection>();
60  hfUpgrade_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
61  psHF.getParameter<int>("level"),
62  psHF.getParameter<int>("firstSample"),
63  psHF.getParameter<int>("samplesToAdd"),
64  psHF.getParameter<bool>("twoSided")));
65  produces<HFUpgradeDigiCollection>("HFUpgradeDigiCollection");
66  hfQIE10_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
67  psHF.getParameter<int>("level"),
68  psHF.getParameter<int>("firstSample"),
69  psHF.getParameter<int>("samplesToAdd"),
70  psHF.getParameter<bool>("twoSided")));
71  produces<QIE10DigiCollection>("HFQIE10DigiCollection");
72 }
73 
75 }
76 
78 {
79  // get conditions
81  eventSetup.get<HcalDbRecord>().get(conditions);
82 
83 
84  {
85  hbhe_->prepare(&(*conditions));
87  e.getByToken(tok_hbhe_,digi);
88 
89  // create empty output
90  std::auto_ptr<HBHEDigiCollection> zs(new HBHEDigiCollection);
91  // run the algorithm
92  hbhe_->suppress(*(digi.product()),*zs);
93 
94  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << digi->size() << " digis, output " << zs->size() << " digis";
95 
96  // return result
97  e.put(zs);
98  hbhe_->done();
99  }
100  {
101  ho_->prepare(&(*conditions));
103  e.getByToken(tok_ho_,digi);
104 
105  // create empty output
106  std::auto_ptr<HODigiCollection> zs(new HODigiCollection);
107  // run the algorithm
108  ho_->suppress(*(digi.product()),*zs);
109 
110  edm::LogInfo("HcalZeroSuppression") << "Suppression (HO) input " << digi->size() << " digis, output " << zs->size() << " digis";
111 
112  // return result
113  e.put(zs);
114  ho_->done();
115  }
116  {
117  hf_->prepare(&(*conditions));
119  e.getByToken(tok_hf_,digi);
120 
121  // create empty output
122  std::auto_ptr<HFDigiCollection> zs(new HFDigiCollection);
123  // run the algorithm
124  hf_->suppress(*(digi.product()),*zs);
125 
126  edm::LogInfo("HcalZeroSuppression") << "Suppression (HF) input " << digi->size() << " digis, output " << zs->size() << " digis";
127 
128  // return result
129  e.put(zs);
130  hf_->done();
131  }
132  {
133  hbheUpgrade_->prepare(&(*conditions));
136 
137  // create empty output
138  std::auto_ptr<HBHEUpgradeDigiCollection> zs(new HBHEUpgradeDigiCollection);
139  // run the algorithm
140  hbheUpgrade_->suppress(*(digi.product()),*zs);
141 
142  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHEUpgrade) input " << digi->size() << " digis, output " << zs->size() << " digis";
143 
144  // return result
145  e.put(zs,"HBHEUpgradeDigiCollection");
146  hbheUpgrade_->done();
147  }
148  {
149  hfUpgrade_->prepare(&(*conditions));
151  e.getByToken(tok_hfUpgrade_,digi);
152 
153  // create empty output
154  std::auto_ptr<HFUpgradeDigiCollection> zs(new HFUpgradeDigiCollection);
155  // run the algorithm
156  hfUpgrade_->suppress(*(digi.product()),*zs);
157 
158  edm::LogInfo("HcalZeroSuppression") << "Suppression (HFUpgrade) input " << digi->size() << " digis, output " << zs->size() << " digis";
159 
160  // return result
161  e.put(zs, "HFUpgradeDigiCollection");
162  hfUpgrade_->done();
163  }
164  {
165  hfQIE10_->prepare(&(*conditions));
167  e.getByToken(tok_hfUpgrade_,digi);
168 
169  // create empty output
170  std::auto_ptr<QIE10DigiCollection> zs(new QIE10DigiCollection);
171  // run the algorithm
172  hfQIE10_->suppress(*(digi.product()),*zs);
173 
174  edm::LogInfo("HcalZeroSuppression") << "Suppression (HFQIE10) input " << digi->size() << " digis, output " << zs->size() << " digis";
175 
176  // return result
177  e.put(zs, "HFQIE10DigiCollection");
178  hfQIE10_->done();
179  }
180 
181 }
T getParameter(std::string const &) const
std::auto_ptr< HcalZSAlgoEnergy > hfQIE10_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
virtual void produce(edm::Event &e, const edm::EventSetup &c)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::auto_ptr< HcalZSAlgoEnergy > hbhe_
edm::EDGetTokenT< HBHEUpgradeDigiCollection > tok_hbheUpgrade_
T const * product() const
Definition: Handle.h:81
std::auto_ptr< HcalZSAlgoEnergy > hfUpgrade_
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::EDGetTokenT< HFUpgradeDigiCollection > tok_hfUpgrade_
std::auto_ptr< HcalZSAlgoEnergy > ho_
HcalSimpleAmplitudeZS(const edm::ParameterSet &ps)
std::auto_ptr< HcalZSAlgoEnergy > hbheUpgrade_
std::auto_ptr< HcalZSAlgoEnergy > hf_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_