CMS 3D CMS Logo

callAbilities.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_stream_callAbilities_h
2 #define FWCore_Framework_stream_callAbilities_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : callAbilities
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sat, 03 Aug 2013 16:28:35 GMT
19 //
20 
21 // system include files
22 #include <memory>
23 // user include files
25 
26 // forward declarations
27 namespace edm {
28  class Run;
29  class EventSetup;
30  class LuminosityBlock;
31  namespace stream {
32  //********************************
33  // CallGlobal
34  //********************************
35  template<typename T , bool>
36  struct CallGlobalImpl {
37  template<typename B>
38  static void set(B* iProd,
39  typename T::GlobalCache const* iCache) {
40  static_cast<T*>(iProd)->setGlobalCache(iCache);
41  }
42  static void endJob(typename T::GlobalCache* iCache) {
43  T::globalEndJob(iCache);
44  }
45  };
46  template<typename T>
48  static void set(void* iProd,
49  void const* iCache) {}
50  static void endJob(void* iCache) {
51  }
52  };
53 
55  //********************************
56  // CallGlobalRun
57  //********************************
58  template<typename T, bool>
60  static void beginRun(edm::Run const& iRun,
61  edm::EventSetup const& iES,
62  typename T::GlobalCache const* iGC,
63  std::shared_ptr<typename T::RunCache const>& oCache) {
64  oCache = T::globalBeginRun(iRun,iES,iGC);
65  }
66 
67  template <typename B>
68  static void set(B* iProd, typename T::RunCache const* iCache) {
69  static_cast<T*>(iProd)->setRunCache(iCache);
70  }
71 
72  static void endRun(edm::Run const& iRun,
73  edm::EventSetup const& iES,
74  typename T::RunContext const* iContext) {
75  T::globalEndRun(iRun, iES, iContext);
76  }
77  };
78 
79  template<typename T>
81  static void beginRun(edm::Run const& ,
82  edm::EventSetup const& ,
83  typename T::GlobalCache const* ,
84  impl::dummy_ptr ) {
85  }
86  static void set(void* iProd,
87  typename T::RunCache const* iCache) {}
88  static void endRun(edm::Run const& ,
89  edm::EventSetup const& ,
90  typename T::RunContext const* ) {
91  }
92  };
93 
95 
96  //********************************
97  // CallGlobalRunSummary
98  //********************************
99  template<typename T, bool>
101  static void beginRun(edm::Run const& iRun,
102  edm::EventSetup const& iES,
103  typename T::RunContext const* iRC,
104  std::shared_ptr<typename T::RunSummaryCache>& oCache) {
105  oCache = T::globalBeginRunSummary(iRun,iES,iRC);
106  }
107  template<typename B>
108  static void streamEndRunSummary(B* iProd,
109  edm::Run const& iRun,
110  edm::EventSetup const& iES,
111  typename T::RunSummaryCache* iCache) {
112  static_cast<T*>(iProd)->endRunSummary(iRun,iES,iCache);
113  }
114 
115  static void globalEndRun(edm::Run const& iRun,
116  edm::EventSetup const& iES,
117  typename T::RunContext const* iContext,
118  typename T::RunSummaryCache* iCache) {
119  T::globalEndRunSummary(iRun, iES, iContext,iCache);
120  }
121  };
122 
123  template<typename T>
125  static void beginRun(edm::Run const& ,
126  edm::EventSetup const& ,
127  typename T::RunContext const* ,
128  impl::dummy_ptr ) {
129  }
130  static void streamEndRunSummary(void* iProd,
131  edm::Run const&,
132  edm::EventSetup const&,
133  typename T::RunSummaryCache const* iCache) {}
134  static void globalEndRun(edm::Run const& ,
135  edm::EventSetup const& ,
136  typename T::RunContext const*,
137  typename T::RunSummaryCache* ) {
138  }
139  };
140 
142 
143  //********************************
144  // CallGlobalLuminosityBlock
145  //********************************
146  template<typename T, bool>
149  edm::EventSetup const& iES,
150  typename T::RunContext const* iRC,
151  std::shared_ptr<typename T::LuminosityBlockCache const>& oCache) {
152  oCache = T::globalBeginLuminosityBlock(Lumi,iES,iRC);
153  }
154 
155  template <typename B>
156  static void set(B* iProd, typename T::LuminosityBlockCache const* iCache) {
157  static_cast<T*>(iProd)->setLuminosityBlockCache(iCache);
158  }
159 
161  edm::EventSetup const& iES,
162  typename T::LuminosityBlockContext const* iContext) {
163  T::globalEndLuminosityBlock(Lumi, iES, iContext);
164  }
165  };
166 
167  template<typename T>
170  edm::EventSetup const& ,
171  typename T::RunContext const* ,
172  impl::dummy_ptr ) {
173  }
174  static void set(void* iProd,
175  typename T::LuminosityBlockCache const* iCache) {}
177  edm::EventSetup const& ,
178  typename T::LuminosityBlockContext const* ) {
179  }
180  };
182 
183  //********************************
184  // CallGlobalLuminosityBlockSummary
185  //********************************
186  template<typename T, bool>
189  edm::EventSetup const& iES,
190  typename T::LuminosityBlockContext const* iRC,
191  std::shared_ptr<typename T::LuminosityBlockSummaryCache>& oCache) {
192  oCache = T::globalBeginLuminosityBlockSummary(Lumi,iES,iRC);
193  }
194  template<typename B>
195  static void streamEndLuminosityBlockSummary(B* iProd,
196  edm::LuminosityBlock const& iLumi,
197  edm::EventSetup const& iES,
198  typename T::LuminosityBlockSummaryCache* iCache) {
199  static_cast<T*>(iProd)->endLuminosityBlockSummary(iLumi,iES,iCache);
200  }
201 
203  edm::EventSetup const& iES,
204  typename T::LuminosityBlockContext const* iContext,
205  typename T::LuminosityBlockSummaryCache* iCache) {
206  T::globalEndLuminosityBlockSummary(Lumi, iES, iContext,iCache);
207  }
208  };
209 
210  template<typename T>
213  edm::EventSetup const& ,
214  typename T::LuminosityBlockContext const* ,
215  impl::dummy_ptr ) {
216  }
217  static void streamEndLuminosityBlockSummary(void* iProd,
218  edm::LuminosityBlock const&,
219  edm::EventSetup const&,
220  typename T::LuminosityBlockSummaryCache* iCache) {}
222  edm::EventSetup const& ,
223  typename T::LuminosityBlockContext const*,
224  typename T::LuminosityBlockSummaryCache* ) {
225  }
226  };
227 
229 
230  //********************************
231  // CallBeginRunProduce
232  //********************************
233  template<typename T, bool >
235  static void produce(edm::Run& iRun,
236  edm::EventSetup const& iES,
237  typename T::RunContext const* iRC) {
238  T::globalBeginRunProduce(iRun,iES,iRC);
239  }
240  };
241 
242  template<typename T>
244  static void produce(edm::Run& iRun,
245  edm::EventSetup const& iES,
246  typename T::RunContext const* iRC) {
247  }
248  };
249 
251 
252  //********************************
253  // CallEndRunProduce
254  //********************************
255  template<typename T, bool bProduce, bool bSummary>
257  static void produce(edm::Run&,
258  edm::EventSetup const&,
259  typename T::RunContext const*,
260  typename T::RunSummaryCache const*) {}
261  };
262 
263  template<typename T>
265  static void produce(edm::Run& iRun,
266  edm::EventSetup const& iES,
267  typename T::RunContext const* iRC,
268  typename T::RunSummaryCache const*) {
269  T::globalEndRunProduce(iRun,iES,iRC);
270  }
271  };
272 
273  template<typename T>
275  static void produce(edm::Run& iRun,
276  edm::EventSetup const& iES,
277  typename T::RunContext const* iRC,
278  typename T::RunSummaryCache const* iRS) {
279  T::globalEndRunProduce(iRun,iES,iRC, iRS);
280  }
281  };
282 
284 
285  //********************************
286  // CallBeginLuminosityBlockProduce
287  //********************************
288  template<typename T, bool >
291  edm::EventSetup const& iES,
292  typename T::LuminosityBlockContext const* iRC) {
293  T::globalBeginLuminosityBlockProduce(Lumi,iES,iRC);
294  }
295  };
296 
297  template<typename T>
300  edm::EventSetup const& iES,
301  typename T::LuminosityBlockContext const* iRC) {
302  }
303  };
304 
306 
307  //********************************
308  // CallEndLuminosityBlockProduce
309  //********************************
310  template<typename T, bool bProduce, bool bSummary>
313  edm::EventSetup const&,
314  typename T::LuminosityBlockContext const*,
315  typename T::LuminosityBlockSummaryCache const*) {}
316  };
317 
318  template<typename T>
321  edm::EventSetup const& iES,
322  typename T::LuminosityBlockContext const* iRC,
323  typename T::LuminosityBlockSummaryCache const*) {
324  T::globalEndLuminosityBlockProduce(Lumi,iES,iRC);
325  }
326  };
327 
328  template<typename T>
331  edm::EventSetup const& iES,
332  typename T::LuminosityBlockContext const* iRC,
333  typename T::LuminosityBlockSummaryCache const* iRS) {
334  T::globalEndLuminosityBlockProduce(Lumi,iES,iRC, iRS);
335  }
336  };
337 
339 
340  }
341 }
342 
343 
344 #endif
static void endLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iContext)
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC)
static void beginRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, std::shared_ptr< typename T::RunSummaryCache > &oCache)
static void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, typename T::LuminosityBlockSummaryCache *)
static void endRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iContext)
Definition: callAbilities.h:72
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC)
static void produce(edm::LuminosityBlock &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, typename T::LuminosityBlockSummaryCache const *)
static void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, impl::dummy_ptr)
static void streamEndRunSummary(B *iProd, edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunSummaryCache *iCache)
static void beginRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::GlobalCache const *iGC, std::shared_ptr< typename T::RunCache const > &oCache)
Definition: callAbilities.h:60
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC)
static void beginLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, std::shared_ptr< typename T::LuminosityBlockSummaryCache > &oCache)
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC)
static void globalEndRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *, typename T::RunSummaryCache *)
static void beginRun(edm::Run const &, edm::EventSetup const &, typename T::GlobalCache const *, impl::dummy_ptr)
Definition: callAbilities.h:81
static void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *)
static void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::RunContext const *, impl::dummy_ptr)
static void beginRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *, impl::dummy_ptr)
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, typename T::RunSummaryCache const *iRS)
static void streamEndRunSummary(void *iProd, edm::Run const &, edm::EventSetup const &, typename T::RunSummaryCache const *iCache)
static const std::string B
static void endJob(typename T::GlobalCache *iCache)
Definition: callAbilities.h:42
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, typename T::LuminosityBlockSummaryCache const *iRS)
static void streamEndLuminosityBlockSummary(B *iProd, edm::LuminosityBlock const &iLumi, edm::EventSetup const &iES, typename T::LuminosityBlockSummaryCache *iCache)
static void globalEndRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iContext, typename T::RunSummaryCache *iCache)
static void endJob(void *iCache)
Definition: callAbilities.h:50
static void streamEndLuminosityBlockSummary(void *iProd, edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockSummaryCache *iCache)
HLT enums.
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, typename T::RunSummaryCache const *)
static void produce(edm::Run &, edm::EventSetup const &, typename T::RunContext const *, typename T::RunSummaryCache const *)
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, typename T::LuminosityBlockSummaryCache const *)
static void globalEndLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iContext, typename T::LuminosityBlockSummaryCache *iCache)
long double T
static void beginLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::RunContext const *iRC, std::shared_ptr< typename T::LuminosityBlockCache const > &oCache)
Definition: Run.h:42
static void endRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *)
Definition: callAbilities.h:88