Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:52

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /*
0027  * ============================================================================
0028  *
0029  *       Filename:  CexmcEventActionMessenger.cc
0030  *
0031  *    Description:  event action messenger (verbose level etc.)
0032  *
0033  *        Version:  1.0
0034  *        Created:  25.11.2009 14:45:01
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * ============================================================================
0042  */
0043 
0044 #include <G4UIcmdWithAnInteger.hh>
0045 #include "CexmcEventActionMessenger.hh"
0046 #include "CexmcEventAction.hh"
0047 #include "CexmcMessenger.hh"
0048 
0049 
0050 CexmcEventActionMessenger::CexmcEventActionMessenger(
0051                                             CexmcEventAction *  eventAction_ ) :
0052     eventAction( eventAction_ ), setVerboseLevel( NULL ),
0053     setVerboseDrawLevel( NULL )
0054 {
0055     setVerboseLevel = new G4UIcmdWithAnInteger(
0056            ( CexmcMessenger::eventDirName + "verbose" ).c_str() , this );
0057     setVerboseLevel->SetGuidance( "\n    0 - do not print messages,\n"
0058                         "    1 - print messages if studied interaction "
0059                                 "triggered,\n"
0060                         "    2 - print messages on event trigger\n"
0061                         "        (reconstructed data will also be printed in "
0062                                 "this case),\n"
0063                         "    3 - print messages if studied interaction or "
0064                                 "event\n        triggered,\n"
0065                         "    4 - print messages on every event" );
0066     setVerboseLevel->SetParameterName( "Verbose", false );
0067     setVerboseLevel->SetRange( "Verbose >= 0 && Verbose <= 4" );
0068     setVerboseLevel->SetDefaultValue( 0 );
0069     setVerboseLevel->AvailableForStates( G4State_PreInit, G4State_Idle );
0070 
0071     setVerboseDrawLevel = new G4UIcmdWithAnInteger(
0072            ( CexmcMessenger::visDirName + "verbose" ).c_str() , this );
0073     setVerboseDrawLevel->SetGuidance( "\n    0 - draw nothing,\n"
0074                         "    1 - draw trajectories and track points if studied "
0075                                 "interaction\n        triggered,\n"
0076                         "    2 - draw trajectories and track points on event "
0077                                 "trigger\n"
0078                         "        (reconstructed data will also be drawn in "
0079                                 "this case),\n"
0080                         "    3 - draw trajectories and track points if "
0081                                 "studied interaction\n        or event "
0082                                 "triggered,\n"
0083                         "    4 - draw trajectories and/or track points on "
0084                                 "every event" );
0085     setVerboseDrawLevel->SetParameterName( "VerboseDraw", false );
0086     setVerboseDrawLevel->SetRange( "VerboseDraw >= 0 && VerboseDraw <= 4" );
0087     setVerboseDrawLevel->SetDefaultValue( 4 );
0088     setVerboseDrawLevel->AvailableForStates( G4State_PreInit, G4State_Idle );
0089 }
0090 
0091 
0092 CexmcEventActionMessenger::~CexmcEventActionMessenger()
0093 {
0094     delete setVerboseLevel;
0095     delete setVerboseDrawLevel;
0096 }
0097 
0098 
0099 void  CexmcEventActionMessenger::SetNewValue( G4UIcommand *  cmd,
0100                                               G4String  value )
0101 {
0102     do
0103     {
0104         if ( cmd == setVerboseLevel )
0105         {
0106             eventAction->SetVerboseOnCexmcLevel(
0107                                 G4UIcmdWithAnInteger::GetNewIntValue( value ) );
0108             break;
0109         }
0110         if ( cmd == setVerboseDrawLevel )
0111         {
0112             eventAction->SetVerboseDrawLevel(
0113                                 G4UIcmdWithAnInteger::GetNewIntValue( value ) );
0114             break;
0115         }
0116     } while ( false );
0117 }
0118