00001
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00054
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00070
00071 #ifndef DsG4Cerenkov_h
00072 #define DsG4Cerenkov_h 1
00073
00075
00077
00078 #include "globals.hh"
00079 #include "templates.hh"
00080 #include "Randomize.hh"
00081 #include "G4ThreeVector.hh"
00082 #include "G4ParticleMomentum.hh"
00083 #include "G4Step.hh"
00084 #include "G4VProcess.hh"
00085 #include "G4OpticalPhoton.hh"
00086 #include "G4DynamicParticle.hh"
00087 #include "G4Material.hh"
00088 #include "G4PhysicsTable.hh"
00089 #include "G4MaterialPropertiesTable.hh"
00090 #include "G4PhysicsOrderedFreeVector.hh"
00091
00092
00093
00094
00095
00096
00098
00100
00101 class DsG4Cerenkov : public G4VProcess
00102 {
00103
00104 private:
00105
00107
00109
00110
00111
00112 public:
00113
00115
00117
00118 DsG4Cerenkov(const G4String& processName = "Cerenkov",
00119 G4ProcessType type = fElectromagnetic);
00120
00121
00122
00123 ~DsG4Cerenkov();
00124
00126
00128
00129 public:
00130
00131 G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
00132
00133
00134 G4double GetMeanFreePath(const G4Track& aTrack,
00135 G4double ,
00136 G4ForceCondition* );
00137
00138
00139
00140 G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
00141 G4double ,
00142 G4ForceCondition* );
00143
00144
00145
00146 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
00147 const G4Step& aStep);
00148
00149
00150
00151 virtual G4double AlongStepGetPhysicalInteractionLength(
00152 const G4Track&,
00153 G4double ,
00154 G4double ,
00155 G4double& ,
00156 G4GPILSelection*
00157 ) { return -1.0; };
00158
00159 virtual G4double AtRestGetPhysicalInteractionLength(
00160 const G4Track& ,
00161 G4ForceCondition*
00162 ) { return -1.0; };
00163
00164
00165 virtual G4VParticleChange* AtRestDoIt(
00166 const G4Track& ,
00167 const G4Step&
00168 ) {return 0;};
00169
00170 virtual G4VParticleChange* AlongStepDoIt(
00171 const G4Track& ,
00172 const G4Step&
00173 ) {return 0;};
00174
00175 void SetTrackSecondariesFirst(const G4bool state);
00176
00177
00178
00179
00180 void SetMaxBetaChangePerStep(const G4double d);
00181
00182
00183
00184 void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
00185
00186
00187
00188
00189
00190
00191
00192 G4PhysicsTable* GetPhysicsTable() const;
00193
00194
00195 void DumpPhysicsTable() const;
00196
00197
00198 G4double GetPhotonWeight() const { return fPhotonWeight; }
00199 void SetPhotonWeight(G4double weight) { fPhotonWeight = weight; }
00200
00201 G4bool GetApplyPreQE() const { return fApplyPreQE; }
00202 void SetApplyPreQE(G4bool a) { fApplyPreQE = a; }
00203
00204 G4double GetPreQE() const { return fPreQE; }
00205 void SetPreQE(G4double a) { fPreQE = a; }
00206
00207 private:
00208
00209 void BuildThePhysicsTable();
00210
00212
00214
00215 G4double GetAverageNumberOfPhotons(const G4double charge,
00216 const G4double beta,
00217 const G4Material *aMaterial,
00218 const G4MaterialPropertyVector* Rindex) const;
00219
00221
00223
00224 protected:
00225
00226 G4PhysicsTable* thePhysicsTable;
00227
00228
00229
00230
00231 private:
00232
00233 G4bool fTrackSecondariesFirst;
00234 G4double fMaxBetaChange;
00235 G4int fMaxPhotons;
00236 G4double fPhotonWeight;
00237 G4bool fApplyPreQE;
00238 G4double fPreQE;
00239 };
00240
00242
00244
00245 inline
00246 G4bool DsG4Cerenkov::IsApplicable(const G4ParticleDefinition& aParticleType)
00247 {
00248 if (aParticleType.GetParticleName() != "chargedgeantino" ) {
00249 return (aParticleType.GetPDGCharge() != 0);
00250 } else {
00251 return false;
00252 }
00253 }
00254
00255 inline
00256 void DsG4Cerenkov::SetTrackSecondariesFirst(const G4bool state)
00257 {
00258 fTrackSecondariesFirst = state;
00259 }
00260
00261 inline
00262 void DsG4Cerenkov::SetMaxBetaChangePerStep(const G4double value)
00263 {
00264 fMaxBetaChange = value*perCent;
00265 }
00266
00267 inline
00268 void DsG4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons)
00269 {
00270 fMaxPhotons = NumPhotons;
00271 }
00272
00273 inline
00274 void DsG4Cerenkov::DumpPhysicsTable() const
00275 {
00276 G4int PhysicsTableSize = thePhysicsTable->entries();
00277 G4PhysicsOrderedFreeVector *v;
00278
00279 for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
00280 {
00281 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i];
00282 v->DumpValues();
00283 }
00284 }
00285
00286 inline
00287 G4PhysicsTable* DsG4Cerenkov::GetPhysicsTable() const
00288 {
00289 return thePhysicsTable;
00290 }
00291
00292 #endif