1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.4 2000/07/18 16:04:06 gosset
19 AliMUONEventReconstructor package:
20 * a few minor modifications and more comments
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
30 Revision 1.3 2000/06/25 13:06:39 hristov
31 Inline functions moved from *.cxx to *.h files instead of forward declarations
33 Revision 1.2 2000/06/15 07:58:49 morsch
34 Code from MUON-dev joined
36 Revision 1.1.2.3 2000/06/12 10:11:45 morsch
37 Dummy copy constructor and assignment operator added
39 Revision 1.1.2.2 2000/06/09 12:58:05 gosset
40 Removed comment beginnings in Log sections of .cxx files
41 Suppressed most violations of coding rules
43 Revision 1.1.2.1 2000/06/07 14:44:53 gosset
44 Addition of files for track reconstruction in C++
47 //__________________________________________________________________________
49 // Reconstructed track hit in ALICE dimuon spectrometer
50 //__________________________________________________________________________
52 #include "AliMUONTrackHit.h"
54 #include "AliMUONHitForRec.h"
56 ClassImp(AliMUONTrackHit) // Class implementation in ROOT context
58 //__________________________________________________________________________
59 AliMUONTrackHit::AliMUONTrackHit(AliMUONHitForRec* Hit)
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);
69 fPrevTrackHitWithSameHitForRec = Hit->GetLastTrackHitPtr();
70 fNextTrackHitWithSameHitForRec = NULL;
72 Hit->SetLastTrackHitPtr(this);
73 fNextTrackHitWithSameHitForRec = NULL;
74 Hit->SetNTrackHits(Hit->GetNTrackHits() + 1);
77 //__________________________________________________________________________
78 AliMUONTrackHit::AliMUONTrackHit (const AliMUONTrackHit& MUONTrackHit)
80 // Dummy copy constructor
83 //__________________________________________________________________________
84 AliMUONTrackHit & AliMUONTrackHit::operator=(const AliMUONTrackHit& MUONTrackHit)
86 // Dummy assignment operator
91 //__________________________________________________________________________
92 AliMUONTrackHit::~AliMUONTrackHit()
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);
112 // to be checked thoroughly !!!!
113 // with Root counter of AliMUONTrackHit objects,
114 // with loop over all these links after the update
117 //__________________________________________________________________________
118 Int_t AliMUONTrackHit::Compare(TObject* TrackHit)
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);