00001 #ifndef SimG4Core_CheckSecondary_StoreSecondary_H 00002 #define SimG4Core_CheckSecondary_StoreSecondary_H 00003 00004 #include "SimG4Core/CheckSecondary/interface/TreatSecondary.h" 00005 #include "SimG4Core/Watcher/interface/SimProducer.h" 00006 #include "SimG4Core/Notification/interface/Observer.h" 00007 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00008 #include "DataFormats/Math/interface/LorentzVector.h" 00009 00010 #include <iostream> 00011 #include <memory> 00012 #include <vector> 00013 #include <string> 00014 00015 class G4Step; 00016 class BeginOfEvent; 00017 class BeginOfTrack; 00018 00019 class StoreSecondary : public SimProducer, 00020 public Observer<const BeginOfEvent *>, 00021 public Observer<const BeginOfTrack *>, 00022 public Observer<const G4Step *> { 00023 00024 public: 00025 StoreSecondary(const edm::ParameterSet &p); 00026 virtual ~StoreSecondary(); 00027 00028 void produce(edm::Event&, const edm::EventSetup&); 00029 00030 private: 00031 StoreSecondary(const StoreSecondary&); // stop default 00032 const StoreSecondary& operator=(const StoreSecondary&); 00033 00034 // observer classes 00035 void update(const BeginOfEvent * evt); 00036 void update(const BeginOfTrack * trk); 00037 void update(const G4Step * step); 00038 00039 private: 00040 int verbosity, killAfter; 00041 int nHad; 00042 bool storeIt; 00043 std::vector<math::XYZTLorentzVector> secondaries; 00044 std::vector<int> nsecs; 00045 std::vector<std::string> procs; 00046 TreatSecondary* treatSecondary; 00047 }; 00048 00049 #endif