CMS 3D CMS Logo

EmptySimHits.cc
Go to the documentation of this file.
1 #include <memory>
2 
5 
8 
10 
13 
15 public:
16  explicit EmptySimHits(const edm::ParameterSet&);
17  ~EmptySimHits() override{};
18 
19  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
20 
21 private:
22  void beginJob() override{};
23  void produce(edm::Event&, const edm::EventSetup&) override;
24  void endJob() override{};
25 
26  const std::vector<std::string> pSimHitInstanceLabels;
27  const std::vector<std::string> pCaloHitInstanceLabels;
28 };
29 
31  : pSimHitInstanceLabels(iConfig.getParameter<std::vector<std::string> >("pSimHitInstanceLabels")),
32  pCaloHitInstanceLabels(iConfig.getParameter<std::vector<std::string> >("pCaloHitInstanceLabels")) {
33  for (size_t i = 0; i < pSimHitInstanceLabels.size(); i++) {
34  produces<edm::PSimHitContainer>(pSimHitInstanceLabels[i]);
35  }
36 
37  for (size_t i = 0; i < pCaloHitInstanceLabels.size(); i++) {
38  produces<edm::PCaloHitContainer>(pCaloHitInstanceLabels[i]);
39  }
40 }
41 
43  for (size_t i = 0; i < pSimHitInstanceLabels.size(); i++) {
44  std::unique_ptr<edm::PSimHitContainer> pSimHitContainer(new edm::PSimHitContainer());
45  iEvent.put(std::move(pSimHitContainer), pSimHitInstanceLabels[i]);
46  }
47 
48  for (size_t i = 0; i < pCaloHitInstanceLabels.size(); i++) {
49  std::unique_ptr<edm::PCaloHitContainer> pCaloHitContainer(new edm::PCaloHitContainer());
50  iEvent.put(std::move(pCaloHitContainer), pCaloHitInstanceLabels[i]);
51  }
52 }
53 
55  //The following says we do not know what parameters are allowed so do no validation
56  // Please change this to state exactly what you do use, even if it is no parameters
58  desc.setUnknown();
59  descriptions.addDefault(desc);
60 }
61 
62 //define this as a plug-in
void beginJob() override
Definition: EmptySimHits.cc:22
std::vector< PCaloHit > PCaloHitContainer
const std::vector< std::string > pSimHitInstanceLabels
Definition: EmptySimHits.cc:24
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EmptySimHits.cc:54
const std::vector< std::string > pCaloHitInstanceLabels
Definition: EmptySimHits.cc:27
EmptySimHits(const edm::ParameterSet &)
Definition: EmptySimHits.cc:30
std::vector< PSimHit > PSimHitContainer
void endJob() override
Definition: EmptySimHits.cc:24
def move(src, dest)
Definition: eostools.py:511
~EmptySimHits() override
Definition: EmptySimHits.cc:17
void produce(edm::Event &, const edm::EventSetup &) override
Definition: EmptySimHits.cc:42