]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/AliRoot/Track.hpp
Changes to compile on alpha
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliRoot / Track.hpp
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Author: Artur Szostak
4 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
5 //
6 ////////////////////////////////////////////////////////////////////////////////
7
8 #ifndef dHLT_ALIROOT_TRACK_HPP
9 #define dHLT_ALIROOT_TRACK_HPP
10
11 #include <TObject.h>
12 #include <Riostream.h>
13
14 #include "AliRoot/Point.hpp"
15 #include "AliRoot/Region.hpp"
16
17
18 namespace AliMUONHLT
19 {
20
21
22 class Track : public TObject
23 {
24 public:
25
26         /* Default constructor initialises everything to zero and fTriggerID to -1.
27          */
28         Track();
29         
30         /* Create a track object from the given parameters.
31            This constructor checks that momentum >= pt and sign is one of the
32            following values: -1, 0 or +1. If these conditions are violated then
33            the internal data is initialised as in the default constructor and an
34            error message is displayed.
35          */
36         Track(
37                 const Int_t triggerid, const Int_t sign, const Float_t momentum, const Float_t pt,
38                 const Point hits[10], const Region regions[10]
39         );
40
41         virtual ~Track() {};
42         
43         
44         // Get/et methods for the trigger ID.
45         void TriggerID(const Int_t value) { fTriggerID = value; };
46         Int_t TriggerID() const { return fTriggerID; };
47         
48         /* Get/Set method for the particle sign. The particle sign must be one
49            of the following values: -1, 0 or +1
50            If the new value is not in this range then an error message is
51            displayed and the internal value remain unchanged.
52          */
53         void ParticleSign(const Int_t value);
54         Int_t ParticleSign() const { return fParticleSign; };
55         
56         /* The get and set methods for the momentum and transverse momentum pt.
57            These methods check that the momentum is always equal or larger than
58            the pt. If not then the internal value are left unchanged and an
59            error message is displayed. The numbers must also be positive.
60          */
61         void P(const Float_t value);
62         Float_t P() const { return fP; };
63         void Pt(const Float_t value);
64         Float_t Pt() const { return fPt; };
65         
66         /* Returns the hit point for the specified chamber.
67            If the chamber number in out of bounds the point on the first
68            chamber is returned and an error message displayed.
69          */
70         Point& Hit(const UInt_t chamber);
71         const Point& Hit(const UInt_t chamber) const;
72         
73         /* Set method for hits. The chamber must be in the range [0..9]
74          */
75         void Hit(const UInt_t chamber, const Point& value);
76         
77         /* Returns the region of interest for the specified chamber.
78            If the chamber number in out of bounds the region on the first
79            chamber is returned and an error message displayed.
80          */
81         Region& RegionOfInterest(const UInt_t chamber);
82         const Region& RegionOfInterest(const UInt_t chamber) const;
83         
84         /* Set method for regions. The chamber must be in the range [0..9]
85          */
86         void RegionOfInterest(const UInt_t chamber, const Region& value);
87         
88         /* Checks to see if the all the hits are within their respective regions
89            of interest for each chamber. kTRUE is returned if they are and kFALSE
90            otherwise.
91          */
92         Bool_t HitsInRegions() const;
93
94         // ostream operator usefull for text output.
95         friend ostream& operator << (ostream& os, const Track& t);
96
97 private:
98
99         // Internal initialisation routine used by the constructors.
100         void Init();
101
102         Int_t fTriggerID;     // The ID number of the trigger record this track was found for.
103         Int_t fParticleSign;  // The sign of the particle.
104         Float_t fP;       // momentum of particle.
105         Float_t fPt;      // transverse momentum.
106         Point fHit[10];   // Fitted track hit coordinates for the 10 tracking chambers.
107         Region fRegionOfInterest[10];  // Region of interest per chamber.
108
109         ClassDef(Track, 1);  // Track data.
110 };
111
112
113 }; // AliMUONHLT
114
115 #endif // dHLT_ALIROOT_TRACK_HPP