Adapted to changes in Geant4.10.3, fixed bug in musrRootOutput.cc

This commit is contained in:
prokscha 2017-03-11 14:50:06 +01:00
parent fa3de4a9b8
commit cf85ff8d25
4 changed files with 12 additions and 10 deletions

View File

@ -91,10 +91,10 @@ G4DecayProducts *MuDecayChannel::DecayIt(G4double)
if (GetVerboseLevel()>1) G4cout << "MuDecayChannel::DecayIt ";
#endif
//------------------------------modified----------xran----------------
if (G4MT_parent == 0) FillParent();
if (G4MT_daughters == 0) FillDaughters();
//------------------------------modified----------xran----------------
//------------------------------Geant4.10.3-------TP------------------
if (G4MT_parent == 0) CheckAndFillParent();
if (G4MT_daughters == 0) CheckAndFillDaughters();
//------------------------------modified----------TP------------------
// parent mass
//------------------------------modified----------xran----------------

View File

@ -68,9 +68,9 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double)
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "MuDecayChannelWithSpin::DecayIt ";
#endif
if (G4MT_parent == 0) FillParent();
if (G4MT_daughters == 0) FillDaughters();
// -------- Geant4.10.3 -TP-----------------------
if (G4MT_parent == 0) CheckAndFillParent();
if (G4MT_daughters == 0) CheckAndFillDaughters();
// parent mass
G4double parentmass = G4MT_parent->GetPDGMass();

View File

@ -527,6 +527,7 @@ void musrPhysicsList::ConstructEM()
//del G4String myTypeOfProcesses = musrParameters::GetInstance()->GetMyTypeOfProcesses();
//del G4cout<<"musrPhysicsList::ConstructEM(): myTypeOfProcesses="<<myTypeOfProcesses<<G4endl;
auto theParticleIterator=GetParticleIterator(); //Geant4.10.3
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
@ -587,6 +588,7 @@ void musrPhysicsList::ConstructGeneral() {
G4RadioactiveDecay* theRadioactiveDecay = new G4RadioactiveDecay();
G4GenericIon* ion = G4GenericIon::GenericIon();
auto theParticleIterator=GetParticleIterator(); //Geant4.10.3
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();

View File

@ -471,12 +471,12 @@ void musrRootOutput::EndOfRunAction() {
for (Int_t i=0; i<maxNGeantParameters; i++) {
TVector_GeantParametersD[i]=GeantParametersD[i];
}
TVector_GeantParametersD.Write("geantParametersD");
//
TH1D* hGeantParameters = new TH1D("hGeantParameters","hGeantParameters",maxNGeantParameters,0.,float(maxNGeantParameters));
for (Int_t i=0; i<maxNGeantParameters+1; i++) {
TVector_GeantParametersD.Write("geantParametersD");
for (Int_t i=0; i<maxNGeantParameters; i++) {
hGeantParameters->SetBinContent(i,GeantParametersD[i]);
}
}
hGeantParameters->Write();
rootFile->Close();
G4cout<<"musrRootOutput::EndOfRunAction() - Root tree written out."<<G4endl;