ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4StackingMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4StackingMessenger.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 // --------------------------------------------------------------------
29 
30 #include "G4StackingMessenger.hh"
31 #include "G4StackManager.hh"
32 #include "G4UIdirectory.hh"
34 #include "G4UIcmdWithAnInteger.hh"
35 #include "G4ios.hh"
36 
38 :fContainer(fCont)
39 {
40  stackDir = new G4UIdirectory("/event/stack/");
41  stackDir->SetGuidance("Stack control commands.");
42 
43  statusCmd = new G4UIcmdWithoutParameter("/event/stack/status",this);
44  statusCmd->SetGuidance("List current status of the stack.");
45 
46  clearCmd = new G4UIcmdWithAnInteger("/event/stack/clear",this);
47  clearCmd->SetGuidance("Clear stacked tracks.");
48  clearCmd->SetGuidance(" 2 : clear all tracks in all stacks");
49  clearCmd->SetGuidance(" 1 : clear tracks in the urgent and waiting stacks");
50  clearCmd->SetGuidance(" 0 : clear tracks in the waiting stack (default)");
51  clearCmd->SetGuidance("-1 : clear tracks in the urgent stack");
52  clearCmd->SetGuidance("-2 : clear tracks in the postponed stack");
53  clearCmd->SetParameterName("level",true);
55  clearCmd->SetRange("level>=-2&&level<=2");
57 
58  verboseCmd = new G4UIcmdWithAnInteger("/event/stack/verbose",this);
59  verboseCmd->SetGuidance("Set verbose level for G4StackManager");
60  verboseCmd->SetGuidance(" 0 : Silence (default)");
61  verboseCmd->SetGuidance(" 1 : Minimum statistics");
62  verboseCmd->SetGuidance(" 2 : Detailed reports");
63  verboseCmd->SetGuidance("Note - this value is overwritten by /event/verbose command.");
64 
65 }
66 
68 {
69  delete statusCmd;
70  delete clearCmd;
71  delete verboseCmd;
72  delete stackDir;
73 }
74 
76 {
77  if( command==statusCmd )
78  {
79  G4cout << "========================== Current status of the stack =====" << G4endl;
80  G4cout << " Number of tracks in the stack" << G4endl;
81  G4cout << " Urgent stack : " << fContainer->GetNUrgentTrack() << G4endl;
82  G4cout << " Waiting stack : " << fContainer->GetNWaitingTrack() << G4endl;
83  G4cout << " Postponed stack : " << fContainer->GetNPostponedTrack() << G4endl;
84  }
85  else if( command==clearCmd )
86  {
87  G4int vc = clearCmd->GetNewIntValue(newValues);
88  switch (vc)
89  {
90  case 2:
91  fContainer->ClearPostponeStack(); // fallthrough
92  /* no break */
93  case 1:
94  fContainer->ClearUrgentStack(); // fallthrough
95  /* no break */
96  case 0:
98  break;
99  case -1:
101  break;
102  case -2:
104  break;
105  }
106  }
107  else if( command==verboseCmd )
108  {
110  }
111 }
112