]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrackHit.cxx
Code from MUON-dev joined
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackHit.cxx
CommitLineData
a9e2aefa 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/*
17$Log$
18Revision 1.1.2.3 2000/06/12 10:11:45 morsch
19Dummy copy constructor and assignment operator added
20
21Revision 1.1.2.2 2000/06/09 12:58:05 gosset
22Removed comment beginnings in Log sections of .cxx files
23Suppressed most violations of coding rules
24
25Revision 1.1.2.1 2000/06/07 14:44:53 gosset
26Addition of files for track reconstruction in C++
27*/
28
29//__________________________________________________________________________
30//
31// Reconstructed track hit in ALICE dimuon spectrometer
32//__________________________________________________________________________
33
34#include "AliMUONTrackHit.h"
35
36#include "AliMUONHitForRec.h"
37
38ClassImp(AliMUONTrackHit) // Class implementation in ROOT context
39
40 //__________________________________________________________________________
41AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
42{
43 // Constructor from the HitForRec pointed to by "Hit"
44 fHitForRecPtr = Hit; // pointer to HitForRec
45 // links from/to HitForRec
46 if (Hit->GetNTrackHits() == 0) {
47 fPrevTrackHitWithSameHitForRec = NULL;
48 Hit->SetFirstTrackHitPtr(this);
49 }
50 else {
51 fPrevTrackHitWithSameHitForRec = Hit->GetLastTrackHitPtr();
52 fNextTrackHitWithSameHitForRec = NULL;
53 }
54 Hit->SetLastTrackHitPtr(this);
55 fNextTrackHitWithSameHitForRec = NULL;
56 Hit->SetNTrackHits(Hit->GetNTrackHits() + 1);
57}
58
59
60AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit)
61{
62// Dummy copy constructor
63}
64
65AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit)
66{
67// Dummy assignment operator
68 return *this;
69}
70
71// Inline functions for Get and Set
72inline AliMUONHitForRec* AliMUONTrackHit::GetHitForRecPtr(void) {
73 // Get fHitForRecPtr
74 return fHitForRecPtr;}
75inline AliMUONTrackParam* AliMUONTrackHit::GetTrackParam(void) {
76 // Get pointer to fTrackParam
77 return &(fTrackParam);}
78inline void AliMUONTrackHit::SetTrackParam(AliMUONTrackParam* TrackParam) {
79 // Set fTrackParam
80 fTrackParam = *TrackParam;}
81
82 //__________________________________________________________________________
83Int_t AliMUONTrackHit::Compare(TObject* TrackHit)
84{
85 // "Compare" function to sort with increasing Z.
86 // Returns -1 (0, +1) if Z of current TrackHit
87 // is smaller than (equal to, larger than) Z of TrackHit
88 if (fHitForRecPtr->GetZ() <
89 ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return(-1);
90 else if (fHitForRecPtr->GetZ() ==
91 ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return( 0);
92 else return(+1);
93}