Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:47

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file medical/dna/range/src/SteppingVerbose.cc
0027 /// \brief Implementation of the SteppingVerbose class
0028 //
0029 //
0030 // $Id: SteppingVerbose.cc 71676 2013-06-20 13:15:08Z gcosmo $
0031 //
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0034 
0035 #include "SteppingVerbose.hh"
0036 
0037 #include "G4ParticleTypes.hh"
0038 #include "G4SteppingManager.hh"
0039 #include "G4UnitsTable.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 SteppingVerbose::SteppingVerbose() : G4SteppingVerbose() {}
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0046 
0047 SteppingVerbose::~SteppingVerbose() {}
0048 
0049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0050 
0051 void SteppingVerbose::TrackingStarted()
0052 {
0053   CopyState();
0054 
0055   G4int prec = G4cout.precision(3);
0056 
0057   // Step zero
0058   //
0059   if (verboseLevel > 0) {
0060     G4cout << std::setw(5) << "Step#"
0061            << " " << std::setw(6) << "X"
0062            << "    " << std::setw(6) << "Y"
0063            << "    " << std::setw(6) << "Z"
0064            << "    " << std::setw(9) << "KineE"
0065            << " " << std::setw(9) << "dEStep"
0066            << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0067            << "Volume"
0068            << "  " << std::setw(10) << "Process" << G4endl;
0069 
0070     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0071            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0072            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0073            << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0074            << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0075            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0076            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0077            << G4BestUnit(fTrack->GetTrackLength(), "Length") << std::setw(10)
0078            << fTrack->GetVolume()->GetName() << "   initStep" << G4endl;
0079   }
0080   G4cout.precision(prec);
0081 }
0082 
0083 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0084 
0085 void SteppingVerbose::StepInfo()
0086 {
0087   CopyState();
0088 
0089   G4int prec = G4cout.precision(3);
0090 
0091   if (verboseLevel >= 1) {
0092     if (verboseLevel >= 4) VerboseTrack();
0093     if (verboseLevel >= 3) {
0094       G4cout << G4endl;
0095       G4cout << std::setw(5) << "#Step#"
0096              << " " << std::setw(6) << "X"
0097              << "    " << std::setw(6) << "Y"
0098              << "    " << std::setw(6) << "Z"
0099              << "    " << std::setw(9) << "KineE"
0100              << " " << std::setw(9) << "dEStep"
0101              << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0102              << "Volume"
0103              << "  " << std::setw(10) << "Process" << G4endl;
0104     }
0105 
0106     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0107            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0108            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0109            << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0110            << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0111            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0112            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0113            << G4BestUnit(fTrack->GetTrackLength(), "Length") << std::setw(10)
0114            << fTrack->GetVolume()->GetName();
0115 
0116     const G4VProcess* process = fStep->GetPostStepPoint()->GetProcessDefinedStep();
0117     G4String procName = " UserLimit";
0118     if (process) procName = process->GetProcessName();
0119     if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
0120     G4cout << "   " << std::setw(10) << procName;
0121     G4cout << G4endl;
0122 
0123     if (verboseLevel == 2) {
0124       const std::vector<const G4Track*>* secondary = fStep->GetSecondaryInCurrentStep();
0125       G4int nbtrk = (G4int)(*secondary).size();
0126       if (nbtrk) {
0127         G4cout << "\n    :----- List of secondaries ----------------" << G4endl;
0128         G4cout.precision(4);
0129         for (G4int lp = 0; lp < nbtrk; lp++) {
0130           G4cout << "   " << std::setw(13) << (*secondary)[lp]->GetDefinition()->GetParticleName()
0131                  << ":  energy =" << std::setw(6)
0132                  << G4BestUnit((*secondary)[lp]->GetKineticEnergy(), "Energy")
0133                  << "  time =" << std::setw(6)
0134                  << G4BestUnit((*secondary)[lp]->GetGlobalTime(), "Time");
0135           G4cout << G4endl;
0136         }
0137 
0138         G4cout << "    :------------------------------------------\n" << G4endl;
0139       }
0140     }
0141   }
0142   G4cout.precision(prec);
0143 }
0144 
0145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......