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 containing data
14 * corresponding to the L0 trigger local board output.
22 * Trigger record class containing information about a dimuon L0 trigger
23 * local board decision.
25 class AliHLTMUONTriggerRecord : public TObject
28 * Stream operator for usage with std::ostream classes.
29 * Allows usage such as:
30 * AliHLTMUONTriggerRecord tr; std::cout << tr;
32 friend std::ostream& operator << (
34 const AliHLTMUONTriggerRecord& trigrec
40 * Constructor for creating a new trigger record.
41 * @param id The trigger record ID number unique for an event.
42 * @param sign The particle's sign. Must be -1, 1 or 0 if the sign is unknown.
43 * @param px X component of the particle's momentum.
44 * @param py Y component of the particle's momentum.
45 * @param pz Z component of the particle's momentum.
46 * @param sourceDDL The DDL from which this trigger record originates.
47 * @param zf The Z coordinate of the middle of the magnetic field assumed
48 * during momentum calculation.
49 * @param qbl The integrated magnetic field strength assumed during momentum
52 AliHLTMUONTriggerRecord(
63 virtual ~AliHLTMUONTriggerRecord() {}
66 * Returns the trigger record ID number, which is unique for an event.
68 Int_t Id() const { return fId; }
71 * Returns the sign of the particle: -1, 1 or 0 if the sign is unknown.
73 Int_t Sign() const { return fSign; }
76 * Returns the momentum vector with components in GeV/c.
78 const TVector3& Momentum() const { return fMomentum; }
81 * Returns the X component of the particle's momentum in GeV/c.
83 Double_t Px() const { return fMomentum.Px(); }
86 * Returns the Y component of the particle's momentum in GeV/c.
88 Double_t Py() const { return fMomentum.Py(); }
91 * Returns the Z component of the particle's momentum in GeV/c.
93 Double_t Pz() const { return fMomentum.Pz(); }
96 * Returns the momentum magnitude of the particle in GeV/c.
98 Double_t P() const { return fMomentum.Mag(); }
101 * Returns the transverse momentum of the particle in GeV/c.
103 Double_t Pt() const { return fMomentum.Pt(); }
106 * Returns the polar angle of the momentum vector in radians.
108 Double_t Polar() const { return fMomentum.Theta(); }
111 * Returns the azimuthal angle of the transverse momentum in radians.
113 Double_t Phi() const { return fMomentum.Phi(); }
116 * Returns the hit coordinate on the specified chamber in the AliRoot
118 * @param chamber The chamber for which to fetch the hit. Valid values
119 * are in the range [11..14].
121 const TVector3& Hit(Int_t chamber) const;
124 * Returns the X coordinate of the reconstructed hit in centimetres.
125 * @param chamber The chamber for which to fetch the hit. Valid values
126 * are in the range [11..14].
128 Double_t X(Int_t chamber) const { return Hit(chamber).X(); }
131 * Returns the Y coordinate of the reconstructed hit in centimetres.
132 * @param chamber The chamber for which to fetch the hit. Valid values
133 * are in the range [11..14].
135 Double_t Y(Int_t chamber) const { return Hit(chamber).Y(); }
138 * Returns the Z coordinate of the reconstructed hit in centimetres.
139 * @param chamber The chamber for which to fetch the hit. Valid values
140 * are in the range [11..14].
142 Double_t Z(Int_t chamber) const { return Hit(chamber).Z(); }
145 * Returns the source DDL from which this trigger record originates.
146 * -1 is returned if this was not set.
148 Int_t SourceDDL() const { return fSourceDDL; }
151 * Returns the detector element ID number for the hit on the specified
152 * chamber. -1 is returned if this information was not set.
153 * @param chamber The chamber for which to fetch the hit. Valid values
154 * are in the range [11..14].
156 Int_t DetElemId(Int_t chamber) const;
159 * Returns the 16 bit X pattern from the local board.
160 * -1 is returned if this information was not set.
161 * @param chamber The chamber for which to fetch the hit. Valid values
162 * are in the range [11..14].
164 Int_t PatternX(Int_t chamber) const;
167 * Returns the 16 bit Y pattern from the local board.
168 * -1 is returned if this information was not set.
169 * @param chamber The chamber for which to fetch the hit. Valid values
170 * are in the range [11..14].
172 Int_t PatternY(Int_t chamber) const;
175 * Returns the Z coordinate in the middle of the magnetic field used to
176 * calculate the momentum.
178 Float_t Zmiddle() const { return fZmiddle; }
181 * Returns the integrated magnetic field strength times charge used in
182 * the calculation of the momentum. Value returned in (T.m) tesla metres.
184 Float_t QBL() const { return fQBL; }
187 * Sets the hit coordinate (in AliRoot global coordinates) on the
189 * @param chamber The chamber for which to fetch the hit. Valid values
190 * are in the range [11..14].
191 * @param x The X coordinate of the hit in centimetres.
192 * @param y The Y coordinate of the hit in centimetres.
193 * @param z The Z coordinate of the hit in centimetres.
195 void SetHit(Int_t chamber, Float_t x, Float_t y, Float_t z);
198 * Sets the debugging information for the hit on the specified chamber.
199 * @param chamber The chamber for which to fetch the hit. Valid values
200 * are in the range [11..14].
201 * @param detElemId The detector element ID.
202 * @param patterX The X bit pattern from the local board.
203 * @param patterY The Y bit pattern from the local board.
205 void SetHitDebugInfo(
207 Int_t detElemId, UShort_t patternX, UShort_t patternY
211 * Prints the details of the trigger record.
212 * @param option A case sensitive string that can contain one of the
214 * "compact" - Prints just the momentum, sign and ID of the trigger
215 * record in a terse format.
216 * "detail" - Prints also the hit information.
217 * "all" - Prints all known information about this trigger record.
218 * If the string contains an empty option or NULL then the default is
219 * to print compactly.
221 virtual void Print(Option_t* option = NULL) const;
223 // Methods inherited from TObject
224 virtual Bool_t IsSortable() const { return kTRUE; }
225 Int_t Compare(const TObject* obj) const;
227 // Implement comparison operators.
228 bool operator == (const AliHLTMUONTriggerRecord& trigrec) const;
230 bool operator != (const AliHLTMUONTriggerRecord& trigrec) const
232 return not this->operator == (trigrec);
237 Int_t fId; // Each trigger record should have an ID number unique for a given event.
238 Int_t fSign; // The sign of the particle: -1 or 1. 0 indicates unknown value.
239 TVector3 fMomentum; // Momentum vector of the particle in GeV/c.
240 TVector3 fHit[4]; // hit coordinates on trigger chambers 11 to 14.
242 // The following is debugging information and may not be filled if the
243 // dHLT components were not set to produce this information.
244 Int_t fSourceDDL; // The DDL from which this trigger record originates.
245 Int_t fDetElemId[4]; // The detector element ID for the hit on each chamber 11 to 14.
246 Int_t fPatternX[4]; // The X pattern from the local board structure for chambers 11 to 14. -1 if invalid.
247 Int_t fPatternY[4]; // The Y pattern from the local board structure for chambers 11 to 14. -1 if invalid.
249 // Parameters used in momentum estimation:
250 Float_t fZmiddle; // Particle momentum X component in GeV/c.
251 Float_t fQBL; // The integrated magnetic field times charge in (T.m) tesla metres.
253 ClassDef(AliHLTMUONTriggerRecord, 1); // Trigger record object translated from dHLT internal raw data.
256 #endif // ALIHLTMUONTRIGGERRECORD_H