-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
IntSource.cc
50 lines (42 loc) · 1.58 KB
/
IntSource.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/InputSourceMacros.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Sources/interface/ProducerSourceBase.h"
#include "DataFormats/TestObjects/interface/ToyProducts.h"
#include "FWCore/Framework/interface/Event.h"
#include <memory>
namespace edm {
class IntSource : public ProducerSourceBase {
public:
explicit IntSource(ParameterSet const&, InputSourceDescription const&);
~IntSource();
static void fillDescriptions(ConfigurationDescriptions& descriptions);
private:
virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time, edm::EventAuxiliary::ExperimentType& eType);
virtual void produce(Event &);
};
IntSource::IntSource(ParameterSet const& pset,
InputSourceDescription const& desc) :
ProducerSourceBase(pset, desc, false)
{ produces<edmtest::IntProduct>(); }
IntSource::~IntSource() {
}
bool
IntSource::setRunAndEventInfo(EventID&, TimeValue_t&, edm::EventAuxiliary::ExperimentType&) {
return true;
}
void
IntSource::produce(edm::Event& e) {
std::unique_ptr<edmtest::IntProduct> p(new edmtest::IntProduct(4));
e.put(std::move(p));
}
void
IntSource::fillDescriptions(ConfigurationDescriptions& descriptions) {
ParameterSetDescription desc;
ProducerSourceBase::fillDescription(desc);
descriptions.add("source", desc);
}
}
using edm::IntSource;
DEFINE_FWK_INPUT_SOURCE(IntSource);