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 // system include files
21 
22 // user include files
24 
26 
28 
30 
31 //
32 // class declaration
33 //
34 
35 //
36 // constants, enums and typedefs
37 //
38 
39 //
40 // static data member definitions
41 //
42 
43 //
44 // constructors and destructor
45 //
47  : m_subsystemLabels(iConfig.getParameter<std::vector<std::string> >("subsystemLabels")) {
48  //the following line is needed to tell the framework what
49  // data is being produced
50  setWhatProduced(this);
51 
52  //now do what ever other initialization is needed
53 }
54 
56  // do anything here that needs to be done at desctruction time
57  // (e.g. close files, deallocate resources etc.)
58 }
59 
60 //
61 // member functions
62 //
63 
64 // ------------ method called to produce the data ------------
66  // Start with "SubsystemKeysOnly"
67  edm::ESHandle<L1TriggerKey> subsystemKeys;
68  try {
69  iRecord.get("SubsystemKeysOnly", subsystemKeys);
70  } catch (l1t::DataAlreadyPresentException& ex) {
71  throw ex;
72  }
73 
74  std::unique_ptr<L1TriggerKey> pL1TriggerKey = std::make_unique<L1TriggerKey>(*subsystemKeys);
75 
76  // Collate object keys
77  std::vector<std::string>::const_iterator itr = m_subsystemLabels.begin();
78  std::vector<std::string>::const_iterator end = m_subsystemLabels.end();
79  for (; itr != end; ++itr) {
81  try {
82  iRecord.get(*itr, objectKeys);
83  } catch (l1t::DataAlreadyPresentException& ex) {
84  throw ex;
85  }
86 
87  pL1TriggerKey->add(objectKeys->recordToKeyMap());
88  }
89 
90  return pL1TriggerKey;
91 }
92 
93 //define this as a plug-in
94 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyOnlineProd);
MessageLogger.h
Exception.h
L1TriggerKeyRcd
Definition: L1TriggerKeyRcd.h:30
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
L1TriggerKeyOnlineProd.h
l1t::DataAlreadyPresentException
Definition: Exception.h:32
L1TriggerKeyOnlineProd::L1TriggerKeyOnlineProd
L1TriggerKeyOnlineProd(const edm::ParameterSet &)
Definition: L1TriggerKeyOnlineProd.cc:46
L1TriggerKeyOnlineProd::m_subsystemLabels
std::vector< std::string > m_subsystemLabels
Definition: L1TriggerKeyOnlineProd.h:48
mps_fire.end
end
Definition: mps_fire.py:242
edm::ESHandle
Definition: DTSurvey.h:22
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
L1TriggerKeyOnlineProd::produce
ReturnType produce(const L1TriggerKeyRcd &)
Definition: L1TriggerKeyOnlineProd.cc:65
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
L1TriggerKeyOnlineProd::ReturnType
std::unique_ptr< L1TriggerKey > ReturnType
Definition: L1TriggerKeyOnlineProd.h:42
std
Definition: JetResolutionObject.h:76
EventSetup.h
L1TriggerKeyOnlineProd::~L1TriggerKeyOnlineProd
~L1TriggerKeyOnlineProd() override
Definition: L1TriggerKeyOnlineProd.cc:55
CSCTFObjectKeysOnline_cff.objectKeys
objectKeys
Definition: CSCTFObjectKeysOnline_cff.py:5