Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimG4Core_CountProcessesAction_H
0002 #define SimG4Core_CountProcessesAction_H
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "SimG4Core/Notification/interface/Observer.h"
0006 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0007 
0008 #include "G4ParticleDefinition.hh"
0009 
0010 #include <map>
0011 #include <string>
0012 
0013 typedef std::map<std::pair<std::string, std::string>, int, std::less<std::pair<std::string, std::string>>> mpssi;
0014 typedef std::pair<std::string, std::string> pss;
0015 typedef std::map<std::string, int, std::less<std::string>> psi;
0016 
0017 class BeginOfRun;
0018 class EndOfRun;
0019 class BeginOfTrack;
0020 class G4Step;
0021 
0022 class CountProcessesAction : public SimWatcher,
0023                              public Observer<const BeginOfRun *>,
0024                              public Observer<const EndOfRun *>,
0025                              public Observer<const BeginOfTrack *>,
0026                              public Observer<const G4Step *> {
0027 public:
0028   CountProcessesAction(edm::ParameterSet const &p);
0029   ~CountProcessesAction() override;
0030   void update(const BeginOfRun *run) override;
0031   void update(const BeginOfTrack *trk) override;
0032   void update(const EndOfRun *track) override;
0033   void update(const G4Step *track) override;
0034   //---- Dump list of processes for each particle.
0035   // printNsteps = 1 print in how many step the process was called,
0036   // print only those processes with this number <> 0
0037   void DumpProcessList(bool printNsteps, std::ostream &out = std::cout);
0038   void DumpCreatorProcessList(bool printNsteps, std::ostream &out = std::cout);
0039   void DumpParticleList(std::ostream &out = std::cout);
0040 
0041 private:
0042   bool fDEBUG;
0043   mpssi theProcessList;
0044   mpssi theCreatorProcessList;
0045   psi theParticleList;
0046 };
0047 
0048 #endif