Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 08:28:45

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 F05SteppingVerbose.cc
0027 /// \brief Implementation of the F05SteppingVerbose class
0028 
0029 #include "F05SteppingVerbose.hh"
0030 
0031 #include "G4SteppingManager.hh"
0032 #include "G4UnitsTable.hh"
0033 
0034 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0035 
0036 void F05SteppingVerbose::StepInfo()
0037 {
0038   CopyState();
0039 
0040   G4int prec = G4cout.precision(6);
0041 
0042   if (verboseLevel >= 1) {
0043     if (verboseLevel >= 4) VerboseTrack();
0044     if (verboseLevel >= 3) {
0045       G4cout << G4endl;
0046       G4cout << std::setw(5) << "#Step#"
0047              << " " << std::setw(10) << "X"
0048              << "    " << std::setw(10) << "Y"
0049              << "    " << std::setw(10) << "Z"
0050              << "    " << std::setw(10) << "Direction x"
0051              << " " << std::setw(10) << "dir y"
0052              << " " << std::setw(10) << "dir z"
0053              << " " << std::setw(8) << "Time"
0054              << " " << std::setw(6) << "dEStep"
0055              << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0056              << "NextVolu" << std::setw(10) << "Process"
0057              << " " << G4endl;
0058     }
0059 
0060     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(10)
0061            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(10)
0062            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(10)
0063            << G4BestUnit(fTrack->GetPosition().z(), "Length");
0064     G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " << std::setw(10)
0065            << fTrack->GetMomentumDirection().y() << " " << std::setw(10)
0066            << fTrack->GetMomentumDirection().z() << " ";
0067     G4cout << std::setw(8) << G4BestUnit(fTrack->GetGlobalTime(), "Time") << std::setw(6)
0068            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(10)
0069            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(10)
0070            << G4BestUnit(fTrack->GetTrackLength(), "Length");
0071 
0072     if (fTrack->GetNextVolume() != nullptr) {
0073       G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0074     }
0075     else {
0076       G4cout << std::setw(10) << "OutOfWorld";
0077     }
0078 
0079     if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr) {
0080       G4cout << "  " << std::setw(10)
0081              << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
0082     }
0083     else {
0084       G4cout << "   UserLimit";
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                << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() << " ---------------"
0096                << G4endl;
0097 
0098         for (size_t lp1 = (*fSecondary).size() - tN2ndariesTot; lp1 < (*fSecondary).size(); lp1++) {
0099           G4cout << "    : " << std::setw(6)
0100                  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length") << std::setw(6)
0101                  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length") << std::setw(6)
0102                  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length") << std::setw(6)
0103                  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy") << std::setw(10)
0104                  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
0105           G4cout << G4endl;
0106         }
0107 
0108         G4cout << "    :-----------------------------"
0109                << "----------------------------------"
0110                << "-- EndOf2ndaries Info ---------------" << G4endl;
0111       }
0112     }
0113   }
0114   G4cout.precision(prec);
0115 }
0116 
0117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0118 
0119 void F05SteppingVerbose::TrackingStarted()
0120 {
0121   CopyState();
0122   G4int prec = G4cout.precision(6);
0123   if (verboseLevel > 0) {
0124     G4cout << std::setw(5) << "Step#"
0125            << " " << std::setw(10) << "X"
0126            << "    " << std::setw(10) << "Y"
0127            << "    " << std::setw(10) << "Z"
0128            << "    " << std::setw(10) << "Direction x"
0129            << " " << std::setw(10) << "dir y"
0130            << " " << std::setw(10) << "dir z"
0131            << " " << std::setw(10) << "Time"
0132            << " " << std::setw(10) << "dEStep"
0133            << " " << std::setw(10) << "StepLeng" << std::setw(10) << "TrakLeng" << std::setw(10)
0134            << "Volume"
0135            << "  " << std::setw(10) << "Process" << G4endl;
0136 
0137     G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " << std::setw(10)
0138            << G4BestUnit(fTrack->GetPosition().x(), "Length") << std::setw(10)
0139            << G4BestUnit(fTrack->GetPosition().y(), "Length") << std::setw(10)
0140            << G4BestUnit(fTrack->GetPosition().z(), "Length");
0141     G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " " << std::setw(10)
0142            << fTrack->GetMomentumDirection().y() << " " << std::setw(10)
0143            << fTrack->GetMomentumDirection().z() << " ";
0144     G4cout << std::setw(8) << G4BestUnit(fTrack->GetGlobalTime(), "Time") << std::setw(6)
0145            << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy") << std::setw(10)
0146            << G4BestUnit(fStep->GetStepLength(), "Length") << std::setw(10)
0147            << G4BestUnit(fTrack->GetTrackLength(), "Length");
0148 
0149     if (fTrack->GetNextVolume()) {
0150       G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0151     }
0152     else {
0153       G4cout << std::setw(10) << "OutOfWorld";
0154     }
0155     G4cout << "    initStep" << G4endl;
0156   }
0157   G4cout.precision(prec);
0158 }
0159 
0160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....