Back to home page

EIC code displayed by LXR

 
 

    


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

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