File indexing completed on 2025-10-31 09:02:49
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 
0036 #ifndef G4GeometrySampler_hh
0037 #define G4GeometrySampler_hh 1
0038 
0039 #include "G4Types.hh"
0040 #include "G4String.hh"
0041 #include "G4VSampler.hh"
0042 #include "G4VSamplerConfigurator.hh"
0043 
0044 class G4ImportanceConfigurator;
0045 class G4WeightWindowConfigurator;
0046 class G4WeightCutOffConfigurator;
0047 
0048 class G4GeometrySampler : public G4VSampler
0049 {
0050 
0051  public:
0052  
0053   explicit G4GeometrySampler(G4VPhysicalVolume *worldvolume, const G4String &particlename);
0054   explicit G4GeometrySampler(const G4String& worldvolumeName, const G4String &particlename);
0055   virtual ~G4GeometrySampler();
0056 
0057   G4GeometrySampler(const G4GeometrySampler &) = delete;
0058   G4GeometrySampler& operator=(const G4GeometrySampler &) = delete;
0059 
0060   
0061   virtual void PrepareImportanceSampling(G4VIStore* istore,
0062                                          const G4VImportanceAlgorithm 
0063                                          *ialg);
0064   virtual void PrepareWeightRoulett(G4double wsurvive, 
0065                                     G4double wlimit,
0066                                     G4double isource);
0067   
0068   virtual void PrepareWeightWindow(G4VWeightWindowStore *wwstore,
0069                                    G4VWeightWindowAlgorithm *wwAlg,
0070                                    G4PlaceOfAction placeOfAction);
0071 
0072   virtual void Configure();
0073   virtual void AddProcess();
0074 
0075   virtual void ClearSampling();
0076   virtual G4bool IsConfigured() const;
0077 
0078   void SetParallel(G4bool paraflag);
0079   void SetWorld(const G4VPhysicalVolume* world);
0080   void SetParticle(const G4String &particlename);
0081 
0082   inline const G4String& GetParticleName() { return fParticleName; }
0083   
0084  private:
0085 
0086   G4String fParticleName;
0087   const G4VPhysicalVolume* fWorld = nullptr;
0088   G4String fWorldName;
0089   G4ImportanceConfigurator* fImportanceConfigurator = nullptr;
0090   G4WeightCutOffConfigurator* fWeightCutOffConfigurator = nullptr;
0091   G4VIStore* fIStore = nullptr;
0092   G4WeightWindowConfigurator* fWeightWindowConfigurator = nullptr;
0093   G4VWeightWindowStore* fWWStore = nullptr;
0094   G4bool fIsConfigured = false;
0095   G4Configurators fConfigurators;
0096   G4bool paraflag = false;
0097 };
0098   
0099 #endif