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