]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrackHit.cxx
Compare() declared const
[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$
8429a5e4 18Revision 1.4 2000/07/18 16:04:06 gosset
19AliMUONEventReconstructor package:
20* a few minor modifications and more comments
21* a few corrections
22 * right sign for Z of raw clusters
23 * right loop over chambers inside station
24 * symmetrized covariance matrix for measurements (TrackChi2MCS)
25 * right sign of charge in extrapolation (ExtrapToZ)
26 * right zEndAbsorber for Branson correction below 3 degrees
27* use of TVirtualFitter instead of TMinuit for AliMUONTrack::Fit
28* no parameter for AliMUONTrack::Fit() but more fit parameters in Track object
29
956019b6 30Revision 1.3 2000/06/25 13:06:39 hristov
31Inline functions moved from *.cxx to *.h files instead of forward declarations
32
9b03f36b 33Revision 1.2 2000/06/15 07:58:49 morsch
34Code from MUON-dev joined
35
a9e2aefa 36Revision 1.1.2.3 2000/06/12 10:11:45 morsch
37Dummy copy constructor and assignment operator added
38
39Revision 1.1.2.2 2000/06/09 12:58:05 gosset
40Removed comment beginnings in Log sections of .cxx files
41Suppressed most violations of coding rules
42
43Revision 1.1.2.1 2000/06/07 14:44:53 gosset
44Addition of files for track reconstruction in C++
45*/
46
47//__________________________________________________________________________
48//
49// Reconstructed track hit in ALICE dimuon spectrometer
50//__________________________________________________________________________
51
52#include "AliMUONTrackHit.h"
53
54#include "AliMUONHitForRec.h"
55
56ClassImp(AliMUONTrackHit) // Class implementation in ROOT context
57
58 //__________________________________________________________________________
59AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
60{
61 // Constructor from the HitForRec pointed to by "Hit"
62 fHitForRecPtr = Hit; // pointer to HitForRec
63 // links from/to HitForRec
64 if (Hit->GetNTrackHits() == 0) {
65 fPrevTrackHitWithSameHitForRec = NULL;
66 Hit->SetFirstTrackHitPtr(this);
67 }
68 else {
69 fPrevTrackHitWithSameHitForRec = Hit->GetLastTrackHitPtr();
70 fNextTrackHitWithSameHitForRec = NULL;
71 }
72 Hit->SetLastTrackHitPtr(this);
73 fNextTrackHitWithSameHitForRec = NULL;
74 Hit->SetNTrackHits(Hit->GetNTrackHits() + 1);
75}
76
956019b6 77 //__________________________________________________________________________
a9e2aefa 78AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit)
79{
80// Dummy copy constructor
81}
82
956019b6 83 //__________________________________________________________________________
a9e2aefa 84AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit)
85{
86// Dummy assignment operator
87 return *this;
88}
89
a9e2aefa 90
956019b6 91 //__________________________________________________________________________
92AliMUONTrackHit::~AliMUONTrackHit()
93{
94 // Destructor
8429a5e4 95 // Update links between HitForRec's and TrackHit's
96 // connected to the current TrackHit being removed.
97 AliMUONHitForRec *hit = fHitForRecPtr; // pointer to HitForRec
98 // remove current TrackHit in HitForRec links
99 if (this == hit->GetFirstTrackHitPtr())
100 hit->SetFirstTrackHitPtr(fNextTrackHitWithSameHitForRec); // if first
101 if (this == hit->GetLastTrackHitPtr())
102 hit->SetLastTrackHitPtr(fPrevTrackHitWithSameHitForRec); // if last
103 hit->SetNTrackHits(hit->GetNTrackHits() - 1); // decrement NTrackHits of hit
104 // update link to next TrackHit of previous TrackHit
105 if (fPrevTrackHitWithSameHitForRec != NULL)
106 fPrevTrackHitWithSameHitForRec->
107 SetNextTrackHitWithSameHitForRec(fNextTrackHitWithSameHitForRec);
108 // update link to previous TrackHit of next TrackHit
109 if (fNextTrackHitWithSameHitForRec)
110 fNextTrackHitWithSameHitForRec->
111 SetPrevTrackHitWithSameHitForRec(fPrevTrackHitWithSameHitForRec);
956019b6 112 // to be checked thoroughly !!!!
113 // with Root counter of AliMUONTrackHit objects,
114 // with loop over all these links after the update
115}
116
a9e2aefa 117 //__________________________________________________________________________
118Int_t AliMUONTrackHit::Compare(TObject* TrackHit)
119{
120 // "Compare" function to sort with increasing Z.
121 // Returns -1 (0, +1) if Z of current TrackHit
122 // is smaller than (equal to, larger than) Z of TrackHit
123 if (fHitForRecPtr->GetZ() <
124 ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return(-1);
125 else if (fHitForRecPtr->GetZ() ==
126 ((AliMUONTrackHit*)TrackHit)->fHitForRecPtr->GetZ()) return( 0);
127 else return(+1);
128}