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  // Start with "SubsystemKeysOnly"
77  edm::ESHandle< L1TriggerKey > subsystemKeys ;
78  try
79  {
80  iRecord.get( "SubsystemKeysOnly", subsystemKeys ) ;
81  }
83  {
84  throw ex ;
85  }
86 
87  std::unique_ptr<L1TriggerKey> pL1TriggerKey = std::make_unique< L1TriggerKey >( *subsystemKeys ) ;
88 
89  // Collate object keys
90  std::vector< std::string >::const_iterator itr = m_subsystemLabels.begin() ;
91  std::vector< std::string >::const_iterator end = m_subsystemLabels.end() ;
92  for( ; itr != end ; ++itr )
93  {
95  try
96  {
97  iRecord.get( *itr, objectKeys ) ;
98  }
100  {
101  throw ex ;
102  }
103 
104  pL1TriggerKey->add( objectKeys->recordToKeyMap() ) ;
105  }
106 
107  return pL1TriggerKey ;
108 }
109 
110 //define this as a plug-in
111 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProd);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
L1TriggerKeyOnlineProd(const edm::ParameterSet &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const RecordToKey & recordToKeyMap() const
Definition: L1TriggerKey.h:94
ReturnType produce(const L1TriggerKeyRcd &)
#define end
Definition: vmac.h:39
std::unique_ptr< L1TriggerKey > ReturnType
std::vector< std::string > m_subsystemLabels