CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TriggerKeyDummyProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TriggerKeyDummyProd
4 // Class: L1TriggerKeyDummyProd
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Sat Mar 1 01:08:46 CET 2008
16 // $Id: L1TriggerKeyDummyProd.cc,v 1.3 2008/10/13 01:48:38 wsun Exp $
17 //
18 //
19 
20 
21 // system include files
22 
23 // user include files
25 
26 //
27 // class declaration
28 //
29 
30 //
31 // constants, enums and typedefs
32 //
33 
34 //
35 // static data member definitions
36 //
37 
38 //
39 // constructors and destructor
40 //
42 {
43  //the following line is needed to tell the framework what
44  // data is being produced
45 
46  // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
47  // by L1TriggerKeyOnlineProd.
48  std::string label = iConfig.getParameter< std::string >( "label" ) ;
49  setWhatProduced(this, label);
50 
51  //now do what ever other initialization is needed
52  m_key.setTSCKey( iConfig.getParameter< std::string >( "tscKey" ) ) ;
54  iConfig.getParameter< std::string >( "csctfKey" ) ) ;
56  iConfig.getParameter< std::string >( "dttfKey" ) ) ;
58  iConfig.getParameter< std::string >( "rpcKey" ) ) ;
60  iConfig.getParameter< std::string >( "gmtKey" ) ) ;
62  iConfig.getParameter< std::string >( "rctKey" ) ) ;
64  iConfig.getParameter< std::string >( "gctKey" ) ) ;
66  iConfig.getParameter< std::string >( "gtKey" ) ) ;
68  iConfig.getParameter< std::string >( "tsp0Key" ) ) ;
69 
70  if( label != "SubsystemKeysOnly" )
71  {
72  typedef std::vector< edm::ParameterSet > ObjectKeys;
73  ObjectKeys keys = iConfig.getParameter< ObjectKeys >( "objectKeys" ) ;
74 
75  for( ObjectKeys::const_iterator it = keys.begin ();
76  it != keys.end() ;
77  ++it )
78  {
79  // Replace ?s with spaces.
80  std::string key = it->getParameter< std::string >( "key" ) ;
81  replace( key.begin(), key.end(), '?', ' ' ) ;
82 
83  m_key.add( it->getParameter< std::string >( "record" ),
84  it->getParameter< std::string >( "type" ),
85  key ) ;
86  }
87  }
88 }
89 
90 
92 {
93 
94  // do anything here that needs to be done at desctruction time
95  // (e.g. close files, deallocate resources etc.)
96 
97 }
98 
99 
100 //
101 // member functions
102 //
103 
104 // ------------ method called to produce the data ------------
107 {
108  using namespace edm::es;
109  boost::shared_ptr<L1TriggerKey> pL1TriggerKey ;
110 
111  pL1TriggerKey = boost::shared_ptr< L1TriggerKey >(
112  new L1TriggerKey( m_key ) ) ;
113 
114  return pL1TriggerKey ;
115 }
116 
117 //define this as a plug-in
118 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProd);
T getParameter(std::string const &) const
L1TriggerKeyDummyProd(const edm::ParameterSet &)
boost::shared_ptr< L1TriggerKey > ReturnType
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setTSCKey(const std::string &tscKey)
Definition: L1TriggerKey.h:69
void add(const std::string &record, const std::string &type, const std::string &key)
Definition: L1TriggerKey.h:56
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
ReturnType produce(const L1TriggerKeyRcd &)
void setSubsystemKey(L1Subsystems subsystem, const std::string &key)
Definition: L1TriggerKey.h:72