source: trunk/WuerzburgSoft/Thomas/mphys/MParticle.h@ 1371

Last change on this file since 1371 was 1370, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.3 KB
Line 
1#ifndef MARS_MParticle
2#define MARS_MParticle
3
4#ifndef ROOT_TObject
5#include <TObject.h>
6#endif
7
8/*
9 #ifndef MARS_MParContainer
10 #include "MParContainer.h"
11 #endif
12 */
13
14class MParticle : public TObject
15{
16public:
17 typedef enum { kEGamma, kEElectron, kEPositron, kENone } ParticleType_t;
18 enum { kEIsPrimary = BIT(14) };
19
20private:
21 const ParticleType_t fPType; //! Particle type
22
23protected:
24 Double_t fEnergy; // [GeV] Energy
25
26 Double_t fZ; // [1] Red shift
27 Double_t fR; // [kpc] Radius from line of view
28 Double_t fPhi; // [rad] Phi@z from line of view
29
30 Double_t fTheta; // [rad] Direction of momentum, angle || line of view
31 Double_t fPsi; // [rad] Direction of momentum, az. angle
32
33public:
34 MParticle(ParticleType_t t=kENone, const char *name=NULL, const char *title=NULL);
35
36 void InitRandom();
37
38 static Double_t ZofR(Double_t *x, Double_t *k=NULL);
39 static Double_t RofZ(Double_t *x, Double_t *k=NULL);
40
41 void operator=(MParticle &p)
42 {
43 fZ = p.fZ;
44 fR = p.fR;
45 fPhi = p.fPhi;
46 fTheta = p.fTheta;
47 fPsi = p.fPsi;
48 }
49
50 // ----------------------------------------------------------------
51
52 static Double_t Planck(Double_t *x, Double_t *k=NULL);
53
54 // ----------------------------------------------------------------
55
56 void SetIsPrimary(Bool_t is=kTRUE) { is ? SetBit(kEIsPrimary) : ResetBit(kEIsPrimary); }
57 Bool_t IsPrimary() const { return TestBit(kEIsPrimary); }
58
59 // ----------------------------------------------------------------
60
61 virtual Double_t GetInteractionLength() const { AbstractMethod("GetInteractionLength"); return 0; }
62
63 void SetEnergy(Double_t e) { fEnergy = e; }
64 void SetZ(Double_t z) { fZ = z; }
65
66 void SetNewDirection(Double_t theta, Double_t phi);
67 Bool_t SetNewPosition(Double_t dr);
68 Bool_t SetNewPosition();
69
70 ParticleType_t GetPType() const { return fPType; }
71
72 Double_t GetEnergy() const { return fEnergy; }
73
74 Double_t GetZ() const { return fZ; }
75 Double_t GetPhi() const { return fPhi; }
76 Double_t GetR() const { return fR; }
77
78 Double_t GetTheta() const { return fTheta; }
79 Double_t GetPsi() const { return fPsi; }
80
81 ClassDef(MParticle, 1) // Container which holds hostograms for the Hillas parameters
82};
83
84#endif
85
Note: See TracBrowser for help on using the repository browser.