Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:50

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 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // J. Comput. Phys. 274 (2014) 841-882
0031 // The Geant4-DNA web site is available at http://geant4-dna.org
0032 //
0033 //
0034 // $Id$
0035 //
0036 /// \file PrimaryKiller.hh
0037 /// \brief Definition of the PrimaryKiller class
0038 
0039 #ifndef CHEM6_PrimaryKiller_h
0040 #define CHEM6_PrimaryKiller_h 1
0041 
0042 #include <G4THitsMap.hh>
0043 #include <G4UImessenger.hh>
0044 #include <G4VPrimitiveScorer.hh>
0045 
0046 class G4UIcmdWithADoubleAndUnit;
0047 class G4UIcmdWith3VectorAndUnit;
0048 
0049 /** \file PrimaryKiller.hh*/
0050 
0051 // Description:
0052 //   Kill the primary particle:
0053 //   - either after a given energy loss
0054 //   - or after the primary particle has reached a given energy
0055 
0056 class PrimaryKiller : public G4VPrimitiveScorer, public G4UImessenger
0057 {
0058   private:
0059     double fELoss;  // cumulated energy loss by the primary
0060 
0061     double fELossRange_Min;  // fELoss from which the primary is killed
0062     double fELossRange_Max;  // fELoss from which the event is aborted
0063     double fKineticE_Min;  // kinetic energy below which the primary is killed
0064     G4ThreeVector fPhantomSize;
0065 
0066     G4UIcmdWithADoubleAndUnit* fpELossUI;
0067     G4UIcmdWithADoubleAndUnit* fpAbortEventIfELossUpperThan;
0068     G4UIcmdWithADoubleAndUnit* fpMinKineticE;
0069     G4UIcmdWith3VectorAndUnit* fpSizeUI;
0070 
0071   public:
0072     PrimaryKiller(G4String name, G4int depth = 0);
0073 
0074     virtual ~PrimaryKiller();
0075 
0076     /** Set energy under which the particle should be
0077      killed*/
0078     inline void SetEnergyThreshold(double energy) { fKineticE_Min = energy; }
0079 
0080     /** Set the energy loss from which the primary is
0081      killed*/
0082     inline void SetMinLossEnergyLimit(double energy) { fELossRange_Min = energy; }
0083 
0084     /** Set the energy loss from which the event is
0085      aborted*/
0086     inline void SetMaxLossEnergyLimit(double energy) { fELossRange_Max = energy; }
0087 
0088     /** Method related to G4UImessenger
0089         used to control energy cuts through macro file
0090      */
0091     virtual void SetNewValue(G4UIcommand* command, G4String newValue);
0092 
0093   protected:
0094     virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
0095 
0096   public:
0097     virtual void Initialize(G4HCofThisEvent*);
0098     virtual void EndOfEvent(G4HCofThisEvent*);
0099     virtual void DrawAll();
0100     virtual void PrintAll();
0101 };
0102 #endif