Go to the documentation of this file.00001
00002
00003
00004
00005
00007 #undef debug
00008 #ifndef DoCastorAnalysis_h
00009 #define DoCastorAnalysis_h
00010
00011 #include "SimG4Core/Notification/interface/BeginOfJob.h"
00012 #include "SimG4Core/Notification/interface/BeginOfRun.h"
00013 #include "SimG4Core/Notification/interface/EndOfRun.h"
00014 #include "SimG4Core/Notification/interface/BeginOfEvent.h"
00015 #include "SimG4Core/Notification/interface/EndOfEvent.h"
00016
00017 #include "G4SDManager.hh"
00018 #include "G4Step.hh"
00019 #include "G4Track.hh"
00020 #include "G4Event.hh"
00021 #include "G4PrimaryVertex.hh"
00022 #include "G4VProcess.hh"
00023 #include "G4HCofThisEvent.hh"
00024 #include "G4UserEventAction.hh"
00025 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00026 #include "CLHEP/Units/GlobalPhysicalConstants.h"
00027
00028 #include "SimG4Core/Notification/interface/Observer.h"
00029 #include "SimG4Core/Watcher/interface/SimWatcher.h"
00030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00031
00032 #include <cassert>
00033 #include <iostream>
00034 #include <string>
00035 #include <map>
00036 #include <cmath>
00037 #include <memory>
00038 #include <vector>
00039
00040 #include <CLHEP/Random/Randomize.h>
00041
00042 #include "TROOT.h"
00043 #include "TFile.h"
00044 #include "TH1.h"
00045 #include "TH2.h"
00046 #include "TProfile.h"
00047 #include "TNtuple.h"
00048 #include "TRandom.h"
00049 #include "TLorentzVector.h"
00050 #include "TUnixSystem.h"
00051 #include "TSystem.h"
00052 #include "TMath.h"
00053 #include "TF1.h"
00054
00055 class G4Step;
00056 class BeginOfJob;
00057 class BeginOfRun;
00058 class EndOfRun;
00059 class BeginOfEvent;
00060 class EndOfEvent;
00061
00062 class DoCastorAnalysis : public SimWatcher,
00063 public Observer<const BeginOfJob *>,
00064 public Observer<const BeginOfRun *>,
00065 public Observer<const EndOfRun *>,
00066 public Observer<const BeginOfEvent *>,
00067 public Observer<const EndOfEvent *>,
00068 public Observer<const G4Step *> {
00069
00070 public:
00071 DoCastorAnalysis(const edm::ParameterSet &p);
00072 virtual ~DoCastorAnalysis();
00073
00074 private:
00075
00076 void update(const BeginOfJob * run);
00077 void update(const BeginOfRun * run);
00078 void update(const EndOfRun * run);
00079 void update(const BeginOfEvent * evt);
00080 void update(const EndOfEvent * evt);
00081 void update(const G4Step * step);
00082
00083 private:
00084
00085 int verbosity;
00086
00087 std::string TreeFileName;
00088
00089 TFile* CastorOutputEventFile;
00090 TTree* CastorTree;
00091
00092 int eventIndex;
00093
00094 std::vector<double> simhit_x, simhit_y, simhit_z;
00095 std::vector<double> simhit_eta, simhit_phi, simhit_energy;
00096 std::vector<int> simhit_sector, simhit_module;
00097
00098
00099 std::vector<double> *psimhit_x, *psimhit_y, *psimhit_z;
00100 std::vector<double> *psimhit_eta, *psimhit_phi, *psimhit_energy;
00101 std::vector<int> *psimhit_sector, *psimhit_module;
00102
00103
00104 double simhit_etot;
00105
00106 };
00107
00108 #endif // DoCastorAnalysis_h
00109