Go to the documentation of this file.00001 #ifndef Watcher_SimWatcherMaker_h
00002 #define Watcher_SimWatcherMaker_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022
00023 #include <memory>
00024
00025
00026 #include "SimG4Core/Watcher/interface/SimWatcherMakerBase.h"
00027 #include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h"
00028
00029
00030
00031 template<class T>
00032 class SimWatcherMaker : public SimWatcherMakerBase
00033 {
00034
00035 public:
00036 SimWatcherMaker(){}
00037
00038
00039 virtual void make(const edm::ParameterSet& p,
00040 SimActivityRegistry& reg,
00041 boost::shared_ptr<SimWatcher>& oWatcher,
00042 boost::shared_ptr<SimProducer>& oProd
00043 ) const
00044 {
00045 boost::shared_ptr<T> returnValue(new T(p));
00046 SimActivityRegistryEnroller::enroll(reg, returnValue.get());
00047 oWatcher = returnValue;
00048
00049
00050 oProd = this->getSimProducer(returnValue.get(), returnValue);
00051 }
00052
00053 private:
00054 boost::shared_ptr<SimProducer>
00055 getSimProducer(SimProducer*, boost::shared_ptr<T>& iProd) const{
00056 return boost::shared_ptr<SimProducer>(iProd);
00057 }
00058 boost::shared_ptr<SimProducer>
00059 getSimProducer(void*, boost::shared_ptr<T>& iProd) const{
00060 return boost::shared_ptr<SimProducer>();
00061 }
00062
00063 };
00064
00065
00066 #endif