78{
79 G4cout << G4endl;
80 G4cout << "Usage: load_gdml <intput_gdml_file:mandatory>"
81 << " <output_gdml_file:optional>" << G4endl;
82 G4cout << G4endl;
83
84 if (argc<2)
85 {
86 G4cout << "Error! Mandatory input file is not specified!" << G4endl;
87 G4cout << G4endl;
88 return -1;
89 }
90
92
93
94
95
96
97
98
99
100 parser.SetOverlapCheck(true);
101 parser.Read(argv[1]);
102
103 if (argc>4)
104 {
105 G4cout << "Error! Too many arguments!" << G4endl;
106 G4cout << G4endl;
107 return -1;
108 }
109
110 auto* runManager = G4RunManagerFactory::CreateRunManager();
111
113 parser.GetWorldVolume()));
114 runManager->SetUserInitialization(
new FTFP_BERT);
116
117 runManager->Initialize();
118
119
121 visManager->Initialize();
122
123
124 G4UImanager* UImanager = G4UImanager::GetUIpointer();
125
126
127
128
129
130
131 G4cout << std::endl;
132
134 std::vector<G4LogicalVolume*>::const_iterator lvciter;
135 for( lvciter = lvs->begin(); lvciter != lvs->end(); lvciter++ )
136 {
137 G4GDMLAuxListType auxInfo = parser.GetVolumeAuxiliaryInformation(*lvciter);
138
139 if (auxInfo.size()>0)
140 G4cout << "Auxiliary Information is found for Logical Volume : "
141 << (*lvciter)->GetName() << G4endl;
142
144 }
145
146
147 G4cout << std::endl;
148 G4cout << "Global auxiliary info:" << std::endl;
149 G4cout << std::endl;
150
152
153 G4cout << std::endl;
154
155
156
157
158
159
160
161 runManager->BeamOn(0);
162
163
164
165 if (argc>=3)
166 {
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186 parser.SetRegionExport(true);
187
188
189 parser.Write(argv[2], G4TransportationManager::GetTransportationManager()
190 ->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume());
191 }
192
193
194 if (argc==4)
195 {
196 G4String command =
"/control/execute ";
198 UImanager->ApplyCommand(command+fileName);
199 }
200 else
201 {
203 UImanager->ApplyCommand("/control/execute vis.mac");
204 ui->SessionStart();
205 delete ui;
206 }
207
208 delete visManager;
209 delete runManager;
210
211 return 0;
212}
Action initialization class.
Detector construction allowing to use the geometry read from the GDML file.