Changeset 9313 for trunk/MagicSoft/include-Classes/MMcFormat
- Timestamp:
- 02/11/09 10:48:24 (16 years ago)
- Location:
- trunk/MagicSoft/include-Classes/MMcFormat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
r9312 r9313 52 52 #include "MMcEvtBasic.h" 53 53 54 #include "MString.h" 55 54 56 #include "MLog.h" 55 57 #include "MLogManip.h" … … 124 126 fTelescopeTheta = fTThet; 125 127 } 128 129 TString MMcEvtBasic::GetParticleName(Int_t id) 130 { 131 switch (id) 132 { 133 case kUNDEFINED: return "Undefined"; 134 case kGAMMA: return "Gamma"; 135 case kPOSITRON: return "Positron"; 136 case kELECTRON: return "Electron"; 137 case kANTIMUON: return "Anti-Muon"; 138 case kMUON: return "Muon"; 139 case kPI0: return "Pi-0"; 140 case kNEUTRON: return "Neutron"; 141 case kPROTON: return "Proton"; 142 case kHELIUM: return "Helium"; 143 case kOXYGEN: return "Oxygen"; 144 case kIRON: return "Iron"; 145 case kArtificial: return "Artificial"; 146 case kNightSky: return "NightSky"; 147 } 148 149 return MString::Format("Id:%d", id); 150 } 151 152 TString MMcEvtBasic::GetParticleSymbol(Int_t id) 153 { 154 switch (id) 155 { 156 case kUNDEFINED:return "N/A"; 157 case kGAMMA: return "\\gamma"; 158 case kPOSITRON: return "e^{+}"; 159 case kELECTRON: return "e^{-}"; 160 case kANTIMUON: return "\\mu^{+}"; 161 case kMUON: return "\\mu^{-}"; 162 case kPI0: return "\\pi^{0}"; 163 case kNEUTRON: return "n"; 164 case kPROTON: return "p"; 165 case kHELIUM: return "He"; 166 case kOXYGEN: return "O"; 167 case kIRON: return "Fe"; 168 case kNightSky: return "\\gamma_{NSB}"; 169 } 170 171 return MString::Format("Id:%d", id); 172 } 173 174 TString MMcEvtBasic::GetEnergyStr(Float_t e) 175 { 176 if (e>=1000) 177 return MString::Format("%.1fTeV", e/1000); 178 179 if (e>=10) 180 return MString::Format("%dGeV", (Int_t)(e+.5)); 181 182 if (e>=1) 183 return MString::Format("%.1fGeV", e); 184 185 return MString::Format("%dMeV", (Int_t)(e*1000+.5)); 186 } 187 126 188 127 189 // -------------------------------------------------------------------------- -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
r9312 r9313 51 51 Float_t GetTelescopeTheta() const { return fTelescopeTheta; } 52 52 53 static TString GetParticleName(Int_t id) 54 { 55 switch (id) 56 { 57 case kUNDEFINED: return "Undefined"; 58 case kGAMMA: return "Gamma"; 59 case kPOSITRON: return "Positron"; 60 case kELECTRON: return "Electron"; 61 case kANTIMUON: return "Anti-Muon"; 62 case kMUON: return "Muon"; 63 case kPI0: return "Pi-0"; 64 case kNEUTRON: return "Neutron"; 65 case kPROTON: return "Proton"; 66 case kHELIUM: return "Helium"; 67 case kOXYGEN: return "Oxygen"; 68 case kIRON: return "Iron"; 69 case kArtificial: return "Artificial"; 70 case kNightSky: return "NightSky"; 71 } 72 73 return Form("Id:%d", id); 74 } 75 76 static TString GetParticleSymbol(Int_t id) 77 { 78 switch (id) 79 { 80 case kUNDEFINED:return "N/A"; 81 case kGAMMA: return "\\gamma"; 82 case kPOSITRON: return "e^{+}"; 83 case kELECTRON: return "e^{-}"; 84 case kANTIMUON: return "\\mu^{+}"; 85 case kMUON: return "\\mu^{-}"; 86 case kPI0: return "\\pi^{0}"; 87 case kNEUTRON: return "n"; 88 case kPROTON: return "p"; 89 case kHELIUM: return "He"; 90 case kOXYGEN: return "O"; 91 case kIRON: return "Fe"; 92 case kNightSky: return "\\gamma_{NSB}"; 93 } 94 95 return Form("Id:%d", id); 96 } 97 98 static TString GetEnergyStr(Float_t e) 99 { 100 if (e>=1000) 101 return Form("%.1fTeV", e/1000); 102 103 if (e>=10) 104 return Form("%dGeV", (Int_t)(e+.5)); 105 106 if (e>=1) 107 return Form("%.1fGeV", e); 108 109 return Form("%dMeV", (Int_t)(e*1000+.5)); 110 } 53 static TString GetParticleName(Int_t id); 54 static TString GetParticleSymbol(Int_t id); 55 static TString GetEnergyStr(Float_t e); 111 56 112 57 TString GetParticleSymbol() const
Note:
See TracChangeset
for help on using the changeset viewer.