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, typename T::GlobalCache const* iCache) {
39  static_cast<T*>(iProd)->setGlobalCache(iCache);
40  }
41  static void endJob(typename T::GlobalCache* iCache) { T::globalEndJob(iCache); }
42  };
43  template <typename T>
44  struct CallGlobalImpl<T, false> {
45  static void set(void* iProd, void const* iCache) {}
46  static void endJob(void* iCache) {}
47  };
48 
49  template <typename T>
51  //********************************
52  // CallGlobalRun
53  //********************************
54  template <typename T, bool>
56  static void beginRun(edm::Run const& iRun,
57  edm::EventSetup const& iES,
58  typename T::GlobalCache const* iGC,
59  std::shared_ptr<typename T::RunCache const>& oCache) {
60  oCache = T::globalBeginRun(iRun, iES, iGC);
61  }
62 
63  template <typename B>
64  static void set(B* iProd, typename T::RunCache const* iCache) {
65  static_cast<T*>(iProd)->setRunCache(iCache);
66  }
67 
68  static void endRun(edm::Run const& iRun, edm::EventSetup const& iES, typename T::RunContext const* iContext) {
69  T::globalEndRun(iRun, iES, iContext);
70  }
71  };
72 
73  template <typename T>
75  static void beginRun(edm::Run const&, edm::EventSetup const&, typename T::GlobalCache const*, impl::dummy_ptr) {}
76  static void set(void* iProd, typename T::RunCache const* iCache) {}
77  static void endRun(edm::Run const&, edm::EventSetup const&, typename T::RunContext const*) {}
78  };
79 
80  template <typename T>
82 
83  //********************************
84  // CallGlobalRunSummary
85  //********************************
86  template <typename T, bool>
88  static void beginRun(edm::Run const& iRun,
89  edm::EventSetup const& iES,
90  typename T::RunContext const* iRC,
91  std::shared_ptr<typename T::RunSummaryCache>& oCache) {
92  oCache = T::globalBeginRunSummary(iRun, iES, iRC);
93  }
94  template <typename B>
95  static void streamEndRunSummary(B* iProd,
96  edm::Run const& iRun,
97  edm::EventSetup const& iES,
98  typename T::RunSummaryCache* iCache) {
99  static_cast<T*>(iProd)->endRunSummary(iRun, iES, iCache);
100  }
101 
102  static void globalEndRun(edm::Run const& iRun,
103  edm::EventSetup const& iES,
104  typename T::RunContext const* iContext,
105  typename T::RunSummaryCache* iCache) {
106  T::globalEndRunSummary(iRun, iES, iContext, iCache);
107  }
108  };
109 
110  template <typename T>
112  static void beginRun(edm::Run const&, edm::EventSetup const&, typename T::RunContext const*, impl::dummy_ptr) {}
113  static void streamEndRunSummary(void* iProd,
114  edm::Run const&,
115  edm::EventSetup const&,
116  typename T::RunSummaryCache const* iCache) {}
117  static void globalEndRun(edm::Run const&,
118  edm::EventSetup const&,
119  typename T::RunContext const*,
120  typename T::RunSummaryCache*) {}
121  };
122 
123  template <typename T>
125 
126  //********************************
127  // CallGlobalLuminosityBlock
128  //********************************
129  template <typename T, bool>
132  edm::EventSetup const& iES,
133  typename T::RunContext const* iRC,
134  std::shared_ptr<typename T::LuminosityBlockCache const>& oCache) {
135  oCache = T::globalBeginLuminosityBlock(Lumi, iES, iRC);
136  }
137 
138  template <typename B>
139  static void set(B* iProd, typename T::LuminosityBlockCache const* iCache) {
140  static_cast<T*>(iProd)->setLuminosityBlockCache(iCache);
141  }
142 
144  edm::EventSetup const& iES,
145  typename T::LuminosityBlockContext const* iContext) {
146  T::globalEndLuminosityBlock(Lumi, iES, iContext);
147  }
148  };
149 
150  template <typename T>
153  edm::EventSetup const&,
154  typename T::RunContext const*,
155  impl::dummy_ptr) {}
156  static void set(void* iProd, typename T::LuminosityBlockCache const* iCache) {}
158  edm::EventSetup const&,
159  typename T::LuminosityBlockContext const*) {}
160  };
161  template <typename T>
163 
164  //********************************
165  // CallGlobalLuminosityBlockSummary
166  //********************************
167  template <typename T, bool>
170  edm::EventSetup const& iES,
171  typename T::LuminosityBlockContext const* iRC,
172  std::shared_ptr<typename T::LuminosityBlockSummaryCache>& oCache) {
173  oCache = T::globalBeginLuminosityBlockSummary(Lumi, iES, iRC);
174  }
175  template <typename B>
176  static void streamEndLuminosityBlockSummary(B* iProd,
177  edm::LuminosityBlock const& iLumi,
178  edm::EventSetup const& iES,
179  typename T::LuminosityBlockSummaryCache* iCache) {
180  static_cast<T*>(iProd)->endLuminosityBlockSummary(iLumi, iES, iCache);
181  }
182 
184  edm::EventSetup const& iES,
185  typename T::LuminosityBlockContext const* iContext,
186  typename T::LuminosityBlockSummaryCache* iCache) {
187  T::globalEndLuminosityBlockSummary(Lumi, iES, iContext, iCache);
188  }
189  };
190 
191  template <typename T>
194  edm::EventSetup const&,
195  typename T::LuminosityBlockContext const*,
196  impl::dummy_ptr) {}
197  static void streamEndLuminosityBlockSummary(void* iProd,
198  edm::LuminosityBlock const&,
199  edm::EventSetup const&,
200  typename T::LuminosityBlockSummaryCache* iCache) {}
202  edm::EventSetup const&,
203  typename T::LuminosityBlockContext const*,
204  typename T::LuminosityBlockSummaryCache*) {}
205  };
206 
207  template <typename T>
210 
211  //********************************
212  // CallBeginRunProduce
213  //********************************
214  template <typename T, bool>
216  static void produce(edm::Run& iRun, edm::EventSetup const& iES, typename T::RunContext const* iRC) {
217  T::globalBeginRunProduce(iRun, iES, iRC);
218  }
219  };
220 
221  template <typename T>
223  static void produce(edm::Run& iRun, edm::EventSetup const& iES, typename T::RunContext const* iRC) {}
224  };
225 
226  template <typename T>
228 
229  //********************************
230  // CallEndRunProduce
231  //********************************
232  template <typename T, bool bProduce, bool bSummary>
234  static void produce(edm::Run&,
235  edm::EventSetup const&,
236  typename T::RunContext const*,
237  typename T::RunSummaryCache const*) {}
238  };
239 
240  template <typename T>
242  static void produce(edm::Run& iRun,
243  edm::EventSetup const& iES,
244  typename T::RunContext const* iRC,
245  typename T::RunSummaryCache const*) {
246  T::globalEndRunProduce(iRun, iES, iRC);
247  }
248  };
249 
250  template <typename T>
252  static void produce(edm::Run& iRun,
253  edm::EventSetup const& iES,
254  typename T::RunContext const* iRC,
255  typename T::RunSummaryCache const* iRS) {
256  T::globalEndRunProduce(iRun, iES, iRC, iRS);
257  }
258  };
259 
260  template <typename T>
262 
263  //********************************
264  // CallBeginLuminosityBlockProduce
265  //********************************
266  template <typename T, bool>
269  edm::EventSetup const& iES,
270  typename T::LuminosityBlockContext const* iRC) {
271  T::globalBeginLuminosityBlockProduce(Lumi, iES, iRC);
272  }
273  };
274 
275  template <typename T>
278  edm::EventSetup const& iES,
279  typename T::LuminosityBlockContext const* iRC) {}
280  };
281 
282  template <typename T>
285 
286  //********************************
287  // CallEndLuminosityBlockProduce
288  //********************************
289  template <typename T, bool bProduce, bool bSummary>
292  edm::EventSetup const&,
293  typename T::LuminosityBlockContext const*,
294  typename T::LuminosityBlockSummaryCache const*) {}
295  };
296 
297  template <typename T>
300  edm::EventSetup const& iES,
301  typename T::LuminosityBlockContext const* iRC,
302  typename T::LuminosityBlockSummaryCache const*) {
303  T::globalEndLuminosityBlockProduce(Lumi, iES, iRC);
304  }
305  };
306 
307  template <typename T>
310  edm::EventSetup const& iES,
311  typename T::LuminosityBlockContext const* iRC,
312  typename T::LuminosityBlockSummaryCache const* iRS) {
313  T::globalEndLuminosityBlockProduce(Lumi, iES, iRC, iRS);
314  }
315  };
316 
317  template <typename T>
320  T::HasAbility::kEndLuminosityBlockProducer,
322 
323  } // namespace stream
324 } // namespace edm
325 
326 #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)
Definition: callAbilities.h:88
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:68
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)
Definition: callAbilities.h:95
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:56
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:75
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:41
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:46
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:45
static void endRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *)
Definition: callAbilities.h:77