Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:31

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File : TrackingVerboseAction.h
0003 // Author: P.Arce  12.09.01
0004 // Ported to CMSSW by: M. Stavrianakou  22.03.06
0005 // Description:
0006 // Modifications:
0007 // Class with the commands to switch on/off the verbosity of tracking and event
0008 // see TrackingVerboseAction for a detailed explanation
0009 // for a given range of tracks each 'n' tracks
0010 // the GEANT4 command '/tracking/verbose N' will be executed when trackNo is
0011 //     fTVTrackMin <= trackNo <= fTVTrackMax
0012 // each fTVTrackStep tracks (starting at 1, not 0) and if the trackNo is
0013 //     fTVTrackMin <= trackNo <= fTVTrackMax
0014 // each fTVTrackStep tracks (starting at 1, not 0)
0015 //
0016 ///////////////////////////////////////////////////////////////////////////////
0017 
0018 #ifndef SimG4Core_TrackingVerbose_h
0019 #define SimG4Core_TrackingVerbose_h 1
0020 
0021 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0022 #include "SimG4Core/Notification/interface/Observer.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 
0025 #include "G4Step.hh"
0026 
0027 #include <vector>
0028 
0029 class BeginOfTrack;
0030 class EndOfTrack;
0031 class BeginOfEvent;
0032 class BeginOfRun;
0033 class G4Track;
0034 class G4TrackingManager;
0035 class G4VSteppingVerbose;
0036 
0037 class TrackingVerboseAction : public SimWatcher,
0038                               public Observer<const BeginOfRun *>,
0039                               public Observer<const BeginOfEvent *>,
0040                               public Observer<const BeginOfTrack *>,
0041                               public Observer<const EndOfTrack *>,
0042                               public Observer<const G4Step *> {
0043 public:
0044   TrackingVerboseAction(edm::ParameterSet const &p);
0045   ~TrackingVerboseAction() override;
0046   void update(const BeginOfRun *) override;
0047   void update(const BeginOfEvent *) override;
0048   void update(const BeginOfTrack *) override;
0049   void update(const EndOfTrack *) override;
0050   void update(const G4Step *) override;
0051 
0052 private:
0053   void setTrackingVerbose(int verblev);
0054   bool checkTrackingVerbose(const G4Track *);
0055   void printTrackInfo(const G4Track *);
0056 
0057 private:
0058   int fLarge;
0059   bool fDEBUG;
0060   bool fG4Verbose;
0061   bool fHighEtPhotons;
0062   int fTVTrackMin;
0063   int fTVTrackMax;
0064   int fTVTrackStep;
0065   int fTVEventMin;
0066   int fTVEventMax;
0067   int fTVEventStep;
0068   int fVerboseLevel;
0069   bool fTrackingVerboseON;
0070   bool fTkVerbThisEventON;
0071   std::vector<int> fPdgIds;
0072   G4TrackingManager *theTrackingManager;
0073   G4VSteppingVerbose *fVerbose;
0074 };
0075 
0076 #endif