File indexing completed on 2024-12-01 23:40:41
0001 #ifndef SimG4Core_Generator3_H
0002 #define SimG4Core_Generator3_H
0003
0004 #include "DataFormats/Math/interface/LorentzVector.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006
0007 #include "SimG4Core/Generators/interface/HepMCParticle.h"
0008 #include "SimG4Core/Notification/interface/GenParticleInfo.h"
0009
0010 #include "HepMC3/GenEvent.h"
0011 #include "HepMC3/GenParticle.h"
0012
0013 #include <vector>
0014
0015 class G4Event;
0016 class G4PrimaryParticle;
0017 class LumiMonitorFilter;
0018
0019 class Generator3 {
0020 public:
0021 Generator3(const edm::ParameterSet &p);
0022 virtual ~Generator3();
0023
0024 void setGenEvent(const HepMC3::GenEvent *inpevt) {
0025 evt_ = (HepMC3::GenEvent *)inpevt;
0026 return;
0027 }
0028 void HepMC2G4(const HepMC3::GenEvent *g, G4Event *e);
0029 void nonCentralEvent2G4(const HepMC3::GenEvent *g, G4Event *e);
0030 virtual const HepMC3::GenEvent *genEvent() const { return evt_; }
0031 virtual const math::XYZTLorentzVector *genVertex() const { return vtx_; }
0032 virtual const double eventWeight() const { return weight_; }
0033
0034 private:
0035 bool particlePassesPrimaryCuts(const G4ThreeVector &p) const;
0036 bool isExotic(int pdgcode) const;
0037 bool isExoticNonDetectable(int pdgcode) const;
0038 bool IsInTheFilterList(int pdgcode) const;
0039 void particleAssignDaughters(G4PrimaryParticle *p, HepMC3::GenParticle *hp, double length);
0040 void setGenId(G4PrimaryParticle *p, int id) const { p->SetUserInformation(new GenParticleInfo(id)); }
0041
0042 private:
0043 bool fPCuts;
0044 bool fPtransCut;
0045 bool fEtaCuts;
0046 bool fPhiCuts;
0047 bool fFiductialCuts;
0048 double theMinPhiCut;
0049 double theMaxPhiCut;
0050 double theMinEtaCut;
0051 double theMaxEtaCut;
0052 double theMinPCut;
0053 double theMinPtCut2;
0054 double theMaxPCut;
0055 double theDecRCut2;
0056 double theEtaCutForHector;
0057 double theDecLenCut;
0058 double maxZCentralCMS;
0059 int verbose;
0060 LumiMonitorFilter *fLumiFilter;
0061 HepMC3::GenEvent *evt_;
0062 math::XYZTLorentzVector *vtx_;
0063 double weight_;
0064 double Z_lmin, Z_lmax, Z_hector;
0065 std::vector<int> pdgFilter;
0066 bool pdgFilterSel;
0067 bool fPDGFilter;
0068 };
0069
0070 #endif