forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEDProducer.h
53 lines (35 loc) · 1.37 KB
/
EDProducer.h
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
51
52
53
#ifndef EDProducerBase_h
#define EDProducerBase_h
#include "Framework/WaitingTaskWithArenaHolder.h"
namespace edm {
class Event;
class EventSetup;
class EDProducer {
public:
EDProducer() = default;
virtual ~EDProducer() = default;
bool hasAcquire() const { return false; }
void doAcquire(Event const& event, EventSetup const& eventSetup, WaitingTaskWithArenaHolder holder) {}
void doProduce(Event& event, EventSetup const& eventSetup) { produce(event, eventSetup); }
virtual void produce(Event& event, EventSetup const& eventSetup) = 0;
void doEndJob() { endJob(); }
virtual void endJob() {}
private:
};
class EDProducerExternalWork {
public:
EDProducerExternalWork() = default;
virtual ~EDProducerExternalWork() = default;
bool hasAcquire() const { return true; }
void doAcquire(Event const& event, EventSetup const& eventSetup, WaitingTaskWithArenaHolder holder) {
acquire(event, eventSetup, std::move(holder));
}
void doProduce(Event& event, EventSetup const& eventSetup) { produce(event, eventSetup); }
virtual void acquire(Event const& event, EventSetup const& eventSetup, WaitingTaskWithArenaHolder holder) = 0;
virtual void produce(Event& event, EventSetup const& eventSetup) = 0;
void doEndJob() { endJob(); }
virtual void endJob() {}
private:
};
} // namespace edm
#endif