00001 #ifndef _MaterialBudgetAction_h 00002 #define _MaterialBudgetAction_h 00003 #include <string> 00004 #include <vector> 00005 #include <map> 00006 00007 // user include files 00008 #include "Validation/Geometry/interface/MaterialBudgetTree.h" 00009 #include "Validation/Geometry/interface/MaterialBudgetFormat.h" 00010 #include "Validation/Geometry/interface/MaterialBudgetHistos.h" 00011 #include "Validation/Geometry/interface/MaterialBudgetTrackerHistos.h" 00012 #include "Validation/Geometry/interface/MaterialBudgetEcalHistos.h" 00013 #include "Validation/Geometry/interface/MaterialBudgetTxt.h" 00014 #include "Validation/Geometry/interface/TestHistoMgr.h" 00015 00016 #include "SimG4Core/Watcher/interface/SimProducer.h" 00017 #include "SimG4Core/Notification/interface/Observer.h" 00018 00019 #include <CLHEP/Vector/LorentzVector.h> 00020 00021 class BeginOfTrack; 00022 class BeginOfRun; 00023 class G4Step; 00024 class EndOfTrack; 00025 class EndOfEvent; 00026 class G4StepPoint; 00027 class G4VTouchable; 00028 00029 class MaterialBudgetAction : public SimProducer, 00030 public Observer<const BeginOfRun*>, 00031 public Observer<const BeginOfTrack*>, 00032 public Observer<const G4Step*>, 00033 public Observer<const EndOfTrack*>, 00034 public Observer<const EndOfEvent *> 00035 { 00036 public: 00037 MaterialBudgetAction(const edm::ParameterSet&); 00038 virtual ~MaterialBudgetAction(); 00039 00040 void produce(edm::Event&, const edm::EventSetup&); 00041 00042 00043 private: 00044 MaterialBudgetAction(const MaterialBudgetAction&); // stop default 00045 00046 const MaterialBudgetAction& operator=(const MaterialBudgetAction&); // stop default 00047 00048 void update(const BeginOfRun*); 00049 void update(const BeginOfTrack*); 00050 void update(const G4Step*); 00051 void update(const EndOfTrack*); 00052 void update(const EndOfEvent*); 00053 00054 void initRun(); 00055 void processEvent( unsigned int nEv ); 00056 void endRun(); 00057 00058 bool CheckTouchableInSelectedVolumes( const G4VTouchable* touch ); 00059 bool StopAfterProcess( const G4Step* aStep ); 00060 00061 private: 00062 void save( const G4Step* aStep ); 00063 std::string getSubDetectorName( G4StepPoint* aStepPoint ); 00064 std::string getPartName( G4StepPoint* aStepPoint ); 00065 MaterialBudgetData* theData; 00066 MaterialBudgetTree* theTree; 00067 MaterialBudgetFormat* theHistos; 00068 MaterialBudgetTxt* theTxt; 00069 TestHistoMgr* theHistoMgr; 00070 bool saveToTxt, saveToTree, saveToHistos; 00071 bool storeDecay; 00072 double Ekin; 00073 bool firstParticle; 00074 00075 std::vector<G4String> theVolumeList; 00076 G4String theProcessToStop; 00077 std::string theHistoList; 00078 00079 }; 00080 00081 #endif