Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-04 02:43:33

0001 #ifndef SimG4Core_Generator_H
0002 #define SimG4Core_Generator_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 "HepMC/GenEvent.h"
0011 #include "HepMC/GenParticle.h"
0012 
0013 #include <vector>
0014 
0015 class G4Event;
0016 class G4PrimaryParticle;
0017 class LumiMonitorFilter;
0018 
0019 class Generator {
0020 public:
0021   Generator(const edm::ParameterSet &p);
0022   virtual ~Generator();
0023 
0024   void setGenEvent(const HepMC::GenEvent *inpevt) {
0025     evt_ = (HepMC::GenEvent *)inpevt;
0026     return;
0027   }
0028   void HepMC2G4(const HepMC::GenEvent *g, G4Event *e);
0029   void nonCentralEvent2G4(const HepMC::GenEvent *g, G4Event *e);
0030   virtual const HepMC::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, HepMC::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   bool fSlepton;
0049   double theMinPhiCut;
0050   double theMaxPhiCut;
0051   double theMinEtaCut;
0052   double theMaxEtaCut;
0053   double theMinPCut;
0054   double theMinPtCut2;
0055   double theMaxPCut;
0056   double theDecRCut2;
0057   double theEtaCutForHector;
0058   double theDecLenCut;
0059   double maxZCentralCMS;
0060   int verbose;
0061   LumiMonitorFilter *fLumiFilter;
0062   HepMC::GenEvent *evt_;
0063   math::XYZTLorentzVector *vtx_;
0064   double weight_;
0065   double Z_lmin, Z_lmax, Z_hector;
0066   std::vector<int> pdgFilter;
0067   bool pdgFilterSel;
0068   bool fPDGFilter;
0069 };
0070 
0071 #endif