91 std::cout<<G4State_PreInit<<
"\t"<<G4State_Init<<
"\t"<<G4State_Idle<<G4endl;
92 std::cout <<
" InitPhys::Geant4 is at stage " << G4StateManager::GetStateManager()->GetCurrentState() <<
std::endl;
98 std::cout <<
" Before::Geant4 is at stage " << G4StateManager::GetStateManager()->GetCurrentState() <<
std::endl;
99 G4StateManager* stateManager = G4StateManager::GetStateManager();
100 stateManager->SetNewState(G4State_PreInit);
102 G4PhysListFactory factory;
103 G4VModularPhysicsList *phys = 0;
108 G4cout <<
"Exiting" << G4endl;
111 this->SetUserInitialization(phys);
114 G4RunManager::InitializePhysics();
116 std::cout <<
" After::Geant4 is at stage " << G4StateManager::GetStateManager()->GetCurrentState() <<
std::endl;
117 G4UImanager* UI = G4UImanager::GetUIpointer();
133 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
134 if (!particleTable->contains(
"kaon0L")) {
135 std::ostringstream mStrStr;
136 mStrStr <<
" The Particle table does not know about kaon Long.. Something not initialized ";
137 G4String mStr(mStrStr.str());
138 G4Exception(
"LBNERunManager::InitializePhysics",
" ", FatalException, mStr.c_str());
141 G4cout <<
"Setting correct branching fractions and form factors for " 142 <<
"K0L, K+ and K- decays (MINOS-doc-1786)"<<G4endl;
144 UI->ApplyCommand(
"/particle/select kaon0L");
145 UI->ApplyCommand(
"/particle/property/decay/select 0");
146 UI->ApplyCommand(
"/particle/property/decay/br 19.72e-2");
147 UI->ApplyCommand(
"/particle/property/decay/select 1");
148 UI->ApplyCommand(
"/particle/property/decay/br 20.20e-2");
149 UI->ApplyCommand(
"/particle/property/decay/select 2");
150 UI->ApplyCommand(
"/particle/property/decay/br 20.20e-2");
151 UI->ApplyCommand(
"/particle/property/decay/select 3");
152 UI->ApplyCommand(
"/particle/property/decay/br 13.495e-2");
153 UI->ApplyCommand(
"/particle/property/decay/select 4");
154 UI->ApplyCommand(
"/particle/property/decay/br 13.495e-2");
155 UI->ApplyCommand(
"/particle/property/decay/select 5");
156 UI->ApplyCommand(
"/particle/property/decay/br 12.53e-2");
158 UI->ApplyCommand(
"/particle/select kaon+");
159 UI->ApplyCommand(
"/particle/property/decay/select 0");
160 UI->ApplyCommand(
"/particle/property/decay/br 63.39e-2");
161 UI->ApplyCommand(
"/particle/property/decay/select 1");
162 UI->ApplyCommand(
"/particle/property/decay/br 21.03e-2");
163 UI->ApplyCommand(
"/particle/property/decay/select 2");
164 UI->ApplyCommand(
"/particle/property/decay/br 5.59e-2");
165 UI->ApplyCommand(
"/particle/property/decay/select 3");
166 UI->ApplyCommand(
"/particle/property/decay/br 5.14e-2");
167 UI->ApplyCommand(
"/particle/property/decay/select 4");
168 UI->ApplyCommand(
"/particle/property/decay/br 3.30e-2");
169 UI->ApplyCommand(
"/particle/property/decay/select 5");
170 UI->ApplyCommand(
"/particle/property/decay/br 1.757e-2");
172 UI->ApplyCommand(
"/particle/select kaon-");
173 UI->ApplyCommand(
"/particle/property/decay/select 0");
174 UI->ApplyCommand(
"/particle/property/decay/br 63.39e-2");
175 UI->ApplyCommand(
"/particle/property/decay/select 1");
176 UI->ApplyCommand(
"/particle/property/decay/br 21.03e-2");
177 UI->ApplyCommand(
"/particle/property/decay/select 2");
178 UI->ApplyCommand(
"/particle/property/decay/br 5.59e-2");
179 UI->ApplyCommand(
"/particle/property/decay/select 3");
180 UI->ApplyCommand(
"/particle/property/decay/br 5.14e-2");
181 UI->ApplyCommand(
"/particle/property/decay/select 4");
182 UI->ApplyCommand(
"/particle/property/decay/br 3.30e-2");
183 UI->ApplyCommand(
"/particle/property/decay/select 5");
184 UI->ApplyCommand(
"/particle/property/decay/br 1.757e-2");
189 G4ParticleTable::G4PTblDicIterator *ptiter=particleTable->GetIterator();
191 G4double lamp = 2.81e-2;
192 G4double lam0 = 1.64e-2;
193 G4double xi_kp= 12.377 * (lam0 - lamp);
194 G4double xi_k0= 11.713 * (lam0 - lamp);
202 G4ParticleDefinition *particle = ptiter->value();
203 if (particle==G4KaonPlus::KaonPlusDefinition()||
204 particle==G4KaonMinus::KaonMinusDefinition()){
205 G4DecayTable *decayTable=particle->GetDecayTable();
206 for (G4int ii=0; ii<decayTable->entries(); ++ii){
207 if (decayTable->GetDecayChannel(ii)->GetKinematicsName()==
"KL3 Decay"){
208 G4KL3DecayChannel *decayChannel=(G4KL3DecayChannel *)decayTable->GetDecayChannel(ii);
211 for (G4int jj=0; jj<decayChannel->GetNumberOfDaughters();++jj){
215 if (decayChannel->GetDaughter(jj)==G4Positron::PositronDefinition()){
219 if (decayChannel->GetDaughter(jj)==G4Electron::ElectronDefinition()){
223 if (decayChannel->GetDaughter(jj)==G4MuonPlus::MuonPlusDefinition()){
227 if (decayChannel->GetDaughter(jj)==G4MuonMinus::MuonMinusDefinition()){
234 decayChannel->SetDalitzParameter(pLambda,pXi0);
238 if (particle==G4KaonZeroLong::KaonZeroLongDefinition()){
239 G4DecayTable *decayTable=particle->GetDecayTable();
240 for (G4int ii=0; ii<decayTable->entries(); ++ii){
241 if (decayTable->GetDecayChannel(ii)->GetKinematicsName()==
"KL3 Decay"){
242 G4KL3DecayChannel *decayChannel=(G4KL3DecayChannel *)decayTable->GetDecayChannel(ii);
244 for (G4int jj=0; jj<decayChannel->GetNumberOfDaughters();++jj){
248 if (decayChannel->GetDaughter(jj)==G4Positron::PositronDefinition()||
249 decayChannel->GetDaughter(jj)==G4Electron::ElectronDefinition()){
253 if (decayChannel->GetDaughter(jj)==G4MuonPlus::MuonPlusDefinition()||
254 decayChannel->GetDaughter(jj)==G4MuonMinus::MuonMinusDefinition()){
262 decayChannel->SetDalitzParameter(pLambda,pXi0);
270 G4ParticleTable* ptbl = G4ParticleTable::GetParticleTable();
271 G4ParticleTable::G4PTblDicIterator* piter = ptbl->GetIterator();
272 G4StepLimiter* slim =
new G4StepLimiter(
"StepLimiter");
275 while ( (*piter)() ) {
276 G4ParticleDefinition* pdef = piter->value();
277 G4ProcessManager* pmgr = pdef->GetProcessManager();
281 pmgr->AddProcess( slim, -1, -1, 3);
285 G4RunManager::Initialize();
287 std::cerr <<
" G4RunManager::Initialize invoked, state is now " 288 << G4StateManager::GetStateManager()->GetCurrentState() <<
std::endl;
307 if (!G4RunManager::ConfirmBeamOnCondition()) {
308 std::ostringstream mStrStr;
309 mStrStr <<
" Expecting to be able to turn on the beam at this stage. Not the case ! Fatal ";
310 G4String mStr(mStrStr.str());
311 G4Exception(
"LBNERunManager::InitializePhysics",
" ", FatalException, mStr.c_str());
313 std::cout <<
" Expecting to be able to turn on the beam at this stage " <<
std::endl;
317 G4ParticleDefinition *piPlus = particleTable->FindParticle(211);
319 G4ProcessManager *piPlusProcM = piPlus->GetProcessManager();
320 piPlusProcM->AddDiscreteProcess(pfProc);
321 G4ParticleDefinition *piMinus = particleTable->FindAntiParticle(211);
322 G4ProcessManager *piMinusProcM = piMinus->GetProcessManager();
323 piMinusProcM->AddDiscreteProcess(pfProc);
324 G4ParticleDefinition *kPlus = particleTable->FindParticle(321);
325 G4ProcessManager *kPlusProcM = kPlus->GetProcessManager();
326 kPlusProcM->AddDiscreteProcess(pfProc);
327 G4ParticleDefinition *kMinus = particleTable->FindAntiParticle(321);
328 G4ProcessManager *kMinusProcM = kMinus->GetProcessManager();
329 kMinusProcM->AddDiscreteProcess(pfProc);
bool fPhysicsInitializedHere
LBNEStackingAction * fLBNEStackingAction
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
LBNERunAction * fLBNERunAction
LBNETrackingAction * fLBNETrackingAction
LBNEEventAction * fLBNEEventAction
LBNESteppingAction * fLBNESteppingAction
G4String fPhysicsListName
QTextStream & endl(QTextStream &s)