4 #include "G4RunManager.hh"
5 #include "G4UImanager.hh"
6 #include "G4VisExecutive.hh"
7 #include "G4UIExecutive.hh"
9 #include "HGCal/TBStandaloneSimulator/interface/DetectorConstruction.hh"
10 #include "HGCal/TBStandaloneSimulator/interface/PhysicsList.hh"
11 #include "HGCal/TBStandaloneSimulator/interface/PrimaryGeneratorAction.hh"
12 #include "HGCal/TBStandaloneSimulator/interface/RunAction.hh"
13 #include "HGCal/TBStandaloneSimulator/interface/EventAction.hh"
14 #include "HGCal/TBStandaloneSimulator/interface/SteppingAction.hh"
15 #include "HGCal/TBStandaloneSimulator/interface/SteppingVerbose.hh"
16 #include "HGCal/TBStandaloneSimulator/interface/TBGeometry.h"
21 int main(
int argc,
char** argv)
24 int hack = CLHEP::HepRandomGenActive;
29 std::cout <<
"Usage: " << std::endl
30 <<
" simulateTB \x1b[1;31;48m<geometry file>\x1b[0m"
31 <<
" \x1b[1;32;48m<macro file>\x1b[0m"
36 G4String geomFile = gSystem->ExpandPathName(argv[1]);
37 G4String macroFile = gSystem->ExpandPathName(argv[2]);
39 config.
macro = macroFile;
45 G4cout << config << G4endl;
50 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine);
53 G4VSteppingVerbose::SetInstance(
new SteppingVerbose);
56 G4RunManager * runManager =
new G4RunManager;
60 runManager->SetUserInitialization(
new DetectorConstruction(geometry,
62 runManager->SetUserInitialization(
new PhysicsList);
65 int model = geometry.
model();
67 runManager->SetUserAction(
new PrimaryGeneratorAction(model, eta));
68 runManager->SetUserAction(
new RunAction);
69 runManager->SetUserAction(
new EventAction);
70 runManager->SetUserAction(
new SteppingAction);
73 runManager->Initialize();
76 G4VisManager* visManager =
new G4VisExecutive;
77 visManager->Initialize();
80 G4UImanager* UImanager = G4UImanager::GetUIpointer();
81 G4String command =
"/control/execute " + macroFile;
82 UImanager->ApplyCommand(command);
int main(int argc, char *argv[])