Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:03:01

0001 #ifndef SimG4Core_CheckSecondary_StoreSecondary_H
0002 #define SimG4Core_CheckSecondary_StoreSecondary_H
0003 
0004 #include "DataFormats/Math/interface/LorentzVector.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "SimG4Core/Notification/interface/Observer.h"
0007 #include "SimG4Core/Watcher/interface/SimProducer.h"
0008 
0009 #include <iostream>
0010 #include <memory>
0011 #include <string>
0012 #include <vector>
0013 
0014 class G4Step;
0015 class BeginOfEvent;
0016 class BeginOfTrack;
0017 class TreatSecondary;
0018 
0019 class StoreSecondary : public SimProducer,
0020                        public Observer<const BeginOfEvent *>,
0021                        public Observer<const BeginOfTrack *>,
0022                        public Observer<const G4Step *> {
0023 public:
0024   StoreSecondary(const edm::ParameterSet &p);
0025   StoreSecondary(const StoreSecondary &) = delete;  // stop default
0026   const StoreSecondary &operator=(const StoreSecondary &) = delete;
0027   ~StoreSecondary() override;
0028 
0029   void produce(edm::Event &, const edm::EventSetup &) override;
0030 
0031 private:
0032   // observer classes
0033   void update(const BeginOfEvent *evt) override;
0034   void update(const BeginOfTrack *trk) override;
0035   void update(const G4Step *step) override;
0036 
0037 private:
0038   int verbosity, killAfter;
0039   int nHad;
0040   bool storeIt;
0041   std::vector<math::XYZTLorentzVector> secondaries;
0042   std::vector<int> nsecs;
0043   std::vector<std::string> procs;
0044   TreatSecondary *treatSecondary;
0045 };
0046 
0047 #endif