// $Id$ // Category: global // // Author: I. Hrivnacova // // Class TG4G3CutVector // -------------------- // See the class description in the header file. #include "TG4G3CutVector.h" #include "TG4G3Defaults.h" #include #include #include #include const G4double TG4G3CutVector::fgkDCUTEOff = 10. * TeV; const G4double TG4G3CutVector::fgkDCUTMOff = 10. * TeV; const G4double TG4G3CutVector::fgkTolerance = 1. * keV; TG4StringVector TG4G3CutVector::fgCutNameVector; //_____________________________________________________________________________ TG4G3CutVector::TG4G3CutVector() : fDeltaRaysOn(true) { // fill name vector if (fgCutNameVector.size() == 0) FillCutNameVector(); // initialize fCutVector for (G4int i=0; i=kNoG3Cuts) { TG4Globals::Exception( "TG4G3CutVector::SetG3Cut: Inconsistent cut."); } fCutVector[cut] = cutValue; } //_____________________________________________________________________________ void TG4G3CutVector::SetG3Defaults() { // Sets G3 default values for all cuts. // --- for (G4int i=0; iCutValue(i); } //_____________________________________________________________________________ G4bool TG4G3CutVector::Update(const TG4G3CutVector& vector) { // Update only those values that have not yet been set ( =0.) // with given vector. // Returns true if some value was modified. // --- G4bool result = false; for (G4int i=0; iGetProcessName(); if ((processName == "eBrem") || (processName == "IeBrem")) { return fCutVector[kBCUTE]; } else if ((processName == "MuBrems") || (processName == "IMuBrems")) { //(processName == "//hBrems")|| (processName == "//IhBrems") // hadron Brehmstrahlung is not defined in G4 return fCutVector[kBCUTM]; } else { return fCutVector[kCUTGAM]; } } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForElectron(const G4Track& track) const { // Returns the cut value for e-. // --- const G4VProcess* kpCreatorProcess = track.GetCreatorProcess(); G4String processName = ""; if (kpCreatorProcess) processName = kpCreatorProcess->GetProcessName(); if ((processName == "eIoni") || (processName == "IeIoni")) { // delta rays by e-, e+ if (fDeltaRaysOn) return fCutVector[kDCUTE]; else return fgkDCUTEOff; } else if ((processName == "MuIoni") || (processName == "IMuIoni") || (processName == "hIoni") || (processName == "IhIoni")) { // delta rays by other particles (mu, hadron) if (fDeltaRaysOn) return fCutVector[kDCUTM]; else return fgkDCUTMOff; } else if (processName == "MuPairProd") { //direct pair production by muons return fCutVector[kPPCUTM]; } else { return fCutVector[kCUTELE]; } } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForEplus(const G4Track& track) const { // Returns the cut value for e+. // --- const G4VProcess* kpCreatorProcess = track.GetCreatorProcess(); G4String processName = ""; if (kpCreatorProcess) processName = kpCreatorProcess->GetProcessName(); if (processName == "MuPairProd") { //direct pair production by muons return fCutVector[kPPCUTM]; } else return fCutVector[kCUTELE]; } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForChargedHadron(const G4Track& track) const { // Returns the cut value for charged hadron. // --- return fCutVector[kCUTHAD]; } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForNeutralHadron(const G4Track& track) const { // Returns the cut value for neutral hadron. // --- return fCutVector[kCUTNEU]; } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForMuon(const G4Track& track) const { // Returns the cut value for neutral muon. // --- return fCutVector[kCUTMUO]; } //_____________________________________________________________________________ G4double TG4G3CutVector::GetMinEkineForOther(const G4Track& track) const { // Returns 0. // --- return 0.; } //_____________________________________________________________________________ G4bool TG4G3CutVector::IsCut() const { // Returns true if any of cuts is set. // --- for (G4int i=0; i fgkTolerance ) return true; return false; }