00001 #ifndef SimG4Core_CheckSecondary_CheckSecondary_H
00002 #define SimG4Core_CheckSecondary_CheckSecondary_H
00003
00004 #include "SimG4Core/CheckSecondary/interface/TreatSecondary.h"
00005 #include "SimG4Core/Watcher/interface/SimWatcher.h"
00006 #include "SimG4Core/Notification/interface/Observer.h"
00007 #include "SimG4Core/Physics/interface/G4ProcessTypeEnumerator.h"
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "DataFormats/Math/interface/LorentzVector.h"
00010
00011 #include "TFile.h"
00012 #include "TTree.h"
00013
00014 #include <iostream>
00015 #include <memory>
00016 #include <vector>
00017 #include <string>
00018
00019 class G4Step;
00020 class BeginOfEvent;
00021 class BeginOfTrack;
00022 class EndOfEvent;
00023
00024 class CheckSecondary : public SimWatcher,
00025 public Observer<const BeginOfEvent *>,
00026 public Observer<const BeginOfTrack *>,
00027 public Observer<const EndOfEvent *>,
00028 public Observer<const G4Step *> {
00029
00030 public:
00031 CheckSecondary(const edm::ParameterSet &p);
00032 virtual ~CheckSecondary();
00033
00034 private:
00035 CheckSecondary(const CheckSecondary&);
00036 const CheckSecondary& operator=(const CheckSecondary&);
00037
00038
00039 TTree * bookTree(std::string);
00040 void endTree();
00041 void update(const BeginOfEvent * evt);
00042 void update(const BeginOfTrack * trk);
00043 void update(const G4Step * step);
00044 void update(const EndOfEvent * evt);
00045
00046 private:
00047 TreatSecondary *treatSecondary;
00048 G4ProcessTypeEnumerator *typeEnumerator;
00049 bool saveToTree, storeIt;
00050 int nHad;
00051 std::vector<int> *nsec, *procids;
00052 std::vector<double> *px, *py, *pz, *mass, *deltae;
00053 std::vector<std::string> *procs;
00054 TFile *file;
00055 TTree *tree;
00056 };
00057
00058 #endif