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

Last change on this file since 6997 was 1449, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.8 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 fSrcR; //! [kpc] Distance from observer to source
25
26 Double_t fEnergy; // [GeV] Energy
27
28 Double_t fZ; // [1] Red shift
29 Double_t fR; // [kpc] Radius from line of view
30 Double_t fPhi; // [rad] Phi@z from line of view
31
32 Double_t fTheta; // [rad] Direction of momentum, angle || line of view
33 Double_t fPsi; // [rad] Direction of momentum, az. angle
34
35 Double_t fX; // [kpc] real traveled distance minus observers distance (added in version 2)
36
37public:
38 MParticle(ParticleType_t t=kENone, const char *name=NULL, const char *title=NULL);
39 MParticle(MParticle &p, ParticleType_t t=kENone) : fPType(t) { *this = p; }
40 MParticle(MParticle &p, Double_t e, ParticleType_t t=kENone) : fPType(t) { *this = p; fEnergy = e; }
41
42 void InitRandom();
43
44 static Double_t ZofR(Double_t *x, Double_t *k=NULL);
45 static Double_t RofZ(Double_t *x, Double_t *k=NULL);
46
47 void operator=(MParticle &p)
48 {
49 fSrcR = p.fSrcR;
50 fZ = p.fZ;
51 fR = p.fR;
52 fPhi = p.fPhi;
53 fTheta = p.fTheta;
54 fPsi = p.fPsi;
55 fX = p.fX;
56 }
57
58 // ----------------------------------------------------------------
59
60 static Double_t Planck0(Double_t *x, Double_t *k=NULL);
61 static Double_t Planck(Double_t *x, Double_t *k=NULL);
62
63 // ----------------------------------------------------------------
64
65 void SetIsPrimary(Bool_t is=kTRUE) { is ? SetBit(kEIsPrimary) : ResetBit(kEIsPrimary); }
66 Bool_t IsPrimary() const { return TestBit(kEIsPrimary); }
67
68 void SetSrcR(Double_t r) { fSrcR = r; }
69
70 // ----------------------------------------------------------------
71
72 virtual Double_t GetInteractionLength() const { AbstractMethod("GetInteractionLength"); return 0; }
73
74 void SetEnergy(Double_t e) { fEnergy = e; }
75 void SetZ(Double_t z) { fZ = z; }
76
77 void SetNewDirection(Double_t theta, Double_t phi);
78 Bool_t SetNewPosition(Double_t dr);
79 Bool_t SetNewPosition();
80
81 ParticleType_t GetPType() const { return fPType; }
82
83 Double_t GetEnergy() const { return fEnergy; }
84
85 Double_t GetZ() const { return fZ; }
86 Double_t GetPhi() const { return fPhi; }
87 Double_t GetR() const { return fR; }
88 Double_t GetX() const { return fX; }
89
90 Double_t GetTheta() const { return fTheta; }
91 Double_t GetPsi() const { return fPsi; }
92
93 ClassDef(MParticle, 2) // Container which holds hostograms for the Hillas parameters
94};
95
96#endif
97
Note: See TracBrowser for help on using the repository browser.