CMS 3D CMS Logo

L1ObjectKeysOnlineProdBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1ObjectKeysOnlineProdBase
4 // Class: L1ObjectKeysOnlineProdBase
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Fri Aug 22 19:51:36 CEST 2008
16 // $Id: L1ObjectKeysOnlineProdBase.cc,v 1.1 2008/09/19 19:22:59 wsun Exp $
17 //
18 //
19 
20 
21 // system include files
22 
23 // user include files
25 
27 
30 
32 
33 //
34 // class declaration
35 //
36 
37 //
38 // constants, enums and typedefs
39 //
40 
41 //
42 // static data member definitions
43 //
44 
45 //
46 // constructors and destructor
47 //
49  : m_omdsReader(
50  iConfig.getParameter< std::string >( "onlineDB" ),
51  iConfig.getParameter< std::string >( "onlineAuthentication" ) )
52 {
53  //the following line is needed to tell the framework what
54  // data is being produced
55 
56  // The subsystemLabel is used by L1TriggerKeyOnlineProd to identify the
57  // L1TriggerKeys to concatenate.
58  setWhatProduced(this,
59  iConfig.getParameter< std::string >( "subsystemLabel" )
60  );
61 
62  //now do what ever other initialization is needed
63 }
64 
65 
67 {
68 
69  // do anything here that needs to be done at desctruction time
70  // (e.g. close files, deallocate resources etc.)
71 
72 }
73 
74 
75 //
76 // member functions
77 //
78 
79 // ------------ method called to produce the data ------------
82 {
83  // Get L1TriggerKey with label "SubsystemKeysOnly". Re-throw exception if
84  // not present.
85  edm::ESHandle< L1TriggerKey > subsystemKeys ;
86  try
87  {
88  iRecord.get( "SubsystemKeysOnly", subsystemKeys ) ;
89  }
91  {
92  throw ex ;
93  }
94 
95  // Copy L1TriggerKey to new object.
96  std::unique_ptr<L1TriggerKey> pL1TriggerKey = std::make_unique< L1TriggerKey >( *subsystemKeys ) ;
97 
98  // Get object keys.
99  fillObjectKeys( pL1TriggerKey.get() ) ;
100 
101  return pL1TriggerKey ;
102 }
103 
104 //define this as a plug-in
105 //DEFINE_FWK_EVENTSETUP_MODULE(L1ObjectKeysOnlineProdBase);
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
std::unique_ptr< L1TriggerKey > ReturnType
ReturnType produce(const L1TriggerKeyRcd &)
virtual void fillObjectKeys(FillType)=0
L1ObjectKeysOnlineProdBase(const edm::ParameterSet &)
bool get(HolderT &iHolder) const