1 #ifndef ALIHLTMUONTRIGGERRECORD_H
2 #define ALIHLTMUONTRIGGERRECORD_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 */
10 /// @file AliHLTMUONTriggerRecord.h
11 /// @author Artur Szostak <artursz@iafrica.com>
13 /// @brief Declaration of the trigger record structure in ROOT object format for dHLT.
21 * Trigger record class containing information about a dimuon L0 trigger
22 * local board decision in a ROOT object.
23 * This class is mainly for testing or as a helper object for dHLT specific analysis,
24 * since it is sometimes easier to store and handle ROOT objects.
26 class AliHLTMUONTriggerRecord : public TObject
29 * Stream operator for usage with std::ostream classes.
30 * Allows usage such as:
31 * AliHLTMUONTriggerRecord tr; std::cout << tr;
33 friend std::ostream& operator << (
35 const AliHLTMUONTriggerRecord& trigrec
41 * Constructor for creating a new trigger record.
42 * @param id The trigger record ID number unique for an event.
43 * @param sign The particle's sign. Must be -1, 1 or 0 if the sign is unknown.
44 * @param px X component of the particle's momentum.
45 * @param py Y component of the particle's momentum.
46 * @param pz Z component of the particle's momentum.
47 * @param sourceDDL The DDL from which this trigger record originates.
48 * @param zf The Z coordinate of the middle of the magnetic field assumed
49 * during momentum calculation.
50 * @param qbl The integrated magnetic field strength assumed during momentum
53 AliHLTMUONTriggerRecord(
67 virtual ~AliHLTMUONTriggerRecord() {}
70 * Returns the trigger record ID number, which is unique for an event.
72 Int_t Id() const { return fId; }
75 * Returns the sign of the particle: -1, 1 or 0 if the sign is unknown.
77 Int_t Sign() const { return fSign; }
80 * Returns the momentum vector with components in GeV/c.
82 const TVector3& Momentum() const { return fMomentum; }
85 * Returns the X component of the particle's momentum in GeV/c.
87 Double_t Px() const { return fMomentum.Px(); }
90 * Returns the Y component of the particle's momentum in GeV/c.
92 Double_t Py() const { return fMomentum.Py(); }
95 * Returns the Z component of the particle's momentum in GeV/c.
97 Double_t Pz() const { return fMomentum.Pz(); }
100 * Returns the momentum magnitude of the particle in GeV/c.
102 Double_t P() const { return fMomentum.Mag(); }
105 * Returns the transverse momentum of the particle in GeV/c.
107 Double_t Pt() const { return fMomentum.Pt(); }
110 * Returns the polar angle of the momentum vector in radians.
112 Double_t Polar() const { return fMomentum.Theta(); }
115 * Returns the azimuthal angle of the transverse momentum in radians.
117 Double_t Phi() const { return fMomentum.Phi(); }
120 * Returns the hit coordinate on the specified chamber in the AliRoot
122 * @param chamber The chamber for which to fetch the hit. Valid values
123 * are in the range [11..14].
125 const TVector3& Hit(Int_t chamber) const;
128 * Returns the X coordinate of the reconstructed hit in centimetres.
129 * @param chamber The chamber for which to fetch the X coordinate.
130 * Valid values are in the range [11..14].
132 Double_t X(Int_t chamber) const { return Hit(chamber).X(); }
135 * Returns the Y coordinate of the reconstructed hit in centimetres.
136 * @param chamber The chamber for which to fetch the Y coordinate.
137 * Valid values are in the range [11..14].
139 Double_t Y(Int_t chamber) const { return Hit(chamber).Y(); }
142 * Returns the Z coordinate of the reconstructed hit in centimetres.
143 * @param chamber The chamber for which to fetch the Z coordinate.
144 * Valid values are in the range [11..14].
146 Double_t Z(Int_t chamber) const { return Hit(chamber).Z(); }
149 * Returns the source DDL from which this trigger record originates.
150 * -1 is returned if this was not set.
152 Int_t SourceDDL() const { return fSourceDDL; }
155 * Returns the detector element ID number for the hit on the specified
156 * chamber. -1 is returned if this information was not set.
157 * @param chamber The chamber for which to fetch the detector element ID.
158 * Valid values are in the range [11..14].
160 Int_t DetElemId(Int_t chamber) const;
163 * Returns the 16 bit X pattern from the local board.
164 * -1 is returned if this information was not set.
165 * @param chamber The chamber for which to fetch the bit pattern.
166 * Valid values are in the range [11..14].
167 * \param board The board for which to fetch the bit pattern in the range [0..2].
168 * 0 indicates the previous board, 1 the central and 2 the next board.
170 Int_t PatternX(Int_t chamber, Int_t board) const;
173 * Returns the 16 bit Y pattern from the local board.
174 * -1 is returned if this information was not set.
175 * @param chamber The chamber for which to fetch the bit pattern.
176 * Valid values are in the range [11..14].
177 * \param board The board for which to fetch the bit pattern in the range [0..2].
178 * 0 indicates the previous board, 1 the central and 2 the next board.
180 Int_t PatternY(Int_t chamber, Int_t board) const;
183 * Returns the Z coordinate in the middle of the magnetic field used to
184 * calculate the momentum.
186 Float_t Zmiddle() const { return fZmiddle; }
189 * Returns the integrated magnetic field strength times polarity used in
190 * the calculation of the momentum. Value returned in (T.m) tesla metres.
192 Float_t QBL() const { return fQBL; }
195 * Sets the hit coordinate (in AliRoot global coordinates) on the
197 * @param chamber The chamber for which to set the hit. Valid values
198 * are in the range [11..14].
199 * @param x The X coordinate of the hit in centimetres.
200 * @param y The Y coordinate of the hit in centimetres.
201 * @param z The Z coordinate of the hit in centimetres.
203 void SetHit(Int_t chamber, Float_t x, Float_t y, Float_t z);
206 * Sets the hit coordinate on a given chamber with the detection element ID.
207 * @param chamber The chamber for which to set the hit. Valid values
208 * are in the range [11..14].
209 * @param x The X coordinate of the hit in centimetres.
210 * @param y The Y coordinate of the hit in centimetres.
211 * @param z The Z coordinate of the hit in centimetres.
212 * @param detElemId The detection element ID where the hit was found.
214 void SetHit(Int_t chamber, Float_t x, Float_t y, Float_t z, Int_t detElemId);
217 * Sets the debugging information for the hit on the specified chamber.
218 * @param chamber The chamber for which to set the debugging information.
219 * Valid values are in the range [11..14].
220 * @param patternX Array of X bit pattern from the local boards.
221 * @param patternY Array of Y bit pattern from the local boards.
222 * \note The bit patterns in the array are in the order: [previous, central, next].
224 void SetHitDebugInfo(Int_t chamber, UShort_t patternX[3], UShort_t patternY[3]);
227 * Sets the debugging information for the hit on the specified chamber.
228 * @param zmiddle The z coordinate of the middle of the magnetic field.
229 * @param bfieldintegral The magnetic field integral times field polarity.
231 void SetDebugInfo(Float_t zmiddle, Float_t bfieldintegral);
234 * Prints the details of the trigger record.
235 * @param option A case sensitive string that can contain one of the
237 * "compact" - Prints just the momentum, sign and ID of the trigger
238 * record in a terse format.
239 * "detail" - Prints also the hit information.
240 * "all" - Prints all known information about this trigger record.
241 * If the string contains an empty option or NULL then the default is
242 * to print compactly.
244 virtual void Print(Option_t* option = NULL) const;
246 // Methods inherited from TObject
247 virtual Bool_t IsSortable() const { return kTRUE; }
248 Int_t Compare(const TObject* obj) const;
250 // Implement comparison operators.
251 bool operator == (const AliHLTMUONTriggerRecord& trigrec) const;
253 bool operator != (const AliHLTMUONTriggerRecord& trigrec) const
255 return not this->operator == (trigrec);
260 Int_t fId; ///< Each trigger record should have an ID number unique for a given event.
261 Int_t fSign; ///< The sign of the particle: -1 or 1. 0 indicates unknown value.
262 TVector3 fMomentum; ///< Momentum vector of the particle in GeV/c.
263 TVector3 fHit[4]; ///< hit coordinates on trigger chambers 11 to 14.
265 // The following is debugging information and may not be filled if the
266 // dHLT components were not set to produce this information.
267 Int_t fSourceDDL; ///< The DDL from which this trigger record originates.
268 Int_t fDetElemId[4]; ///< The detector element ID for the hit on each chamber 11 to 14.
269 Int_t fPatternX[4][3]; ///< The X strip pattern for chambers 11 to 14 and previous, central and next local boards. -1 if invalid.
270 Int_t fPatternY[4][3]; ///< The Y strip pattern for chambers 11 to 14 and previous, central and next local boards. -1 if invalid.
272 // Parameters used in momentum estimation:
273 Float_t fZmiddle; ///< Particle momentum X component in GeV/c.
274 Float_t fQBL; ///< The integrated magnetic field times field polarity in (T.m) tesla metres.
276 ClassDef(AliHLTMUONTriggerRecord, 4); // Trigger record object translated from dHLT internal raw data.
279 #endif // ALIHLTMUONTRIGGERRECORD_H