CMS 3D CMS Logo

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  std::shared_ptr<L1TriggerKey> pL1TriggerKey = std::make_shared< L1TriggerKey >( *subsystemKeys ) ;
90 
91  // Collate object keys
92  std::vector< std::string >::const_iterator itr = m_subsystemLabels.begin() ;
93  std::vector< std::string >::const_iterator end = m_subsystemLabels.end() ;
94  for( ; itr != end ; ++itr )
95  {
97  try
98  {
99  iRecord.get( *itr, objectKeys ) ;
100  }
102  {
103  throw ex ;
104  }
105 
106  pL1TriggerKey->add( objectKeys->recordToKeyMap() ) ;
107  }
108 
109  return pL1TriggerKey ;
110 }
111 
112 //define this as a plug-in
113 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProd);
std::shared_ptr< L1TriggerKey > ReturnType
L1TriggerKeyOnlineProd(const edm::ParameterSet &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const RecordToKey & recordToKeyMap() const
Definition: L1TriggerKey.h:94
void get(HolderT &iHolder) const
ReturnType produce(const L1TriggerKeyRcd &)
#define end
Definition: vmac.h:37
std::vector< std::string > m_subsystemLabels