Back to home page

EIC code displayed by LXR

 
 

    


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

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:  CexmcMessenger.cc
0030  *
0031  *    Description:  common messenger stuff (directories etc.)
0032  *
0033  *        Version:  1.0
0034  *        Created:  15.11.2009 12:59:56
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * ============================================================================
0042  */
0043 
0044 #include <G4UIdirectory.hh>
0045 #include "CexmcMessenger.hh"
0046 #include "CexmcSensitiveDetectorsAttributes.hh"
0047 
0048 
0049 namespace
0050 {
0051     const G4String  ed( CexmcDetectorTypeName[ CexmcEDDetector ] + "/" );
0052 }
0053 
0054 
0055 CexmcMessenger *  CexmcMessenger::instance( NULL );
0056 
0057 G4String  CexmcMessenger::mainDirName( "/cexmc/" );
0058 G4String  CexmcMessenger::geometryDirName( CexmcMessenger::mainDirName +
0059                                            "geometry/" );
0060 G4String  CexmcMessenger::physicsDirName( CexmcMessenger::mainDirName +
0061                                            "physics/" );
0062 G4String  CexmcMessenger::gunDirName( CexmcMessenger::mainDirName +
0063                                            "gun/" );
0064 G4String  CexmcMessenger::detectorDirName( CexmcMessenger::mainDirName +
0065                                            "detector/" );
0066 G4String  CexmcMessenger::eventDirName( CexmcMessenger::mainDirName +
0067                                            "event/" );
0068 G4String  CexmcMessenger::runDirName( CexmcMessenger::mainDirName +
0069                                            "run/" );
0070 G4String  CexmcMessenger::monitorDirName( CexmcMessenger::detectorDirName +
0071                CexmcDetectorRoleName[ CexmcMonitorDetectorRole ] + "/" );
0072 G4String  CexmcMessenger::targetDirName( CexmcMessenger::detectorDirName +
0073                CexmcDetectorRoleName[ CexmcTargetDetectorRole ] + "/" );
0074 G4String  CexmcMessenger::vetoCounterDirName( CexmcMessenger::detectorDirName +
0075                CexmcDetectorRoleName[ CexmcVetoCounterDetectorRole ] + "/" );
0076 G4String  CexmcMessenger::vetoCounterLeftDirName(
0077                             CexmcMessenger::vetoCounterDirName + "left/" );
0078 G4String  CexmcMessenger::vetoCounterRightDirName(
0079                             CexmcMessenger::vetoCounterDirName + "right/" );
0080 G4String  CexmcMessenger::calorimeterDirName( CexmcMessenger::detectorDirName +
0081                CexmcDetectorRoleName[ CexmcCalorimeterDetectorRole ] + "/" );
0082 G4String  CexmcMessenger::calorimeterLeftDirName(
0083                             CexmcMessenger::calorimeterDirName + "left/" );
0084 G4String  CexmcMessenger::calorimeterRightDirName(
0085                             CexmcMessenger::calorimeterDirName + "right/" );
0086 G4String  CexmcMessenger::monitorEDDirName(
0087                             CexmcMessenger::monitorDirName + ed );
0088 G4String  CexmcMessenger::vetoCounterEDDirName(
0089                             CexmcMessenger::vetoCounterDirName + ed );
0090 G4String  CexmcMessenger::vetoCounterLeftEDDirName(
0091                             CexmcMessenger::vetoCounterLeftDirName + ed );
0092 G4String  CexmcMessenger::vetoCounterRightEDDirName(
0093                             CexmcMessenger::vetoCounterRightDirName + ed );
0094 G4String  CexmcMessenger::calorimeterEDDirName(
0095                             CexmcMessenger::calorimeterDirName + ed );
0096 G4String  CexmcMessenger::calorimeterLeftEDDirName(
0097                             CexmcMessenger::calorimeterLeftDirName + ed );
0098 G4String  CexmcMessenger::calorimeterRightEDDirName(
0099                             CexmcMessenger::calorimeterRightDirName + ed );
0100 G4String  CexmcMessenger::reconstructorDirName(
0101                             CexmcMessenger::mainDirName + "reconstructor/" );
0102 G4String  CexmcMessenger::visDirName( CexmcMessenger::mainDirName + "vis/" );
0103 #ifdef CEXMC_USE_ROOT
0104 G4String  CexmcMessenger::histoDirName(
0105                             CexmcMessenger::mainDirName + "histo/" );
0106 #endif
0107 
0108 
0109 CexmcMessenger *  CexmcMessenger::Instance( void )
0110 {
0111     if ( instance == NULL )
0112         instance = new CexmcMessenger;
0113 
0114     return instance;
0115 }
0116 
0117 
0118 void  CexmcMessenger::Destroy( void )
0119 {
0120     delete instance;
0121     instance = NULL;
0122 }
0123 
0124 
0125 CexmcMessenger::CexmcMessenger() : mainDir( NULL ), geometryDir( NULL ),
0126     physicsDir( NULL ), gunDir( NULL ), detectorDir( NULL ), eventDir( NULL ),
0127     runDir( NULL ), monitorDir( NULL ), targetDir( NULL ),
0128     vetoCounterDir( NULL ), vetoCounterLeftDir( NULL ),
0129     vetoCounterRightDir( NULL ), calorimeterDir( NULL ),
0130     calorimeterLeftDir( NULL ), calorimeterRightDir( NULL ),
0131     monitorEDDir( NULL ), vetoCounterEDDir( NULL ),
0132     vetoCounterLeftEDDir( NULL ), vetoCounterRightEDDir( NULL ),
0133     calorimeterEDDir( NULL ), calorimeterLeftEDDir( NULL ),
0134     calorimeterRightEDDir( NULL ), reconstructorDir( NULL ), visDir( NULL )
0135 #ifdef CEXMC_USE_ROOT
0136     ,histoDir( NULL )
0137 #endif
0138 {
0139     mainDir = new G4UIdirectory( mainDirName );
0140     mainDir->SetGuidance( "Cexmc settings." );
0141     geometryDir = new G4UIdirectory( geometryDirName );
0142     geometryDir->SetGuidance( "Geometry settings (gdml file etc.)" );
0143     physicsDir = new G4UIdirectory( physicsDirName );
0144     physicsDir->SetGuidance( "Physics related settings "
0145                              "(production model etc.)" );
0146     gunDir = new G4UIdirectory( gunDirName );
0147     gunDir->SetGuidance( "Gun settings (different FWHMs etc.)" );
0148     detectorDir = new G4UIdirectory( detectorDirName );
0149     detectorDir->SetGuidance( "Sensitive detectors settings" );
0150     eventDir = new G4UIdirectory( eventDirName );
0151     eventDir->SetGuidance( "Event settings (verbose level etc.)" );
0152     runDir = new G4UIdirectory( runDirName );
0153     runDir->SetGuidance( "Run settings (geometry file etc.)" );
0154     monitorDir = new G4UIdirectory( monitorDirName );
0155     monitorDir->SetGuidance( "Various settings for the monitor." );
0156     targetDir = new G4UIdirectory( targetDirName );
0157     targetDir->SetGuidance( "Various settings for the target." );
0158     vetoCounterDir = new G4UIdirectory( vetoCounterDirName );
0159     vetoCounterDir->SetGuidance( "Various settings for the veto counters." );
0160     vetoCounterLeftDir = new G4UIdirectory( vetoCounterLeftDirName );
0161     vetoCounterLeftDir->SetGuidance(
0162             "\n    Various settings for the left veto counter." );
0163     vetoCounterRightDir = new G4UIdirectory( vetoCounterRightDirName );
0164     vetoCounterRightDir->SetGuidance(
0165             "\n    Various settings for the right veto counter." );
0166     calorimeterDir = new G4UIdirectory( calorimeterDirName );
0167     calorimeterDir->SetGuidance( "Various settings for the calorimeters." );
0168     calorimeterLeftDir = new G4UIdirectory( calorimeterLeftDirName );
0169     calorimeterLeftDir->SetGuidance(
0170             "\n    Various settings for the left calorimeter." );
0171     calorimeterRightDir = new G4UIdirectory( calorimeterRightDirName );
0172     calorimeterRightDir->SetGuidance(
0173             "\n    Various settings for the right calorimeter." );
0174     monitorEDDir = new G4UIdirectory( monitorEDDirName );
0175     monitorEDDir->SetGuidance(
0176             "\n    Energy deposit settings in the monitor (thresholds etc.)" );
0177     vetoCounterEDDir = new G4UIdirectory( vetoCounterEDDirName );
0178     vetoCounterEDDir->SetGuidance(
0179             "\n    Energy deposit settings in both veto counters "
0180             "(thresholds etc.)" );
0181     vetoCounterLeftEDDir = new G4UIdirectory( vetoCounterLeftEDDirName );
0182     vetoCounterLeftEDDir->SetGuidance(
0183             "\n    Energy deposit settings in the left veto counter "
0184             "(thresholds etc.)" );
0185     vetoCounterRightEDDir = new G4UIdirectory( vetoCounterRightEDDirName );
0186     vetoCounterRightEDDir->SetGuidance(
0187             "\n    Energy deposit settings in the right veto counter "
0188             "(thresholds etc.)" );
0189     calorimeterEDDir = new G4UIdirectory( calorimeterEDDirName );
0190     calorimeterEDDir->SetGuidance(
0191             "\n    Energy deposit settings in both calorimeters "
0192             "(thresholds etc.)" );
0193     calorimeterLeftEDDir = new G4UIdirectory( calorimeterLeftEDDirName );
0194     calorimeterLeftEDDir->SetGuidance(
0195             "\n    Energy deposit settings in the left calorimeter "
0196             "(thresholds etc.)" );
0197     calorimeterRightEDDir = new G4UIdirectory( calorimeterRightEDDirName );
0198     calorimeterRightEDDir->SetGuidance(
0199             "\n    Energy deposit settings in the right calorimeter "
0200             "(thresholds etc.)" );
0201     reconstructorDir = new G4UIdirectory( reconstructorDirName );
0202     reconstructorDir->SetGuidance( "Reconstructor settings" );
0203     visDir = new G4UIdirectory( visDirName );
0204     visDir->SetGuidance( "Visualization settings" );
0205 #ifdef CEXMC_USE_ROOT
0206     histoDir = new G4UIdirectory( histoDirName );
0207     histoDir->SetGuidance( "Commands to list and show histograms" );
0208 #endif
0209 }
0210 
0211 
0212 CexmcMessenger::~CexmcMessenger()
0213 {
0214     delete mainDir;
0215     delete geometryDir;
0216     delete physicsDir;
0217     delete gunDir;
0218     delete detectorDir;
0219     delete eventDir;
0220     delete runDir;
0221     delete monitorDir;
0222     delete targetDir;
0223     delete vetoCounterDir;
0224     delete vetoCounterLeftDir;
0225     delete vetoCounterRightDir;
0226     delete calorimeterDir;
0227     delete calorimeterLeftDir;
0228     delete calorimeterRightDir;
0229     delete monitorEDDir;
0230     delete vetoCounterEDDir;
0231     delete vetoCounterLeftEDDir;
0232     delete vetoCounterRightEDDir;
0233     delete calorimeterEDDir;
0234     delete calorimeterLeftEDDir;
0235     delete calorimeterRightEDDir;
0236     delete reconstructorDir;
0237     delete visDir;
0238 #ifdef CEXMC_USE_ROOT
0239     delete histoDir;
0240 #endif
0241 }
0242