]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OnlineAnalysis/AliHLTMUONCalculations.h
9e5281a8a54b7c3b2eb7d87a8cf2d5fec07efab6
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONCalculations.h
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
6 /* $Id$ */
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
17 /*
18  * Note: this class uses static global variables so thread protection must be
19  * explicit in any multi-threaded usage.
20  */
21 class AliHLTMUONCalculations
22 {
23 public:
24
25         /* Computes the momentum components based on the equations given in the
26            ALICE dimuon spectrometer Technical Design Report (TDR-5): trigger section.
27            
28            Reference: 
29              "CERN/LHCC 2000-046
30               Addendum 1 to ALICE TDR 5
31               15 Dec 2000"
32              
33              Section 3.1.2 pages 144 and 145.
34              
35            Input can be in meters, cm or mm. 
36            Output is in GeV.
37          */
38         static bool ComputeMomentum(
39                         AliHLTFloat32_t x1,
40                         AliHLTFloat32_t y1, AliHLTFloat32_t y2,
41                         AliHLTFloat32_t z1, AliHLTFloat32_t z2
42                 );
43                 
44         static AliHLTFloat32_t Zf() { return fgZf; }
45         static void Zf(AliHLTFloat32_t value) { fgZf = value; }
46         static AliHLTFloat32_t QBL();
47         static void QBL(AliHLTFloat32_t value);
48         
49         static AliHLTMUONParticleSign Sign() { return fgSign; }
50         static AliHLTFloat32_t Px() { return fgPx; }
51         static AliHLTFloat32_t Py() { return fgPy; }
52         static AliHLTFloat32_t Pz() { return fgPz; }
53         
54         /// Calculates the invariant mass for a pair of particles.
55         static AliHLTFloat32_t ComputeMass(
56                         AliHLTFloat32_t massA,
57                         AliHLTFloat32_t pxA,
58                         AliHLTFloat32_t pyA,
59                         AliHLTFloat32_t pzA,
60                         AliHLTFloat32_t massB,
61                         AliHLTFloat32_t pxB,
62                         AliHLTFloat32_t pyB,
63                         AliHLTFloat32_t pzB
64                 );
65         
66 private:
67
68         // Prevent destroying or creating of this object.
69         AliHLTMUONCalculations();
70         ~AliHLTMUONCalculations();
71
72         static AliHLTFloat32_t fgZf;  // The Z coordinate of the middle of the dipole magnetic field.
73         static AliHLTFloat32_t fgQBLScaled; // The integrated field strength times units of charge (T.m.*c/1e9)
74         
75         static AliHLTMUONParticleSign fgSign;  // The calculated sign.
76         static AliHLTFloat32_t fgPx;  // The calculated X momentum (GeV/c).
77         static AliHLTFloat32_t fgPy;  // The calculated Y momentum (GeV/c).
78         static AliHLTFloat32_t fgPz;  // The calculated Z momentum (GeV/c).
79 };
80
81 #endif // ALIHLTMUONCALCULATIONS_H