1 | // $Id: MCTruth.cc 2667 2006-04-12 10:16:39Z moreggia $ |
---|
2 | // Author: M. Pallavicini |
---|
3 | // |
---|
4 | |
---|
5 | /***************************************************************************** |
---|
6 | * ESAF: Euso Simulation and Analysis Framework * |
---|
7 | * * |
---|
8 | * Id: MCTruth * |
---|
9 | * Package: GenBase * |
---|
10 | * Coordinator: Sergio.Bottai, D.Naumov * |
---|
11 | * * |
---|
12 | *****************************************************************************/ |
---|
13 | |
---|
14 | |
---|
15 | //______________________________________________________________________________ |
---|
16 | // |
---|
17 | // Monte Carlo Truth |
---|
18 | // |
---|
19 | // MCTruth holds the parameters u |
---|
20 | |
---|
21 | |
---|
22 | #include "MCTruth.hh" |
---|
23 | #include "Etypes.hh" |
---|
24 | #include <stdexcept> |
---|
25 | |
---|
26 | ClassImp(MCTruth) |
---|
27 | |
---|
28 | //______________________________________________________________________________ |
---|
29 | MCTruth::MCTruth() : fEnergy(0), fTheta(0), fPhi(0), fX1(0), fEarthAge(0), |
---|
30 | fShowerXMax(0), fHclouds(-kHuge), fCloudsthick(0), fCloudsOD(0),fHGround(-kHuge), |
---|
31 | fGroundAlbedo(-kHuge), fGroundSpecular(-kHuge) { |
---|
32 | // |
---|
33 | // Constructor |
---|
34 | // |
---|
35 | |
---|
36 | } |
---|
37 | |
---|
38 | //______________________________________________________________________________ |
---|
39 | MCTruth::~MCTruth() { |
---|
40 | // |
---|
41 | // Destructor |
---|
42 | // |
---|
43 | } |
---|
44 | |
---|
45 | //______________________________________________________________________________ |
---|
46 | void MCTruth::Clear() { |
---|
47 | // |
---|
48 | // Reset the truth |
---|
49 | // |
---|
50 | fEnergy = 0; |
---|
51 | fTheta = 0; |
---|
52 | fPhi = 0; |
---|
53 | fParticleName.clear(); |
---|
54 | fParticleCode = 0; |
---|
55 | fInitPos.SetXYZ(0,0,0); |
---|
56 | fX1 = 0; |
---|
57 | fEarthImpact.SetXYZ(0,0,0); |
---|
58 | fEarthAge = 0; |
---|
59 | fShowerMaxPos.SetXYZ(0,0,0); |
---|
60 | fShowerXMax = 0; |
---|
61 | fHclouds = -kHuge; |
---|
62 | fCloudsthick = 0; |
---|
63 | fCloudsOD = 0; |
---|
64 | fHGround = -kHuge; |
---|
65 | fGroundAlbedo = -kHuge; |
---|
66 | fGroundSpecular = -kHuge; |
---|
67 | } |
---|
68 | |
---|
69 | //______________________________________________________________________________ |
---|
70 | const string& MCTruth::Dump() { |
---|
71 | // |
---|
72 | // Dump the contents of the truth on screen |
---|
73 | // |
---|
74 | |
---|
75 | fDumpText = "Dumping MCTruth object:\n"; |
---|
76 | char truth[300]; |
---|
77 | sprintf(truth,"Energy= %10.5e\nTheta= %f\nPhi = %f\n",fEnergy,fTheta,fPhi); |
---|
78 | fDumpText += truth; |
---|
79 | return fDumpText; |
---|
80 | } |
---|
81 | |
---|
82 | //______________________________________________________________________________ |
---|
83 | void MCTruth::BuildName() { |
---|
84 | // |
---|
85 | // Fill particle name according to code |
---|
86 | // |
---|
87 | |
---|
88 | if(fParticleCode == 1) fParticleName = "Proton"; |
---|
89 | else if(fParticleCode == 56) fParticleName = "Iron"; |
---|
90 | else { |
---|
91 | fParticleName = "Unknown"; |
---|
92 | MsgForm(EsafMsg::Warning,"Unknown Particle Code, Particle Name set to Unknown"); |
---|
93 | } |
---|
94 | } |
---|