Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-01 03:54:05

0001 #ifndef SimG4Core_HelpfulWatchers_MonopoleSteppingAction_H
0002 #define SimG4Core_HelpfulWatchers_MonopoleSteppingAction_H
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "SimG4Core/Notification/interface/Observer.h"
0006 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0007 #include "MagneticField/Engine/interface/MagneticField.h"
0008 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0009 
0010 #include "G4Step.hh"
0011 #include <vector>
0012 
0013 class BeginOfRun;
0014 class BeginOfTrack;
0015 
0016 class MonopoleSteppingAction : public SimWatcher,
0017                                public Observer<const BeginOfRun *>,
0018                                public Observer<const BeginOfTrack *>,
0019                                public Observer<const G4Step *> {
0020 public:
0021   MonopoleSteppingAction(edm::ParameterSet const &p);
0022   ~MonopoleSteppingAction() override;
0023   void registerConsumes(edm::ConsumesCollector) override;
0024   void beginRun(edm::EventSetup const &) override;
0025   void update(const BeginOfRun *) override;
0026   void update(const BeginOfTrack *) override;
0027   void update(const G4Step *) override;
0028 
0029 private:
0030   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_bFieldH_;
0031   bool mode, actOnTrack;
0032   std::vector<int> pdgCode;
0033   double eStart, pxStart, pyStart, pzStart;
0034   double dirxStart, diryStart, dirzStart;
0035   double cMevToJ, cMeVToKgMByS, cInMByS, magCharge, bZ;
0036 };
0037 
0038 #endif