Back to home page

EIC code displayed by LXR

 
 

    


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

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 field/field02/src/F02SteppingVerbose.cc
0027 /// \brief Implementation of the F02SteppingVerbose class
0028 //
0029 //
0030 //
0031 //
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0034 
0035 #include "F02SteppingVerbose.hh"
0036 
0037 #include "G4SteppingManager.hh"
0038 #include "G4UnitsTable.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 void F02SteppingVerbose::StepInfo()
0043 {
0044   CopyState();
0045 
0046   G4int prec = G4cout.precision(3);
0047 
0048   if (verboseLevel >= 1) {
0049     if (verboseLevel >= 4) VerboseTrack();
0050     if (verboseLevel >= 3) {
0051       G4cout << G4endl;
0052       G4cout << std::setw(5) << "#Step#"
0053              << " " << std::setw(6) << "X"
0054              << "    " << std::setw(6) << "Y"
0055              << "    " << std::setw(6) << "Z"
0056              << "    " << std::setw(9) << "KineE"
0057              << " " << std::setw(9) << "dEStep"
0058              << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0059              << "NextVolu" << std::setw(10) << "Process" << G4endl;
0060     }
0061 
0062     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0063            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0064            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0065            << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0066            << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0067            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0068            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0069            << G4BestUnit(fTrack->GetTrackLength(), "Length");
0070 
0071     if (fTrack->GetNextVolume() != nullptr) {
0072       G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
0073     }
0074     else {
0075       G4cout << std::setw(10) << "OutOfWorld";
0076     }
0077 
0078     if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr) {
0079       G4cout << std::setw(10)
0080              << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
0081     }
0082     else {
0083       G4cout << "   UserLimit";
0084     }
0085 
0086     G4cout << G4endl;
0087 
0088     if (verboseLevel == 2) {
0089       G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt + fN2ndariesPostStepDoIt;
0090       if (tN2ndariesTot > 0) {
0091         G4cout << "    :----- List of 2ndaries - "
0092                << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot << "(Rest=" << std::setw(2)
0093                << fN2ndariesAtRestDoIt << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
0094                << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt << "), "
0095                << " ---------------" << G4endl;
0096         G4cout << "    :-----------------------------"
0097                << "----------------------------------"
0098                << "-- EndOf2ndaries Info ---------------" << G4endl;
0099       }
0100     }
0101   }
0102   G4cout.precision(prec);
0103 }
0104 
0105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0106 
0107 void F02SteppingVerbose::TrackingStarted()
0108 {
0109   CopyState();
0110   G4int prec = G4cout.precision(3);
0111   if (verboseLevel > 0) {
0112     G4cout << std::setw(5) << "Step#"
0113            << " " << std::setw(6) << "X"
0114            << "    " << std::setw(6) << "Y"
0115            << "    " << std::setw(6) << "Z"
0116            << "    " << std::setw(9) << "KineE"
0117            << " " << std::setw(9) << "dEStep"
0118            << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0119            << "NextVolu" << std::setw(10) << "Process" << G4endl;
0120 
0121     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(6)
0122            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(6)
0123            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(6)
0124            << G4BestUnit(fTrack->GetPosition().z(), "Length") << std::setw(6)
0125            << G4BestUnit(fTrack->GetKineticEnergy(), "Energy") << std::setw(6)
0126            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(6)
0127            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(6)
0128            << G4BestUnit(fTrack->GetTrackLength(), "Length");
0129 
0130     if (fTrack->GetNextVolume()) {
0131       G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
0132     }
0133     else {
0134       G4cout << std::setw(10) << "OutOfWorld"
0135              << " ";
0136     }
0137     G4cout << std::setw(10) << "initStep" << G4endl;
0138   }
0139   G4cout.precision(prec);
0140 }
0141 
0142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......