00001 00002 // File : TrackingVerboseAction.h 00003 // Author: P.Arce 12.09.01 00004 // Ported to CMSSW by: M. Stavrianakou 22.03.06 00005 // Description: 00006 // Modifications: 00007 // Class with the commands to switch on/off the verbosity of tracking and event 00008 // see TrackingVerboseAction for a detailed explanation 00009 // for a given range of tracks each 'n' tracks 00010 // the GEANT4 command '/tracking/verbose N' will be executed when trackNo is 00011 // fTVTrackMin <= trackNo <= fTVTrackMax 00012 // each fTVTrackStep tracks (starting at 1, not 0) and if the trackNo is 00013 // fTVTrackMin <= trackNo <= fTVTrackMax 00014 // each fTVTrackStep tracks (starting at 1, not 0) 00015 // 00017 00018 #ifndef SimG4Core_TrackingVerbose_h 00019 #define SimG4Core_TrackingVerbose_h 1 00020 00021 #include "SimG4Core/Watcher/interface/SimWatcher.h" 00022 #include "SimG4Core/Notification/interface/Observer.h" 00023 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00024 00025 #include "G4Step.hh" 00026 00027 #include <vector> 00028 00029 class BeginOfTrack; 00030 class EndOfTrack; 00031 class BeginOfEvent; 00032 class BeginOfRun; 00033 class G4Track; 00034 class G4TrackingManager; 00035 class G4VSteppingVerbose; 00036 00037 class TrackingVerboseAction : public SimWatcher, 00038 public Observer<const BeginOfRun *>, 00039 public Observer<const BeginOfEvent *>, 00040 public Observer<const BeginOfTrack *>, 00041 public Observer<const EndOfTrack *>, 00042 public Observer<const G4Step *> { 00043 00044 public: 00045 TrackingVerboseAction(edm::ParameterSet const & p); 00046 ~TrackingVerboseAction(); 00047 void update(const BeginOfRun *); 00048 void update(const BeginOfEvent *); 00049 void update(const BeginOfTrack *); 00050 void update(const EndOfTrack *); 00051 void update(const G4Step*); 00052 private: 00053 void setTrackingVerbose(int verblev); 00054 bool checkTrackingVerbose(const G4Track*); 00055 void printTrackInfo(const G4Track*); 00056 private: 00057 int fLarge; 00058 bool fDEBUG; 00059 bool fG4Verbose; 00060 bool fHighEtPhotons; 00061 int fTVTrackMin; 00062 int fTVTrackMax; 00063 int fTVTrackStep; 00064 int fTVEventMin; 00065 int fTVEventMax; 00066 int fTVEventStep; 00067 int fVerboseLevel; 00068 bool fTrackingVerboseON; 00069 bool fTkVerbThisEventON; 00070 std::vector<int> fPdgIds; 00071 G4TrackingManager * theTrackingManager; 00072 G4VSteppingVerbose* fVerbose; 00073 }; 00074 00075 #endif