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, double weight,
00048 bool onlyLong=false);
00049
00050 protected:
00051
00052 bool rInside(double r);
00053 void getRecord(int, int);
00054 void loadEventInfo(TBranch *);
00055 void interpolate(int, double);
00056 void extrapolate(int, double);
00057 void storePhoton(int j);
00058 std::vector<double> getDDDArray(const std::string&, const DDsvalues_type&,
00059 int&);
00060
00061 private:
00062
00063 HFFibre * fibre;
00064 TFile * hf;
00065 TBranch *emBranch, *hadBranch;
00066
00067 bool verbose, applyFidCut;
00068 int nMomBin, totEvents, evtPerBin;
00069 float libVers, listVersion;
00070 std::vector<double> pmom;
00071
00072 double probMax, backProb;
00073 double dphi, rMin, rMax;
00074 std::vector<double> gpar;
00075
00076 int emPDG, epPDG, gammaPDG;
00077 int pi0PDG, etaPDG, nuePDG, numuPDG, nutauPDG;
00078 int anuePDG, anumuPDG, anutauPDG, geantinoPDG;
00079
00080 int npe;
00081 std::vector<HFShowerPhoton> pe;
00082 std::vector<HFShowerPhoton> photon;
00083
00084 };
00085 #endif