| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | // $Id: G4AdjointStackingAction.hh,v 1.2 2009/11/18 17:57:59 gcosmo Exp $
|
|---|
| 27 | // GEANT4 tag $Name: geant4-09-03 $
|
|---|
| 28 | //
|
|---|
| 29 | /////////////////////////////////////////////////////////////////////////////////
|
|---|
| 30 | // Class Name: G4AdjointStackingAction
|
|---|
| 31 | // Author: L. Desorgher
|
|---|
| 32 | // Organisation: SpaceIT GmbH
|
|---|
| 33 | // Contract: ESA contract 21435/08/NL/AT
|
|---|
| 34 | // Customer: ESA/ESTEC
|
|---|
| 35 | /////////////////////////////////////////////////////////////////////////////////
|
|---|
| 36 | //
|
|---|
| 37 | // CHANGE HISTORY
|
|---|
| 38 | // --------------
|
|---|
| 39 | // ChangeHistory:
|
|---|
| 40 | // -April 2008 First implementation by L. Desorgher
|
|---|
| 41 | // -4-11-2009 Adding the possibility to use user adjoint stacking action, L. Desorgher
|
|---|
| 42 | //
|
|---|
| 43 | //
|
|---|
| 44 | //-------------------------------------------------------------
|
|---|
| 45 | // Documentation:
|
|---|
| 46 | // Stacking action used in the adjoint simulation. It is responsible to kill a primary forward particle before it is traked in the forwrad phase
|
|---|
| 47 | // if the last adjoint particle did not reach the adjoint surface. Was needed for the new design where the G4AdjointSimManager is no more an extension
|
|---|
| 48 | // of the G4RunManager. If the primary particles is not killed before being tracked in the sensitive geometry, the User Stacking action
|
|---|
| 49 | // can be used duiring the forward phase if specified by the method G4AdjointSimManager::UseUserStackingAction(Bool).
|
|---|
| 50 | //
|
|---|
| 51 | //
|
|---|
| 52 | //
|
|---|
| 53 | //
|
|---|
| 54 | //
|
|---|
| 55 | //
|
|---|
| 56 | //
|
|---|
| 57 | #ifndef G4AdjointStackingAction_h
|
|---|
| 58 | #define G4AdjointStackingAction_h 1
|
|---|
| 59 |
|
|---|
| 60 | #include "globals.hh"
|
|---|
| 61 | #include "G4UserStackingAction.hh"
|
|---|
| 62 |
|
|---|
| 63 | class G4Track;
|
|---|
| 64 | class G4ParticleDefinition;
|
|---|
| 65 |
|
|---|
| 66 | class G4AdjointStackingAction : public G4UserStackingAction
|
|---|
| 67 | {
|
|---|
| 68 | public:
|
|---|
| 69 | G4AdjointStackingAction();
|
|---|
| 70 | virtual ~G4AdjointStackingAction();
|
|---|
| 71 |
|
|---|
| 72 | public:
|
|---|
| 73 | virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
|
|---|
| 74 | virtual void NewStage();
|
|---|
| 75 | virtual void PrepareNewEvent();
|
|---|
| 76 | inline void SetUserFwdStackingAction(G4UserStackingAction* anAction){theFwdStackingAction = anAction;}
|
|---|
| 77 | inline void SetUserAdjointStackingAction(G4UserStackingAction* anAction){theUserAdjointStackingAction = anAction;}
|
|---|
| 78 |
|
|---|
| 79 | inline void SetKillTracks(G4bool aBool){kill_tracks =aBool;}
|
|---|
| 80 | inline void SetAdjointMode(G4bool aBool){adjoint_mode=aBool;}
|
|---|
| 81 |
|
|---|
| 82 | private:
|
|---|
| 83 | G4UserStackingAction* theFwdStackingAction;
|
|---|
| 84 | G4UserStackingAction* theUserAdjointStackingAction;
|
|---|
| 85 | G4bool kill_tracks, adjoint_mode;
|
|---|
| 86 | };
|
|---|
| 87 |
|
|---|
| 88 | #endif
|
|---|
| 89 |
|
|---|