Back to home page

EIC code displayed by LXR

 
 

    


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

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