Go to the documentation of this file.00001 #ifndef SimG4CMS_HFShowerLibrary_h
00002 #define SimG4CMS_HFShowerLibrary_h 1
00003
00004
00005
00007
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00010 #include "SimG4CMS/Calo/interface/HFFibre.h"
00011 #include "SimDataFormats/CaloHit/interface/HFShowerPhoton.h"
00012 #include "DetectorDescription/Core/interface/DDsvalues.h"
00013
00014 #include "G4ParticleTable.hh"
00015 #include "G4ThreeVector.hh"
00016
00017
00018 #include "TROOT.h"
00019 #include "TFile.h"
00020 #include "TTree.h"
00021
00022 #include <string>
00023 #include <memory>
00024
00025 class DDCompactView;
00026 class G4Step;
00027
00028 class HFShowerLibrary {
00029
00030 public:
00031
00032
00033 HFShowerLibrary(std::string & name, const DDCompactView & cpv,
00034 edm::ParameterSet const & p);
00035 ~HFShowerLibrary();
00036
00037 public:
00038
00039 struct Hit {
00040 Hit() {}
00041 G4ThreeVector position;
00042 int depth;
00043 double time;
00044 };
00045
00046 void initRun(G4ParticleTable * theParticleTable);
00047 std::vector<Hit> getHits(G4Step * aStep, bool & ok, bool onlyLong=false);
00048
00049 protected:
00050
00051 bool rInside(double r);
00052 void getRecord(int, int);
00053 void loadEventInfo(TBranch *);
00054 void interpolate(int, double);
00055 void extrapolate(int, double);
00056 void storePhoton(int j);
00057 std::vector<double> getDDDArray(const std::string&, const DDsvalues_type&,
00058 int&);
00059
00060 private:
00061
00062 HFFibre * fibre;
00063 TFile * hf;
00064 TBranch *emBranch, *hadBranch;
00065
00066 bool verbose;
00067 int nMomBin, totEvents, evtPerBin;
00068 float libVers, listVersion;
00069 std::vector<double> pmom;
00070
00071 double probMax, backProb;
00072 double dphi, rMin, rMax;
00073 std::vector<double> gpar;
00074
00075 int emPDG, epPDG, gammaPDG;
00076 int pi0PDG, etaPDG, nuePDG, numuPDG, nutauPDG;
00077 int anuePDG, anumuPDG, anutauPDG, geantinoPDG;
00078
00079 int npe;
00080 std::vector<HFShowerPhoton> pe;
00081 std::vector<HFShowerPhoton> photon;
00082
00083 };
00084 #endif