Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:04

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 
0027 #include "eRositaSteppingVerbose.hh"
0028 
0029 #include "G4SteppingManager.hh"
0030 #include "G4UnitsTable.hh"
0031 
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0033 
0034 eRositaSteppingVerbose::eRositaSteppingVerbose()
0035 {
0036 }
0037 
0038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0039 
0040 eRositaSteppingVerbose::~eRositaSteppingVerbose()
0041 {
0042 }
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0045 
0046 void eRositaSteppingVerbose::StepInfo()
0047 {
0048     CopyState();
0049 
0050     G4int precision = G4cout.precision(3);
0051 
0052     if (verboseLevel >= 1) {
0053         if (verboseLevel >= 4) {
0054             VerboseTrack();
0055         }
0056         if (verboseLevel >= 3) {
0057             G4cout << G4endl;
0058             G4cout << std::setw(5) << "Step#"
0059                    << " "
0060                    << std::setw(6) << "X"
0061                    << "    "
0062                    << std::setw(6) << "Y"
0063                    << "    "
0064                    << std::setw(6) << "Z"
0065                    << "    "
0066                    << std::setw(9) << "KineticEnergy"
0067                    << " "
0068                    << std::setw(9) << "dEStep"
0069                    << " "
0070                    << std::setw(10) << "StepLength"
0071                    << std::setw(10) << "TrackLength"
0072                    << std::setw(10) << "Volume"
0073                    << "  "
0074                    << std::setw(10) << "Process" << G4endl;
0075         }
0076 
0077         G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
0078                << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(), "Length")
0079                << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(), "Length")
0080                << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(), "Length")
0081                << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
0082                << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy")
0083                << std::setw(6) << G4BestUnit(fStep->GetStepLength(), "Length")
0084                << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(), "Length")
0085                << "  ";
0086 
0087         // if(fStepStatus != fWorldBoundary) {
0088         if (fTrack->GetNextVolume() != nullptr) {
0089             G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0090         } else {
0091             G4cout << std::setw(10) << "OutOfWorld";
0092         }
0093 
0094         if (fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr) {
0095             G4cout << "  "
0096                    << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
0097         } else {
0098             G4cout << "   UserLimit";
0099         }
0100 
0101         G4cout << G4endl;
0102 
0103         if (verboseLevel == 2) {
0104             G4int tN2ndariesTot = fN2ndariesAtRestDoIt + fN2ndariesAlongStepDoIt + fN2ndariesPostStepDoIt;
0105             if (tN2ndariesTot > 0) {
0106                 G4cout << "    :----- List of secondaries - "
0107                        << "#SpawnInStep: " << std::setw(3) << tN2ndariesTot
0108                        << "(Rest: " << std::setw(2) << fN2ndariesAtRestDoIt
0109                        << ", Along: " << std::setw(2) << fN2ndariesAlongStepDoIt
0110                        << ", Post: " << std::setw(2) << fN2ndariesPostStepDoIt
0111                        << "), "
0112                        << "#SpawnTotal: " << std::setw(3) << (*fSecondary).size()
0113                        << " ---------------"
0114                        << G4endl;
0115 
0116                 for (size_t lp1 = (*fSecondary).size() - tN2ndariesTot; lp1 < (*fSecondary).size(); lp1++) {
0117                     G4cout << "    : "
0118                            << std::setw(6)
0119                            << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(), "Length")
0120                            << std::setw(6)
0121                            << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(), "Length")
0122                            << std::setw(6)
0123                            << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(), "Length")
0124                            << std::setw(6)
0125                            << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(), "Energy")
0126                            << std::setw(10)
0127                            << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
0128                     G4cout << G4endl;
0129                 }
0130 
0131                 G4cout << "    :-----------------------------"
0132                        << "----------------------------------"
0133                        << "-- EndOfSecondaries Info ---------------"
0134                        << G4endl;
0135             }
0136         }
0137     }
0138     G4cout.precision(precision);
0139 }
0140 
0141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0142 
0143 void eRositaSteppingVerbose::TrackingStarted()
0144 {
0145     CopyState();
0146 
0147     G4int precision = G4cout.precision(3);
0148 
0149     if (verboseLevel > 0) {
0150         G4cout << std::setw(5) << "Step#"
0151                << " "
0152                << std::setw(6) << "X"
0153                << "    "
0154                << std::setw(6) << "Y"
0155                << "    "
0156                << std::setw(6) << "Z"
0157                << "    "
0158                << std::setw(9) << "KineticEnergy"
0159                << " "
0160                << std::setw(9) << "dEStep"
0161                << " "
0162                << std::setw(10) << "StepLength"
0163                << std::setw(10) << "TrackLength"
0164                << std::setw(10) << "Volume"
0165                << "  "
0166                << std::setw(10) << "Process" << G4endl;
0167 
0168         G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
0169                << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(), "Length")
0170                << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(), "Length")
0171                << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(), "Length")
0172                << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(), "Energy")
0173                << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(), "Energy")
0174                << std::setw(6) << G4BestUnit(fStep->GetStepLength(), "Length")
0175                << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(), "Length")
0176                << "  ";
0177 
0178         if (fTrack->GetNextVolume() != nullptr) {
0179             G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
0180         } else {
0181             G4cout << std::setw(10) << "OutOfWorld";
0182         }
0183         G4cout << "    initStep" << G4endl;
0184     }
0185     G4cout.precision(precision);
0186 }