CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/FWCore/Framework/interface/OccurrenceTraits.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_OccurrenceTraits_h
00002 #define FWCore_Framework_OccurrenceTraits_h
00003 
00004 /*----------------------------------------------------------------------
00005   
00006 OccurrenceTraits: 
00007 
00008 ----------------------------------------------------------------------*/
00009 
00010 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00011 #include "FWCore/Framework/interface/BranchActionType.h"
00012 #include "FWCore/Framework/interface/EventPrincipal.h"
00013 #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h"
00014 #include "FWCore/Framework/interface/RunPrincipal.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/LuminosityBlock.h"
00017 #include "FWCore/Framework/interface/Run.h"
00018 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00019 
00020 #include<string>
00021 
00022 namespace edm {
00023   template <typename T, BranchActionType B> class OccurrenceTraits;
00024 
00025   template <>
00026   class OccurrenceTraits<EventPrincipal, BranchActionBegin> {
00027   public:
00028     typedef EventPrincipal MyPrincipal;
00029     static BranchType const branchType_ = InEvent;
00030     static bool const begin_ = true;
00031     static bool const isEvent_ = true;
00032     static void preScheduleSignal(ActivityRegistry *a, EventPrincipal const* ep) {
00033       a->preProcessEventSignal_(ep->id(), ep->time()); 
00034     }
00035     static void postScheduleSignal(ActivityRegistry *a, EventPrincipal* ep, EventSetup const* es) {
00036       Event ev(*ep, ModuleDescription());
00037       a->postProcessEventSignal_(ev, *es);
00038     }
00039     static void prePathSignal(ActivityRegistry *a, std::string const& s) {
00040       a->preProcessPathSignal_(s); 
00041     }
00042     static void postPathSignal(ActivityRegistry *a, std::string const& s, HLTPathStatus const& status) {
00043       a->postProcessPathSignal_(s, status); 
00044     }
00045     static void preModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00046       a->preModuleSignal_(*md); 
00047     }
00048     static void postModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00049       a->postModuleSignal_(*md); 
00050     }
00051   };
00052 
00053   template <>
00054   class OccurrenceTraits<RunPrincipal, BranchActionBegin> {
00055   public:
00056     typedef RunPrincipal MyPrincipal;
00057     static BranchType const branchType_ = InRun;
00058     static bool const begin_ = true;
00059     static bool const isEvent_ = false;
00060     static void preScheduleSignal(ActivityRegistry *a, RunPrincipal const* ep) {
00061       a->preBeginRunSignal_(ep->id(), ep->beginTime()); 
00062     }
00063     static void postScheduleSignal(ActivityRegistry *a, RunPrincipal* ep, EventSetup const* es) {
00064       Run run(*ep, ModuleDescription());
00065       a->postBeginRunSignal_(run, *es);
00066     }
00067     static void prePathSignal(ActivityRegistry *a, std::string const& s) {
00068       a->prePathBeginRunSignal_(s); 
00069     }
00070     static void postPathSignal(ActivityRegistry *a, std::string const& s, HLTPathStatus const& status) {
00071       a->postPathBeginRunSignal_(s, status); 
00072     }
00073     static void preModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00074       a->preModuleBeginRunSignal_(*md); 
00075     }
00076     static void postModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00077       a->postModuleBeginRunSignal_(*md); 
00078     }
00079   };
00080 
00081   template <>
00082   class OccurrenceTraits<RunPrincipal, BranchActionEnd> {
00083   public:
00084     typedef RunPrincipal MyPrincipal;
00085     static BranchType const branchType_ = InRun;
00086     static bool const begin_ = false;
00087     static bool const isEvent_ = false;
00088     static void preScheduleSignal(ActivityRegistry *a, RunPrincipal const* ep) {
00089       a->preEndRunSignal_(ep->id(), ep->endTime()); 
00090     }
00091     static void postScheduleSignal(ActivityRegistry *a, RunPrincipal* ep, EventSetup const* es) {
00092       Run run(*ep, ModuleDescription());
00093       a->postEndRunSignal_(run, *es);
00094     }
00095     static void prePathSignal(ActivityRegistry *a, std::string const& s) {
00096       a->prePathEndRunSignal_(s); 
00097     }
00098     static void postPathSignal(ActivityRegistry *a, std::string const& s, HLTPathStatus const& status) {
00099       a->postPathEndRunSignal_(s, status); 
00100     }
00101     static void preModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00102       a->preModuleEndRunSignal_(*md); 
00103     }
00104     static void postModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00105       a->postModuleEndRunSignal_(*md); 
00106     }
00107   };
00108 
00109   template <>
00110   class OccurrenceTraits<LuminosityBlockPrincipal, BranchActionBegin> {
00111   public:
00112     typedef LuminosityBlockPrincipal MyPrincipal;
00113     static BranchType const branchType_ = InLumi;
00114     static bool const begin_ = true;
00115     static bool const isEvent_ = false;
00116     static void preScheduleSignal(ActivityRegistry *a, LuminosityBlockPrincipal const* ep) {
00117       a->preBeginLumiSignal_(ep->id(), ep->beginTime()); 
00118     }
00119     static void postScheduleSignal(ActivityRegistry *a, LuminosityBlockPrincipal* ep, EventSetup const* es) {
00120       LuminosityBlock lumi(*ep, ModuleDescription());
00121       a->postBeginLumiSignal_(lumi, *es);
00122     }
00123     static void prePathSignal(ActivityRegistry *a, std::string const& s) {
00124       a->prePathBeginLumiSignal_(s); 
00125     }
00126     static void postPathSignal(ActivityRegistry *a, std::string const& s, HLTPathStatus const& status) {
00127       a->postPathBeginLumiSignal_(s, status); 
00128     }
00129     static void preModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00130       a->preModuleBeginLumiSignal_(*md); 
00131     }
00132     static void postModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00133       a->postModuleBeginLumiSignal_(*md); 
00134     }
00135   };
00136 
00137   template <>
00138   class OccurrenceTraits<LuminosityBlockPrincipal, BranchActionEnd> {
00139   public:
00140     typedef LuminosityBlockPrincipal MyPrincipal;
00141     static BranchType const branchType_ = InLumi;
00142     static bool const begin_ = false;
00143     static bool const isEvent_ = false;
00144     static void preScheduleSignal(ActivityRegistry *a, LuminosityBlockPrincipal const* ep) {
00145       a->preEndLumiSignal_(ep->id(), ep->beginTime()); 
00146     }
00147     static void postScheduleSignal(ActivityRegistry *a, LuminosityBlockPrincipal* ep, EventSetup const* es) {
00148       LuminosityBlock lumi(*ep, ModuleDescription());
00149       a->postEndLumiSignal_(lumi, *es);
00150     }
00151     static void prePathSignal(ActivityRegistry *a, std::string const& s) {
00152       a->prePathEndLumiSignal_(s); 
00153     }
00154     static void postPathSignal(ActivityRegistry *a, std::string const& s, HLTPathStatus const& status) {
00155       a->postPathEndLumiSignal_(s, status); 
00156     }
00157     static void preModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00158       a->preModuleEndLumiSignal_(*md); 
00159     }
00160     static void postModuleSignal(ActivityRegistry *a, ModuleDescription const* md) {
00161       a->postModuleEndLumiSignal_(*md); 
00162     }
00163   };
00164 }
00165 #endif