ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/ShallowTools/plugins/ShallowExampleProducer.cc
Revision: 1.1
Committed: Sat Jun 6 14:23:09 2009 UTC (15 years, 11 months ago) by bbetchar
Content type: text/plain
Branch: MAIN
CVS Tags: V03-00-02, V03-00-01, V03-00-00
Log Message:
Move directories around

File Contents

# User Rev Content
1 bbetchar 1.1 #include "UserCode/ShallowTools/interface/ShallowExampleProducer.h"
2    
3     ShallowExampleProducer::ShallowExampleProducer(const edm::ParameterSet& iConfig)
4     {
5     produces <bool> ( "booly" );
6     produces <short> ( "shorty" );
7     produces <int> ( "inty" );
8     produces <long> ( "longy" );
9     produces <float> ( "floaty" );
10     produces <double> ( "doubley" );
11     produces <unsigned short> ( "ushorty" );
12     produces <unsigned int> ( "uinty" );
13     produces <unsigned long> ( "ulongy" );
14     produces <std::vector <bool> >( "boolsy" );
15     produces <std::vector <short> >( "shortsy" );
16     produces <std::vector <int> >( "intsy" );
17     produces <std::vector <long> >( "longsy" );
18     produces <std::vector <float> >( "floatsy" );
19     produces <std::vector <double> >( "doublesy" );
20     produces <std::vector<unsigned short> >( "ushortsy" );
21     produces <std::vector<unsigned int> >( "uintsy" );
22     produces <std::vector<unsigned long> >( "ulongsy" );
23     produces < std::string> ( "stringy" );
24     }
25    
26     void ShallowExampleProducer::
27     produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
28     std::auto_ptr<bool> b ( new bool(true) );
29     std::auto_ptr<short> s ( new short(-3) );
30     std::auto_ptr<int> i ( new int(-3) );
31     std::auto_ptr<long> l ( new long(-3) );
32     std::auto_ptr<float> f ( new float(3.0) );
33     std::auto_ptr<double> d ( new double(3.0) );
34    
35     std::auto_ptr<unsigned short> us ( new unsigned short(3) );
36     std::auto_ptr<unsigned int> ui ( new unsigned int(3) );
37     std::auto_ptr<unsigned long> ul ( new unsigned long(3) );
38    
39     std::auto_ptr<std::vector<bool> > bv ( new std::vector<bool>() );
40     std::auto_ptr<std::vector<short> > sv ( new std::vector<short>() );
41     std::auto_ptr<std::vector<int> > iv ( new std::vector<int>() );
42     std::auto_ptr<std::vector<long> > lv ( new std::vector<long>() );
43     std::auto_ptr<std::vector<float> > fv ( new std::vector<float>() );
44     std::auto_ptr<std::vector<double> > dv ( new std::vector<double>() );
45    
46     std::auto_ptr <std::vector<unsigned short> > usv ( new std::vector<unsigned short>() );
47     std::auto_ptr <std::vector<unsigned int> > uiv ( new std::vector<unsigned int>() );
48     std::auto_ptr <std::vector<unsigned long> > ulv ( new std::vector<unsigned long>() );
49    
50     std::auto_ptr <std::string> S( new std::string("a string") );
51    
52    
53     for(int j=0; j<10; j++) {
54    
55     bv->push_back((j%2)==0);
56    
57     usv->push_back(j);
58     uiv->push_back(j);
59     ulv->push_back(j);
60    
61     sv->push_back(0-j);
62     iv->push_back(0-j);
63     lv->push_back(0-j);
64    
65     fv->push_back(j/2.);
66     dv->push_back(j/2.);
67     }
68    
69     iEvent.put( b, "booly" );
70     iEvent.put( s, "shorty" );
71     iEvent.put( i, "inty" );
72     iEvent.put( l, "longy" );
73     iEvent.put( f, "floaty" );
74     iEvent.put( d, "doubley" );
75    
76     iEvent.put( us, "ushorty" );
77     iEvent.put( ui, "uinty" );
78     iEvent.put( ul, "ulongy" );
79    
80     iEvent.put( bv, "boolsy" );
81     iEvent.put( sv, "shortsy" );
82     iEvent.put( iv, "intsy" );
83     iEvent.put( lv, "longsy" );
84     iEvent.put( fv, "floatsy" );
85     iEvent.put( dv, "doublesy");
86    
87     iEvent.put( usv,"ushortsy");
88     iEvent.put( uiv,"uintsy" );
89     iEvent.put( ulv,"ulongsy" );
90    
91     iEvent.put( S, "stringy" );
92    
93     }