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/10/02 21:28:09 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.3 2000/06/25 13:06:39 hristov
22 Inline functions moved from *.cxx to *.h files instead of forward declarations
24 Revision 1.2 2000/06/15 07:58:48 morsch
25 Code from MUON-dev joined
27 Revision 1.1.2.4 2000/06/12 10:11:10 morsch
28 Dummy copy constructor and assignment operator added
30 Revision 1.1.2.3 2000/06/09 22:14:43 morsch
31 Make includes consistent with new file naming.
33 Revision 1.1.2.2 2000/06/09 12:58:05 gosset
34 Removed comment beginnings in Log sections of .cxx files
35 Suppressed most violations of coding rules
37 Revision 1.1.2.1 2000/06/07 14:44:53 gosset
38 Addition of files for track reconstruction in C++
41 //__________________________________________________________________________
43 // Hit for reconstruction in ALICE dimuon spectrometer
44 //__________________________________________________________________________
46 #include "AliMUONHitForRec.h"
47 #include "AliMUONTrackParam.h"
48 #include "AliMUONRawCluster.h"
49 #include "AliMUONHit.h"
51 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
53 //__________________________________________________________________________
54 AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* Ghit)
56 // Constructor for AliMUONHitForRec from a GEANT hit.
57 // Fills the bending, non bending, and Z coordinates,
58 // which are taken from the coordinates of the GEANT hit,
59 // the track number (GEANT and not TH),
60 // and the chamber number (0...).
61 fBendingCoor = Ghit->Y();
62 fNonBendingCoor = Ghit->X();
64 // fTrack = Ghit->fTrack; ?????????
65 fChamberNumber = Ghit->Chamber() - 1;
66 // other fields will be updated in
67 // AliMUONEventReconstructor::NewHitForRecFromGEANT,
68 // except the following ones
69 fIndexOfFirstSegment = -1;
71 fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
76 // //__________________________________________________________________________
77 // AliMUONHitForRec::AliMUONHitForRec(AliMUONReconstHit* CathCorrel)
79 // // Constructor for AliMUONHitForRec from a (cathode correlated) raw cluster.
80 // // Fills the bending and non bending coordinates.
81 // // Only the first correlation is taken into account.
82 // // The bending coordinate is taken from the first cathode.
83 // // The non bending coordinate is taken
84 // // from the second cathode if it exists,
85 // // from the first one otherwise.
86 // fBendingCoor = CathCorrel->fY[3];
87 // if (CathCorrel->fCorrelIndex[0] >= 0) fNonBendingCoor = CathCorrel->fX[0];
88 // else fNonBendingCoor = CathCorrel->fX[3];
92 //__________________________________________________________________________
93 AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* RawCluster)
95 // Constructor for AliMUONHitForRec from a raw cluster.
96 // Fills the bending and non bending coordinates.
97 fNonBendingCoor = RawCluster->fX[0];
98 fBendingCoor = RawCluster->fY[0];
99 // other fields will be updated in
100 // AliMUONEventReconstructor::AddHitsForRecFromRawClusters,
101 // except the following ones
104 fIndexOfFirstSegment = -1;
106 fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
111 AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& MUONHitForRec)
113 // Dummy copy constructor
116 AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& MUONHitForRec)
118 // Dummy assignment operator
121 //__________________________________________________________________________
122 Int_t AliMUONHitForRec::Compare(TObject* Hit)
124 // "Compare" function to sort with increasing chamber number.
125 // Returns -1 (0, +1) if ChamberNumber of current HitForRec
126 // is smaller than (equal to, larger than) ChamberNumber of Hit
127 if (fChamberNumber < ((AliMUONHitForRec*)Hit)->fChamberNumber) return(-1);
128 else if (fChamberNumber == ((AliMUONHitForRec*)Hit)->fChamberNumber) return( 0);
132 //__________________________________________________________________________
133 Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* HitForRec, Double_t Sigma2Cut)
135 // Calculate the normalized Chi2 between the current HitForRec (this)
136 // and the HitForRec pointed to by "HitForRec",
137 // i.e. the square deviations between the coordinates,
138 // in both the bending and the non bending plane,
139 // divided by the variance of the same quantities and by "Sigma2Cut".
140 // Returns 3 if none of the 2 quantities is OK,
141 // something smaller than or equal to 2 otherwise.
142 // Would it be more correct to use a real chi square
143 // including the non diagonal term ????
144 Double_t chi2, chi2Max, diff, normDiff;
147 // coordinate in bending plane
148 diff = this->fBendingCoor - HitForRec->fBendingCoor;
149 normDiff = diff * diff /
150 (this->fBendingReso2 + HitForRec->fBendingReso2) / Sigma2Cut;
151 if (normDiff > 1.0) return chi2Max;
152 chi2 = chi2 + normDiff;
153 // coordinate in non bending plane
154 diff = this->fNonBendingCoor - HitForRec->fNonBendingCoor;
155 normDiff = diff * diff /
156 (this->fNonBendingReso2 + HitForRec->fNonBendingReso2) / Sigma2Cut;
157 if (normDiff > 1.0) return chi2Max;
158 chi2 = chi2 + normDiff;