source: tags/Mars-V0.8.7pre/mmc/MMcEvtBasic.h

Last change on this file was 6375, checked in by moralejo, 20 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1#ifndef __MMcEvtBasic__
2#define __MMcEvtBasic__
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8#include "MMcEvt.hxx"
9
10//
11// Version 1:
12// New container to keep the very basic informations on the
13// original MC events produced by Corsika
14//
15
16class MMcEvtBasic : public MParContainer
17{
18
19private:
20 MMcEvt::ParticleId_t fPartId; // Type of particle
21 Float_t fEnergy; // [GeV] Energy
22 Float_t fImpact; // [cm] impact parameter
23
24 // Telescope orientation (see TDAS 02-11 regarding the
25 // precise meaning of these angles):
26 Float_t fTelescopePhi; // [rad]
27 Float_t fTelescopeTheta; // [rad]
28
29
30 public:
31 MMcEvtBasic();
32
33 MMcEvtBasic(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);
34 ~MMcEvtBasic();
35
36 void Clear(Option_t *opt=NULL);
37
38 void Fill(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);
39
40 void Print(Option_t *opt=NULL) const;
41
42 MMcEvt::ParticleId_t GetPartId() const { return fPartId; }
43 Float_t GetEnergy() const { return fEnergy; }
44 Float_t GetImpact() const { return fImpact; }
45 Float_t GetTelescopePhi() const { return fTelescopePhi; }
46 Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
47
48 TString GetParticleName() const
49 {
50 switch (fPartId)
51 {
52 case MMcEvt::kGAMMA: return "Gamma";
53 case MMcEvt::kPOSITRON: return "Positron";
54 case MMcEvt::kELECTRON: return "Electron";
55 case MMcEvt::kANTIMUON: return "Anti-Muon";
56 case MMcEvt::kMUON: return "Muon";
57 case MMcEvt::kPI0: return "Pi-0";
58 case MMcEvt::kNEUTRON: return "Neutron";
59 case MMcEvt::kPROTON: return "Proton";
60 case MMcEvt::kHELIUM: return "Helium";
61 case MMcEvt::kOXYGEN: return "Oxygen";
62 case MMcEvt::kIRON: return "Iron";
63 }
64
65 return Form("Id:%d", fPartId);
66 }
67
68 TString GetParticleSymbol() const
69 {
70 switch (fPartId)
71 {
72 case MMcEvt::kGAMMA: return "\\gamma";
73 case MMcEvt::kPOSITRON: return "e^{+}";
74 case MMcEvt::kELECTRON: return "e^{-}";
75 case MMcEvt::kANTIMUON: return "\\mu^{+}";
76 case MMcEvt::kMUON: return "\\mu^{-}";
77 case MMcEvt::kPI0: return "\\pi^{0}";
78 case MMcEvt::kNEUTRON: return "n";
79 case MMcEvt::kPROTON: return "p";
80 case MMcEvt::kHELIUM: return "He";
81 case MMcEvt::kOXYGEN: return "O";
82 case MMcEvt::kIRON: return "Fe";
83 }
84
85 return Form("Id:%d", fPartId);
86 }
87
88 TString GetEnergyStr() const
89 {
90 if (fEnergy>1000)
91 return Form("%.1fTeV", fEnergy/1000);
92
93 if (fEnergy>10)
94 return Form("%dGeV", (Int_t)(fEnergy+.5));
95
96 if (fEnergy>1)
97 return Form("%.1fGeV", fEnergy);
98
99 return Form("%dMeV", (Int_t)(fEnergy*1000+.5));
100 }
101
102
103 void SetPartId(MMcEvt::ParticleId_t id)
104 { fPartId = id; }
105
106 void SetEnergy(Float_t Energy)
107 { fEnergy=Energy; } //Set Energy
108
109 void SetImpact(Float_t Impact)
110 { fImpact=Impact;} //Set impact parameter
111
112 void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
113
114 void SetTelescopePhi (Float_t Phi) { fTelescopePhi=Phi; }
115
116 ClassDef(MMcEvtBasic, 1) //Stores Basic Montecarlo Information of one event
117
118};
119
120#endif
Note: See TracBrowser for help on using the repository browser.