File indexing completed on 2024-04-06 12:29:59
0001 #ifndef SimG4CMS_CastorShowerLibrary_h
0002 #define SimG4CMS_CastorShowerLibrary_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 #include "SimDataFormats/CaloHit/interface/CastorShowerLibraryInfo.h"
0015 #include "SimDataFormats/CaloHit/interface/CastorShowerEvent.h"
0016
0017 #include "G4ParticleTable.hh"
0018 #include "G4ThreeVector.hh"
0019
0020 #include <string>
0021 #include <memory>
0022
0023 class G4Step;
0024 class TFile;
0025 class TBranch;
0026
0027 class CastorShowerLibrary {
0028 public:
0029
0030 CastorShowerLibrary(const std::string &name, edm::ParameterSet const &p);
0031 ~CastorShowerLibrary();
0032
0033 public:
0034 CastorShowerEvent getShowerHits(const G4Step *, bool &);
0035 int FindEnergyBin(double);
0036 int FindEtaBin(double);
0037 int FindPhiBin(double);
0038
0039 protected:
0040 void initFile(edm::ParameterSet const &);
0041 CastorShowerEvent getRecord(int, int);
0042 void loadEventInfo(TBranch *);
0043
0044 CastorShowerEvent select(int, double, double = 0, double = 9);
0045
0046 private:
0047 TFile *hf;
0048 TBranch *emBranch, *hadBranch;
0049
0050 bool verbose;
0051 unsigned int nMomBin, totEvents, evtPerBin;
0052
0053 std::vector<double> pmom;
0054
0055
0056 unsigned int nBinsE, nBinsEta, nBinsPhi;
0057 unsigned int nEvtPerBinE, nEvtPerBinEta, nEvtPerBinPhi;
0058 std::vector<double> SLenergies;
0059 std::vector<double> SLetas;
0060 std::vector<double> SLphis;
0061 };
0062 #endif