G4AnalysisVerbose.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 
00028 // Author: Ivana Hrivnacova, 17/10/2011  (ivana@ipno.in2p3.fr)
00029 
00030 #include "G4AnalysisVerbose.hh"
00031 #include "G4UnitsTable.hh"
00032 
00033 #include <iostream>
00034 
00035 //_____________________________________________________________________________
00036 G4AnalysisVerbose::G4AnalysisVerbose(const G4String& type, G4int verboseLevel)
00037  : fType(type),
00038    fToBeDoneText(),
00039    fDoneText(),
00040    fFailureText()
00041 {
00042    if ( verboseLevel == 1 ) fDoneText = "- done";
00043    if ( verboseLevel == 2 ) fDoneText = "- done";
00044    if ( verboseLevel == 3 ) fToBeDoneText = "done ";
00045    if ( verboseLevel == 4 ) fToBeDoneText = "going to ";
00046    fFailureText = "has failed";
00047 }
00048 
00049 //_____________________________________________________________________________
00050 G4AnalysisVerbose::~G4AnalysisVerbose()
00051 {  
00052 }
00053 
00054 // 
00055 // public method
00056 //
00057 
00058 //_____________________________________________________________________________
00059 void G4AnalysisVerbose::Message(const G4String& action, 
00060                                 const G4String& object, 
00061                                 const G4String& objectName,
00062                                 G4bool success)
00063 {
00064   G4cout << "... "
00065          << fToBeDoneText
00066          << action
00067          << " "
00068          << fType
00069          << " "
00070          << object 
00071          << " : "
00072          << objectName 
00073          << " ";
00074 
00075   if ( success )
00076      G4cout << fDoneText;
00077   else   
00078      G4cout << fFailureText;
00079         
00080   G4cout << G4endl;
00081 }  
00082   
00083 //_____________________________________________________________________________
00084 void G4AnalysisVerbose::Message(const G4String& action, 
00085                                 const G4String& object, 
00086                                 G4ExceptionDescription& description,
00087                                 G4bool success)
00088 {
00089   G4cout << "... "
00090          << fToBeDoneText
00091          << action
00092          << " "
00093          << fType
00094          << " "
00095          << object 
00096          << " : "
00097          << description.str() 
00098          << " ";
00099 
00100   if ( success )
00101      G4cout << fDoneText;
00102   else   
00103      G4cout << fFailureText;
00104         
00105   G4cout << G4endl;
00106 }  
00107   

Generated on Mon May 27 17:47:38 2013 for Geant4 by  doxygen 1.4.7