Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:14:38

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Class G4GeometrySampler
0027 //
0028 // Class description:
0029 //
0030 // This class inherits from G4VSampler. It is used for scoring and 
0031 // importance sampling in the tracking (mass) geometry.
0032 // See also the description in G4VSampler.hh.
0033 //
0034 // Author: Michael Dressel, CERN
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   //  virtual void PrepareScoring(G4VScorer *Scorer);
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