Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:59

0001 #ifndef SimG4CMS_ZdcShowerLibrary_h
0002 #define SimG4CMS_ZdcShowerLibrary_h 1
0003 ///////////////////////////////////////////////////////////////////////////////
0004 // File: ZdcShowerLibrary.h
0005 // Description: Gets information from a shower library
0006 // E. Garcia June 2008
0007 ///////////////////////////////////////////////////////////////////////////////
0008 
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include "Geometry/ForwardGeometry/interface/ZdcHardcodeGeometryData.h"
0012 
0013 #include "G4ParticleTable.hh"
0014 #include "G4ThreeVector.hh"
0015 #include "DetectorDescription/Core/interface/DDsvalues.h"
0016 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0017 
0018 #include <string>
0019 #include <memory>
0020 
0021 class G4Step;
0022 class ZdcShowerLibrary {
0023 public:
0024   //Constructor and Destructor
0025   ZdcShowerLibrary(const std::string& name, edm::ParameterSet const& p);
0026   ~ZdcShowerLibrary() = default;
0027 
0028   struct Hit {
0029     Hit() {}
0030     G4ThreeVector entryLocal;
0031     G4ThreeVector position;
0032     int depth;
0033     double time;
0034     int detID;
0035     double DeHad;
0036     double DeEM;
0037   };
0038 
0039   void initRun(G4ParticleTable* theParticleTable);
0040   std::vector<Hit>& getHits(const G4Step* aStep, bool& ok);
0041   int getEnergyFromLibrary(const G4ThreeVector& posHit,
0042                            const G4ThreeVector& momDir,
0043                            double energy,
0044                            G4int parCode,
0045                            HcalZDCDetId::Section section,
0046                            bool side,
0047                            int channel);
0048   int photonFluctuation(double eav, double esig, double edis);
0049   int encodePartID(G4int parCode);
0050 
0051 private:
0052   bool verbose;
0053   G4int emPDG, epPDG, gammaPDG;
0054   G4int pi0PDG, etaPDG, nuePDG, numuPDG, nutauPDG;
0055   G4int anuePDG, anumuPDG, anutauPDG, geantinoPDG;
0056   int npe;
0057   std::vector<ZdcShowerLibrary::Hit> hits;
0058 };
0059 #endif