CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OccurrenceTraits.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_OccurrenceTraits_h
2 #define FWCore_Framework_OccurrenceTraits_h
3 
4 /*----------------------------------------------------------------------
5 
6 OccurrenceTraits:
7 
8 ----------------------------------------------------------------------*/
9 
26 
27 #include<string>
28 
29 namespace edm {
30 
31  class ProcessContext;
32 
33  template <typename T, BranchActionType B> class OccurrenceTraits;
34 
35  template <>
37  public:
40  static BranchType const branchType_ = InEvent;
41  static bool const begin_ = true;
42  static bool const isEvent_ = true;
43 
44  static void setStreamContext(StreamContext& streamContext, MyPrincipal const& principal) {
46  streamContext.setEventID(principal.id());
47  streamContext.setTimestamp(principal.time());
48  }
49 
50  static void preScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
51  a->preEventSignal_(*streamContext);
52  }
53  static void postScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
54  a->postEventSignal_(*streamContext);
55  }
56  static void prePathSignal(ActivityRegistry *a, PathContext const* pathContext) {
57  a->prePathEventSignal_(*pathContext->streamContext(), *pathContext);
58  }
59  static void postPathSignal(ActivityRegistry *a, HLTPathStatus const& status, PathContext const* pathContext) {
60  a->postPathEventSignal_(*pathContext->streamContext(), *pathContext, status);
61  }
62  static void preModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
63  a->preModuleEventSignal_(*streamContext, *moduleCallingContext);
64  }
65  static void postModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
66  a->postModuleEventSignal_(*streamContext, *moduleCallingContext);
67  }
68  };
69 
70  template <>
72  public:
75  static BranchType const branchType_ = InRun;
76  static bool const begin_ = true;
77  static bool const isEvent_ = false;
78 
79  static GlobalContext makeGlobalContext(MyPrincipal const& principal, ProcessContext const* processContext) {
81  LuminosityBlockID(principal.run(), 0),
82  principal.index(),
84  principal.beginTime(),
85  processContext);
86  }
87 
88  static void preScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
89  a->preGlobalBeginRunSignal_(*globalContext);
90  }
91  static void postScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
92  a->postGlobalBeginRunSignal_(*globalContext);
93  }
94  static void prePathSignal(ActivityRegistry *, PathContext const* ) {
95  }
96  static void postPathSignal(ActivityRegistry *, HLTPathStatus const& , PathContext const* ) {
97  }
98  static void preModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
99  a->preModuleGlobalBeginRunSignal_(*globalContext, *moduleCallingContext);
100  }
101  static void postModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
102  a->postModuleGlobalBeginRunSignal_(*globalContext, *moduleCallingContext);
103  }
104  };
105 
106  template <>
108  public:
111  static BranchType const branchType_ = InRun;
112  static bool const begin_ = true;
113  static bool const isEvent_ = false;
114 
115  static void setStreamContext(StreamContext& streamContext, MyPrincipal const& principal) {
117  streamContext.setEventID(EventID(principal.run(), 0, 0));
118  streamContext.setRunIndex(principal.index());
120  streamContext.setTimestamp(principal.beginTime());
121  }
122 
123  static void preScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
124  a->preStreamBeginRunSignal_(*streamContext);
125  }
126  static void postScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
127  a->postStreamBeginRunSignal_(*streamContext);
128  }
129  static void prePathSignal(ActivityRegistry *, PathContext const* ) {
130  }
131  static void postPathSignal(ActivityRegistry *, HLTPathStatus const& , PathContext const*) {
132  }
133  static void preModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
134  a->preModuleStreamBeginRunSignal_(*streamContext, *moduleCallingContext);
135  }
136  static void postModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
137  a->postModuleStreamBeginRunSignal_(*streamContext, *moduleCallingContext);
138  }
139  };
140 
141  template <>
143  public:
146  static BranchType const branchType_ = InRun;
147  static bool const begin_ = false;
148  static bool const isEvent_ = false;
149 
150  static void setStreamContext(StreamContext& streamContext, MyPrincipal const& principal) {
152  streamContext.setEventID(EventID(principal.run(), 0, 0));
153  streamContext.setRunIndex(principal.index());
155  streamContext.setTimestamp(principal.endTime());
156  }
157 
158  static void preScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
159  a->preStreamEndRunSignal_(*streamContext);
160  }
161  static void postScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
162  a->postStreamEndRunSignal_(*streamContext);
163  }
164  static void prePathSignal(ActivityRegistry *, PathContext const* ) {
165  }
166  static void postPathSignal(ActivityRegistry *, HLTPathStatus const& , PathContext const* ) {
167  }
168  static void preModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
169  a->preModuleStreamEndRunSignal_(*streamContext, *moduleCallingContext);
170  }
171  static void postModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
172  a->postModuleStreamEndRunSignal_(*streamContext, *moduleCallingContext);
173  }
174  };
175 
176  template <>
178  public:
181  static BranchType const branchType_ = InRun;
182  static bool const begin_ = false;
183  static bool const isEvent_ = false;
184 
185  static GlobalContext makeGlobalContext(MyPrincipal const& principal, ProcessContext const* processContext) {
187  LuminosityBlockID(principal.run(), 0),
188  principal.index(),
190  principal.endTime(),
191  processContext);
192  }
193 
194  static void preScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
195  a->preGlobalEndRunSignal_(*globalContext);
196  }
197  static void postScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
198  a->postGlobalEndRunSignal_(*globalContext);
199  }
200  static void prePathSignal(ActivityRegistry *, PathContext const*) {
201  }
202  static void postPathSignal(ActivityRegistry *, HLTPathStatus const& , PathContext const* ) {
203  }
204  static void preModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
205  a->preModuleGlobalEndRunSignal_(*globalContext, *moduleCallingContext);
206  }
207  static void postModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
208  a->postModuleGlobalEndRunSignal_(*globalContext, *moduleCallingContext);
209  }
210  };
211 
212  template <>
214  public:
217  static BranchType const branchType_ = InLumi;
218  static bool const begin_ = true;
219  static bool const isEvent_ = false;
220 
221  static GlobalContext makeGlobalContext(MyPrincipal const& principal, ProcessContext const* processContext) {
223  principal.id(),
224  principal.runPrincipal().index(),
225  principal.index(),
226  principal.beginTime(),
227  processContext);
228  }
229 
230  static void preScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
231  a->preGlobalBeginLumiSignal_(*globalContext);
232  }
233  static void postScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
234  a->postGlobalBeginLumiSignal_(*globalContext);
235  }
236  static void prePathSignal(ActivityRegistry *, PathContext const*) {
237  }
238  static void postPathSignal(ActivityRegistry *, HLTPathStatus const&, PathContext const*) {
239  }
240  static void preModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
241  a->preModuleGlobalBeginLumiSignal_(*globalContext, *moduleCallingContext);
242  }
243  static void postModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
244  a->postModuleGlobalBeginLumiSignal_(*globalContext, *moduleCallingContext);
245  }
246  };
247 
248  template <>
250  public:
253  static BranchType const branchType_ = InLumi;
254  static bool const begin_ = true;
255  static bool const isEvent_ = false;
256 
257  static void setStreamContext(StreamContext& streamContext, MyPrincipal const& principal) {
259  streamContext.setEventID(EventID(principal.run(), principal.luminosityBlock(), 0));
260  streamContext.setRunIndex(principal.runPrincipal().index());
261  streamContext.setLuminosityBlockIndex(principal.index());
262  streamContext.setTimestamp(principal.beginTime());
263  }
264 
265  static void preScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
266  a->preStreamBeginLumiSignal_(*streamContext);
267  }
268  static void postScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
269  a->postStreamBeginLumiSignal_(*streamContext);
270  }
271  static void prePathSignal(ActivityRegistry *, PathContext const*) {
272  }
273  static void postPathSignal(ActivityRegistry *, HLTPathStatus const&, PathContext const*) {
274  }
275  static void preModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
276  a->preModuleStreamBeginLumiSignal_(*streamContext, *moduleCallingContext);
277  }
278  static void postModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
279  a->postModuleStreamBeginLumiSignal_(*streamContext, *moduleCallingContext);
280  }
281  };
282 
283  template <>
285  public:
288  static BranchType const branchType_ = InLumi;
289  static bool const begin_ = false;
290  static bool const isEvent_ = false;
291 
292  static StreamContext const* context(StreamContext const* s, GlobalContext const*) { return s; }
293 
294  static void setStreamContext(StreamContext& streamContext, MyPrincipal const& principal) {
296  streamContext.setEventID(EventID(principal.run(), principal.luminosityBlock(), 0));
297  streamContext.setRunIndex(principal.runPrincipal().index());
298  streamContext.setLuminosityBlockIndex(principal.index());
299  streamContext.setTimestamp(principal.endTime());
300  }
301 
302  static void preScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
303  a->preStreamEndLumiSignal_(*streamContext);
304  }
305  static void postScheduleSignal(ActivityRegistry *a, StreamContext const* streamContext) {
306  a->postStreamEndLumiSignal_(*streamContext);
307  }
308  static void prePathSignal(ActivityRegistry *, PathContext const* ) {
309  }
310  static void postPathSignal(ActivityRegistry *, HLTPathStatus const&, PathContext const*) {
311  }
312  static void preModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
313  a->preModuleStreamEndLumiSignal_(*streamContext, *moduleCallingContext);
314  }
315  static void postModuleSignal(ActivityRegistry *a, StreamContext const* streamContext, ModuleCallingContext const* moduleCallingContext) {
316  a->postModuleStreamEndLumiSignal_(*streamContext, *moduleCallingContext);
317  }
318  };
319 
320  template <>
322  public:
325  static BranchType const branchType_ = InLumi;
326  static bool const begin_ = false;
327  static bool const isEvent_ = false;
328 
329  static GlobalContext makeGlobalContext(MyPrincipal const& principal, ProcessContext const* processContext) {
331  principal.id(),
332  principal.runPrincipal().index(),
333  principal.index(),
334  principal.beginTime(),
335  processContext);
336  }
337 
338  static void preScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
339  a->preGlobalEndLumiSignal_(*globalContext);
340  }
341  static void postScheduleSignal(ActivityRegistry *a, GlobalContext const* globalContext) {
342  a->postGlobalEndLumiSignal_(*globalContext);
343  }
344  static void prePathSignal(ActivityRegistry *, PathContext const*) {
345  }
346  static void postPathSignal(ActivityRegistry *, HLTPathStatus const& , PathContext const* ) {
347  }
348  static void preModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
349  a->preModuleGlobalEndLumiSignal_(*globalContext, *moduleCallingContext);
350  }
351  static void postModuleSignal(ActivityRegistry *a, GlobalContext const* globalContext, ModuleCallingContext const* moduleCallingContext) {
352  a->postModuleGlobalEndLumiSignal_(*globalContext, *moduleCallingContext);
353  }
354  };
355 }
356 #endif
RunPrincipal const & runPrincipal() const
PreModuleStreamBeginRun preModuleStreamBeginRunSignal_
static void postScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void preModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
static StreamContext const * context(StreamContext const *s, GlobalContext const *)
PreStreamBeginRun preStreamBeginRunSignal_
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static void prePathSignal(ActivityRegistry *, PathContext const *)
PostModuleStreamEndRun postModuleStreamEndRunSignal_
static void postModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
void setTimestamp(Timestamp const &v)
Definition: StreamContext.h:69
static void preScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void preModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
PrePathEvent prePathEventSignal_
Timestamp const & beginTime() const
PostModuleGlobalBeginRun postModuleGlobalBeginRunSignal_
static void preScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
PreGlobalBeginRun preGlobalBeginRunSignal_
signal is emitted after the Run has been created by the InputSource but before any modules have seen ...
static void preScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void postModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
static void postModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
PostModuleEvent postModuleEventSignal_
PreGlobalEndRun preGlobalEndRunSignal_
PostEvent postEventSignal_
signal is emitted after all modules have finished processing the Event
PostStreamEndLumi postStreamEndLumiSignal_
PostGlobalBeginRun postGlobalBeginRunSignal_
Timestamp const & endTime() const
EventID const & id() const
static void preModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
static void setStreamContext(StreamContext &streamContext, MyPrincipal const &principal)
static void preModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
static void prePathSignal(ActivityRegistry *, PathContext const *)
LuminosityBlockIndex index() const
PostModuleStreamBeginLumi postModuleStreamBeginLumiSignal_
static void prePathSignal(ActivityRegistry *, PathContext const *)
RunNumber_t run() const
Definition: RunPrincipal.h:61
static void postScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void setStreamContext(StreamContext &streamContext, MyPrincipal const &principal)
static void postModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
static void postModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
static void postModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
BranchType
Definition: BranchType.h:11
PreModuleStreamEndLumi preModuleStreamEndLumiSignal_
void setTransition(Transition v)
Definition: StreamContext.h:65
PostGlobalEndLumi postGlobalEndLumiSignal_
Timestamp const & time() const
static GlobalContext makeGlobalContext(MyPrincipal const &principal, ProcessContext const *processContext)
PreGlobalBeginLumi preGlobalBeginLumiSignal_
static void postScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
LuminosityBlockNumber_t luminosityBlock() const
PostModuleGlobalEndRun postModuleGlobalEndRunSignal_
void setLuminosityBlockIndex(LuminosityBlockIndex const &v)
Definition: StreamContext.h:68
PostModuleGlobalEndLumi postModuleGlobalEndLumiSignal_
Timestamp const & beginTime() const
Definition: RunPrincipal.h:73
static void postScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
PreModuleStreamEndRun preModuleStreamEndRunSignal_
PostStreamEndRun postStreamEndRunSignal_
PreStreamEndRun preStreamEndRunSignal_
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static void preScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
Timestamp const & endTime() const
Definition: RunPrincipal.h:77
PreGlobalEndLumi preGlobalEndLumiSignal_
static void postScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static GlobalContext makeGlobalContext(MyPrincipal const &principal, ProcessContext const *processContext)
static void prePathSignal(ActivityRegistry *, PathContext const *)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static LuminosityBlockIndex invalidLuminosityBlockIndex()
static void preModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
PreStreamBeginLumi preStreamBeginLumiSignal_
PreModuleStreamBeginLumi preModuleStreamBeginLumiSignal_
PostStreamBeginRun postStreamBeginRunSignal_
PreModuleGlobalBeginRun preModuleGlobalBeginRunSignal_
static void preModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
static void setStreamContext(StreamContext &streamContext, MyPrincipal const &principal)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static void postScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static GlobalContext makeGlobalContext(MyPrincipal const &principal, ProcessContext const *processContext)
PreModuleGlobalBeginLumi preModuleGlobalBeginLumiSignal_
static void postModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static void preModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
PreModuleGlobalEndLumi preModuleGlobalEndLumiSignal_
static void postModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
PostGlobalEndRun postGlobalEndRunSignal_
static void preScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void prePathSignal(ActivityRegistry *, PathContext const *)
RunIndex index() const
Definition: RunPrincipal.h:53
static void prePathSignal(ActivityRegistry *, PathContext const *)
PreModuleEvent preModuleEventSignal_
static void preModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
PostGlobalBeginLumi postGlobalBeginLumiSignal_
StreamContext const * streamContext() const
Definition: PathContext.h:38
void setEventID(EventID const &v)
Definition: StreamContext.h:66
static void preScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void setStreamContext(StreamContext &streamContext, MyPrincipal const &principal)
double a
Definition: hdecay.h:121
static GlobalContext makeGlobalContext(MyPrincipal const &principal, ProcessContext const *processContext)
PostPathEvent postPathEventSignal_
PostStreamBeginLumi postStreamBeginLumiSignal_
static void preScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
PreStreamEndLumi preStreamEndLumiSignal_
static void postScheduleSignal(ActivityRegistry *a, GlobalContext const *globalContext)
static void postPathSignal(ActivityRegistry *a, HLTPathStatus const &status, PathContext const *pathContext)
PostModuleStreamEndLumi postModuleStreamEndLumiSignal_
static void postScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
PreModuleGlobalEndRun preModuleGlobalEndRunSignal_
static void prePathSignal(ActivityRegistry *, PathContext const *)
static void preScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void setStreamContext(StreamContext &streamContext, MyPrincipal const &principal)
PreEvent preEventSignal_
signal is emitted after the Event has been created by the InputSource but before any modules have see...
PostModuleStreamBeginRun postModuleStreamBeginRunSignal_
static void preScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void preModuleSignal(ActivityRegistry *a, GlobalContext const *globalContext, ModuleCallingContext const *moduleCallingContext)
void setRunIndex(RunIndex const &v)
Definition: StreamContext.h:67
static void prePathSignal(ActivityRegistry *a, PathContext const *pathContext)
static void postPathSignal(ActivityRegistry *, HLTPathStatus const &, PathContext const *)
static void postScheduleSignal(ActivityRegistry *a, StreamContext const *streamContext)
static void prePathSignal(ActivityRegistry *, PathContext const *)
PostModuleGlobalBeginLumi postModuleGlobalBeginLumiSignal_
static void postModuleSignal(ActivityRegistry *a, StreamContext const *streamContext, ModuleCallingContext const *moduleCallingContext)
tuple status
Definition: mps_update.py:57