ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActionInitialization.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ActionInitialization.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 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // J. Comput. Phys. 274 (2014) 841-882
31 // The Geant4-DNA web site is available at http://geant4-dna.org
32 //
33 //
36 
37 #include "ActionInitialization.hh"
38 
39 #include "PrimaryGeneratorAction.hh"
40 #include "RunAction.hh"
41 #include "SteppingAction.hh"
42 #include "DetectorConstruction.hh"
43 #include "TrackingAction.hh"
44 #include "G4RunManager.hh"
45 
46 #include "PrimaryGeneratorAction.hh"
47 #include "RunAction.hh"
48 #include "SteppingAction.hh"
49 
50 #include "G4DNAChemistryManager.hh"
51 
52 #include "G4SystemOfUnits.hh"
53 #include "G4UnitsTable.hh"
54 
55 #include "G4Threading.hh"
56 
57 #include "TrackingAction.hh"
58 
59 // chemistry
60 #include "G4Scheduler.hh"
61 #include "StackingAction.hh"
62 #include "TimeStepAction.hh"
63 #include "ITTrackingInteractivity.hh"
64 #include "ITSteppingAction.hh"
65 #include "ITTrackingAction.hh"
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {}
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 {
82  // In MT mode, to be clearer, the RunAction class for the master thread might
83  // be different than the one used for the workers.
84  // This RunAction will be called before and after starting the
85  // workers.
86  // For more details, please refer to :
87  // https://twiki.cern.ch/twiki/bin/view/Geant4/Geant4MTForApplicationDevelopers
88  //
89  // RunAction* runAction= new RunAction();
90  // SetUserAction(runAction);
91 }
92 
93 void ActionInitialization::Build() const
94 {
96  SetUserAction(primGenAction);
97 
98  // Set optional user action classes
99  SetUserAction(new RunAction());
103 
104  // chemistry part
107 
108  // Uncomment and set to stop chemistry stage after:
109  // ...given number of time steps
110  //G4Scheduler::Instance()->SetMaxNbSteps(1000);
111 
112  // ...OR reaching this time
114 
116 
117  ITTrackingInteractivity* itInteractivity = new ITTrackingInteractivity();
118  itInteractivity->SetUserAction(new ITSteppingAction);
119  itInteractivity->SetUserAction(new ITTrackingAction);
120  G4Scheduler::Instance()->SetInteractivity(itInteractivity);
121  }
122 /*
123  // To output the pre-chemical stage
124  //
125  G4String fileName ("output");
126 
127  if(G4RunManager::GetRunManager()->GetRunManagerType() ==
128  G4RunManager::sequentialRM)
129  {
130  // write initial situation at 1 picosecond
131  G4DNAChemistryManager::Instance()->WriteInto(fileName + ".txt");
132  }
133  else
134  {
135  G4int id = G4Threading::G4GetThreadId();
136 
137  G4String fileName_mt = fileName;
138  fileName_mt += G4UIcommand::ConvertToString(id);
139  fileName_mt += ".txt";
140 
141  G4cout << "chosen file name : " << fileName_mt << G4endl;
142 
143  G4DNAChemistryManager::Instance()->WriteInto(fileName_mt);
144  }
145 */
146 }