CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimG4Core/CustomPhysics/plugins/RHStopTracer.h

Go to the documentation of this file.
00001 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00002 
00003 #include "SimG4Core/Watcher/interface/SimProducer.h"
00004 #include "SimG4Core/Notification/interface/Observer.h"
00005 
00006 
00007 #include <boost/regex.hpp>
00008 
00009 class BeginOfRun;
00010 class BeginOfEvent;
00011 class BeginOfTrack;
00012 class EndOfTrack;
00013 class G4Step;
00014 
00015 class RHStopTracer :  public SimProducer,
00016                       public Observer<const BeginOfRun *>, 
00017                       public Observer<const BeginOfEvent *>, 
00018                       public Observer<const BeginOfTrack *>,
00019                       public Observer<const EndOfTrack *>
00020 {
00021  public:
00022   RHStopTracer(edm::ParameterSet const & p);
00023   virtual ~RHStopTracer();
00024   void update(const BeginOfRun *);
00025   void update(const BeginOfEvent *);
00026   void update(const BeginOfTrack *);
00027   void update(const EndOfTrack *);
00028   void produce(edm::Event&, const edm::EventSetup&);
00029  private:
00030   struct StopPoint {
00031     StopPoint (const std::string& fName, double fX, double fY, double fZ, double fT) 
00032       : name(fName), x(fX), y(fY), z(fZ), t(fT) 
00033     {}
00034     std::string name;
00035     double x;
00036     double y;
00037     double z;
00038     double t;
00039   };
00040   bool mDebug;
00041   bool mStopRegular;
00042   double mTraceEnergy;
00043   boost::regex mTraceParticleNameRegex;
00044   std::vector <StopPoint> mStopPoints;
00045   bool matched (const std::string& fName) const;
00046 };