Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:14

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 //  Gorad (Geant4 Open-source Radiation Analysis and Design)
0027 //
0028 //  Author : Makoto Asai (SLAC National Accelerator Laboratory)
0029 //
0030 //  Development of Gorad is funded by NASA Johnson Space Center (JSC)
0031 //  under the contract NNJ15HK11B.
0032 //
0033 // ********************************************************************
0034 //
0035 // GRRunActionMessenger.hh
0036 //   Header file of a messenger class that handles histograms and
0037 //   n-tuple in GRRunAction.
0038 //
0039 // History
0040 //   September 8th, 2020 : first implementation
0041 //
0042 // ********************************************************************
0043 
0044 #ifndef GRRunActionMessenger_H
0045 #define GRRunActionMessenger_H 1
0046 
0047 #include "G4UImessenger.hh"
0048 #include "globals.hh"
0049 
0050 class GRRunAction;
0051 class G4UIdirectory;
0052 class G4UIcommand;
0053 class G4UIcmdWithAString;
0054 class G4UIcmdWithABool;
0055 class G4UIcmdWithAnInteger;
0056 class G4UIcmdWithoutParameter;
0057 
0058 class GRRunActionMessenger: public G4UImessenger
0059 {
0060   public:
0061     GRRunActionMessenger(GRRunAction*);
0062     virtual ~GRRunActionMessenger();
0063     virtual void SetNewValue(G4UIcommand*,G4String);
0064     virtual G4String GetCurrentValue(G4UIcommand*);
0065 
0066   private:
0067     void Define1D();
0068     void Define1P();
0069 
0070   private:
0071     GRRunAction* pRA;
0072 
0073     G4UIdirectory*      anaDir;
0074     G4UIcmdWithAString*         fileCmd;
0075     G4UIcmdWithAnInteger*   verboseCmd;
0076     G4UIcmdWithoutParameter*    listCmd;
0077     G4UIcmdWithAnInteger*   openCmd;
0078     G4UIcmdWithAnInteger*       plotCmd;
0079     G4UIcmdWithABool*           carryCmd;
0080     G4UIcmdWithoutParameter*    flushCmd;
0081     G4UIcmdWithoutParameter*    resetCmd;
0082     G4UIcommand*                idOffsetCmd;
0083 
0084     G4UIdirectory*              oneDDir;
0085     G4UIcommand*                create1DCmd;
0086     G4UIcommand*                create1DPrimPCmd;
0087     G4UIcommand*                create1DPlotPCmd;
0088     G4UIcmdWithoutParameter*    set1DCmd;
0089     G4UIcommand*                config1DCmd;
0090     G4UIcommand*                title1DCmd;
0091     G4UIcmdWithABool*           set1DYaxisLogCmd;
0092 
0093     G4UIdirectory*              onePDir;
0094     G4UIcommand*                create1PCmd;
0095     G4UIcommand*                set1PCmd;
0096     G4UIcommand*                title1PCmd;
0097 
0098     G4UIdirectory*              ntupleDir;
0099     G4UIcommand*                addColumnCmd;
0100 
0101   private:
0102     G4int currentID;
0103 
0104   private:
0105     inline G4bool CheckID(G4UIcommand* cmd)
0106     {
0107       if(currentID<0)
0108       {
0109         G4ExceptionDescription ed;
0110         ed << "There is no currently opened histogram. Create or open one.";
0111         cmd->CommandFailed(ed);
0112         return false;
0113       }
0114       return true;
0115     }
0116     inline G4bool CheckOpenID(G4UIcommand* /*cmd*/)
0117     {
0118       if(currentID>=0)
0119       {
0120         G4cout << "Previously opened histogram <" << currentID << "> is closed." << G4endl;
0121         currentID = -1;
0122       }
0123       return true;
0124     }
0125 };
0126 
0127 #endif
0128