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 **************************************************************************/
16 //-------------------------------------------------------------------------
18 // This is an extension of the AliCluster class for the case when
19 // the sensitive plane this cluster belongs to is arbitrarily oriented
20 // in space. This class can serve as the base for the TOF and HMPID
23 // cvetan.cheshkov@cern.ch & jouri.belikov@cern.ch 5/3/2007
24 //-------------------------------------------------------------------------
25 #include <TGeoManager.h>
26 #include <TGeoMatrix.h>
28 #include "AliCluster3D.h"
31 ClassImp(AliCluster3D)
33 //______________________________________________________________________________
34 AliCluster3D::AliCluster3D():
40 // Default constructor
43 //______________________________________________________________________________
44 AliCluster3D::AliCluster3D(UShort_t volId,
45 Float_t x, Float_t y, Float_t z,
46 Float_t sx2, Float_t sxy, Float_t sxz,
47 Float_t sy2, Float_t syz,
48 Float_t sz2, const Int_t *lab):
49 AliCluster(volId,x,y,z,sy2,sz2,syz,lab),
54 //-------------------------------------------------------------------------
55 // The main constructor
56 //-------------------------------------------------------------------------
59 //______________________________________________________________________________
60 AliCluster3D::AliCluster3D(const AliCluster3D& cluster):
62 fSigmaX2(cluster.fSigmaX2),
63 fSigmaXY(cluster.fSigmaXY),
64 fSigmaXZ(cluster.fSigmaXZ)
69 //______________________________________________________________________________
70 Bool_t AliCluster3D::GetGlobalCov(Float_t cov[6]) const
73 // Get the covariance matrix in the global coordinate system.
74 // All the needed information is taken only
77 if (!gGeoManager || !gGeoManager->IsClosed()) {
78 AliError("gGeoManager doesn't exist or it is still opened !");
82 const TGeoHMatrix *mt = GetTracking2LocalMatrix();
83 if (!mt) return kFALSE;
85 TGeoHMatrix *ml = GetMatrix();
86 if (!ml) return kFALSE;
89 Double_t tcov[9] = { fSigmaX2, fSigmaXY, fSigmaXZ,
90 fSigmaXY, GetSigmaY2(), GetSigmaYZ(),
91 fSigmaXZ, GetSigmaYZ(), GetSigmaZ2()};
93 m.Multiply(&mt->Inverse());
94 m.Multiply(&ml->Inverse());
97 Double_t *ncov = m.GetRotationMatrix();
98 cov[0] = ncov[0]; cov[1] = ncov[1]; cov[2] = ncov[2];
99 cov[3] = ncov[4]; cov[4] = ncov[5];