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: prodname
4 // Class: prodname
5 //
13 //
14 // Original Author: John Doe
15 // Created: day-mon-xx
16 // RCS(Id)
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 #include "boost/shared_ptr.hpp"
24 
25 // user include files
28 
30 
31 @perl if( 1 lt scalar( @::datatypes ) ) {$result="#include \"FWCore/Framework/interface/ESProducts.h\""; } @\perl
32 
33 
34 //
35 // class declaration
36 //
37 
38 class prodname : public edm::ESProducer {
39  public:
41  ~prodname();
42 
43  typedef @perl if( 1 eq scalar( @::datatypes ) ) { $result="boost::shared_ptr<$::datatypes[0]>"; } else { $result="edm::ESProducts<"; $line = 0; foreach $type ( @::datatypes ) { if ($line) { $result = "$result, "; } $result= "$result boost::shared_ptr<$type> "; $line =1;} $result="$result>"; } @\perl ReturnType;
44 
45  ReturnType produce(const recordname&);
46  private:
47  // ----------member data ---------------------------
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62 {
63  //the following line is needed to tell the framework what
64  // data is being produced
65  setWhatProduced(this);
66 
67  //now do what ever other initialization is needed
68 }
69 
70 
72 {
73 
74  // do anything here that needs to be done at desctruction time
75  // (e.g. close files, deallocate resources etc.)
76 
77 }
78 
79 
80 //
81 // member functions
82 //
83 
84 // ------------ method called to produce the data ------------
86 prodname::produce(const recordname& iRecord)
87 {
88  using namespace edm::es;
89 @perl $result=""; foreach $type (@::datatypes) {$result ="$result boost::shared_ptr<$type> p$type ;\n";} @\perl
90 
91  return @perl if( 1 eq scalar( @::datatypes ) ) { $result="p$::datatypes[0]" } else { $result="products("; $line = 0; foreach $type ( @::datatypes ) { if ($line) { $result = "$result,"; } $result= "$result p$type"; $line +=1; } $result="$result)"; } @\perl ;
92 }
93 
94 //define this as a plug-in
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition: edproducer.cc:115
foreach $type(@::datatypes)
Definition: esproducer.cc:43
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
perl ReturnType
Definition: esproducer.cc:43
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:56
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
prodname(const edm::ParameterSet &)
Definition: edproducer.cc:79
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
Definition: matutil.cc:184