CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: __subsys__/__pkgname__
4 // Class: __class__
5 //
13 //
14 // Original Author: __author__
15 // Created: __date__
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
28 
30 
31 
32 //
33 // class declaration
34 //
35 
36 class __class__ : public edm::ESProducer {
37  public:
39  ~__class__();
40 
41 #python_begin
42  if len(__datatypes__) > 1:
43  datatypes = []
44  for dtype in __datatypes__:
45  datatypes.append("std::shared_ptr<%s>" % dtype)
46  print " typedef edm::ESProducts<%s> ReturnType;" % ','.join(datatypes)
47  elif len(__datatypes__) == 1:
48  print " typedef std::shared_ptr<%s> ReturnType;" % __datatypes__[0]
49 #python_end
50 
51  ReturnType produce(const __record__&);
52  private:
53  // ----------member data ---------------------------
54 };
55 
56 //
57 // constants, enums and typedefs
58 //
59 
60 //
61 // static data member definitions
62 //
63 
64 //
65 // constructors and destructor
66 //
68 {
69  //the following line is needed to tell the framework what
70  // data is being produced
71  setWhatProduced(this);
72 
73  //now do what ever other initialization is needed
74 }
75 
76 
78 {
79 
80  // do anything here that needs to be done at desctruction time
81  // (e.g. close files, deallocate resources etc.)
82 
83 }
84 
85 
86 //
87 // member functions
88 //
89 
90 // ------------ method called to produce the data ------------
92 __class__::produce(const __record__& iRecord)
93 {
94  using namespace edm::es;
95 #python_begin
96  out1 = []
97  out2 = []
98  for dtype in __datatypes__:
99  out1.append(" std::shared_ptr<%s> p%s;" % (dtype, dtype))
100  out2.append("p%s" % dtype)
101  output = '\n'.join(out1)
102  output += "\n return products(%s);" % ','.join(out2)
103  print output
104 #python_end
105 
106 }
107 
108 //define this as a plug-in
virtual void produce(edm::Event &, const edm::EventSetup &) override
Definition: EDLooper.cc:98
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
__class__()
Definition: Skeleton.cc:30
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::map< DetId, double > ReturnType
virtual ~__class__()
Definition: EDAnalyzer.cc:89
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60