]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/OnlineAnalysis/AliHLTMUONCalculations.h
Fixes to trigger reconstruction component to handle real data better.
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONCalculations.h
CommitLineData
364df03a 1#ifndef ALIHLTMUONCALCULATIONS_H
2#define ALIHLTMUONCALCULATIONS_H
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
1d8ae082 6// $Id$
364df03a 7
8////////////////////////////////////////////////////////////////////////////////
9//
10// Author: Artur Szostak
11// Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
12//
13////////////////////////////////////////////////////////////////////////////////
14
15#include "AliHLTMUONDataTypes.h"
16
a3d4b6ba 17extern "C" struct AliHLTMUONTriggerRecordStruct;
18
b92524d0 19/*
c9537879 20 * Note: this class uses static global variables so thread protection must be
a3d4b6ba 21 * explicit in any multi-threaded usage. Or the class should be rewritten.
364df03a 22 */
e6357f88 23class AliHLTMUONCalculations
24{
25public:
26
a3d4b6ba 27 /// Calculates the momentum estimate given two track points behind the
28 /// dipole magnet and assuming origin is the interaction point.
e6357f88 29 static bool ComputeMomentum(
30 AliHLTFloat32_t x1,
31 AliHLTFloat32_t y1, AliHLTFloat32_t y2,
32 AliHLTFloat32_t z1, AliHLTFloat32_t z2
33 );
34
35 static AliHLTFloat32_t Zf() { return fgZf; }
36 static void Zf(AliHLTFloat32_t value) { fgZf = value; }
b92524d0 37 static AliHLTFloat32_t QBL();
38 static void QBL(AliHLTFloat32_t value);
e6357f88 39
40 static AliHLTMUONParticleSign Sign() { return fgSign; }
41 static AliHLTFloat32_t Px() { return fgPx; }
42 static AliHLTFloat32_t Py() { return fgPy; }
43 static AliHLTFloat32_t Pz() { return fgPz; }
c9537879 44
45 /// Calculates the invariant mass for a pair of particles.
46 static AliHLTFloat32_t ComputeMass(
47 AliHLTFloat32_t massA,
48 AliHLTFloat32_t pxA,
49 AliHLTFloat32_t pyA,
50 AliHLTFloat32_t pzA,
51 AliHLTFloat32_t massB,
52 AliHLTFloat32_t pxB,
53 AliHLTFloat32_t pyB,
54 AliHLTFloat32_t pzB
55 );
56
a3d4b6ba 57 static bool FitLineToTriggerRecord(const AliHLTMUONTriggerRecordStruct& trigger);
58
59 static bool FitLineToTriggerRecord(
60 const AliHLTMUONTriggerRecordStruct& trigger,
61 const bool hitset[4]
62 );
63
64 static AliHLTFloat32_t IdealZ1() { return fgIdealZ1; }
65 static void IdealZ1(AliHLTFloat32_t value) { fgIdealZ1 = value; }
66 static AliHLTFloat32_t IdealZ2() { return fgIdealZ2; }
67 static void IdealZ2(AliHLTFloat32_t value) { fgIdealZ2 = value; }
68
69 static AliHLTFloat32_t IdealX1() { return fgIdealX1; }
70 static AliHLTFloat32_t IdealY1() { return fgIdealY1; }
71 static AliHLTFloat32_t IdealX2() { return fgIdealX2; }
72 static AliHLTFloat32_t IdealY2() { return fgIdealY2; }
73
74 static bool FitLineToData(
75 const AliHLTFloat32_t* x, const AliHLTFloat32_t* y,
76 const AliHLTFloat32_t* z, AliHLTUInt32_t n
77 );
78
462e3880 79 static bool FitLineToData(
80 const AliHLTFloat32_t* x, const AliHLTFloat32_t* z,
81 AliHLTUInt32_t n
82 );
83
a3d4b6ba 84 static AliHLTFloat32_t Mzx() { return fgMzx; }
85 static AliHLTFloat32_t Mzy() { return fgMzy; }
86 static AliHLTFloat32_t Czx() { return fgCzx; }
87 static AliHLTFloat32_t Czy() { return fgCzy; }
88
89 static AliHLTFloat32_t ComputeChi2(
90 const AliHLTFloat32_t* x, const AliHLTFloat32_t* y,
91 const AliHLTFloat32_t* z, AliHLTUInt32_t n
92 );
93
94 static AliHLTFloat32_t SigmaX2() { return fgSigmaX2; }
95 static void SigmaX2(AliHLTFloat32_t value) { fgSigmaX2 = (value != 0 ? value : 1.); }
96 static AliHLTFloat32_t SigmaY2() { return fgSigmaY2; }
97 static void SigmaY2(AliHLTFloat32_t value) { fgSigmaY2 = (value != 0 ? value : 1.); }
98
e6357f88 99private:
100
101 // Prevent destroying or creating of this object.
102 AliHLTMUONCalculations();
103 ~AliHLTMUONCalculations();
104
a3d4b6ba 105 static AliHLTFloat32_t fgZf; /// The Z coordinate of the middle of the dipole magnetic field.
106 static AliHLTFloat32_t fgQBLScaled; /// The integrated field strength times units of charge (T.m.*c/1e9)
107
108 static AliHLTMUONParticleSign fgSign; /// The calculated sign.
109 static AliHLTFloat32_t fgPx; /// The calculated X momentum (GeV/c).
110 static AliHLTFloat32_t fgPy; /// The calculated Y momentum (GeV/c).
111 static AliHLTFloat32_t fgPz; /// The calculated Z momentum (GeV/c).
112
113 static AliHLTFloat32_t fgSigmaX2; /// The sigma squared value for the variance / uncertainty in X coordinates.
114 static AliHLTFloat32_t fgSigmaY2; /// The sigma squared value for the variance / uncertainty in Y coordinates.
115
116 static AliHLTFloat32_t fgMzx; /// Calculated slope of the line fitted to the ZX plane. (x = fgMzx * z + fgCzx)
117 static AliHLTFloat32_t fgMzy; /// Calculated slope of the line fitted to the ZY plane. (y = fgMzy * z + fgCzy)
118 static AliHLTFloat32_t fgCzx; /// Calculated coefficient of the line fitted to the ZX plane. (x = fgMzx * z + fgCzx)
119 static AliHLTFloat32_t fgCzy; /// Calculated coefficient of the line fitted to the ZY plane. (y = fgMzy * z + fgCzy)
e6357f88 120
a3d4b6ba 121 static AliHLTFloat32_t fgIdealX1; /// Ideal X coordinate of the point on MT1
122 static AliHLTFloat32_t fgIdealY1; /// Ideal Y coordinate of the point on MT1
123 static AliHLTFloat32_t fgIdealZ1; /// Ideal Z coordinate of the point on MT1
124 static AliHLTFloat32_t fgIdealX2; /// Ideal X coordinate of the point on MT2
125 static AliHLTFloat32_t fgIdealY2; /// Ideal Y coordinate of the point on MT2
126 static AliHLTFloat32_t fgIdealZ2; /// Ideal Z coordinate of the point on MT2
e6357f88 127};
364df03a 128
129#endif // ALIHLTMUONCALCULATIONS_H