CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/SimG4Core/CountProcesses/interface/CountProcessesAction.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_CountProcessesAction_H
00002 #define SimG4Core_CountProcessesAction_H
00003 
00004 #include "SimG4Core/Watcher/interface/SimWatcher.h"
00005 #include "SimG4Core/Notification/interface/Observer.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007    
00008 #include "G4ParticleDefinition.hh"
00009 
00010 #include <string>
00011 #include <map>
00012 
00013 typedef std::map 
00014 <std::pair<std::string,std::string>, int, std::less< std::pair<std::string,std::string> > > mpssi;
00015 typedef std::pair<std::string,std::string> pss;
00016 typedef std::map<std::string,int,std::less<std::string> > psi;
00017 
00018 class BeginOfRun;
00019 class EndOfRun;
00020 class BeginOfTrack;
00021 class G4Step;
00022 
00023 class CountProcessesAction : public SimWatcher,
00024                              public Observer<const BeginOfRun *>, 
00025                              public Observer<const EndOfRun *>,  
00026                              public Observer<const BeginOfTrack *>, 
00027                              public Observer<const G4Step *> 
00028 {
00029 public:
00030     CountProcessesAction(edm::ParameterSet const & p);
00031     ~CountProcessesAction();
00032     void update(const BeginOfRun * run);
00033     void update(const BeginOfTrack * trk);
00034     void update(const EndOfRun * track);
00035     void update(const G4Step * track);
00036     //---- Dump list of processes for each particle. 
00037     // printNsteps = 1 print in how many step the process was called, 
00038     // print only those processes with this number <> 0
00039     void DumpProcessList(bool printNsteps, std::ostream& out = std::cout);
00040     void DumpCreatorProcessList(bool printNsteps, std::ostream& out = std::cout);
00041     void DumpParticleList(std::ostream& out = std::cout);
00042 private:
00043     bool fDEBUG;
00044     mpssi theProcessList;
00045     mpssi theCreatorProcessList;
00046     psi theParticleList;
00047 };
00048 
00049 #endif