~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/common_cpp/Simulation/MAUSPhysicsList.cc

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 */
17
17
 
 
18
#include <limits>
18
19
#include <iostream>
19
20
#include <sstream>
20
21
#include <vector>
77
78
        mpl->Setup();
78
79
        return mpl;
79
80
    }
80
 
    catch(Squeal squee) {
 
81
    catch (Exception exc) {
81
82
        delete mpl;
82
 
        throw squee;
 
83
        throw exc;
83
84
    }
84
85
  } else {
85
 
    throw(Squeal(Squeal::recoverable,
 
86
    throw(Exception(Exception::recoverable,
86
87
        "Failed to recognise physics list model "+physModel,
87
88
        "MAUSPhysicsList::GetMAUSPhysicsList()")
88
89
    );
105
106
                              << "\n  pi 1/2 life " << _piHalfLife
106
107
                              << "\n  mu 1/2 life " << _muHalfLife << std::endl;
107
108
  SetStochastics(_msModel, _dEModel, _hadronicModel, _partDecay);
108
 
  SetHalfLife(_piHalfLife, _muHalfLife);
109
109
}
110
110
 
111
111
void MAUSPhysicsList::SetStochastics(scat scatteringModel,
118
118
}
119
119
 
120
120
void MAUSPhysicsList::SetDecay(bool decay) {
121
 
  if (!decay) UIApplyCommand("/process/inactivate Decay");
122
 
  else        UIApplyCommand("/process/activate   Decay");
 
121
  if (decay) {
 
122
      SetHalfLife(_piHalfLife, _muHalfLife);
 
123
  } else {
 
124
      // note that disabling decays makes a G4Exception, as per #1404
 
125
      // This is a G4 bug.
 
126
      //
 
127
      // Here we just set the lifetime to be very long (this could cause a
 
128
      // problem if user sets simulation time to be even longer, default
 
129
      // max time is 1e9 nanoseconds
 
130
      double life = std::numeric_limits<double>::max()/10.;
 
131
      SetHalfLife(life, life);
 
132
  }
123
133
}
124
134
 
125
135