Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-10 08:05:40

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