Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:02:42

0001 // ********************************************************************
0002 //
0003 // eASTRunActionMessenger.hh
0004 //   Header file of a messenger class that handles histograms and
0005 //   n-tuple in eASTRunAction.
0006 //
0007 // History
0008 //   May 8th, 2021 : first implementation
0009 //
0010 // ********************************************************************
0011 
0012 #ifndef eASTRunActionMessenger_H
0013 #define eASTRunActionMessenger_H 1
0014 
0015 #include "G4UImessenger.hh"
0016 #include "globals.hh"
0017 
0018 class eASTRunAction;
0019 class G4UIdirectory;
0020 class G4UIcommand;
0021 class G4UIcmdWithAString;
0022 class G4UIcmdWithABool;
0023 class G4UIcmdWithAnInteger;
0024 class G4UIcmdWithoutParameter;
0025 
0026 class eASTRunActionMessenger: public G4UImessenger
0027 {
0028   public:
0029     eASTRunActionMessenger(eASTRunAction*);
0030     virtual ~eASTRunActionMessenger();
0031     virtual void SetNewValue(G4UIcommand*,G4String);
0032     virtual G4String GetCurrentValue(G4UIcommand*);
0033 
0034   private:
0035     void Define1D();
0036     void Define1P();
0037 
0038   private:
0039     eASTRunAction* pRA;
0040 
0041     G4UIdirectory*      anaDir;
0042     G4UIcmdWithAString*         fileCmd;
0043     G4UIcmdWithAnInteger*   verboseCmd;
0044     G4UIcmdWithoutParameter*    listCmd;
0045     G4UIcmdWithAnInteger*   openCmd;
0046     G4UIcmdWithAnInteger*       plotCmd;
0047     G4UIcmdWithABool*           carryCmd;
0048     G4UIcmdWithoutParameter*    flushCmd;
0049     G4UIcmdWithoutParameter*    resetCmd;
0050 
0051     G4UIdirectory*              oneDDir;
0052     G4UIcommand*                create1DCmd;
0053     G4UIcommand*                create1DPlotPCmd;
0054     G4UIcommand*                config1DCmd;
0055     G4UIcommand*                title1DCmd;
0056     G4UIcmdWithABool*           set1DYaxisLogCmd;
0057 
0058     G4UIdirectory*              onePDir;
0059     G4UIcommand*                create1PCmd;
0060     G4UIcommand*                set1PCmd;
0061     G4UIcommand*                title1PCmd;
0062 
0063     G4UIdirectory*              ntupleDir;
0064     G4UIcommand*                addColumnCmd;
0065 
0066   private:
0067     G4int currentID;
0068 
0069   private:
0070     inline G4bool CheckID(G4UIcommand* cmd)
0071     {
0072       if(currentID<0)
0073       {
0074         G4ExceptionDescription ed;
0075         ed << "There is no currently opened histogram. Create or open one.";
0076         cmd->CommandFailed(ed);
0077         return false;
0078       }
0079       return true;
0080     }
0081     inline G4bool CheckOpenID(G4UIcommand* /*cmd*/)
0082     {
0083       if(currentID>=0)
0084       {
0085         G4cout << "Previously opened histogram <" << currentID << "> is closed." << G4endl;
0086         currentID = -1;
0087       }
0088       return true;
0089     }
0090 };
0091 
0092 #endif
0093