00001 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00002 #include "SimG4Core/Watcher/interface/SimWatcher.h" 00003 #include "SimG4Core/Notification/interface/Observer.h" 00004 00005 #include <TFile.h> 00006 #include <TTree.h> 00007 #include <TH1F.h> 00008 #include <TH2F.h> 00009 #include <TProfile.h> 00010 00011 #include <string> 00012 00013 // 00014 // class decleration 00015 // 00016 00017 class BeginOfEvent; 00018 class EndOfEvent; 00019 class G4Step; 00020 class GflashObject; 00021 00022 class GflashG4Watcher : public SimWatcher, 00023 public Observer<const BeginOfEvent*>, 00024 public Observer<const EndOfEvent*>, 00025 public Observer<const G4Step*> { 00026 00027 public: 00028 GflashG4Watcher(const edm::ParameterSet& p); 00029 ~GflashG4Watcher(); 00030 00031 private: 00032 00033 G4bool inc_flag; 00034 G4double inc_energy; 00035 G4ThreeVector inc_direction; 00036 G4ThreeVector inc_position; 00037 00038 void update(const BeginOfEvent* ); 00039 void update(const EndOfEvent* ); 00040 void update(const G4Step* ); 00041 00042 // histograms for GflashG4Watcher 00043 00044 std::string histFileName_; 00045 TFile* histFile_; 00046 00047 GflashObject* gflashObject_; 00048 TTree* watcherTree_; 00049 TH1F* longitudinal_; 00050 TH1F* lateral_r_; 00051 TH1F* showerStartingPosition_; 00052 TH1F* nHits_; 00053 TH1F* hitEnergy_; 00054 TH2F* rzHits_; 00055 TH1F* incEnergy_; 00056 TH1F* outEnergy_; 00057 }; 00058