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