]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONHitForRec.cxx
Adaption to new fluka common blocks (E. Futo)
[u/mrichter/AliRoot.git] / MUON / AliMUONHitForRec.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$
83dbc640 18Revision 1.6 2001/02/05 14:49:29 hristov
19Compare() declared const (R.Brun)
20
2a941f4e 21Revision 1.5 2001/01/26 21:46:33 morsch
22Use access functions to MUONHit, ... data members.
23
e819fbd3 24Revision 1.4 2000/10/02 21:28:09 fca
25Removal of useless dependecies via forward declarations
26
94de3818 27Revision 1.3 2000/06/25 13:06:39 hristov
28Inline functions moved from *.cxx to *.h files instead of forward declarations
29
9b03f36b 30Revision 1.2 2000/06/15 07:58:48 morsch
31Code from MUON-dev joined
32
a9e2aefa 33Revision 1.1.2.4 2000/06/12 10:11:10 morsch
34Dummy copy constructor and assignment operator added
35
36Revision 1.1.2.3 2000/06/09 22:14:43 morsch
37Make includes consistent with new file naming.
38
39Revision 1.1.2.2 2000/06/09 12:58:05 gosset
40Removed comment beginnings in Log sections of .cxx files
41Suppressed most violations of coding rules
42
43Revision 1.1.2.1 2000/06/07 14:44:53 gosset
44Addition of files for track reconstruction in C++
45*/
46
47//__________________________________________________________________________
48//
49// Hit for reconstruction in ALICE dimuon spectrometer
50//__________________________________________________________________________
51
52#include "AliMUONHitForRec.h"
53#include "AliMUONTrackParam.h"
54#include "AliMUONRawCluster.h"
55#include "AliMUONHit.h"
56
57ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
58
59 //__________________________________________________________________________
60AliMUONHitForRec::AliMUONHitForRec(AliMUONHit* Ghit)
61{
62 // Constructor for AliMUONHitForRec from a GEANT hit.
63 // Fills the bending, non bending, and Z coordinates,
64 // which are taken from the coordinates of the GEANT hit,
65 // the track number (GEANT and not TH),
66 // and the chamber number (0...).
94de3818 67 fBendingCoor = Ghit->Y();
68 fNonBendingCoor = Ghit->X();
69 fZ = Ghit->Z();
a9e2aefa 70 // fTrack = Ghit->fTrack; ?????????
e819fbd3 71 fChamberNumber = Ghit->Chamber() - 1;
a9e2aefa 72 // other fields will be updated in
73 // AliMUONEventReconstructor::NewHitForRecFromGEANT,
74 // except the following ones
75 fIndexOfFirstSegment = -1;
76 fNSegments = 0;
77 fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
78 fNTrackHits = 0;
79 return;
80}
81
82// //__________________________________________________________________________
83// AliMUONHitForRec::AliMUONHitForRec(AliMUONReconstHit* CathCorrel)
84// {
85// // Constructor for AliMUONHitForRec from a (cathode correlated) raw cluster.
86// // Fills the bending and non bending coordinates.
87// // Only the first correlation is taken into account.
88// // The bending coordinate is taken from the first cathode.
89// // The non bending coordinate is taken
90// // from the second cathode if it exists,
91// // from the first one otherwise.
92// fBendingCoor = CathCorrel->fY[3];
93// if (CathCorrel->fCorrelIndex[0] >= 0) fNonBendingCoor = CathCorrel->fX[0];
94// else fNonBendingCoor = CathCorrel->fX[3];
95// return;
96// }
97
98 //__________________________________________________________________________
99AliMUONHitForRec::AliMUONHitForRec(AliMUONRawCluster* RawCluster)
100{
101 // Constructor for AliMUONHitForRec from a raw cluster.
102 // Fills the bending and non bending coordinates.
103 fNonBendingCoor = RawCluster->fX[0];
104 fBendingCoor = RawCluster->fY[0];
105 // other fields will be updated in
106 // AliMUONEventReconstructor::AddHitsForRecFromRawClusters,
107 // except the following ones
108 fTHTrack = -1;
109 fGeantSignal = -1;
110 fIndexOfFirstSegment = -1;
111 fNSegments = 0;
112 fFirstTrackHitPtr = fLastTrackHitPtr = NULL;
113 fNTrackHits = 0;
114 return;
115}
116
117AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& MUONHitForRec)
118{
119// Dummy copy constructor
120}
121
122AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& MUONHitForRec)
123{
124// Dummy assignment operator
125 return *this;
126}
a9e2aefa 127 //__________________________________________________________________________
83dbc640 128/*AZ
2a941f4e 129Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
a9e2aefa 130{
131 // "Compare" function to sort with increasing chamber number.
132 // Returns -1 (0, +1) if ChamberNumber of current HitForRec
133 // is smaller than (equal to, larger than) ChamberNumber of Hit
134 if (fChamberNumber < ((AliMUONHitForRec*)Hit)->fChamberNumber) return(-1);
135 else if (fChamberNumber == ((AliMUONHitForRec*)Hit)->fChamberNumber) return( 0);
136 else return(+1);
137}
83dbc640 138*/
139 //__________________________________________________________________________
140Int_t AliMUONHitForRec::Compare(const TObject* Hit) const
141{
142 // "Compare" function to sort with increasing Z-coordinate.
143 // Returns -1 (0, +1) if Z-coordinate of current HitForRec
144 // is smaller than (equal to, larger than) Z-coordinate of Hit
145 if (fZ < ((AliMUONHitForRec*)Hit)->fZ) return(-1);
146 else if (fZ == ((AliMUONHitForRec*)Hit)->fZ) return( 0);
147 else return(+1);
148}
a9e2aefa 149
150 //__________________________________________________________________________
151Double_t AliMUONHitForRec::NormalizedChi2WithHitForRec(AliMUONHitForRec* HitForRec, Double_t Sigma2Cut)
152{
153 // Calculate the normalized Chi2 between the current HitForRec (this)
154 // and the HitForRec pointed to by "HitForRec",
155 // i.e. the square deviations between the coordinates,
156 // in both the bending and the non bending plane,
157 // divided by the variance of the same quantities and by "Sigma2Cut".
158 // Returns 3 if none of the 2 quantities is OK,
159 // something smaller than or equal to 2 otherwise.
160 // Would it be more correct to use a real chi square
161 // including the non diagonal term ????
162 Double_t chi2, chi2Max, diff, normDiff;
163 chi2 = 0.0;
164 chi2Max = 3.0;
165 // coordinate in bending plane
166 diff = this->fBendingCoor - HitForRec->fBendingCoor;
167 normDiff = diff * diff /
168 (this->fBendingReso2 + HitForRec->fBendingReso2) / Sigma2Cut;
169 if (normDiff > 1.0) return chi2Max;
170 chi2 = chi2 + normDiff;
171 // coordinate in non bending plane
172 diff = this->fNonBendingCoor - HitForRec->fNonBendingCoor;
173 normDiff = diff * diff /
174 (this->fNonBendingReso2 + HitForRec->fNonBendingReso2) / Sigma2Cut;
175 if (normDiff > 1.0) return chi2Max;
176 chi2 = chi2 + normDiff;
177 return chi2;
178}