Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:57

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