Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4VFastSimulationModel.hh,v 1.7 2006-06-29 21:09:24 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-09-04-patch-01 $ 27 // 29 // 28 // << 30 // 29 //-------------------------------------------- 31 //--------------------------------------------------------------- 30 // 32 // 31 // G4VFastSimulationModel.hh 33 // G4VFastSimulationModel.hh 32 // 34 // 33 // Description: 35 // Description: 34 // Base class for fast simulation models. 36 // Base class for fast simulation models. 35 // 37 // 36 // History: 38 // History: 37 // Oct 97: Verderi && MoraDeFreitas - First 39 // Oct 97: Verderi && MoraDeFreitas - First Implementation. 38 // 40 // 39 //-------------------------------------------- 41 //--------------------------------------------------------------- 40 42 >> 43 41 #ifndef G4VFastSimulationModel_h 44 #ifndef G4VFastSimulationModel_h 42 #define G4VFastSimulationModel_h 45 #define G4VFastSimulationModel_h 43 46 44 #include "G4FastStep.hh" << 45 #include "G4FastTrack.hh" 47 #include "G4FastTrack.hh" >> 48 #include "G4FastStep.hh" >> 49 >> 50 //--------------------------- >> 51 // For possible future needs: >> 52 //--------------------------- >> 53 typedef G4Region G4Envelope; 46 54 47 //------------------------------------------- 55 //------------------------------------------- 48 // 56 // 49 // G4VFastSimulationModel class 57 // G4VFastSimulationModel class 50 // 58 // 51 //------------------------------------------- 59 //------------------------------------------- 52 60 53 // Class Description: 61 // Class Description: 54 // This is the abstract class for the implem << 62 // This is the abstract class for the implementation of parameterisations. 55 // You have to inherit from it to implement << 63 // You have to inherit from it to implement your concrete parameterisation 56 // model. 64 // model. 57 // 65 // 58 66 59 class G4VFastSimulationModel << 67 class G4VFastSimulationModel 60 { 68 { 61 public: << 69 public: // With description 62 // aName identifies the parameterisation m << 70 63 G4VFastSimulationModel(const G4String& aNa << 71 G4VFastSimulationModel(const G4String& aName); 64 << 72 // aName identifies the parameterisation model. 65 // This constructor allows you to get a qu << 73 66 // In addition to the model name, this con << 74 G4VFastSimulationModel(const G4String& aName, G4Envelope*, 67 // pointer. This volume will automatically << 75 G4bool IsUnique=FALSE); 68 // needed G4FastSimulationManager object i << 76 // This constructor allows you to get a quick "getting started". 69 // it the G4LogicalVolume pointer and the << 77 // In addition to the model name, this constructor accepts a G4LogicalVolume 70 // exists, the model is simply added to th << 78 // pointer. This volume will automatically becomes the envelope, and the 71 // G4VFastSimulationModel object will not << 79 // needed G4FastSimulationManager object is constructed if necessary giving 72 // in the constructor. << 80 // it the G4LogicalVolume pointer and the boolean value. If it already 73 // The boolean argument is there for optim << 81 // exists, the model is simply added to this manager. However the 74 // the G4LogicalVolume envelope is placed << 82 // G4VFastSimulationModel object will not keep track of the envelope given 75 // boolean value to "true" (an automated m << 83 // in the constructor. 76 G4VFastSimulationModel(const G4String& aNa << 84 // The boolean argument is there for optimization purpose: if you know that 77 << 85 // the G4LogicalVolume envelope is placed only once you can turn this 78 virtual ~G4VFastSimulationModel() = defaul << 86 // boolean value to "true" (an automated mechanism is foreseen here.) 79 << 87 80 // In your implementation, you have to ret << 88 public: // Without description 81 // applicable to the G4ParticleDefinition << 89 virtual ~G4VFastSimulationModel() {}; 82 // G4ParticleDefinition provides all intri << 90 83 // charge, spin, name ...). << 91 public: // With description 84 virtual G4bool IsApplicable(const G4Partic << 92 85 << 93 virtual G4bool IsApplicable(const G4ParticleDefinition&) = 0; 86 // You have to return "true" when the dyna << 94 // In your implementation, you have to return "true" when your model is 87 // parameterisation are fulfiled. The G4Fa << 95 // applicable to the G4ParticleDefinition passed to this method. The 88 // the current G4Track, gives simple acces << 96 // G4ParticleDefinition provides all intrisic particle informations (mass, 89 // (G4LogicalVolume, G4VSolid, G4AffineTra << 97 // charge, spin, name ...). 90 // global and the envelope local coordinat << 98 91 // the position, momentum expressed in the << 99 virtual G4bool ModelTrigger(const G4FastTrack &) = 0; 92 // Using those quantities and the G4VSolid << 100 // You have to return "true" when the dynamics conditions to trigger your 93 // easily check how far you are from the e << 101 // parameterisation are fulfiled. The G4FastTrack provides you access to 94 virtual G4bool ModelTrigger(const G4FastTr << 102 // the current G4Track, gives simple access to envelope related features 95 << 103 // (G4LogicalVolume, G4VSolid, G4AffineTransform references between the 96 // Your parameterisation properly said. Th << 104 // global and the envelope local coordinates systems) and simple access to 97 // input informations. The final state of << 105 // the position, momentum expressed in the envelope coordinate system. 98 // has to be returned through the G4FastSt << 106 // Using those quantities and the G4VSolid methods, you can for example 99 // described has "requests" the tracking w << 107 // easily check how far you are from the envelope boundary. 100 // parameterisation has been invoked. << 108 101 virtual void DoIt(const G4FastTrack&, G4Fa << 109 virtual void DoIt(const G4FastTrack&, G4FastStep&) = 0; 102 << 110 // Your parameterisation properly said. The G4FastTrack reference provides 103 // --------------------------- << 111 // input informations. The final state of the particles after parameterisation 104 // -- Idem for AtRest methods: << 112 // has to be returned through the G4FastStep reference. This final state is 105 // --------------------------- << 113 // described has "requests" the tracking will apply after your 106 // -- A default dummy implementation is pr << 114 // parameterisation has been invoked. 107 << 115 108 // You have to return "true" when the dyna << 116 // --------------------------- 109 // parameterisation are fulfiled. The G4Fa << 117 // -- Idem for AtRest methods: 110 // the current G4Track, gives simple acces << 118 // --------------------------- 111 // (G4LogicalVolume, G4VSolid, G4AffineTra << 119 // -- A default dummy implementation is provided. 112 // global and the envelope local coordinat << 120 113 // the position, momentum expressed in the << 121 virtual 114 // Using those quantities and the G4VSolid << 122 G4bool AtRestModelTrigger(const G4FastTrack&) {return false;} 115 // easily check how far you are from the e << 123 // You have to return "true" when the dynamics conditions to trigger your 116 virtual G4bool AtRestModelTrigger(const G4 << 124 // parameterisation are fulfiled. The G4FastTrack provides you access to 117 << 125 // the current G4Track, gives simple access to envelope related features 118 // Your parameterisation properly said. Th << 126 // (G4LogicalVolume, G4VSolid, G4AffineTransform references between the 119 // input informations. The final state of << 127 // global and the envelope local coordinates systems) and simple access to 120 // has to be returned through the G4FastSt << 128 // the position, momentum expressed in the envelope coordinate system. 121 // described has "requests" the tracking w << 129 // Using those quantities and the G4VSolid methods, you can for example 122 // parameterisation has been invoked. << 130 // easily check how far you are from the envelope boundary. 123 virtual void AtRestDoIt(const G4FastTrack& << 131 124 << 132 virtual 125 // Complete processing of any buffered or << 133 void AtRestDoIt (const G4FastTrack&, G4FastStep&) {} 126 virtual void Flush() {} << 134 // Your parameterisation properly said. The G4FastTrack reference provides 127 << 135 // input informations. The final state of the particles after parameterisation 128 // Useful public methods : << 136 // has to be returned through the G4FastStep reference. This final state is 129 const G4String GetName() const; << 137 // described has "requests" the tracking will apply after your 130 G4bool operator==(const G4VFastSimulationM << 138 // parameterisation has been invoked. 131 << 139 132 private: << 140 public: // Without description 133 //------------- << 141 134 // Model Name: << 142 // Useful public methods : 135 //------------- << 143 const G4String GetName() const; 136 G4String theModelName; << 144 G4bool operator == ( const G4VFastSimulationModel&) const; >> 145 >> 146 private: >> 147 //------------- >> 148 // Model Name: >> 149 //------------- >> 150 G4String theModelName; 137 }; 151 }; 138 152 139 inline const G4String G4VFastSimulationModel:: << 153 inline const G4String G4VFastSimulationModel::GetName() const 140 { 154 { 141 return theModelName; 155 return theModelName; 142 } 156 } 143 157 144 inline G4bool G4VFastSimulationModel::operator << 158 inline G4bool >> 159 G4VFastSimulationModel::operator == (const G4VFastSimulationModel& fsm) const 145 { 160 { 146 return this == &fsm; << 161 return (this==&fsm) ? true : false; 147 } 162 } 148 #endif 163 #endif 149 164