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 // system include files
21 
22 // user include files
24 
26 
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_omdsReader(iConfig.getParameter<std::string>("onlineDB"),
49  iConfig.getParameter<std::string>("onlineAuthentication")) {
50  //the following line is needed to tell the framework what
51  // data is being produced
52 
53  // The subsystemLabel is used by L1TriggerKeyOnlineProd to identify the
54  // L1TriggerKeys to concatenate.
55  setWhatProduced(this, iConfig.getParameter<std::string>("subsystemLabel"));
56 
57  //now do what ever other initialization is needed
58 }
59 
61  // do anything here that needs to be done at desctruction time
62  // (e.g. close files, deallocate resources etc.)
63 }
64 
65 //
66 // member functions
67 //
68 
69 // ------------ method called to produce the data ------------
71  // Get L1TriggerKey with label "SubsystemKeysOnly". Re-throw exception if
72  // not present.
73  edm::ESHandle<L1TriggerKey> subsystemKeys;
74  try {
75  iRecord.get("SubsystemKeysOnly", subsystemKeys);
76  } catch (l1t::DataAlreadyPresentException& ex) {
77  throw ex;
78  }
79 
80  // Copy L1TriggerKey to new object.
81  std::unique_ptr<L1TriggerKey> pL1TriggerKey = std::make_unique<L1TriggerKey>(*subsystemKeys);
82 
83  // Get object keys.
84  fillObjectKeys(pL1TriggerKey.get());
85 
86  return pL1TriggerKey;
87 }
88 
89 //define this as a plug-in
90 //DEFINE_FWK_EVENTSETUP_MODULE(L1ObjectKeysOnlineProdBase);
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
std::unique_ptr< L1TriggerKey > ReturnType
ReturnType produce(const L1TriggerKeyRcd &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
virtual void fillObjectKeys(FillType)=0
L1ObjectKeysOnlineProdBase(const edm::ParameterSet &)