CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMaker.h

Go to the documentation of this file.
00001 #ifndef SensitiveDetector_SensitiveDetectorMaker_h
00002 #define SensitiveDetector_SensitiveDetectorMaker_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     SensitiveDetector
00006 // Class  :     SensitiveDetectorMaker
00007 // 
00016 //
00017 // Original Author:  
00018 //         Created:  Mon Nov 14 11:56:05 EST 2005
00019 // $Id: SensitiveDetectorMaker.h,v 1.3 2007/05/08 23:11:53 sunanda Exp $
00020 //
00021 
00022 // system include files
00023 #include <memory>
00024 
00025 // user include files
00026 #include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h"
00027 #include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h"
00028 
00029 // forward declarations
00030 
00031 template<class T>
00032 class SensitiveDetectorMaker : public SensitiveDetectorMakerBase
00033 {
00034 
00035    public:
00036      SensitiveDetectorMaker(){}
00037      //virtual ~SensitiveDetectorMaker();
00038 
00039       // ---------- const member functions ---------------------
00040       virtual void make(const std::string& iname,
00041                         const DDCompactView& cpv,
00042                         SensitiveDetectorCatalog& clg,
00043                         const edm::ParameterSet& p,
00044                         const SimTrackManager* m,
00045                         SimActivityRegistry& reg,
00046                         std::auto_ptr<SensitiveTkDetector>& oTK,
00047                         std::auto_ptr<SensitiveCaloDetector>& oCalo) const
00048       {
00049         std::auto_ptr<T> returnValue(new T(iname, cpv, clg, p, m));
00050         SimActivityRegistryEnroller::enroll(reg, returnValue.get());
00051 
00052         this->convertTo(returnValue.get(), oTK,oCalo);
00053         //ownership was passed in the previous function
00054         returnValue.release();
00055       }
00056 
00057       // ---------- static member functions --------------------
00058 
00059       // ---------- member functions ---------------------------
00060 
00061    private:
00062       SensitiveDetectorMaker(const SensitiveDetectorMaker&); // stop default
00063 
00064       const SensitiveDetectorMaker& operator=(const SensitiveDetectorMaker&); // stop default
00065 
00066       // ---------- member data --------------------------------
00067 
00068 };
00069 
00070 
00071 #endif