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 
27  const edm::ParameterSet& psHBHE=conf.getParameter<edm::ParameterSet>("hbhe");
28  bool markAndPass=psHBHE.getParameter<bool>("markAndPass");
29  hbhe_=std::auto_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  hbheUpgrade_=std::auto_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<HBHEUpgradeDigiCollection>("HBHEUpgradeDigiCollection");
41 
42  const edm::ParameterSet& psHO=conf.getParameter<edm::ParameterSet>("ho");
43  markAndPass=psHO.getParameter<bool>("markAndPass");
44  ho_=std::auto_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::auto_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  hfUpgrade_=std::auto_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<HFUpgradeDigiCollection>("HFUpgradeDigiCollection");
65 
66 }
67 
69 }
70 
72 {
73  // get conditions
75  eventSetup.get<HcalDbRecord>().get(conditions);
76 
77 
78  {
79  hbhe_->prepare(&(*conditions));
81  e.getByToken(tok_hbhe_,digi);
82 
83  // create empty output
84  std::auto_ptr<HBHEDigiCollection> zs(new HBHEDigiCollection);
85  // run the algorithm
86  hbhe_->suppress(*(digi.product()),*zs);
87 
88  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << digi->size() << " digis, output " << zs->size() << " digis";
89 
90  // return result
91  e.put(zs);
92  hbhe_->done();
93  }
94  {
95  ho_->prepare(&(*conditions));
97  e.getByToken(tok_ho_,digi);
98 
99  // create empty output
100  std::auto_ptr<HODigiCollection> zs(new HODigiCollection);
101  // run the algorithm
102  ho_->suppress(*(digi.product()),*zs);
103 
104  edm::LogInfo("HcalZeroSuppression") << "Suppression (HO) input " << digi->size() << " digis, output " << zs->size() << " digis";
105 
106  // return result
107  e.put(zs);
108  ho_->done();
109  }
110  {
111  hf_->prepare(&(*conditions));
113  e.getByToken(tok_hf_,digi);
114 
115  // create empty output
116  std::auto_ptr<HFDigiCollection> zs(new HFDigiCollection);
117  // run the algorithm
118  hf_->suppress(*(digi.product()),*zs);
119 
120  edm::LogInfo("HcalZeroSuppression") << "Suppression (HF) input " << digi->size() << " digis, output " << zs->size() << " digis";
121 
122  // return result
123  e.put(zs);
124  hf_->done();
125  }
126  {
127  hbheUpgrade_->prepare(&(*conditions));
130 
131  // create empty output
132  std::auto_ptr<HBHEUpgradeDigiCollection> zs(new HBHEUpgradeDigiCollection);
133  // run the algorithm
134  hbheUpgrade_->suppress(*(digi.product()),*zs);
135 
136  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHEUpgrade) input " << digi->size() << " digis, output " << zs->size() << " digis";
137 
138  // return result
139  e.put(zs,"HBHEUpgradeDigiCollection");
140  hbheUpgrade_->done();
141  }
142  {
143  hfUpgrade_->prepare(&(*conditions));
145  e.getByToken(tok_hfUpgrade_,digi);
146 
147  // create empty output
148  std::auto_ptr<HFUpgradeDigiCollection> zs(new HFUpgradeDigiCollection);
149  // run the algorithm
150  hfUpgrade_->suppress(*(digi.product()),*zs);
151 
152  edm::LogInfo("HcalZeroSuppression") << "Suppression (HFUpgrade) input " << digi->size() << " digis, output " << zs->size() << " digis";
153 
154  // return result
155  e.put(zs, "HFUpgradeDigiCollection");
156  hfUpgrade_->done();
157  }
158 
159 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
virtual void produce(edm::Event &e, const edm::EventSetup &c)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
std::auto_ptr< HcalZSAlgoEnergy > hbhe_
tuple conf
Definition: dbtoconf.py:185
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:55
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_