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