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