1 #ifndef ALIHLTMUONTRACK_H
2 #define ALIHLTMUONTRACK_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 */
8 /// @file AliHLTMUONTrack.h
9 /// @author Indranil Das <indra.ehep@gmail.com> and Artur Szostak <artursz@iafrica.com>
10 /// @date 10 March 2010
11 /// @brief Declaration of the track class used to store converted dHLT track data.
17 class AliHLTMUONTriggerRecord;
18 class AliHLTMUONRecHit;
21 * AliHLTMUONTrack stores converted dHLT raw track data from HLT raw data blocks
22 * as a ROOT object. This class is mainly for testing or as a helper object for
23 * dHLT specific analysis, since it is sometimes easier to store and handle ROOT
24 * objects than the raw data blocks.
26 class AliHLTMUONTrack : public TObject
29 * Stream operator for usage with std::ostream classes.
30 * Allows usage such as:
31 * AliHLTMUONTrack t; std::cout << t;
33 friend std::ostream& operator << (
35 const AliHLTMUONTrack& track
41 * Constructor for creating a new track object.
42 * \note this class does not take ownership of the hit or trigger record
43 * objects and will not attempt to delete them. This must be done by the
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 invmom Inverse bending momentum (GeV/c).
51 * @param thetaX The non-bending plane slope of the fitted track.
52 * @param thetaY The bending plane slope of the fitted track.
53 * @param x X coordinate of the particle's distance of closest
54 * approach (DCA) position (cm).
55 * @param y Y coordinate of the particle's DCA position (cm).
56 * @param z Z coordinate of the particle's DCA position (cm).
57 * @param chi2 The chi squared of the track fit.
58 * @param trigrec Corresponding trigger record used as a seed to find
60 * @param hits The array of 16 hit coordinates found for the track.
61 * If NULL then then all hit coordinates are set to empty.
64 Int_t id = -1, Int_t sign = 0,
65 Float_t px = 0, Float_t py = 0, Float_t pz = 0,
66 Float_t invmom = 0, Float_t thetaX = 0, Float_t thetaY = 0,
67 Float_t x = 0, Float_t y = 0, Float_t z = 0,
69 const AliHLTMUONTriggerRecord* trigrec = NULL,
70 const AliHLTMUONRecHit* hits[16] = NULL
76 virtual ~AliHLTMUONTrack() {}
79 * Returns the track ID number, which should be unique for an event.
81 Int_t Id() const { return fId; }
84 * Returns the sign of the particle: -1, 1 or 0 if the sign is unknown.
86 Int_t Sign() const { return fSign; }
89 * Returns the inverse momentum in the bending plane, i.e. 1/p_yz, in units c/GeV.
91 Float_t InverseBendingMomentum() const { return fInverseBendingMomentum; }
94 * Returns the slope of the fitted track in the non-bending plane.
96 Float_t ThetaX() const { return fThetaX; }
99 * Returns the slope of the fitted track in the bending plane.
101 Float_t ThetaY() const { return fThetaY; }
104 * Returns the momentum vector with components in GeV/c.
106 const TVector3& Momentum() const { return fMomentum; }
109 * Returns the X component of the particle's momentum in GeV/c.
111 Double_t Px() const { return fMomentum.Px(); }
114 * Returns the Y component of the particle's momentum in GeV/c.
116 Double_t Py() const { return fMomentum.Py(); }
119 * Returns the Z component of the particle's momentum in GeV/c.
121 Double_t Pz() const { return fMomentum.Pz(); }
124 * Returns the momentum magnitude of the particle in GeV/c.
126 Double_t P() const { return fMomentum.Mag(); }
129 * Returns the transverse momentum of the particle in GeV/c.
131 Double_t Pt() const { return fMomentum.Pt(); }
134 * Returns the polar angle of the momentum vector in radians.
136 Double_t Polar() const { return fMomentum.Theta(); }
139 * Returns the azimuthal angle of the transverse momentum in radians.
141 Double_t Phi() const { return fMomentum.Phi(); }
144 * Returns the distance of closest approach (DCA) position in centimetres.
146 const TVector3& VertexDCA() const { return fVertexDCA; }
149 * Returns the non-bending plane coordinate for the distance of closest approach (DCA) in cm.
151 Double_t X() const { return fVertexDCA.X(); }
154 * Returns the bending plane coordinate for the distance of closest approach (DCA) in cm.
156 Double_t Y() const { return fVertexDCA.Y(); }
159 * Returns the z coordinate for the distance of closest approach (DCA) in cm.
161 Double_t Z() const { return fVertexDCA.Z(); }
164 * Returns the chi squared of the track fit, indicating the quality of
167 Float_t Chi2() const { return fChi2; }
170 * Returns the trigger record corresponding to this track.
171 * If NULL is returned then no trigger record was found or associated
174 const AliHLTMUONTriggerRecord* TriggerRecord() const { return fTrigRec; }
177 * Returns the i'th hit set for this track.
178 * If NULL is returned then no hit was found or set for that hit position.
179 * @param i Specifies the number of the hit to return.
180 * Valid values are in the range [0..15].
182 const AliHLTMUONRecHit* Hit(Int_t i) const;
185 * Returns the first hit found on the specified tracking chamber.
186 * If NULL is returned then no hit was found or set for that chamber.
187 * @param chamber Specifies the chamber for which to return the hit.
188 * Valid values are in the range [1..14].
190 const AliHLTMUONRecHit* HitByChamber(Int_t chamber) const;
193 * Prints the details of the track.
194 * @param option A case sensitive string that can contain one of the
196 * "compact" - Prints just the momentum, sign and ID of the track
198 * "detail" - Prints also the hit information.
199 * "all" - Prints all known information about this track.
200 * If the string contains an empty option or NULL then the default is
201 * to print compactly.
203 virtual void Print(Option_t* option = NULL) const;
205 // Methods inherited from TObject
206 virtual Bool_t IsSortable() const { return kTRUE; }
207 Int_t Compare(const TObject* obj) const;
209 // Implement comparison operators.
210 bool operator == (const AliHLTMUONTrack& track) const;
212 bool operator != (const AliHLTMUONTrack& track) const
214 return not this->operator == (track);
219 // Do not allow copying of this class.
220 AliHLTMUONTrack(const AliHLTMUONTrack& track);
221 AliHLTMUONTrack& operator = (const AliHLTMUONTrack& track);
223 Int_t fId; ///< Track ID number which is unique for a particular event.
224 Int_t fSign; ///< The sign of the particle.
225 Float_t fInverseBendingMomentum; ///< One over the momentum of the fitted track in GeV/c.
226 Float_t fThetaX; ///< The slope of the fitted track in the non-bending plane.
227 Float_t fThetaY; ///< The slope of the fitted track in the bending plane.
228 TVector3 fMomentum; ///< Momentum vector of the particle in GeV/c.
229 TVector3 fVertexDCA; ///< The position for the distance of closest approach to the vertex in cm.
230 Float_t fChi2; ///< Chi squared of fit.
231 const AliHLTMUONTriggerRecord* fTrigRec; ///< Corresponding trigger record.
232 const AliHLTMUONRecHit* fHit[16]; ///< Particle hits on tracking chambers.
234 ClassDef(AliHLTMUONTrack, 1); // Track object containing data converted from a dHLT internal track structure.
237 #endif // ALIHLTMUONTRACK_H