// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // //#define debug //#define errors #include "PhotInStackingAction.hh" // Can be moved to the PhotInConstants.hh G4int PhotInStackingAction::PhotInNGamma [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNElectron [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNPositron [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNNeutrons [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNProtons [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNDeuterons [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNTritons [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNHe3s [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNAlphas [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNLambdas [PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNHeavyFrags[PhotInDiNSections] = {0,0,0,0,0,0}; G4int PhotInStackingAction::PhotInNMesons [PhotInDiNSections] = {0,0,0,0,0,0}; G4double PhotInStackingAction::PhotInEMinGamma [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinElectron [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinPositron [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinNeutrons [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinProtons [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinDeuterons [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinTritons [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinHe3s [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinAlphas [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinLambdas [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinHeavyFrags[PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMinMesons [PhotInDiNSections] = {DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX,DBL_MAX}; G4double PhotInStackingAction::PhotInEMaxGamma [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxElectron [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxPositron [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxNeutrons [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxProtons [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxDeuterons [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxTritons [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxHe3s [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxAlphas [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxLambdas [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxHeavyFrags[PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; G4double PhotInStackingAction::PhotInEMaxMesons [PhotInDiNSections]={0.,0.,0.,0.,0.,0.}; PhotInStackingAction::PhotInStackingAction() {} PhotInStackingAction::~PhotInStackingAction(){} G4ClassificationOfNewTrack PhotInStackingAction::ClassifyNewTrack(const G4Track* aTrack) { G4TouchableHistory* theTouchable = (G4TouchableHistory*)(aTrack->GetTouchable()); G4int depth=0; // Depth of geometrical hierarchy of volumes if(theTouchable)depth=theTouchable->GetHistoryDepth(); #ifdef debug G4cout<<"PhotInStackingAction::ClassifyNewTrack: --------->>>>>>> depth="<2) slabNumber=theTouchable->GetReplicaNumber(depth-3); else i++; // Collect information in the absorber #ifdef debug G4cout<<"PhotInStackingAction::ClassifyNewTrack:Slab#"<GetDefinition(); if(particleType==G4Gamma::GammaDefinition()) { PhotInNGamma[i]++; if(PhotInEMinGamma[i]>aTrack->GetKineticEnergy()) PhotInEMinGamma[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxGamma[i]GetKineticEnergy()) PhotInEMaxGamma[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Electron::ElectronDefinition()) { PhotInNElectron[i]++; if(PhotInEMinElectron[i]>aTrack->GetKineticEnergy()) PhotInEMinElectron[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxElectron[i]GetKineticEnergy()) PhotInEMaxElectron[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Positron::PositronDefinition()) { PhotInNPositron[i]++; if(PhotInEMinPositron[i]>aTrack->GetKineticEnergy()) PhotInEMinPositron[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxPositron[i]GetKineticEnergy()) PhotInEMaxPositron[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Neutron::NeutronDefinition()) { PhotInNNeutrons[i]++; if(PhotInEMinNeutrons[i]>aTrack->GetKineticEnergy()) PhotInEMinNeutrons[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxNeutrons[i]GetKineticEnergy()) PhotInEMaxNeutrons[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Proton::ProtonDefinition()) { PhotInNProtons[i]++; if(PhotInEMinProtons[i]>aTrack->GetKineticEnergy()) PhotInEMinProtons[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxProtons[i]GetKineticEnergy()) PhotInEMaxProtons[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Deuteron::DeuteronDefinition()) { PhotInNDeuterons[i]++; if(PhotInEMinDeuterons[i]>aTrack->GetKineticEnergy()) PhotInEMinDeuterons[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxDeuterons[i]GetKineticEnergy()) PhotInEMaxDeuterons[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Triton::TritonDefinition()) { PhotInNTritons[i]++; if(PhotInEMinTritons[i]>aTrack->GetKineticEnergy()) PhotInEMinTritons[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxTritons[i]GetKineticEnergy()) PhotInEMaxTritons[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4He3::He3Definition()) { PhotInNHe3s[i]++; if(PhotInEMinHe3s[i]>aTrack->GetKineticEnergy()) PhotInEMinHe3s[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxHe3s[i]GetKineticEnergy()) PhotInEMaxHe3s[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Alpha::AlphaDefinition()) { PhotInNAlphas[i]++; if(PhotInEMinAlphas[i]>aTrack->GetKineticEnergy()) PhotInEMinAlphas[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxAlphas[i]GetKineticEnergy()) PhotInEMaxAlphas[i]=aTrack->GetKineticEnergy(); } else if(particleType==G4Lambda::LambdaDefinition()) { PhotInNLambdas[i]++; if(PhotInEMinLambdas[i]>aTrack->GetKineticEnergy()) PhotInEMinLambdas[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxLambdas[i]GetKineticEnergy()) PhotInEMaxLambdas[i]=aTrack->GetKineticEnergy(); } else if(particleType->GetBaryonNumber()>4) { PhotInNHeavyFrags[i]++; if(PhotInEMinHeavyFrags[i]>aTrack->GetKineticEnergy()) PhotInEMinHeavyFrags[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxHeavyFrags[i]GetKineticEnergy()) PhotInEMaxHeavyFrags[i]=aTrack->GetKineticEnergy(); } else if(!particleType->GetBaryonNumber()) { PhotInNMesons[i]++; if(PhotInEMinMesons[i]>aTrack->GetKineticEnergy()) PhotInEMinMesons[i]=aTrack->GetKineticEnergy(); if(PhotInEMaxMesons[i]GetKineticEnergy()) PhotInEMaxMesons[i]=aTrack->GetKineticEnergy(); } } } return fUrgent; } void PhotInStackingAction::PrepareNewEvent() { for(int i=0; i