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

Last change on this file since 1369 was 1364, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.2 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 static Double_t ZofR(Double_t *x, Double_t *k=NULL);
37 static Double_t RofZ(Double_t *x, Double_t *k=NULL);
38
39 void operator=(MParticle &p)
40 {
41 fZ = p.fZ;
42 fR = p.fR;
43 fPhi = p.fPhi;
44 fTheta = p.fTheta;
45 fPsi = p.fPsi;
46 }
47
48 // ----------------------------------------------------------------
49
50 static Double_t Planck(Double_t *x, Double_t *k=NULL);
51
52 // ----------------------------------------------------------------
53
54 void SetIsPrimary(Bool_t is=kTRUE) { is ? SetBit(kEIsPrimary) : ResetBit(kEIsPrimary); }
55 Bool_t IsPrimary() const { return TestBit(kEIsPrimary); }
56
57 // ----------------------------------------------------------------
58
59 virtual Double_t GetInteractionLength() const { AbstractMethod("GetInteractionLength"); return 0; }
60
61 void SetEnergy(Double_t e) { fEnergy = e; }
62 void SetZ(Double_t z) { fZ = z; }
63
64 void SetNewDirection(Double_t theta, Double_t phi);
65 Bool_t SetNewPosition(Double_t dr);
66 Bool_t SetNewPosition();
67
68 Double_t GetEnergy() const { return fEnergy; }
69
70 Double_t GetZ() const { return fZ; }
71 Double_t GetPhi() const { return fPhi; }
72 Double_t GetR() const { return fR; }
73
74 Double_t GetTheta() const { return fTheta; }
75 Double_t GetPsi() const { return fPsi; }
76
77 ClassDef(MParticle, 1) // Container which holds hostograms for the Hillas parameters
78};
79
80#endif
81
Note: See TracBrowser for help on using the repository browser.