Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / MUON / AliMUONRecoTrack.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 //Authors: Mihaela Gheata, Andrei Gheata 09/10/00
19 ////////////////////////////////////////////////////////////////////
20 //                                                                //
21 // AliMUONRecoTrack                                               //
22 //                                                                //
23 // This class represents a reconstructed muon track               //
24 // in the tree of reconstructed events.                           //
25 //                                                                //
26 ////////////////////////////////////////////////////////////////////
27
28 #include <Riostream.h>
29
30 #include "AliMUONRecoTrack.h"
31
32 ClassImp(AliMUONRecoTrack)
33
34 //-------------------------------------------------------------------
35 AliMUONRecoTrack::AliMUONRecoTrack(Bool_t active)
36   : TObject()
37 {
38 //Constructor of AliMUONRecoTrack
39    fSign  = 0;
40    fZvr   = 0.0;
41    fChi2r = 0.0;
42    if (active) {
43         for (Int_t axis=0; axis<3; axis++) {
44         fPr[axis] = 0.0;
45         }
46         for (Int_t chamber=0; chamber<10; chamber++) {
47         fPosX[chamber] = 0.0;
48         fPosY[chamber] = 0.0;
49         fPosZ[chamber] = 0.0;
50         }
51    }
52 }
53
54 //-------------------------------------------------------------------
55 const Double_t AliMUONRecoTrack::Phi()
56 {
57 // Return trach phi angle
58         return TMath::ATan2(fPr[2], fPr[1]);
59 }
60
61 //-------------------------------------------------------------------
62 const Double_t AliMUONRecoTrack::Theta()
63 {
64 // Return trach theta angle
65    return TMath::ACos(fPr[2] / P());
66 }
67
68 //-------------------------------------------------------------------
69 void AliMUONRecoTrack::SetMomReconstr(Double_t px, Double_t py, Double_t pz)
70 {
71 // Set the track reconstructed momentum 
72    fPr[0] = px;
73    fPr[1] = py;
74    fPr[2] = pz;            
75
76    
77 //-------------------------------------------------------------------           
78 void AliMUONRecoTrack::SetHitPosition(Int_t chamber, Double_t x, Double_t y, Double_t z)
79 {
80 // Set hit coordinates in chamber[0..9]
81    fPosX[chamber] = x;
82    fPosY[chamber] = y;
83    fPosZ[chamber] = z;
84 }
85
86 //-------------------------------------------------------------------           
87 void AliMUONRecoTrack::TrackInfo()
88 {
89 // Prints momentum info for this track
90    cout << "Px=" << GetMomReconstr(0) << " Py=" << GetMomReconstr(1) <<
91           " Pz=" << GetMomReconstr(2) << " P=" << P() << endl;
92 }