]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONMansoTrack.h
updated cluster histo component for ITS (Gaute)
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONMansoTrack.h
1 #ifndef ALIHLTMUONMANSOTRACK_H
2 #define ALIHLTMUONMANSOTRACK_H
3 /* This file is property of and copyright by the ALICE HLT Project        *
4  * ALICE Experiment at CERN, All rights reserved.                         *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 ///
10 /// @file   AliHLTMUONMansoTrack.h
11 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @date   29 Sep 2007
13 /// @brief  Declaration of the Manso track class used to store converted track data.
14 ///
15
16 #include "TObject.h"
17 #include "TVector3.h"
18
19 class AliHLTMUONTriggerRecord;
20 class AliHLTMUONRecHit;
21
22 /**
23  * AliHLTMUONMansoTrack stores converted dHLT raw track data as a ROOT object.
24  * This class is mainly for testing or as a helper object for dHLT specific analysis,
25  * since it is sometimes easier to store and handle ROOT objects.
26  */
27 class AliHLTMUONMansoTrack : public TObject
28 {
29         /**
30          * Stream operator for usage with std::ostream classes.
31          * Allows usage such as:
32          *   AliHLTMUONMansoTrack t; std::cout << t;
33          */
34         friend std::ostream& operator << (
35                         std::ostream& stream,
36                         const AliHLTMUONMansoTrack& track
37                 );
38
39 public:
40
41         /**
42          * Constructor for creating a track object with none, some or all 4 hits
43          * specified. Note: this class does not take ownership of the hit or trigger
44          * record objects and will not attempt to delete them.
45          * @param id       The track ID number which must be unique for any event.
46          * @param sign     The particle's sign: -1, 1 or 0 if unknown.
47          * @param px       X component of the particle's momentum (GeV/c).
48          * @param py       Y component of the particle's momentum (GeV/c).
49          * @param pz       Z component of the particle's momentum (GeV/c).
50          * @param chi2     The chi squared of the track fit.
51          * @param trigrec  Corresponding trigger record used as a seed to find
52          *                 this track.
53          * @param hit7     Hit on chamber 7, tracking station 4.
54          * @param hit8     Hit on chamber 8, tracking station 4.
55          * @param hit9     Hit on chamber 9, tracking station 5.
56          * @param hit10    Hit on chamber 10, tracking station 5.
57          * @param zf    The Z coordinate of the middle of the magnetic field assumed
58          *              during momentum calculation.
59          * @param qbl   The integrated magnetic field strength assumed during momentum
60          *              calculation.
61          */
62         AliHLTMUONMansoTrack(
63                         Int_t id = -1, Int_t sign = 0,
64                         Float_t px = 0, Float_t py = 0, Float_t pz = 0,
65                         Float_t chi2 = -1,
66                         const AliHLTMUONTriggerRecord* trigrec = NULL,
67                         const AliHLTMUONRecHit* hit7 = NULL,
68                         const AliHLTMUONRecHit* hit8 = NULL,
69                         const AliHLTMUONRecHit* hit9 = NULL,
70                         const AliHLTMUONRecHit* hit10 = NULL,
71                         Float_t zf = 0, Float_t qbl = 0
72                 );
73         
74         /**
75          * Default destructor.
76          */
77         virtual ~AliHLTMUONMansoTrack() {}
78
79         /**
80          * Returns the track ID number, which is unique for an event.
81          */
82         Int_t Id() const { return fId; }
83         
84         /**
85          * Returns the sign of the particle: -1, 1 or 0 if the sign is unknown.
86          */
87         Int_t Sign() const { return fSign; }
88
89         /**
90          * Returns the momentum vector with components in GeV/c.
91          */
92         const TVector3& Momentum() const { return fMomentum; }
93
94         /**
95          * Returns the X component of the particle's momentum in GeV/c.
96          */
97         Double_t Px() const { return fMomentum.Px(); }
98
99         /**
100          * Returns the Y component of the particle's momentum in GeV/c.
101          */
102         Double_t Py() const { return fMomentum.Py(); }
103
104         /**
105          * Returns the Z component of the particle's momentum in GeV/c.
106          */
107         Double_t Pz() const { return fMomentum.Pz(); }
108
109         /**
110          * Returns the momentum magnitude of the particle in GeV/c.
111          */
112         Double_t P() const { return fMomentum.Mag(); }
113
114         /**
115          * Returns the transverse momentum of the particle in GeV/c.
116          */
117         Double_t Pt() const { return fMomentum.Pt(); }
118
119         /**
120          * Returns the polar angle of the momentum vector in radians.
121          */
122         Double_t Polar() const { return fMomentum.Theta(); }
123
124         /**
125          * Returns the azimuthal angle of the transverse momentum in radians.
126          */
127         Double_t Phi() const { return fMomentum.Phi(); }
128
129         /**
130          * Returns the chi squared of the track fit, indicating the quality of
131          * the fit.
132          */
133         Float_t Chi2() const { return fChi2; }
134
135         /**
136          * Returns the trigger record corresponding to this track.
137          * If NULL is returned then no trigger record was found.
138          */
139         const AliHLTMUONTriggerRecord* TriggerRecord() const { return fTrigRec; }
140
141         /**
142          * Returns tje hit found on the specified tracking chamber.
143          * If NULL is returned then no hit was found or set.
144          * @param chamber  Specifies the chamber for which to return the hit.
145          *                 Valid values are in the range [7..10].
146          */
147         const AliHLTMUONRecHit* Hit(Int_t chamber) const;
148         
149         /**
150          * Prints the details of the track.
151          * @param option  A case sensitive string that can contain one of the
152          *     following strings:
153          *       "compact" - Prints just the momentum, sign and ID of the track
154          *                   in a terse format.
155          *       "detail" - Prints also the hit information.
156          *       "all" - Prints all known information about this track.
157          *     If the string contains an empty option or NULL then the default is
158          *     to print compactly.
159          */
160         virtual void Print(Option_t* option = NULL) const;
161         
162         // Methods inherited from TObject
163         virtual Bool_t IsSortable() const { return kTRUE; }
164         Int_t Compare(const TObject* obj) const;
165
166         // Implement comparison operators.
167         bool operator == (const AliHLTMUONMansoTrack& track) const;
168
169         bool operator != (const AliHLTMUONMansoTrack& track) const
170         {
171                 return not this->operator == (track);
172         }
173
174 private:
175
176         // Do not allow copying of this class.
177         AliHLTMUONMansoTrack(const AliHLTMUONMansoTrack& track);
178         AliHLTMUONMansoTrack& operator = (const AliHLTMUONMansoTrack& track);
179         
180         Int_t fId; ///< Track ID number which is unique for a particular event.
181         Int_t fSign;  ///< The sign of the particle.
182         TVector3 fMomentum; ///< Momentum vector of the particle in GeV/c.
183         Float_t fChi2; ///< Chi squared of fit.
184         const AliHLTMUONTriggerRecord* fTrigRec;  ///< Corresponding trigger record.
185         const AliHLTMUONRecHit* fHit[4];   ///< Particle hits on tracking chambers 7 to 10.
186         
187         // The following is debugging information and may not be filled if the
188         // dHLT components were not set to produce this information.
189         
190         // Parameters used in momentum estimation:
191         Float_t fZmiddle; ///< Particle momentum X component in GeV/c.
192         Float_t fQBL;     ///< The integrated magnetic field times charge in (T.m) tesla metres.
193
194         ClassDef(AliHLTMUONMansoTrack, 3); // Manso track object containing data converted from a dHLT internal track structure.
195 };
196
197 #endif // ALIHLTMUONMANSOTRACK_H