Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (14 years ago)
Author:
garnier
Message:

geant4 tag 9.4

Location:
trunk/source/visualization/gMocren/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/gMocren/src/CVS/Entries

    r1346 r1347  
     1/G4GMocrenFile.cc/1.2/Mon Oct 12 10:04:35 2009//Tgeant4-09-04-ref-00
     2/G4GMocrenFileCTtoDensityMap.cc/1.2/Wed Dec 16 17:51:27 2009//Tgeant4-09-04-ref-00
     3/G4GMocrenFileSceneHandler.cc/1.18/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00
     4/G4GMocrenFileViewer.cc/1.4/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00
     5/G4GMocrenIO.cc/1.6/Wed Nov 10 23:53:23 2010//Tgeant4-09-04-ref-00
     6/G4GMocrenMessenger.cc/1.2/Mon Oct 12 10:04:35 2009//Tgeant4-09-04-ref-00
    17D
  • trunk/source/visualization/gMocren/src/G4GMocrenFile.cc

    r1337 r1347  
    2626//
    2727// $Id: G4GMocrenFile.cc,v 1.2 2009/10/12 10:04:35 akimura Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
  • trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc

    r1337 r1347  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.17 2010/09/03 16:01:21 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4GMocrenFileSceneHandler.cc,v 1.18 2010/11/10 23:53:23 akimura Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    4343
    4444#include "globals.hh"
     45#include "G4VisManager.hh"
     46
    4547#include "G4GMocrenFile.hh"
    4648#include "G4GMocrenFileSceneHandler.hh"
     
    156158G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler ()
    157159{
    158   if(GFDEBUG) G4cerr << "***** ~G4GMocrenFileSceneHandler" << G4endl;
     160  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     161      G4cout << "***** ~G4GMocrenFileSceneHandler" << G4endl;
    159162
    160163  if(kGddDest) {
     
    199202    if( i == MAX_FILE_INDEX )
    200203      {
    201         G4cerr << "==========================================="   << G4endl;
    202         G4cerr << "WARNING MESSAGE from GMocrenFile driver:   "   << G4endl;
    203         G4cerr << "  This file name is the final one in the   "   << G4endl;
    204         G4cerr << "  automatic updation of the output file name." << G4endl;
    205         G4cerr << "  You may overwrite existing files, i.e.   "   << G4endl;
    206         G4cerr << "  g4_XX.gdd."   << G4endl;
    207         G4cerr << "==========================================="   << G4endl;
     204        if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     205          G4cout << "==========================================="   << G4endl;
     206          G4cout << "WARNING MESSAGE from GMocrenFile driver:   "   << G4endl;
     207          G4cout << "  This file name is the final one in the   "   << G4endl;
     208          G4cout << "  automatic updation of the output file name." << G4endl;
     209          G4cout << "  You may overwrite existing files, i.e.   "   << G4endl;
     210          G4cout << "  g4_XX.gdd."   << G4endl;
     211          G4cout << "==========================================="   << G4endl;
     212        }
    208213      }
    209214
     
    231236  } // for
    232237
    233   G4cerr << "======================================================================" << G4endl;
    234   G4cerr << "Output file: " << kGddFileName                          << G4endl;
    235   G4cerr << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;
    236   G4cerr << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;
    237   G4cerr << "Note:" << G4endl;
    238   G4cerr << "  * The maximum number is customizable as:           " << G4endl;
    239   G4cerr << "      % setenv  G4GMocrenFile_MAX_FILE_NUM  number " << G4endl;       
    240   G4cerr << "  * The destination directory is customizable as:" << G4endl;
    241   G4cerr << "      % setenv  G4GMocrenFile_DEST_DIR  dir_name/  " << G4endl;       
    242   G4cerr << "     ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;             
    243   //G4cerr << "        dir_name, e.g. \"./tmp/\"."                 << G4endl;             
    244   G4cerr << G4endl;
    245   G4cerr << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;
    246   G4cerr << "======================================================================" << G4endl;
     238  G4cout << "======================================================================" << G4endl;
     239  G4cout << "Output file: " << kGddFileName                          << G4endl;
     240  G4cout << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;
     241  G4cout << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;
     242  G4cout << "Note:" << G4endl;
     243  G4cout << "  * The maximum number is customizable as:           " << G4endl;
     244  G4cout << "      % setenv  G4GMocrenFile_MAX_FILE_NUM  number " << G4endl;       
     245  G4cout << "  * The destination directory is customizable as:" << G4endl;
     246  G4cout << "      % setenv  G4GMocrenFile_DEST_DIR  dir_name/  " << G4endl;       
     247  G4cout << "     ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;             
     248  //G4cout << "        dir_name, e.g. \"./tmp/\"."                 << G4endl;             
     249  G4cout << G4endl;
     250  G4cout << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;
     251  G4cout << "======================================================================" << G4endl;
    247252
    248253} // G4GMocrenFileSceneHandler::SetGddFileName()
     
    252257void    G4GMocrenFileSceneHandler::BeginSavingGdd( void )
    253258{
    254   if(GFDEBUG) G4cerr << "***** BeginSavingGdd (called)" << G4endl;
     259  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     260      G4cout << "***** BeginSavingGdd (called)" << G4endl;
    255261
    256262  if( !IsSavingGdd() ) {
    257263
    258     if(GFDEBUG) {
    259       G4cerr << "*****                   (started) " ;
    260       G4cerr << "(open g4.gdd, ##)"  << G4endl;
     264    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     265      G4cout << "*****                   (started) " ;
     266      G4cout << "(open g4.gdd, ##)"  << G4endl;
    261267    }
    262268
     
    294300     
    295301    } else {
    296       G4cerr << "cann't open the file : " << fname << G4endl;
     302      G4cout << "cann't open the file : " << fname << G4endl;
    297303    }
    298304    */
     
    322328void    G4GMocrenFileSceneHandler::EndSavingGdd  ( void )
    323329{
    324   if(GFDEBUG) G4cerr << "***** EndSavingGdd (called)" << G4endl;
     330  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     331    G4cout << "***** EndSavingGdd (called)" << G4endl;
    325332
    326333  if(IsSavingGdd()) {
    327     if(GFDEBUG) G4cerr << "*****                 (started) (close "
    328                        << kGddFileName << ")" << G4endl;
     334    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     335      G4cout << "*****                 (started) (close "
     336             << kGddFileName << ")" << G4endl;
    329337
    330338    if(kGddDest) kGddDest.close();
     
    483491
    484492
    485       if(GFDEBUG) G4cerr << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl;
     493    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     494      G4cout << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl;
    486495
    487496      //----- Send saving command and heading comment
     
    511520void G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline& polyline)
    512521{
    513   if(GFDEBUG) G4cerr << "***** AddPrimitive" << G4endl;
     522  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     523    G4cout << "***** AddPrimitive" << G4endl;
    514524
    515525
     
    591601{
    592602  //-----
    593   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4NURBS )" << G4endl;
     603  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     604    G4cout << "***** AddPrimitive( G4NURBS )" << G4endl;
    594605
    595606  //----- Initialize if necessary
     
    607618
    608619  //-----
    609   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Text )" << G4endl;
     620  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     621    G4cout << "***** AddPrimitive( G4Text )" << G4endl;
    610622
    611623  //----- Initialize IF NECESSARY
     
    622634
    623635  //-----
    624   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Circle )" << G4endl;
     636  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     637    G4cout << "***** AddPrimitive( G4Circle )" << G4endl;
    625638
    626639  //----- Initialize IF NECESSARY
     
    638651
    639652  //-----
    640   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Square )" << G4endl;
     653  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     654    G4cout << "***** AddPrimitive( G4Square )" << G4endl;
    641655
    642656  //----- Initialize if necessary
     
    650664{
    651665  //-----
    652   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Polyhedron )" << G4endl;
     666  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     667    G4cout << "***** AddPrimitive( G4Polyhedron )" << G4endl;
    653668
    654669
     
    678693      break;
    679694    default:
    680       G4cerr <<
    681         "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl;
     695      if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     696        G4cout <<
     697          "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl;
    682698      G4PhysicalVolumeModel* pPVModel =
    683699        dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
    684       if (pPVModel) G4cerr <<
    685                       "Volume " << pPVModel->GetCurrentPV()->GetName() <<
    686                       ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() <<
    687                       " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType();
    688       G4cerr <<
    689         "\nG4Polyhedron facet with " << i << " edges" << G4endl;       
     700      if (pPVModel)   
     701        if(G4VisManager::GetVerbosity() >= G4VisManager::errors)
     702          G4cout << "Volume " << pPVModel->GetCurrentPV()->GetName() <<
     703            ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() <<
     704            " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType();
     705
     706      if(G4VisManager::GetVerbosity() >= G4VisManager::errors)
     707        G4cout <<
     708          "\nG4Polyhedron facet with " << i << " edges" << G4endl;     
    690709    }
    691710  }
     
    700719
    701720  //-----               
    702   if(GFDEBUG) G4cerr << "***** GFEndModeling (called)" << G4endl;
     721  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     722    G4cout << "***** GFEndModeling (called)" << G4endl;
    703723
    704724  if( GFIsInModeling() ) {
    705725
    706     if(GFDEBUG) {
    707       G4cerr << "***** GFEndModeling (started) " ;
    708       G4cerr << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;
     726    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     727      G4cout << "***** GFEndModeling (started) " ;
     728      G4cout << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;
    709729    }
    710730
     
    723743void G4GMocrenFileSceneHandler::BeginPrimitives (const G4Transform3D& objectTransformation)
    724744{
    725   if(GFDEBUG) G4cerr << "***** BeginPrimitives " << G4endl;
     745  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     746    G4cout << "***** BeginPrimitives " << G4endl;
    726747
    727748  GFBeginModeling();
     
    736757void G4GMocrenFileSceneHandler::EndPrimitives ()
    737758{
    738   if(GFDEBUG) G4cerr << "***** EndPrimitives " << G4endl;
     759  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     760    G4cout << "***** EndPrimitives " << G4endl;
    739761
    740762  G4VSceneHandler::EndPrimitives ();
     
    747769void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )
    748770{
    749   if(GFDEBUG) G4cerr << "***** AddSolid ( box )" << G4endl;
     771  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     772    G4cout << "***** AddSolid ( box )" << G4endl;
    750773
    751774  if(GFDEBUG_DET > 0)
     
    12791302G4GMocrenFileSceneHandler::AddSolid( const G4Tubs& tubes )
    12801303{
    1281   if(GFDEBUG) G4cerr << "***** AddSolid ( tubes )" << G4endl;
     1304  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1305    G4cout << "***** AddSolid ( tubes )" << G4endl;
    12821306
    12831307  //----- skip drawing invisible primitive
     
    13211345G4GMocrenFileSceneHandler::AddSolid( const G4Cons& cons )
    13221346{
    1323   if(GFDEBUG) G4cerr << "***** AddSolid ( cons )" << G4endl;
     1347  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1348    G4cout << "***** AddSolid ( cons )" << G4endl;
    13241349
    13251350  //----- skip drawing invisible primitive
     
    13381363void G4GMocrenFileSceneHandler::AddSolid ( const G4Trd& trd )
    13391364{
    1340   if(GFDEBUG) G4cerr << "***** AddSolid ( trd )" << G4endl;
     1365  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1366    G4cout << "***** AddSolid ( trd )" << G4endl;
    13411367
    13421368
     
    13561382void G4GMocrenFileSceneHandler::AddSolid ( const G4Sphere& sphere )
    13571383{
    1358   if(GFDEBUG) G4cerr << "***** AddSolid ( sphere )" << G4endl;
     1384  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1385    G4cout << "***** AddSolid ( sphere )" << G4endl;
    13591386
    13601387  //----- skip drawing invisible primitive
     
    13731400void G4GMocrenFileSceneHandler::AddSolid (const G4Para& para)
    13741401{
    1375   if(GFDEBUG) G4cerr << "***** AddSolid ( para )" << G4endl;
     1402  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1403    G4cout << "***** AddSolid ( para )" << G4endl;
    13761404
    13771405  //----- skip drawing invisible primitive
     
    13901418void G4GMocrenFileSceneHandler::AddSolid (const G4Trap& trap)
    13911419{
    1392   if(GFDEBUG) G4cerr << "***** AddSolid ( trap )" << G4endl;
     1420  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1421    G4cout << "***** AddSolid ( trap )" << G4endl;
    13931422
    13941423  //----- skip drawing invisible primitive
     
    14081437G4GMocrenFileSceneHandler::AddSolid( const G4Torus& torus )
    14091438{
    1410   if(GFDEBUG) G4cerr << "***** AddSolid ( torus )" << G4endl;
     1439  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1440    G4cout << "***** AddSolid ( torus )" << G4endl;
    14111441
    14121442  //----- skip drawing invisible primitive
     
    14521482
    14531483  if(GFDEBUG_TRK) {
    1454     std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl;
     1484    G4cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << G4endl;
    14551485    G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
    14561486    if (!pTrModel) {
  • trunk/source/visualization/gMocren/src/G4GMocrenFileViewer.cc

    r1337 r1347  
    2525//
    2626//
    27 // $Id: G4GMocrenFileViewer.cc,v 1.3 2009/12/03 11:44:42 akimura Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4GMocrenFileViewer.cc,v 1.4 2010/11/10 23:53:23 akimura Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    4141#include <cassert>
    4242
     43#include "G4VisManager.hh"
    4344#include "G4Scene.hh"
    4445#include "G4Vector3D.hh"
     
    9394{
    9495  if(GFDEBUG)
    95     G4cerr << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl;
     96    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     97      G4cout << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl;
    9698
    9799  // Do nothing, since DAWN is running as a different process.
     
    105107{
    106108  if(GFDEBUG)
    107     G4cerr << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
     109    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     110      G4cout << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
    108111
    109112  //if(kSceneHandler.kGddDest) {
     
    121124{
    122125  if(GFDEBUG)
    123     G4cerr << "***** G4GMocrenFileViewer::DrawView () " << G4endl;
     126    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     127      G4cout << "***** G4GMocrenFileViewer::DrawView () " << G4endl;
    124128
    125129  //-----
     
    140144{
    141145  if(GFDEBUG)
    142     G4cerr << "***** G4GMocrenFileViewer::ShowView () " << G4endl;
     146    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     147      G4cout << "***** G4GMocrenFileViewer::ShowView () " << G4endl;
    143148
    144149  if( kSceneHandler.GFIsInModeling() )
  • trunk/source/visualization/gMocren/src/G4GMocrenIO.cc

    r1337 r1347  
    2525//
    2626//
    27 // $Id: G4GMocrenIO.cc,v 1.5 2009/12/03 11:44:42 akimura Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4GMocrenIO.cc,v 1.6 2010/11/10 23:53:23 akimura Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    4040//
    4141#include "G4GMocrenIO.hh"
    42 
    4342#include <iostream>
    4443#include <ctime>
     
    4746#include <cstdlib>
    4847#include <cstring>
     48
     49#include "globals.hh"
     50#include "G4VisManager.hh"
     51
    4952#if defined(_WIN32)
    5053#define LITTLE_ENDIAN 1234
     
    97100  }
    98101  if(!stat) {
    99     std::cerr << "Warning: operator + "
    100               << "         Cannot do the operator +"
    101               << std::endl;
     102    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     103      G4cout << "Warning: operator + "
     104             << "         Cannot do the operator +"
     105             << G4endl;
    102106    return *this;
    103107  }
     
    137141  }
    138142  if(!stat) {
    139     std::cerr << "Warning: operator += " << std::endl
    140               << "         Cannot do the operator +="
    141               << std::endl;
     143    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     144      G4cout << "Warning: operator += " << G4endl
     145             << "         Cannot do the operator +="
     146             << G4endl;
    142147    return *this;
    143148  }
     
    263268                           int _num) {
    264269  if(_num >= (int)kTrack.size()) {
    265     std::cerr << "GMocrenTrack::getStep(...) Error: "
    266               << "invalid step # : " << _num << std::endl;
     270    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     271      G4cout << "GMocrenTrack::getStep(...) Error: "
     272             << "invalid step # : " << _num << G4endl;
    267273    return;
    268274  }
     
    313319                           int _num) {
    314320  if(_num >= (int)kDetector.size()) {
    315     std::cerr << "GMocrenDetector::getEdge(...) Error: "
    316               << "invalid edge # : " << _num << std::endl;
     321    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     322      G4cout << "GMocrenDetector::getEdge(...) Error: "
     323             << "invalid edge # : " << _num << G4endl;
    317324    return;
    318325  }
     
    458465
    459466  if(DEBUG || kVerbose > 0)
    460     std::cout << ">>>>>>>  store data (ver.4) <<<<<<<" << std::endl;
     467    G4cout << ">>>>>>>  store data (ver.4) <<<<<<<" << G4endl;
    461468  if(DEBUG || kVerbose > 0)
    462     std::cout << "         " << kFileName << std::endl;
     469    G4cout << "         " << kFileName << G4endl;
    463470
    464471  // output file open
     
    466473                      std::ios_base::out|std::ios_base::binary);
    467474  if(DEBUG || kVerbose > 0)
    468     std::cout << "         file open status: " << ofile << std::endl;
     475    G4cout << "         file open status: " << ofile << G4endl;
    469476 
    470477  // file identifier
     
    480487  ofile.write((char *)&littleEndian, sizeof(char));
    481488  if(DEBUG || kVerbose > 0) {
    482     //std::cout << "Endian: " << (int)kLittleEndianOutput << std::endl;
    483     std::cout << "Endian: " << (int)littleEndian << std::endl;
     489    //G4cout << "Endian: " << (int)kLittleEndianOutput << G4endl;
     490    G4cout << "Endian: " << (int)littleEndian << G4endl;
    484491  }
    485492
     
    505512  ofile.write((char *)cmt, 1024);
    506513  if(DEBUG || kVerbose > 0) {
    507     std::cout << "Data comment : "
    508               << kComment << std::endl;
     514    G4cout << "Data comment : "
     515              << kComment << G4endl;
    509516  }
    510517
     
    518525  }
    519526  if(DEBUG || kVerbose > 0) {
    520     std::cout << "Voxel spacing : ("
     527    G4cout << "Voxel spacing : ("
    521528              << kVoxelSpacing[0] << ", "
    522529              << kVoxelSpacing[1] << ", "
    523530              << kVoxelSpacing[2]
    524               << ") mm " << std::endl;
     531              << ") mm " << G4endl;
    525532  }
    526533
     
    583590
    584591  if(DEBUG || kVerbose > 0) {
    585     std::cout << "Each pointer to data : "
     592    G4cout << "Each pointer to data : "
    586593              << kPointerToModalityData << ", ";
    587594    for(int i = 0; i < nDoseDist; i++) {
    588       std::cout << kPointerToDoseDistData[i] << ", ";
    589     }
    590     std::cout << kPointerToROIData << ", "
     595      G4cout << kPointerToDoseDistData[i] << ", ";
     596    }
     597    G4cout << kPointerToROIData << ", "
    591598              << kPointerToTrackData << ", "
    592599              << kPointerToDetectorData
    593               << std::endl;
     600              << G4endl;
    594601  }
    595602
     
    613620
    614621  if(DEBUG || kVerbose > 0) {
    615     std::cout << "Modality image size : ("
     622    G4cout << "Modality image size : ("
    616623              << size[0] << ", "
    617624              << size[1] << ", "
    618625              << size[2] << ")"
    619               << std::endl;
     626              << G4endl;
    620627  }
    621628
     
    643650  }
    644651  if(DEBUG || kVerbose > 0) {
    645     std::cout << "Modality image min., max., scale : "
     652    G4cout << "Modality image min., max., scale : "
    646653              << minmax[0] << ", "
    647654              << minmax[1] << ", "
    648               << scale << std::endl;
     655              << scale << G4endl;
    649656  }
    650657
    651658  // modality image
    652659  int psize = size[0]*size[1];
    653   if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";
     660  if(DEBUG || kVerbose > 0) G4cout << "Modality image : ";
    654661  for(int i = 0; i < size[2]; i++) {
    655662    short * image = kModality.getImage(i);
     
    663670    }
    664671
    665     if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
    666   }
    667   if(DEBUG || kVerbose > 0) std::cout << std::endl;
     672    if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
     673  }
     674  if(DEBUG || kVerbose > 0) G4cout << G4endl;
    668675
    669676  // modality desity map for CT value
    670677  size_t msize = minmax[1] - minmax[0]+1;
    671678  if(DEBUG || kVerbose > 0)
    672     std::cout << "modality image : " << minmax[0] << ", " << minmax[1] << std::endl;
     679    G4cout << "modality image : " << minmax[0] << ", " << minmax[1] << G4endl;
    673680  float * pdmap = new float[msize];
    674681  for(int i = 0; i < (int)msize; i++) pdmap[i] =kModalityImageDensityMap[i];
     
    684691
    685692  if(DEBUG || kVerbose > 0) {
    686     std::cout << "density map : " << std::ends;
     693    G4cout << "density map : " << std::ends;
    687694    for(int i = 0; i < (int)msize; i+=50)
    688       std::cout <<kModalityImageDensityMap[i] << ", ";
    689     std::cout << std::endl;
     695      G4cout <<kModalityImageDensityMap[i] << ", ";
     696    G4cout << G4endl;
    690697  }
    691698  delete [] pdmap;
     
    709716      }
    710717      if(DEBUG || kVerbose > 0) {
    711         std::cout << "Dose dist. [" << ndose << "] image size : ("
     718        G4cout << "Dose dist. [" << ndose << "] image size : ("
    712719                  << size[0] << ", "
    713720                  << size[1] << ", "
    714721                  << size[2] << ")"
    715                   << std::endl;
     722                  << G4endl;
    716723      }
    717724
     
    732739      ofile.write((char *)cdunit, 12);
    733740      if(DEBUG || kVerbose > 0) {
    734         std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;
     741        G4cout << "Dose dist. unit : " << kDoseUnit << G4endl;
    735742      }
    736743
     
    746753      }
    747754      if(DEBUG || kVerbose > 0) {
    748         std::cout << "Dose dist. [" << ndose
     755        G4cout << "Dose dist. [" << ndose
    749756                  << "] image min., max., scale : "
    750757                  << minmax[0] << ", "
    751758                  << minmax[1] << ", "
    752                   << scale << std::endl;
     759                  << scale << G4endl;
    753760      }
    754761
     
    770777          for(int j = 0; j < dsize; j++) {
    771778            if(dimage[j] < 0)
    772               std::cout << "[" << j << "," << z << "]"
     779              G4cout << "[" << j << "," << z << "]"
    773780                        << dimage[j] << ", ";
    774781          }
    775782        }
    776783      }
    777       if(DEBUG || kVerbose > 0) std::cout << std::endl;
     784      if(DEBUG || kVerbose > 0) G4cout << G4endl;
    778785      delete [] dimage;
    779786
     
    790797      }
    791798      if(DEBUG || kVerbose > 0) {
    792         std::cout << "Dose dist. [" << ndose
     799        G4cout << "Dose dist. [" << ndose
    793800                  << "]image relative location : ("
    794801                  << iCenter[0] << ", "
    795802                  << iCenter[1] << ", "
    796                   << iCenter[2] << ")" << std::endl;
     803                  << iCenter[2] << ")" << G4endl;
    797804      }
    798805
     
    803810      ofile.write((char *)name.c_str(), 80);
    804811      if(DEBUG || kVerbose > 0) {
    805         std::cout << "Dose dist. name : " << name << std::endl;
     812        G4cout << "Dose dist. name : " << name << G4endl;
    806813      }
    807814
     
    821828    }
    822829    if(DEBUG || kVerbose > 0) {
    823       std::cout << "ROI image size : ("
     830      G4cout << "ROI image size : ("
    824831                << size[0] << ", "
    825832                << size[1] << ", "
    826833                << size[2] << ")"
    827                 << std::endl;
     834                << G4endl;
    828835    }
    829836
     
    847854    }
    848855    if(DEBUG || kVerbose > 0) {
    849       std::cout << "ROI image min., max., scale : "
     856      G4cout << "ROI image min., max., scale : "
    850857                << minmax[0] << ", "
    851858                << minmax[1] << ", "
    852                 << scale << std::endl;
     859                << scale << G4endl;
    853860    }
    854861
     
    879886    }
    880887    if(DEBUG || kVerbose > 0) {
    881       std::cout << "ROI image relative location : ("
     888      G4cout << "ROI image relative location : ("
    882889                << iCenter[0] << ", "
    883890                << iCenter[1] << ", "
    884                 << iCenter[2] << ")" << std::endl;
     891                << iCenter[2] << ")" << G4endl;
    885892    }
    886893  }
     
    898905    }
    899906    if(DEBUG || kVerbose > 0) {
    900       std::cout << "# of tracks : "
    901                 << ntrk << std::endl;
     907      G4cout << "# of tracks : "
     908                << ntrk << G4endl;
    902909    }
    903910
     
    913920      }
    914921      if(DEBUG || kVerbose > 0) {
    915         std::cout << "# of steps : " << nsteps << std::endl;
     922        G4cout << "# of steps : " << nsteps << G4endl;
    916923      }
    917924
     
    950957    }
    951958    if(DEBUG || kVerbose > 0) {
    952       std::cout << "# of detectors : "
    953                 << ndet << std::endl;
     959      G4cout << "# of detectors : "
     960                << ndet << G4endl;
    954961    }
    955962
     
    965972      }
    966973      if(DEBUG || kVerbose > 0) {
    967         std::cout << "# of edges in a detector : " << nedges << std::endl;
     974        G4cout << "# of edges in a detector : " << nedges << G4endl;
    968975      }
    969976
     
    985992        if(DEBUG || kVerbose > 0) {
    986993          if(ne < 1) {
    987             std::cout << " edge : (" << edgePoints[0] << ", "
     994            G4cout << " edge : (" << edgePoints[0] << ", "
    988995                      << edgePoints[1] << ", "
    989996                      << edgePoints[2] << ") - ("
    990997                      << edgePoints[3] << ", "
    991998                      << edgePoints[4] << ", "
    992                       << edgePoints[5] << ")" << std::endl;
     999                      << edgePoints[5] << ")" << G4endl;
    9931000          }
    9941001        }
     
    10001007      ofile.write((char *)dcolor, 3);
    10011008      if(DEBUG || kVerbose > 0) {
    1002         std::cout << " rgb : (" << (int)dcolor[0] << ", "
     1009        G4cout << " rgb : (" << (int)dcolor[0] << ", "
    10031010                  << (int)dcolor[1] << ", "
    1004                   << (int)dcolor[2] << ")" << std::endl;
     1011                  << (int)dcolor[2] << ")" << G4endl;
    10051012      }
    10061013
     
    10101017      ofile.write((char *)dname.c_str(), 80);
    10111018      if(DEBUG || kVerbose > 0) {
    1012         std::cout << " detector name : " << dname << std::endl;
     1019        G4cout << " detector name : " << dname << G4endl;
    10131020     
    10141021      }
     
    10211028  ofile.close();
    10221029  if(DEBUG || kVerbose > 0)
    1023     std::cout << ">>>> closed gdd file: " << kFileName << std::endl;
     1030    G4cout << ">>>> closed gdd file: " << kFileName << G4endl;
    10241031
    10251032  return true;
     
    10271034bool G4GMocrenIO::storeData3() {
    10281035
    1029   if(kVerbose > 0) std::cout << ">>>>>>>  store data (ver.3) <<<<<<<" << std::endl;
    1030   if(kVerbose > 0) std::cout << "         " << kFileName << std::endl;
     1036  if(kVerbose > 0) G4cout << ">>>>>>>  store data (ver.3) <<<<<<<" << G4endl;
     1037  if(kVerbose > 0) G4cout << "         " << kFileName << G4endl;
    10311038
    10321039  bool DEBUG = false;//
     
    10551062  ofile.write((char *)cmt, 1024);
    10561063  if(DEBUG || kVerbose > 0) {
    1057     std::cout << "Data comment : "
    1058               << kComment << std::endl;
     1064    G4cout << "Data comment : "
     1065              << kComment << G4endl;
    10591066  }
    10601067
     
    10621069  ofile.write((char *)kVoxelSpacing, 12);
    10631070  if(DEBUG || kVerbose > 0) {
    1064     std::cout << "Voxel spacing : ("
     1071    G4cout << "Voxel spacing : ("
    10651072              << kVoxelSpacing[0] << ", "
    10661073              << kVoxelSpacing[1] << ", "
    10671074              << kVoxelSpacing[2]
    1068               << ") mm " << std::endl;
     1075              << ") mm " << G4endl;
    10691076  }
    10701077
     
    10901097  ofile.write((char *)&kPointerToTrackData, 4);
    10911098  if(DEBUG || kVerbose > 0) {
    1092     std::cout << "Each pointer to data : "
     1099    G4cout << "Each pointer to data : "
    10931100              << kPointerToModalityData << ", ";
    10941101    for(int i = 0; i < nDoseDist; i++) {
    1095       std::cout << kPointerToDoseDistData[i] << ", ";
    1096     }
    1097     std::cout << kPointerToROIData << ", "
    1098               << kPointerToTrackData << std::endl;
     1102      G4cout << kPointerToDoseDistData[i] << ", ";
     1103    }
     1104    G4cout << kPointerToROIData << ", "
     1105              << kPointerToTrackData << G4endl;
    10991106  }
    11001107
     
    11101117  ofile.write((char *)size, 3*sizeof(int));
    11111118  if(DEBUG || kVerbose > 0) {
    1112     std::cout << "Modality image size : ("
     1119    G4cout << "Modality image size : ("
    11131120              << size[0] << ", "
    11141121              << size[1] << ", "
    11151122              << size[2] << ")"
    1116               << std::endl;
     1123              << G4endl;
    11171124  }
    11181125
     
    11291136  ofile.write((char *)&scale, 4);
    11301137  if(DEBUG || kVerbose > 0) {
    1131     std::cout << "Modality image min., max., scale : "
     1138    G4cout << "Modality image min., max., scale : "
    11321139              << minmax[0] << ", "
    11331140              << minmax[1] << ", "
    1134               << scale << std::endl;
     1141              << scale << G4endl;
    11351142  }
    11361143
    11371144  // modality image
    11381145  int psize = size[0]*size[1];
    1139   if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";
     1146  if(DEBUG || kVerbose > 0) G4cout << "Modality image : ";
    11401147  for(int i = 0; i < size[2]; i++) {
    11411148    short * image = kModality.getImage(i);
    11421149    ofile.write((char *)image, psize*sizeof(short));
    11431150
    1144     if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
    1145   }
    1146   if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1151    if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
     1152  }
     1153  if(DEBUG || kVerbose > 0) G4cout << G4endl;
    11471154
    11481155  // modality desity map for CT value
     
    11521159  ofile.write((char *)pdmap, msize*sizeof(float));
    11531160  if(DEBUG || kVerbose > 0) {
    1154     std::cout << "density map : " << std::ends;
     1161    G4cout << "density map : " << std::ends;
    11551162    for(int i = 0; i < (int)msize; i+=50)
    1156       std::cout <<kModalityImageDensityMap[i] << ", ";
    1157     std::cout << std::endl;
     1163      G4cout <<kModalityImageDensityMap[i] << ", ";
     1164    G4cout << G4endl;
    11581165  }
    11591166  delete [] pdmap;
     
    11711178      ofile.write((char *)size, 3*sizeof(int));
    11721179      if(DEBUG || kVerbose > 0) {
    1173         std::cout << "Dose dist. [" << ndose << "] image size : ("
     1180        G4cout << "Dose dist. [" << ndose << "] image size : ("
    11741181                  << size[0] << ", "
    11751182                  << size[1] << ", "
    11761183                  << size[2] << ")"
    1177                   << std::endl;
     1184                  << G4endl;
    11781185      }
    11791186
     
    11851192      ofile.write((char *)kDoseUnit.c_str(), 12);
    11861193      if(DEBUG || kVerbose > 0) {
    1187         std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;
     1194        G4cout << "Dose dist. unit : " << kDoseUnit << G4endl;
    11881195      }
    11891196
     
    11941201      ofile.write((char *)&scale, 4);
    11951202      if(DEBUG || kVerbose > 0) {
    1196         std::cout << "Dose dist. [" << ndose
     1203        G4cout << "Dose dist. [" << ndose
    11971204                  << "] image min., max., scale : "
    11981205                  << minmax[0] << ", "
    11991206                  << minmax[1] << ", "
    1200                   << scale << std::endl;
     1207                  << scale << G4endl;
    12011208      }
    12021209
     
    12111218          for(int j = 0; j < dsize; j++) {
    12121219            if(dimage[j] < 0)
    1213               std::cout << "[" << j << "," << z << "]"
     1220              G4cout << "[" << j << "," << z << "]"
    12141221                        << dimage[j] << ", ";
    12151222          }
    12161223        }
    12171224      }
    1218       if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1225      if(DEBUG || kVerbose > 0) G4cout << G4endl;
    12191226      delete [] dimage;
    12201227
     
    12251232      ofile.write((char *)iCenter, 3*4); // 3*sizeof(int)
    12261233      if(DEBUG || kVerbose > 0) {
    1227         std::cout << "Dose dist. [" << ndose
     1234        G4cout << "Dose dist. [" << ndose
    12281235                  << "]image relative location : ("
    12291236                  << iCenter[0] << ", "
    12301237                  << iCenter[1] << ", "
    1231                   << iCenter[2] << ")" << std::endl;
     1238                  << iCenter[2] << ")" << G4endl;
    12321239      }
    12331240    }
     
    12401247    ofile.write((char *)size, 3*sizeof(int));
    12411248    if(DEBUG || kVerbose > 0) {
    1242       std::cout << "ROI image size : ("
     1249      G4cout << "ROI image size : ("
    12431250                << size[0] << ", "
    12441251                << size[1] << ", "
    12451252                << size[2] << ")"
    1246                 << std::endl;
     1253                << G4endl;
    12471254    }
    12481255
     
    12551262    ofile.write((char *)&scale, sizeof(float));
    12561263    if(DEBUG || kVerbose > 0) {
    1257       std::cout << "ROI image min., max., scale : "
     1264      G4cout << "ROI image min., max., scale : "
    12581265                << minmax[0] << ", "
    12591266                << minmax[1] << ", "
    1260                 << scale << std::endl;
     1267                << scale << G4endl;
    12611268    }
    12621269
     
    12741281    ofile.write((char *)iCenter, 3*sizeof(int));
    12751282    if(DEBUG || kVerbose > 0) {
    1276       std::cout << "ROI image relative location : ("
     1283      G4cout << "ROI image relative location : ("
    12771284                << iCenter[0] << ", "
    12781285                << iCenter[1] << ", "
    1279                 << iCenter[2] << ")" << std::endl;
     1286                << iCenter[2] << ")" << G4endl;
    12801287    }
    12811288  }
     
    12861293  ofile.write((char *)&ntrk, sizeof(int));
    12871294  if(DEBUG || kVerbose > 0) {
    1288     std::cout << "# of tracks : "
    1289               << ntrk << std::endl;
     1295    G4cout << "# of tracks : "
     1296              << ntrk << G4endl;
    12901297  }
    12911298  // track position
     
    12971304  int ntcolor = int(kStepColors.size());
    12981305  if(ntrk != ntcolor)
    1299     std::cerr << "# of track color information must be the same as # of tracks."
    1300               << std::endl;
     1306    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1307      G4cout << "# of track color information must be the same as # of tracks."
     1308             << G4endl;
    13011309  unsigned char white[3] = {255,255,255}; // default color
    13021310  for(int i = 0; i < ntrk; i++) {
     
    13251333bool G4GMocrenIO::storeData2() {
    13261334
    1327   if(kVerbose > 0) std::cout << ">>>>>>>  store data (ver.2) <<<<<<<" << std::endl;
    1328   if(kVerbose > 0) std::cout << "         " << kFileName << std::endl;
     1335  if(kVerbose > 0) G4cout << ">>>>>>>  store data (ver.2) <<<<<<<" << G4endl;
     1336  if(kVerbose > 0) G4cout << "         " << kFileName << G4endl;
    13291337
    13301338  bool DEBUG = false;//
     
    13611369  ofile.write((char *)kVoxelSpacing, 12);
    13621370  if(DEBUG || kVerbose > 0) {
    1363     std::cout << "Voxel spacing : ("
     1371    G4cout << "Voxel spacing : ("
    13641372              << kVoxelSpacing[0] << ", "
    13651373              << kVoxelSpacing[1] << ", "
    13661374              << kVoxelSpacing[2]
    1367               << ") mm " << std::endl;
     1375              << ") mm " << G4endl;
    13681376  }
    13691377
     
    13811389  ofile.write((char *)&kPointerToTrackData, 4);
    13821390  if(DEBUG || kVerbose > 0) {
    1383     std::cout << "Each pointer to data : "
     1391    G4cout << "Each pointer to data : "
    13841392              << kPointerToModalityData << ", "
    13851393              << kPointerToDoseDistData[0] << ", "
    13861394              << kPointerToROIData << ", "
    1387               << kPointerToTrackData << std::endl;
     1395              << kPointerToTrackData << G4endl;
    13881396  }
    13891397
     
    13991407  ofile.write((char *)size, 3*sizeof(int));
    14001408  if(DEBUG || kVerbose > 0) {
    1401     std::cout << "Modality image size : ("
     1409    G4cout << "Modality image size : ("
    14021410              << size[0] << ", "
    14031411              << size[1] << ", "
    14041412              << size[2] << ")"
    1405               << std::endl;
     1413              << G4endl;
    14061414  }
    14071415
     
    14181426  ofile.write((char *)&scale, 4);
    14191427  if(DEBUG || kVerbose > 0) {
    1420     std::cout << "Modality image min., max., scale : "
     1428    G4cout << "Modality image min., max., scale : "
    14211429              << minmax[0] << ", "
    14221430              << minmax[1] << ", "
    1423               << scale << std::endl;
     1431              << scale << G4endl;
    14241432  }
    14251433
    14261434  // modality image
    14271435  int psize = size[0]*size[1];
    1428   if(DEBUG || kVerbose > 0) std::cout << "Modality image : ";
     1436  if(DEBUG || kVerbose > 0) G4cout << "Modality image : ";
    14291437  for(int i = 0; i < size[2]; i++) {
    14301438    short * image =kModality.getImage(i);
    14311439    ofile.write((char *)image, psize*sizeof(short));
    14321440
    1433     if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
    1434   }
    1435   if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1441    if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << image[(size_t)(psize*0.55)] << ", ";
     1442  }
     1443  if(DEBUG || kVerbose > 0) G4cout << G4endl;
    14361444
    14371445  // modality desity map for CT value
     
    14411449  ofile.write((char *)pdmap, msize*sizeof(float));
    14421450  if(DEBUG || kVerbose > 0) {
    1443     std::cout << "density map : " << std::ends;
     1451    G4cout << "density map : " << std::ends;
    14441452    for(int i = 0; i < (int)msize; i+=50)
    1445       std::cout <<kModalityImageDensityMap[i] << ", ";
    1446     std::cout << std::endl;
     1453      G4cout <<kModalityImageDensityMap[i] << ", ";
     1454    G4cout << G4endl;
    14471455  }
    14481456  delete [] pdmap;
     
    14581466    ofile.write((char *)size, 3*sizeof(int));
    14591467    if(DEBUG || kVerbose > 0) {
    1460       std::cout << "Dose dist. image size : ("
     1468      G4cout << "Dose dist. image size : ("
    14611469                << size[0] << ", "
    14621470                << size[1] << ", "
    14631471                << size[2] << ")"
    1464                 << std::endl;
     1472                << G4endl;
    14651473    }
    14661474
     
    14731481    ofile.write((char *)&scale, sizeof(float));
    14741482    if(DEBUG || kVerbose > 0) {
    1475       std::cout << "Dose dist. image min., max., scale : "
     1483      G4cout << "Dose dist. image min., max., scale : "
    14761484                << minmax[0] << ", "
    14771485                << minmax[1] << ", "
    1478                 << scale << std::endl;
     1486                << scale << G4endl;
    14791487    }
    14801488
     
    14891497        for(int j = 0; j < dsize; j++) {
    14901498          if(dimage[j] < 0)
    1491             std::cout << "[" << j << "," << z << "]"
     1499            G4cout << "[" << j << "," << z << "]"
    14921500                      << dimage[j] << ", ";
    14931501        }
    14941502      }
    14951503    }
    1496     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1504    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    14971505    delete [] dimage;
    14981506
     
    15031511    ofile.write((char *)iCenter, 3*sizeof(int));
    15041512    if(DEBUG || kVerbose > 0) {
    1505       std::cout << "Dose dist. image relative location : ("
     1513      G4cout << "Dose dist. image relative location : ("
    15061514                << iCenter[0] << ", "
    15071515                << iCenter[1] << ", "
    1508                 << iCenter[2] << ")" << std::endl;
     1516                << iCenter[2] << ")" << G4endl;
    15091517    }
    15101518
     
    15171525    ofile.write((char *)size, 3*sizeof(int));
    15181526    if(DEBUG || kVerbose > 0) {
    1519       std::cout << "ROI image size : ("
     1527      G4cout << "ROI image size : ("
    15201528                << size[0] << ", "
    15211529                << size[1] << ", "
    15221530                << size[2] << ")"
    1523                 << std::endl;
     1531                << G4endl;
    15241532    }
    15251533
     
    15321540    ofile.write((char *)&scale, sizeof(float));
    15331541    if(DEBUG || kVerbose > 0) {
    1534       std::cout << "ROI image min., max., scale : "
     1542      G4cout << "ROI image min., max., scale : "
    15351543                << minmax[0] << ", "
    15361544                << minmax[1] << ", "
    1537                 << scale << std::endl;
     1545                << scale << G4endl;
    15381546    }
    15391547
     
    15511559    ofile.write((char *)iCenter, 3*sizeof(int));
    15521560    if(DEBUG || kVerbose > 0) {
    1553       std::cout << "ROI image relative location : ("
     1561      G4cout << "ROI image relative location : ("
    15541562                << iCenter[0] << ", "
    15551563                << iCenter[1] << ", "
    1556                 << iCenter[2] << ")" << std::endl;
     1564                << iCenter[2] << ")" << G4endl;
    15571565    }
    15581566  }
     
    15641572  ofile.write((char *)&ntrk, sizeof(int));
    15651573  if(DEBUG || kVerbose > 0) {
    1566     std::cout << "# of tracks : "
    1567               << ntrk << std::endl;
     1574    G4cout << "# of tracks : "
     1575              << ntrk << G4endl;
    15681576  }
    15691577  for(int i = 0; i < ntrk; i++) {
     
    15911599  std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary);
    15921600  if(!ifile) {
    1593     std::cerr << "Cannot open file: " << kFileName
    1594               << " in G4GMocrenIO::retrieveData()." << std::endl;
     1601    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1602      G4cout << "Cannot open file: " << kFileName
     1603             << " in G4GMocrenIO::retrieveData()." << G4endl;
    15951604    return false;
    15961605  }
     
    16061615  if(std::strncmp(verid, "gMocren", 7) == 0) {
    16071616    if(ver == 0x03) {
    1608       std::cout << ">>>>>>>  retrieve data (ver.3) <<<<<<<" << std::endl;
    1609       std::cout << "         " << kFileName << std::endl;
     1617      G4cout << ">>>>>>>  retrieve data (ver.3) <<<<<<<" << G4endl;
     1618      G4cout << "         " << kFileName << G4endl;
    16101619      retrieveData3();
    16111620    } else if (ver == 0x04) {
    1612       std::cout << ">>>>>>>  retrieve data (ver.4) <<<<<<<" << std::endl;
    1613       std::cout << "         " << kFileName << std::endl;
     1621      G4cout << ">>>>>>>  retrieve data (ver.4) <<<<<<<" << G4endl;
     1622      G4cout << "         " << kFileName << G4endl;
    16141623      retrieveData4();
    16151624    } else {
    1616       std::cerr << "Error -- invalid file version : " << (int)ver
    1617                 << std::endl;
    1618       std::cerr << "         " << kFileName << std::endl;
     1625      if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     1626        G4cout << "Error -- invalid file version : " << (int)ver
     1627                  << G4endl;
     1628        G4cout << "         " << kFileName << G4endl;
     1629      }
    16191630      std::exit(-1);
    16201631    }
    16211632  } else if(std::strncmp(verid, "GRAPE", 5) == 0) {
    1622     std::cout << ">>>>>>>  retrieve data (ver.2) <<<<<<<" << std::endl;
    1623     std::cout << "         " << kFileName << std::endl;
     1633    G4cout << ">>>>>>>  retrieve data (ver.2) <<<<<<<" << G4endl;
     1634    G4cout << "         " << kFileName << G4endl;
    16241635    retrieveData2();
    16251636  } else {
    1626     std::cerr << kFileName << " was not gdd file." << std::endl;
     1637    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1638      G4cout << kFileName << " was not gdd file." << G4endl;
    16271639    return false;
    16281640  }
     
    16441656  std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary);
    16451657  if(!ifile) {
    1646     std::cerr << "Cannot open file: " << kFileName
    1647               << " in G4GMocrenIO::retrieveData3()." << std::endl;
     1658    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1659      G4cout << "Cannot open file: " << kFileName
     1660                << " in G4GMocrenIO::retrieveData3()." << G4endl;
    16481661    return false;
    16491662  }
     
    16621675  ss << (int)ver;
    16631676  kVersion = ss.str();
    1664   if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;
     1677  if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl;
    16651678
    16661679  // endian
    16671680  ifile.read((char *)&kLittleEndianInput, sizeof(char));
    16681681  if(DEBUG || kVerbose > 0) {
    1669     std::cout << "Endian : ";
     1682    G4cout << "Endian : ";
    16701683    if(kLittleEndianInput == 1)
    1671       std::cout << " little" << std::endl;
     1684      G4cout << " little" << G4endl;
    16721685    else {
    1673       std::cout << " big" << std::endl;
     1686      G4cout << " big" << G4endl;
    16741687    }
    16751688  }
     
    16861699  setComment(scmt);
    16871700  if(DEBUG || kVerbose > 0) {
    1688     std::cout << "Data comment : "
    1689               << kComment << std::endl;
     1701    G4cout << "Data comment : "
     1702              << kComment << G4endl;
    16901703  }
    16911704
     
    16961709  convertEndian(ctmp+8, kVoxelSpacing[2]);
    16971710  if(DEBUG || kVerbose > 0) {
    1698     std::cout << "Voxel spacing : ("
     1711    G4cout << "Voxel spacing : ("
    16991712              << kVoxelSpacing[0] << ", "
    17001713              << kVoxelSpacing[1] << ", "
    17011714              << kVoxelSpacing[2]
    1702               << ") mm " << std::endl;
     1715              << ") mm " << G4endl;
    17031716  }
    17041717
     
    17341747
    17351748  if(DEBUG || kVerbose > 0) {
    1736     std::cout << "Each pointer to data : "
     1749    G4cout << "Each pointer to data : "
    17371750              << kPointerToModalityData << ", ";
    17381751    for(int i = 0; i < nDoseDist; i++)
    1739       std::cout << kPointerToDoseDistData[i] << ", ";
    1740     std::cout << kPointerToROIData << ", "
     1752      G4cout << kPointerToDoseDistData[i] << ", ";
     1753    G4cout << kPointerToROIData << ", "
    17411754              << kPointerToTrackData << ", "
    17421755              << kPointerToDetectorData
    1743               << std::endl;
     1756              << G4endl;
    17441757  }
    17451758
     
    17491762     kPointerToROIData == 0 && kPointerToTrackData == 0) {
    17501763    if(DEBUG || kVerbose > 0) {
    1751       std::cout << "No data." << std::endl;
     1764      G4cout << "No data." << G4endl;
    17521765    }
    17531766    return false;
     
    17741787  convertEndian(ctmp+2*sizeof(int), size[2]);
    17751788  if(DEBUG || kVerbose > 0) {
    1776     std::cout << "Modality image size : ("
     1789    G4cout << "Modality image size : ("
    17771790              << size[0] << ", "
    17781791              << size[1] << ", "
    17791792              << size[2] << ")"
    1780               << std::endl;
     1793              << G4endl;
    17811794  }
    17821795  kModality.setSize(size);
     
    18101823    kModality.setScale(dscale = scale);
    18111824    if(DEBUG || kVerbose > 0) {
    1812       std::cout << "Modality image min., max., scale : "
     1825      G4cout << "Modality image min., max., scale : "
    18131826                << minmax[0] << ", "
    18141827                << minmax[1] << ", "
    1815                 << scale << std::endl;
     1828                << scale << G4endl;
    18161829    }
    18171830
    18181831    // modality density
    18191832    int psize = size[0]*size[1];
    1820     if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";
     1833    if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): ";
    18211834    char * cimage = new char[psize*sizeof(short)];
    18221835    for(int i = 0; i < size[2]; i++) {
     
    18281841      kModality.addImage(mimage);
    18291842
    1830       if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
    1831     }
    1832     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1843      if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
     1844    }
     1845    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    18331846    delete [] cimage;
    18341847
    18351848    // modality desity map for CT value
    18361849    size_t msize = minmax[1]-minmax[0]+1;
    1837     if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;
     1850    if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl;
    18381851    char * pdmap = new char[msize*sizeof(float)];
    18391852    ifile.read((char *)pdmap, msize*sizeof(float));
     
    18441857    }
    18451858    if(DEBUG || kVerbose > 0) {
    1846       std::cout << "density map : " << std::ends;
     1859      G4cout << "density map : " << std::ends;
    18471860      for(int i = 0; i < 10; i++)
    1848         std::cout <<kModalityImageDensityMap[i] << ", ";
    1849       std::cout << std::endl;
    1850       for(int i = 0; i < 10; i++) std::cout << "..";
    1851       std::cout << std::endl;
     1861        G4cout <<kModalityImageDensityMap[i] << ", ";
     1862      G4cout << G4endl;
     1863      for(int i = 0; i < 10; i++) G4cout << "..";
     1864      G4cout << G4endl;
    18521865      for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++)
    1853         std::cout <<kModalityImageDensityMap[i] << ", ";
    1854       std::cout << std::endl;
     1866        G4cout <<kModalityImageDensityMap[i] << ", ";
     1867      G4cout << G4endl;
    18551868    }
    18561869
     
    18691882    convertEndian(ctmp+2*sizeof(int), size[2]);
    18701883    if(DEBUG || kVerbose > 0) {
    1871       std::cout << "Dose dist. image size : ("
     1884      G4cout << "Dose dist. image size : ("
    18721885                << size[0] << ", "
    18731886                << size[1] << ", "
    18741887                << size[2] << ")"
    1875                 << std::endl;
     1888                << G4endl;
    18761889    }
    18771890    kDose[ndose].setSize(size);
     
    18891902    setDoseDistUnit(sdunit, ndose);
    18901903    if(DEBUG || kVerbose > 0) {
    1891       std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;
     1904      G4cout << "Dose dist. unit : " << kDoseUnit << G4endl;
    18921905    }
    18931906
     
    19021915
    19031916    if(DEBUG || kVerbose > 0) {
    1904       std::cout << "Dose dist. image min., max., scale : "
     1917      G4cout << "Dose dist. image min., max., scale : "
    19051918                << dminmax[0] << ", "
    19061919                << dminmax[1] << ", "
    1907                 << scale << std::endl;
     1920                << scale << G4endl;
    19081921    }
    19091922
    19101923    // dose distribution image
    19111924    int dsize = size[0]*size[1];
    1912     if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";
     1925    if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): ";
    19131926    char * di = new char[dsize*sizeof(short)];
    19141927    short * shimage = new short[dsize];
     
    19221935      kDose[ndose].addImage(dimage);
    19231936
    1924       if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
     1937      if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
    19251938
    19261939      if(DEBUG || kVerbose > 0) {
    19271940        for(int j = 0; j < dsize; j++) {
    19281941          if(dimage[j] < 0)
    1929             std::cout << "[" << j << "," << z << "]"
     1942            G4cout << "[" << j << "," << z << "]"
    19301943                      << dimage[j] << ", ";
    19311944        }
     
    19341947    delete [] shimage;
    19351948    delete [] di;
    1936     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     1949    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    19371950
    19381951    ifile.read((char *)ctmp, 3*4); // 3*sizeof(int)
     
    19441957
    19451958    if(DEBUG || kVerbose > 0) {
    1946       std::cout << "Dose dist. image relative location : ("
     1959      G4cout << "Dose dist. image relative location : ("
    19471960                << fCenter[0] << ", "
    19481961                << fCenter[1] << ", "
    1949                 << fCenter[2] << ")" << std::endl;
     1962                << fCenter[2] << ")" << G4endl;
    19501963    }
    19511964
     
    19571970    setDoseDistName(dosename, ndose);
    19581971    if(DEBUG || kVerbose > 0) {
    1959       std::cout << "Dose dist. name : " << dosename << std::endl;
     1972      G4cout << "Dose dist. name : " << dosename << G4endl;
    19601973    }
    19611974
     
    19741987    kRoi[0].setSize(size);
    19751988    if(DEBUG || kVerbose > 0) {
    1976       std::cout << "ROI image size : ("
     1989      G4cout << "ROI image size : ("
    19771990                << size[0] << ", "
    19781991                << size[1] << ", "
    19791992                << size[2] << ")"
    1980                 << std::endl;
     1993                << G4endl;
    19811994    }
    19821995
     
    19922005    kRoi[0].setScale(dscale = scale);
    19932006    if(DEBUG || kVerbose > 0) {
    1994       std::cout << "ROI image min., max., scale : "
     2007      G4cout << "ROI image min., max., scale : "
    19952008                << minmax[0] << ", "
    19962009                << minmax[1] << ", "
    1997                 << scale << std::endl;
     2010                << scale << G4endl;
    19982011    }
    19992012
     
    20202033    kRoi[0].setCenterPosition(fCenter);
    20212034    if(DEBUG || kVerbose > 0) {
    2022       std::cout << "ROI image relative location : ("
     2035      G4cout << "ROI image relative location : ("
    20232036                << fCenter[0] << ", "
    20242037                << fCenter[1] << ", "
    2025                 << fCenter[2] << ")" << std::endl;
     2038                << fCenter[2] << ")" << G4endl;
    20262039    }
    20272040
     
    20362049    convertEndian(ctmp, ntrk);
    20372050    if(DEBUG || kVerbose > 0) {
    2038       std::cout << "# of tracks: " << ntrk << std::endl;
     2051      G4cout << "# of tracks: " << ntrk << G4endl;
    20392052    }
    20402053
     
    20712084      if(DEBUG || kVerbose > 0) {
    20722085        if(i < 5) {
    2073           std::cout << i << ": " ;
    2074           for(int j = 0; j < 3; j++) std::cout << steps[0][j] << " ";
     2086          G4cout << i << ": " ;
     2087          for(int j = 0; j < 3; j++) G4cout << steps[0][j] << " ";
    20752088          int nstp = steps.size();
    2076           std::cout << "<-> ";
    2077           for(int j = 3; j < 6; j++) std::cout << steps[nstp-1][j] << " ";
    2078           std::cout << "    rgb( ";
    2079           for(int j = 0; j < 3; j++) std::cout << (int)rgb[j] << " ";
    2080           std::cout << ")" << std::endl;
     2089          G4cout << "<-> ";
     2090          for(int j = 3; j < 6; j++) G4cout << steps[nstp-1][j] << " ";
     2091          G4cout << "    rgb( ";
     2092          for(int j = 0; j < 3; j++) G4cout << (int)rgb[j] << " ";
     2093          G4cout << ")" << G4endl;
    20812094        }
    20822095      }
     
    20962109
    20972110    if(DEBUG || kVerbose > 0) {
    2098       std::cout << "# of detectors : "
    2099                 << ndet << std::endl;
     2111      G4cout << "# of detectors : "
     2112                << ndet << G4endl;
    21002113    }
    21012114
     
    21072120      convertEndian(ctmp, nedges);
    21082121      if(DEBUG || kVerbose > 0) {
    2109         std::cout << "# of edges in a detector : " << nedges << std::endl;
     2122        G4cout << "# of edges in a detector : " << nedges << G4endl;
    21102123      }
    21112124
     
    21232136
    21242137      if(DEBUG || kVerbose > 0) {
    2125         std::cout << " first edge : (" << detector[0][0] << ", "
     2138        G4cout << " first edge : (" << detector[0][0] << ", "
    21262139                  << detector[0][1] << ", "
    21272140                  << detector[0][2] << ") - ("
    21282141                  << detector[0][3] << ", "
    21292142                  << detector[0][4] << ", "
    2130                   << detector[0][5] << ")" << std::endl;
     2143                  << detector[0][5] << ")" << G4endl;
    21312144      }
    21322145
     
    21352148      ifile.read((char *)dcolor, 3);
    21362149      if(DEBUG || kVerbose > 0) {
    2137         std::cout << " detector color : rgb("
     2150        G4cout << " detector color : rgb("
    21382151                  << (int)dcolor[0] << ", "
    21392152                  << (int)dcolor[1] << ", "
    2140                   << (int)dcolor[2] << std::endl;
     2153                  << (int)dcolor[2] << G4endl;
    21412154      }
    21422155
     
    21472160      std::string dname = cname;
    21482161      if(DEBUG || kVerbose > 0) {
    2149         std::cout << " detector name : " << dname << std::endl;
     2162        G4cout << " detector name : " << dname << G4endl;
    21502163      }
    21512164
     
    21742187  std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary);
    21752188  if(!ifile) {
    2176     std::cerr << "Cannot open file: " << kFileName
    2177               << " in G4GMocrenIO::retrieveData3()." << std::endl;
     2189    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     2190      G4cout << "Cannot open file: " << kFileName
     2191                << " in G4GMocrenIO::retrieveData3()." << G4endl;
    21782192    return false;
    21792193  }
     
    21922206  ss << (int)ver;
    21932207  kVersion = ss.str();
    2194   if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;
     2208  if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl;
    21952209
    21962210  // endian
    21972211  ifile.read((char *)&kLittleEndianInput, sizeof(char));
    21982212  if(DEBUG || kVerbose > 0) {
    2199     std::cout << "Endian : ";
     2213    G4cout << "Endian : ";
    22002214    if(kLittleEndianInput == 1)
    2201       std::cout << " little" << std::endl;
     2215      G4cout << " little" << G4endl;
    22022216    else {
    2203       std::cout << " big" << std::endl;
     2217      G4cout << " big" << G4endl;
    22042218    }
    22052219  }
     
    22152229  setComment(scmt);
    22162230  if(DEBUG || kVerbose > 0) {
    2217     std::cout << "Data comment : "
    2218               << kComment << std::endl;
     2231    G4cout << "Data comment : "
     2232              << kComment << G4endl;
    22192233  }
    22202234
     
    22252239  convertEndian(ctmp+8, kVoxelSpacing[2]);
    22262240  if(DEBUG || kVerbose > 0) {
    2227     std::cout << "Voxel spacing : ("
     2241    G4cout << "Voxel spacing : ("
    22282242              << kVoxelSpacing[0] << ", "
    22292243              << kVoxelSpacing[1] << ", "
    22302244              << kVoxelSpacing[2]
    2231               << ") mm " << std::endl;
     2245              << ") mm " << G4endl;
    22322246  }
    22332247
     
    22582272  convertEndian(ctmp, kPointerToTrackData);
    22592273  if(DEBUG || kVerbose > 0) {
    2260     std::cout << "Each pointer to data : "
     2274    G4cout << "Each pointer to data : "
    22612275              << kPointerToModalityData << ", ";
    22622276    for(int i = 0; i < nDoseDist; i++)
    2263       std::cout << kPointerToDoseDistData[0] << ", ";
    2264     std::cout << kPointerToROIData << ", "
    2265               << kPointerToTrackData << std::endl;
     2277      G4cout << kPointerToDoseDistData[0] << ", ";
     2278    G4cout << kPointerToROIData << ", "
     2279              << kPointerToTrackData << G4endl;
    22662280  }
    22672281
     
    22692283     kPointerToROIData == 0 && kPointerToTrackData == 0) {
    22702284    if(DEBUG || kVerbose > 0) {
    2271       std::cout << "No data." << std::endl;
     2285      G4cout << "No data." << G4endl;
    22722286    }
    22732287    return false;
     
    22942308  convertEndian(ctmp+2*sizeof(int), size[2]);
    22952309  if(DEBUG || kVerbose > 0) {
    2296     std::cout << "Modality image size : ("
     2310    G4cout << "Modality image size : ("
    22972311              << size[0] << ", "
    22982312              << size[1] << ", "
    22992313              << size[2] << ")"
    2300               << std::endl;
     2314              << G4endl;
    23012315  }
    23022316  kModality.setSize(size);
     
    23292343    kModality.setScale(dscale = scale);
    23302344    if(DEBUG || kVerbose > 0) {
    2331       std::cout << "Modality image min., max., scale : "
     2345      G4cout << "Modality image min., max., scale : "
    23322346                << minmax[0] << ", "
    23332347                << minmax[1] << ", "
    2334                 << scale << std::endl;
     2348                << scale << G4endl;
    23352349    }
    23362350
    23372351    // modality density
    23382352    int psize = size[0]*size[1];
    2339     if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";
     2353    if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): ";
    23402354    char * cimage = new char[psize*sizeof(short)];
    23412355    for(int i = 0; i < size[2]; i++) {
     
    23472361      kModality.addImage(mimage);
    23482362
    2349       if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
    2350     }
    2351     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     2363      if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
     2364    }
     2365    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    23522366    delete [] cimage;
    23532367
    23542368    // modality desity map for CT value
    23552369    size_t msize = minmax[1]-minmax[0]+1;
    2356     if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;
     2370    if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl;
    23572371    char * pdmap = new char[msize*sizeof(float)];
    23582372    ifile.read((char *)pdmap, msize*sizeof(float));
     
    23632377    }
    23642378    if(DEBUG || kVerbose > 0) {
    2365       std::cout << "density map : " << std::ends;
     2379      G4cout << "density map : " << std::ends;
    23662380      for(int i = 0; i < 10; i++)
    2367         std::cout <<kModalityImageDensityMap[i] << ", ";
    2368       std::cout << std::endl;
    2369       for(int i = 0; i < 10; i++) std::cout << "..";
    2370       std::cout << std::endl;
     2381        G4cout <<kModalityImageDensityMap[i] << ", ";
     2382      G4cout << G4endl;
     2383      for(int i = 0; i < 10; i++) G4cout << "..";
     2384      G4cout << G4endl;
    23712385      for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++)
    2372         std::cout <<kModalityImageDensityMap[i] << ", ";
    2373       std::cout << std::endl;
     2386        G4cout <<kModalityImageDensityMap[i] << ", ";
     2387      G4cout << G4endl;
    23742388    }
    23752389
     
    23882402    convertEndian(ctmp+2*sizeof(int), size[2]);
    23892403    if(DEBUG || kVerbose > 0) {
    2390       std::cout << "Dose dist. image size : ("
     2404      G4cout << "Dose dist. image size : ("
    23912405                << size[0] << ", "
    23922406                << size[1] << ", "
    23932407                << size[2] << ")"
    2394                 << std::endl;
     2408                << G4endl;
    23952409    }
    23962410    kDose[ndose].setSize(size);
     
    24072421    setDoseDistUnit(sdunit, ndose);
    24082422    if(DEBUG || kVerbose > 0) {
    2409       std::cout << "Dose dist. unit : " << kDoseUnit << std::endl;
     2423      G4cout << "Dose dist. unit : " << kDoseUnit << G4endl;
    24102424    }
    24112425
     
    24202434
    24212435    if(DEBUG || kVerbose > 0) {
    2422       std::cout << "Dose dist. image min., max., scale : "
     2436      G4cout << "Dose dist. image min., max., scale : "
    24232437                << dminmax[0] << ", "
    24242438                << dminmax[1] << ", "
    2425                 << scale << std::endl;
     2439                << scale << G4endl;
    24262440    }
    24272441
    24282442    // dose distribution image
    24292443    int dsize = size[0]*size[1];
    2430     if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";
     2444    if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): ";
    24312445    char * di = new char[dsize*sizeof(short)];
    24322446    short * shimage = new short[dsize];
     
    24402454      kDose[ndose].addImage(dimage);
    24412455
    2442       if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
     2456      if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
    24432457
    24442458      if(DEBUG || kVerbose > 0) {
    24452459        for(int j = 0; j < dsize; j++) {
    24462460          if(dimage[j] < 0)
    2447             std::cout << "[" << j << "," << z << "]"
     2461            G4cout << "[" << j << "," << z << "]"
    24482462                      << dimage[j] << ", ";
    24492463        }
     
    24522466    delete [] shimage;
    24532467    delete [] di;
    2454     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     2468    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    24552469
    24562470    ifile.read((char *)ctmp, 3*4); // 3*sizeof(int)
     
    24622476
    24632477    if(DEBUG || kVerbose > 0) {
    2464       std::cout << "Dose dist. image relative location : ("
     2478      G4cout << "Dose dist. image relative location : ("
    24652479                << fCenter[0] << ", "
    24662480                << fCenter[1] << ", "
    2467                 << fCenter[2] << ")" << std::endl;
     2481                << fCenter[2] << ")" << G4endl;
    24682482    }
    24692483
     
    24832497    kRoi[0].setSize(size);
    24842498    if(DEBUG || kVerbose > 0) {
    2485       std::cout << "ROI image size : ("
     2499      G4cout << "ROI image size : ("
    24862500                << size[0] << ", "
    24872501                << size[1] << ", "
    24882502                << size[2] << ")"
    2489                 << std::endl;
     2503                << G4endl;
    24902504    }
    24912505
     
    25012515    kRoi[0].setScale(dscale = scale);
    25022516    if(DEBUG || kVerbose > 0) {
    2503       std::cout << "ROI image min., max., scale : "
     2517      G4cout << "ROI image min., max., scale : "
    25042518                << minmax[0] << ", "
    25052519                << minmax[1] << ", "
    2506                 << scale << std::endl;
     2520                << scale << G4endl;
    25072521    }
    25082522
     
    25292543    kRoi[0].setCenterPosition(fCenter);
    25302544    if(DEBUG || kVerbose > 0) {
    2531       std::cout << "ROI image relative location : ("
     2545      G4cout << "ROI image relative location : ("
    25322546                << fCenter[0] << ", "
    25332547                << fCenter[1] << ", "
    2534                 << fCenter[2] << ")" << std::endl;
     2548                << fCenter[2] << ")" << G4endl;
    25352549    }
    25362550
     
    25452559    convertEndian(ctmp, ntrk);
    25462560    if(DEBUG || kVerbose > 0) {
    2547       std::cout << "# of tracks: " << ntrk << std::endl;
     2561      G4cout << "# of tracks: " << ntrk << G4endl;
    25482562    }
    25492563
     
    25562570
    25572571      ifile.read((char *)ctmp, sizeof(float)*3);
    2558       if(DEBUG || kVerbose > 0) if(i < 10) std::cout << i << ": " ;
     2572      if(DEBUG || kVerbose > 0) if(i < 10) G4cout << i << ": " ;
    25592573      for(int j = 0; j < 3; j++) {
    25602574        convertEndian(ctmp+j*sizeof(float), tp[j]);
    2561         if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j] << ", ";
     2575        if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j] << ", ";
    25622576      }
    25632577
     
    25652579      for(int j = 0; j < 3; j++) {
    25662580        convertEndian(ctmp+j*sizeof(float), tp[j+3]);
    2567         if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j+3] << ", ";
     2581        if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j+3] << ", ";
    25682582      }
    25692583      addTrack(tp);
    2570       if(DEBUG || kVerbose > 0) if(i < 10) std::cout << std::endl;
     2584      if(DEBUG || kVerbose > 0) if(i < 10) G4cout << G4endl;
    25712585
    25722586      // v4
     
    26102624  std::ifstream ifile(kFileName.c_str(), std::ios_base::in|std::ios_base::binary);
    26112625  if(!ifile) {
    2612     std::cerr << "Cannot open file: " << kFileName
    2613               << " in G4GMocrenIO::retrieveData2()." << std::endl;
     2626    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     2627      G4cout << "Cannot open file: " << kFileName
     2628                << " in G4GMocrenIO::retrieveData2()." << G4endl;
    26142629    return false;
    26152630  }
     
    26282643  ss << (int)ver;
    26292644  kVersion = ss.str();
    2630   if(DEBUG || kVerbose > 0) std::cout << "File version : " << kVersion << std::endl;
     2645  if(DEBUG || kVerbose > 0) G4cout << "File version : " << kVersion << G4endl;
    26312646
    26322647  // id of version 1
     
    26412656  ifile.read((char *)&kLittleEndianInput, sizeof(char));
    26422657  if(DEBUG || kVerbose > 0) {
    2643     std::cout << "Endian : ";
     2658    G4cout << "Endian : ";
    26442659    if(kLittleEndianInput == 1)
    2645       std::cout << " little" << std::endl;
     2660      G4cout << " little" << G4endl;
    26462661    else {
    2647       std::cout << " big" << std::endl;
     2662      G4cout << " big" << G4endl;
    26482663    }
    26492664  }
     
    26552670  convertEndian(ctmp+8, kVoxelSpacing[2]);
    26562671  if(DEBUG || kVerbose > 0) {
    2657     std::cout << "Voxel spacing : ("
     2672    G4cout << "Voxel spacing : ("
    26582673              << kVoxelSpacing[0] << ", "
    26592674              << kVoxelSpacing[1] << ", "
    26602675              << kVoxelSpacing[2]
    2661               << ") mm " << std::endl;
     2676              << ") mm " << G4endl;
    26622677  }
    26632678
     
    26812696  convertEndian(ctmp, kPointerToTrackData);
    26822697  if(DEBUG || kVerbose > 0) {
    2683     std::cout << "Each pointer to data : "
     2698    G4cout << "Each pointer to data : "
    26842699              << kPointerToModalityData << ", "
    26852700              << kPointerToDoseDistData[0] << ", "
    26862701              << kPointerToROIData << ", "
    2687               << kPointerToTrackData << std::endl;
     2702              << kPointerToTrackData << G4endl;
    26882703  }
    26892704
     
    26912706     kPointerToROIData == 0 && kPointerToTrackData == 0) {
    26922707    if(DEBUG || kVerbose > 0) {
    2693       std::cout << "No data." << std::endl;
     2708      G4cout << "No data." << G4endl;
    26942709    }
    26952710    return false;
     
    27162731  convertEndian(ctmp+2*sizeof(int), size[2]);
    27172732  if(DEBUG || kVerbose > 0) {
    2718     std::cout << "Modality image size : ("
     2733    G4cout << "Modality image size : ("
    27192734              << size[0] << ", "
    27202735              << size[1] << ", "
    27212736              << size[2] << ")"
    2722               << std::endl;
     2737              << G4endl;
    27232738  }
    27242739  kModality.setSize(size);
     
    27452760    kModality.setScale(dscale = scale);
    27462761    if(DEBUG || kVerbose > 0) {
    2747       std::cout << "Modality image min., max., scale : "
     2762      G4cout << "Modality image min., max., scale : "
    27482763                << minmax[0] << ", "
    27492764                << minmax[1] << ", "
    2750                 << scale << std::endl;
     2765                << scale << G4endl;
    27512766    }
    27522767
    27532768    // modality density
    27542769    int psize = size[0]*size[1];
    2755     if(DEBUG || kVerbose > 0) std::cout << "Modality image (" << psize << "): ";
     2770    if(DEBUG || kVerbose > 0) G4cout << "Modality image (" << psize << "): ";
    27562771    char * cimage = new char[psize*sizeof(short)];
    27572772    for(int i = 0; i < size[2]; i++) {
     
    27632778      kModality.addImage(mimage);
    27642779
    2765       if(DEBUG || kVerbose > 0) std::cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
    2766     }
    2767     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     2780      if(DEBUG || kVerbose > 0) G4cout << "[" << i << "]" << mimage[(size_t)(psize*0.55)] << ", ";
     2781    }
     2782    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    27682783    delete [] cimage;
    27692784
    27702785    // modality desity map for CT value
    27712786    size_t msize = minmax[1]-minmax[0]+1;
    2772     if(DEBUG || kVerbose > 0) std::cout << "msize: " << msize << std::endl;
     2787    if(DEBUG || kVerbose > 0) G4cout << "msize: " << msize << G4endl;
    27732788    char * pdmap = new char[msize*sizeof(float)];
    27742789    ifile.read((char *)pdmap, msize*sizeof(float));
     
    27792794    }
    27802795    if(DEBUG || kVerbose > 0) {
    2781       std::cout << "density map : " << std::ends;
     2796      G4cout << "density map : " << std::ends;
    27822797      for(int i = 0; i < 10; i++)
    2783         std::cout <<kModalityImageDensityMap[i] << ", ";
    2784       std::cout << std::endl;
    2785       for(int i = 0; i < 10; i++) std::cout << "..";
    2786       std::cout << std::endl;
     2798        G4cout <<kModalityImageDensityMap[i] << ", ";
     2799      G4cout << G4endl;
     2800      for(int i = 0; i < 10; i++) G4cout << "..";
     2801      G4cout << G4endl;
    27872802      for(size_t i =kModalityImageDensityMap.size() - 10; i <kModalityImageDensityMap.size(); i++)
    2788         std::cout <<kModalityImageDensityMap[i] << ", ";
    2789       std::cout << std::endl;
     2803        G4cout <<kModalityImageDensityMap[i] << ", ";
     2804      G4cout << G4endl;
    27902805    }
    27912806
     
    28042819    convertEndian(ctmp+2*sizeof(int), size[2]);
    28052820    if(DEBUG || kVerbose > 0) {
    2806       std::cout << "Dose dist. image size : ("
     2821      G4cout << "Dose dist. image size : ("
    28072822                << size[0] << ", "
    28082823                << size[1] << ", "
    28092824                << size[2] << ")"
    2810                 << std::endl;
     2825                << G4endl;
    28112826    }
    28122827    kDose[0].setSize(size);
     
    28262841
    28272842    if(DEBUG || kVerbose > 0) {
    2828       std::cout << "Dose dist. image min., max., scale : "
     2843      G4cout << "Dose dist. image min., max., scale : "
    28292844                << dminmax[0] << ", "
    28302845                << dminmax[1] << ", "
    2831                 << scale << std::endl;
     2846                << scale << G4endl;
    28322847    }
    28332848
    28342849    // dose distribution image
    28352850    int dsize = size[0]*size[1];
    2836     if(DEBUG || kVerbose > 0) std::cout << "Dose dist. (" << dsize << "): ";
     2851    if(DEBUG || kVerbose > 0) G4cout << "Dose dist. (" << dsize << "): ";
    28372852    char * di = new char[dsize*sizeof(short)];
    28382853    short * shimage = new short[dsize];
     
    28462861      kDose[0].addImage(dimage);
    28472862
    2848       if(DEBUG || kVerbose > 0) std::cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
     2863      if(DEBUG || kVerbose > 0) G4cout << "[" << z << "]" << dimage[(size_t)(dsize*0.55)] << ", ";
    28492864
    28502865      if(DEBUG || kVerbose > 0) {
    28512866        for(int j = 0; j < dsize; j++) {
    28522867          if(dimage[j] < 0)
    2853             std::cout << "[" << j << "," << z << "]"
     2868            G4cout << "[" << j << "," << z << "]"
    28542869                      << dimage[j] << ", ";
    28552870        }
     
    28582873    delete [] shimage;
    28592874    delete [] di;
    2860     if(DEBUG || kVerbose > 0) std::cout << std::endl;
     2875    if(DEBUG || kVerbose > 0) G4cout << G4endl;
    28612876
    28622877    /* ver 1
     
    29022917
    29032918    if(DEBUG || kVerbose > 0) {
    2904       std::cout << "Dose dist. image relative location : ("
     2919      G4cout << "Dose dist. image relative location : ("
    29052920                << fCenter[0] << ", "
    29062921                << fCenter[1] << ", "
    2907                 << fCenter[2] << ")" << std::endl;
     2922                << fCenter[2] << ")" << G4endl;
    29082923    }
    29092924
     
    29232938    kRoi[0].setSize(size);
    29242939    if(DEBUG || kVerbose > 0) {
    2925       std::cout << "ROI image size : ("
     2940      G4cout << "ROI image size : ("
    29262941                << size[0] << ", "
    29272942                << size[1] << ", "
    29282943                << size[2] << ")"
    2929                 << std::endl;
     2944                << G4endl;
    29302945    }
    29312946
     
    29412956    kRoi[0].setScale(dscale = scale);
    29422957    if(DEBUG || kVerbose > 0) {
    2943       std::cout << "ROI image min., max., scale : "
     2958      G4cout << "ROI image min., max., scale : "
    29442959                << minmax[0] << ", "
    29452960                << minmax[1] << ", "
    2946                 << scale << std::endl;
     2961                << scale << G4endl;
    29472962    }
    29482963
     
    29692984    kRoi[0].setCenterPosition(fCenter);
    29702985    if(DEBUG || kVerbose > 0) {
    2971       std::cout << "ROI image relative location : ("
     2986      G4cout << "ROI image relative location : ("
    29722987                << fCenter[0] << ", "
    29732988                << fCenter[1] << ", "
    2974                 << fCenter[2] << ")" << std::endl;
     2989                << fCenter[2] << ")" << G4endl;
    29752990    }
    29762991
     
    29853000    convertEndian(ctmp, ntrk);
    29863001    if(DEBUG || kVerbose > 0) {
    2987       std::cout << "# of tracks: " << ntrk << std::endl;
     3002      G4cout << "# of tracks: " << ntrk << G4endl;
    29883003    }
    29893004
     
    29973012
    29983013      ifile.read((char *)ctmp, sizeof(float)*3);
    2999       if(DEBUG || kVerbose > 0) if(i < 10) std::cout << i << ": " ;
     3014      if(DEBUG || kVerbose > 0) if(i < 10) G4cout << i << ": " ;
    30003015      for(int j = 0; j < 3; j++) {
    30013016        convertEndian(ctmp+j*sizeof(float), tp[j]);
    3002         if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j] << ", ";
     3017        if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j] << ", ";
    30033018      }
    30043019
     
    30063021      for(int j = 0; j < 3; j++) {
    30073022        convertEndian(ctmp+j*sizeof(float), tp[j+3]);
    3008         if(DEBUG || kVerbose > 0) if(i < 10) std::cout << tp[j+3] << ", ";
     3023        if(DEBUG || kVerbose > 0) if(i < 10) G4cout << tp[j+3] << ", ";
    30093024      }
    30103025
     
    30143029      addTrack(trkv4, trkcolorv4);
    30153030     
    3016       if(DEBUG || kVerbose > 0) if(i < 10) std::cout << std::endl;
     3031      if(DEBUG || kVerbose > 0) if(i < 10) G4cout << G4endl;
    30173032    }
    30183033
     
    32173232    setPointerToTrackData(pointer0);
    32183233  }
    3219   if(kVerbose > 0) std::cout << " pointer to the track data :"
    3220                              << kPointerToTrackData << std::endl;
     3234  if(kVerbose > 0) G4cout << " pointer to the track data :"
     3235                             << kPointerToTrackData << G4endl;
    32213236
    32223237  // pointer to detector data
     
    32273242    kPointerToDetectorData = 0;
    32283243  }
    3229   if(kVerbose > 0) std::cout << " pointer to the detector data :"
    3230                              << kPointerToDetectorData << std::endl;
     3244  if(kVerbose > 0) G4cout << " pointer to the detector data :"
     3245                             << kPointerToDetectorData << G4endl;
    32313246
    32323247}
     
    34313446    rval = minmax[1];
    34323447    for(int i = 0; i < nmap; i++) {
    3433       //std::cout << kModalityImageDensityMap[i] << std::endl;
     3448      //G4cout << kModalityImageDensityMap[i] << G4endl;
    34343449      if(_dens <= kModalityImageDensityMap[i]) {
    34353450        rval = i + minmax[0];
     
    35583573
    35593574  if(_data == NULL) {
    3560     std::cerr << "In G4GMocrenIO::getShortDoseDist(), "
    3561               << "first argument is NULL pointer. "
    3562               << "The argument must be allocated array."
    3563               << std::endl;
     3575    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3576      G4cout << "In G4GMocrenIO::getShortDoseDist(), "
     3577                << "first argument is NULL pointer. "
     3578                << "The argument must be allocated array."
     3579                << G4endl;
    35643580    std::exit(-1);
    35653581  }
     
    35993615  void G4GMocrenIO::getDoseDist(double * & _image, int _z, int _num) {
    36003616
    3601   std::cout << " <" << (void*)_image << "> ";
     3617  G4cout << " <" << (void*)_image << "> ";
    36023618  if(isDoseEmpty()) {
    36033619  _image = 0;
    36043620  } else {
    36053621  _image = kDose[_num].getImage(_z);
    3606   std::cout << " <" << (void*)_image << "> ";
    3607   std::cout << _image[100] << " ";
     3622  G4cout << " <" << (void*)_image << "> ";
     3623  G4cout << _image[100] << " ";
    36083624  }
    36093625  }
     
    36603676bool G4GMocrenIO::mergeDoseDist(std::vector<class GMocrenDataPrimitive<double> > & _dose) {
    36613677  if(kDose.size() != _dose.size()) {
    3662     std::cerr << "G4GMocrenIO::mergeDoseDist() : Error" << std::endl;
    3663     std::cerr << "   Unable to merge the dose distributions,"<< std::endl;
    3664     std::cerr << "   because of different size of dose maps."<< std::endl;
     3678    if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     3679      G4cout << "G4GMocrenIO::mergeDoseDist() : Error" << G4endl;
     3680      G4cout << "   Unable to merge the dose distributions,"<< G4endl;
     3681      G4cout << "   because of different size of dose maps."<< G4endl;
     3682    }
    36653683    return false;
    36663684  }
     
    36703688  std::vector<class GMocrenDataPrimitive<double> >::iterator itr2 = _dose.begin();
    36713689  for(int i = 0; i < num; i++, itr1++, itr2++) {
    3672     if(kVerbose > 0) std::cerr << "merged dose distribution [" << i << "]" << std::endl;
     3690    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3691      if(kVerbose > 0)
     3692        G4cout << "merged dose distribution [" << i << "]" << G4endl;
    36733693    *itr1 += *itr2;
    36743694  }
     
    36893709bool G4GMocrenIO::isDoseEmpty() {
    36903710  if(kDose.empty()) {
    3691     //std::cerr << "!!! dose distribution data is empty." << std::endl;
     3711    //if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3712    //  G4cout << "!!! dose distribution data is empty." << G4endl;
    36923713    return true;
    36933714  } else {
     
    37943815bool G4GMocrenIO::isROIEmpty() {
    37953816  if(kRoi.empty()) {
    3796     //std::cerr << "!!! ROI data is empty." << std::endl;
     3817    //if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3818    //  G4cout << "!!! ROI data is empty." << G4endl;
    37973819    return true;
    37983820  } else {
     
    38833905
    38843906  if(_num > (int)kTracks.size()) {
    3885     std::cerr << "ERROR in getTrack() : " << std::endl;
     3907    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3908      G4cout << "ERROR in getTrack() : " << G4endl;
    38863909    std::exit(-1);
    38873910  }
     
    39423965
    39433966  if(_num > (int)kDetectors.size()) {
    3944     std::cerr << "ERROR in getDetector() : " << std::endl;
     3967    if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
     3968      G4cout << "ERROR in getDetector() : " << G4endl;
    39453969    std::exit(-1);
    39463970  }
  • trunk/source/visualization/gMocren/src/G4GMocrenMessenger.cc

    r1337 r1347  
    2626//
    2727// $Id: G4GMocrenMessenger.cc,v 1.2 2009/10/12 10:04:35 akimura Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
Note: See TracChangeset for help on using the changeset viewer.