CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TriggerKeyOnlineProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TriggerKeyOnlineProd
4 // Class: L1TriggerKeyOnlineProd
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Sun Mar 2 03:03:32 CET 2008
16 // $Id: L1TriggerKeyOnlineProd.cc,v 1.10 2008/10/13 01:49:48 wsun Exp $
17 //
18 //
19 
20 
21 // system include files
22 
23 // user include files
25 
27 
29 
31 
32 //
33 // class declaration
34 //
35 
36 //
37 // constants, enums and typedefs
38 //
39 
40 //
41 // static data member definitions
42 //
43 
44 //
45 // constructors and destructor
46 //
48  : m_subsystemLabels( iConfig.getParameter< std::vector< std::string > >(
49  "subsystemLabels" ) )
50 {
51  //the following line is needed to tell the framework what
52  // data is being produced
53  setWhatProduced(this);
54 
55  //now do what ever other initialization is needed
56 }
57 
58 
60 {
61 
62  // do anything here that needs to be done at desctruction time
63  // (e.g. close files, deallocate resources etc.)
64 
65 }
66 
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to produce the data ------------
75 {
76  using namespace edm::es;
77 
78  // Start with "SubsystemKeysOnly"
79  edm::ESHandle< L1TriggerKey > subsystemKeys ;
80  try
81  {
82  iRecord.get( "SubsystemKeysOnly", subsystemKeys ) ;
83  }
85  {
86  throw ex ;
87  }
88 
89  boost::shared_ptr<L1TriggerKey> pL1TriggerKey ;
90  pL1TriggerKey = boost::shared_ptr< L1TriggerKey >(
91  new L1TriggerKey( *subsystemKeys ) ) ;
92 
93  // Collate object keys
94  std::vector< std::string >::const_iterator itr = m_subsystemLabels.begin() ;
95  std::vector< std::string >::const_iterator end = m_subsystemLabels.end() ;
96  for( ; itr != end ; ++itr )
97  {
99  try
100  {
101  iRecord.get( *itr, objectKeys ) ;
102  }
104  {
105  throw ex ;
106  }
107 
108  pL1TriggerKey->add( objectKeys->recordToKeyMap() ) ;
109  }
110 
111  return pL1TriggerKey ;
112 }
113 
114 //define this as a plug-in
115 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProd);
L1TriggerKeyOnlineProd(const edm::ParameterSet &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void get(HolderT &iHolder) const
boost::shared_ptr< L1TriggerKey > ReturnType
ReturnType produce(const L1TriggerKeyRcd &)
#define end
Definition: vmac.h:37
std::vector< std::string > m_subsystemLabels