EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eASTRunActionMessenger.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eASTRunActionMessenger.hh
1 // ********************************************************************
2 //
3 // eASTRunActionMessenger.hh
4 // Header file of a messenger class that handles histograms and
5 // n-tuple in eASTRunAction.
6 //
7 // History
8 // May 8th, 2021 : first implementation
9 //
10 // ********************************************************************
11 
12 #ifndef eASTRunActionMessenger_H
13 #define eASTRunActionMessenger_H 1
14 
15 #include "G4UImessenger.hh"
16 #include "globals.hh"
17 
18 class eASTRunAction;
19 class G4UIdirectory;
20 class G4UIcommand;
21 class G4UIcmdWithAString;
22 class G4UIcmdWithABool;
23 class G4UIcmdWithAnInteger;
24 class G4UIcmdWithoutParameter;
25 
26 class eASTRunActionMessenger: public G4UImessenger
27 {
28  public:
30  virtual ~eASTRunActionMessenger();
31  virtual void SetNewValue(G4UIcommand*,G4String);
32  virtual G4String GetCurrentValue(G4UIcommand*);
33 
34  private:
35  void Define1D();
36  void Define1P();
37 
38  private:
40 
41  G4UIdirectory* anaDir;
42  G4UIcmdWithAString* fileCmd;
43  G4UIcmdWithAnInteger* verboseCmd;
44  G4UIcmdWithoutParameter* listCmd;
45  G4UIcmdWithAnInteger* openCmd;
46  G4UIcmdWithAnInteger* plotCmd;
47  G4UIcmdWithABool* carryCmd;
48  G4UIcmdWithoutParameter* flushCmd;
49  G4UIcmdWithoutParameter* resetCmd;
50 
51  G4UIdirectory* oneDDir;
52  G4UIcommand* create1DCmd;
53  G4UIcommand* create1DPlotPCmd;
54  G4UIcommand* config1DCmd;
55  G4UIcommand* title1DCmd;
56  G4UIcmdWithABool* set1DYaxisLogCmd;
57 
58  G4UIdirectory* onePDir;
59  G4UIcommand* create1PCmd;
60  G4UIcommand* set1PCmd;
61  G4UIcommand* title1PCmd;
62 
63  G4UIdirectory* ntupleDir;
64  G4UIcommand* addColumnCmd;
65 
66  private:
67  G4int currentID;
68 
69  private:
70  inline G4bool CheckID(G4UIcommand* cmd)
71  {
72  if(currentID<0)
73  {
74  G4ExceptionDescription ed;
75  ed << "There is no currently opened histogram. Create or open one.";
76  cmd->CommandFailed(ed);
77  return false;
78  }
79  return true;
80  }
81  inline G4bool CheckOpenID(G4UIcommand* /*cmd*/)
82  {
83  if(currentID>=0)
84  {
85  G4cout << "Previously opened histogram <" << currentID << "> is closed." << G4endl;
86  currentID = -1;
87  }
88  return true;
89  }
90 };
91 
92 #endif
93