]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCluster.h
AliTriggerConfiguration: fix for DTRUE and 5 bcmasks
[u/mrichter/AliRoot.git] / STEER / AliCluster.h
index 54cb37c1517ae9f27da87f30af451f1d7d1d375d..0c934646abb05f89e59a4b7e0b6546b676d8ddf0 100644 (file)
@@ -3,51 +3,92 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
-
 //-------------------------------------------------------------------------
-//                          Class AliCluster
+//                         Class AliCluster
+// This is the future base for managing the clusters in barrel detectors.
+// It is fully interfaced with the ROOT geometrical modeller TGeo.
+// Each cluster contains XYZ coordinates in the local tracking c.s. and
+// the unique ID of the sensitive detector element which continas the
+// cluster. The coordinates in global c.s. are computed using the interface
+// to TGeo and will be not overwritten by the derived sub-detector cluster
+// classes.
 //
-//       Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
+// cvetan.cheshkov@cern.ch  & jouri.belikov@cern.ch     5/3/2007
 //-------------------------------------------------------------------------
 
 #include <TObject.h>
 
-//_____________________________________________________________________________
+class TGeoHMatrix;
+class TGeoPNEntry;
+
 class AliCluster : public TObject {
-public:
+ public:
+  enum {
+    kUsed   =  BIT(14),
+    kShared =  BIT(15)
+  };
+
   AliCluster();
+  AliCluster(UShort_t volId, const Float_t *hit, Float_t x = 0, Float_t sigyz = 0, const Int_t *lab = NULL);
+  AliCluster(UShort_t volId,
+                Float_t x, Float_t y, Float_t z,
+                Float_t sy2, Float_t sz2, Float_t syz,
+                const Int_t *lab = NULL);
+  AliCluster(const AliCluster& cluster);
+  AliCluster &operator=(const AliCluster& cluster);
   virtual ~AliCluster() {;}
-  AliCluster(Int_t *lab, Float_t *hit);
-  void SetLabel(Int_t lab, Int_t i) {fTracks[i]=lab;}
-  void SetY(Float_t y)              {fY=y;}
-  void SetZ(Float_t z)              {fZ=z;}
-  void SetSigmaY2(Float_t sy2)      {fSigmaY2=sy2;}
-  void SetSigmaZ2(Float_t sz2)      {fSigmaZ2=sz2;}
-
-  Int_t GetLabel(Int_t i) const {return fTracks[i];}
-  Float_t GetY()          const {return fY;}
-  Float_t GetZ()          const {return fZ;}
-  Float_t GetSigmaY2()    const {return fSigmaY2;}
-  Float_t GetSigmaZ2()    const {return fSigmaZ2;}
-
-  //PH  virtual void Use() = 0;
-  //PH The pure virtual function has been temporarily replaced by 
-  //PH virtual function with empty body. This correction somehow helps
-  //PH to write/read TClonesArray with AliITSclusterV2 objects, but obviously
-  //PH hides some more tricky problems (to be investigated)
-  virtual void Use() {;}
-
-protected:
-  Int_t     fTracks[3];//labels of overlapped tracks
-  Float_t   fY ;       //Y of cluster
-  Float_t   fZ ;       //Z of cluster
-  Float_t   fSigmaY2;  //Sigma Y square of cluster
-  Float_t   fSigmaZ2;  //Sigma Z square of cluster
-  
-  ClassDef(AliCluster,1)  // Time Projection Chamber clusters
-};
 
-#endif
+  virtual void Print(Option_t* option = "") const;
+
+  Int_t    GetLabel(Int_t i) const {return fTracks[i];}
+  Float_t  GetX()            const {return fX;}
+  Float_t  GetY()            const {return fY;}
+  Float_t  GetZ()            const {return fZ;}
+  Float_t  GetSigmaY2()      const {return fSigmaY2;}
+  Float_t  GetSigmaZ2()      const {return fSigmaZ2;}
+  Float_t  GetSigmaYZ()      const {return fSigmaYZ;}
+  UShort_t GetVolumeId()     const {return fVolumeId;}
+
+  void   IncreaseClusterUsage()  { if (TestBit(kUsed)) SetBit(kShared); else SetBit(kUsed); }
+  Bool_t IsClusterUsed()   const { return TestBit(kUsed);   }
+  Bool_t IsClusterShared() const { return TestBit(kShared); }
+
+  virtual void Use(Int_t = 0) {;}
+
+  Bool_t   GetGlobalXYZ(Float_t xyz[3]) const;
+  virtual Bool_t   GetGlobalCov(Float_t cov[6]) const;
+  Bool_t   GetXRefPlane(Float_t &xref) const;
 
+  Bool_t   Misalign();
 
+  void     SetLabel(Int_t lab,Int_t i)
+  { if (i>=0 && i<3) fTracks[i] = lab;}
+  void     SetX(Float_t x) {fX = x;}
+  void     SetY(Float_t y) {fY = y;}
+  void     SetZ(Float_t z) {fZ = z;}
+  void     SetSigmaY2(Float_t sigy2) {fSigmaY2 = sigy2;}
+  void     SetSigmaZ2(Float_t sigz2) {fSigmaZ2 = sigz2;}
+  void     SetSigmaYZ(Float_t sigyz) {fSigmaYZ = sigyz;};
+  void     SetVolumeId(UShort_t id)  {fVolumeId = id;}
+
+ protected:
+
+  const TGeoHMatrix*   GetTracking2LocalMatrix() const;
+  TGeoHMatrix*         GetMatrix(Bool_t original = kFALSE) const;
+
+ private:
+
+  Int_t    fTracks[3];//MC labels
+  Float_t  fX;        // X of the cluster in the tracking c.s.
+  Float_t  fY;        // Y of the cluster in the tracking c.s.
+  Float_t  fZ;        // Z of the cluster in the tracking c.s.
+  Float_t  fSigmaY2;  // Sigma Y square of cluster
+  Float_t  fSigmaZ2;  // Sigma Z square of cluster
+  Float_t  fSigmaYZ;  // Non-diagonal element of cov.matrix
+  UShort_t fVolumeId; // Volume ID of the detector element
+  Bool_t   fIsMisaligned; // Cluster was misagned or not?
+
+  ClassDef(AliCluster,3) // Barrel detectors cluster
+};
+
+#endif