Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimG4Core_CheckSecondary_CheckSecondary_H
0002 #define SimG4Core_CheckSecondary_CheckSecondary_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/Physics/interface/G4ProcessTypeEnumerator.h"
0008 #include "SimG4Core/Watcher/interface/SimWatcher.h"
0009 
0010 #include "TFile.h"
0011 #include "TTree.h"
0012 
0013 #include <iostream>
0014 #include <memory>
0015 #include <string>
0016 #include <vector>
0017 
0018 class G4Step;
0019 class BeginOfEvent;
0020 class BeginOfTrack;
0021 class EndOfEvent;
0022 class TreatSecondary;
0023 class ProcessTypeEnumerator;
0024 
0025 class CheckSecondary : public SimWatcher,
0026                        public Observer<const BeginOfEvent *>,
0027                        public Observer<const BeginOfTrack *>,
0028                        public Observer<const EndOfEvent *>,
0029                        public Observer<const G4Step *> {
0030 public:
0031   CheckSecondary(const edm::ParameterSet &p);
0032   CheckSecondary(const CheckSecondary &) = delete;  // stop default
0033   const CheckSecondary &operator=(const CheckSecondary &) = delete;
0034   ~CheckSecondary() override;
0035 
0036 private:
0037   // observer classes
0038   TTree *bookTree(std::string);
0039   void endTree();
0040   void update(const BeginOfEvent *evt) override;
0041   void update(const BeginOfTrack *trk) override;
0042   void update(const G4Step *step) override;
0043   void update(const EndOfEvent *evt) override;
0044 
0045 private:
0046   TreatSecondary *treatSecondary;
0047   G4ProcessTypeEnumerator *typeEnumerator;
0048   bool saveToTree, storeIt;
0049   int nHad;
0050   std::vector<int> *nsec, *procids;
0051   std::vector<double> *px, *py, *pz, *mass, *deltae;
0052   std::vector<std::string> *procs;
0053   TFile *file;
0054   TTree *tree;
0055 };
0056 
0057 #endif