]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MFT/AliMFTCluster.h
Coverity fix.
[u/mrichter/AliRoot.git] / MFT / AliMFTCluster.h
index 898418acfc4cc0627f8dc4ae512ea494cbd3be90..122088b697a8715e3099cfaa56ba431050f30a55 100644 (file)
 
 #include "AliMUONRawCluster.h"
 #include "AliMUONVCluster.h"
+#include "AliMFTDigit.h"
+#include "TClonesArray.h"
 #include "TObject.h"
+#include "AliMFTConstants.h"
 
 //====================================================================================================================================================
 
@@ -23,26 +26,26 @@ class AliMFTCluster : public TObject {
 public:
 
   AliMFTCluster();
-//   AliMFTCluster(const AliMFTCluster& pt);
-//   AliMFTCluster& operator=(const AliMFTCluster &source);
+  AliMFTCluster(const AliMFTCluster&);
+  AliMFTCluster& operator=(const AliMFTCluster&);
 
   virtual ~AliMFTCluster() {};  // destructor
 
   void SetXYZ(Double_t x, Double_t y, Double_t z) { fX=x; fY=y; fZ=z; }
 
-  void SetX(Double_t x) { fX = x; }
-  void SetY(Double_t y) { fY = y; }
-  void SetZ(Double_t z) { fZ = z; }
+  void SetX(Double_t x) { if(fIsClusterEditable) fX = x; }
+  void SetY(Double_t y) { if(fIsClusterEditable) fY = y; }
+  void SetZ(Double_t z) { if(fIsClusterEditable) fZ = z; }
 
   Double_t GetX() const { return fX; }
   Double_t GetY() const { return fY; }
   Double_t GetZ() const { return fZ; }
   
-  void SetErrXYZ(Double_t errX, Double_t errY, Double_t errZ) { fErrX = errX; fErrY = errY; fErrZ = errZ; }
+  void SetErrXYZ(Double_t errX, Double_t errY, Double_t errZ) { if(fIsClusterEditable) { fErrX = errX; fErrY = errY; fErrZ = errZ; } }
        
-  void SetErrX(Double_t errX) { fErrX = errX; }
-  void SetErrY(Double_t errY) { fErrY = errY; }
-  void SetErrZ(Double_t errZ) { fErrZ = errZ; }
+  void SetErrX(Double_t errX) { if(fIsClusterEditable) fErrX = errX; }
+  void SetErrY(Double_t errY) { if(fIsClusterEditable) fErrY = errY; }
+  void SetErrZ(Double_t errZ) { if(fIsClusterEditable) fErrZ = errZ; }
 
   Double_t GetErrX()  const { return fErrX; }
   Double_t GetErrY()  const { return fErrY; }
@@ -51,17 +54,21 @@ public:
   Double_t GetErrY2() const { return fErrY*fErrY; }
   Double_t GetErrZ2() const { return fErrZ*fErrZ; }
   
-  void     SetNElectrons(Double_t nElectrons) { fNElectrons = nElectrons; }
+  void     SetNElectrons(Double_t nElectrons) { if(fIsClusterEditable) fNElectrons = nElectrons; }
   Double_t GetNElectrons() const { return fNElectrons; }
   
-  void  AddMCLabel(Int_t label) { if (fNMCTracks==fNMaxMCTracks) return; else fMCLabel[fNMCTracks++]=label; }
+  void  AddMCLabel(Int_t label);
   Int_t GetNMCTracks() const { return fNMCTracks; }
   Int_t GetMCLabel(Int_t track) const { if (track<fNMCTracks && track>=0) return fMCLabel[track]; else return -1; }
+  void  SetMCLabel(Int_t track, Int_t labelMC) { if (track<fNMCTracks && track>=0) fMCLabel[track]=labelMC; }
 
-  void  SetPlane(Int_t plane) { fPlane = plane; }
+  void  SetPlane(Int_t plane) { if(fIsClusterEditable) fPlane = plane; }
   Int_t GetPlane() const { return fPlane; }
 
-  void  SetSize(Int_t size) { fSize = size; }
+  void SetDetElemID(Int_t detElemID) { fDetElemID = detElemID; }
+  Int_t GetDetElemID() { return fDetElemID; }
+
+  void  SetSize(Int_t size) { if(fIsClusterEditable) fSize = size; }
   Int_t GetSize() const { return fSize; }
 
   void SetLocalChi2(Double_t chi2) { fLocalChi2 = chi2; }
@@ -70,18 +77,27 @@ public:
   Double_t GetLocalChi2() { return fLocalChi2; }
   Double_t GetTrackChi2() { return fTrackChi2; }
 
+  Bool_t AddPixel(AliMFTDigit *pixel);
+
+  Bool_t IsClusterEditable() { return fIsClusterEditable; }
+  void SetClusterEditable(Bool_t isClusterEditable) { fIsClusterEditable = isClusterEditable; }
+  void TerminateCluster();
+
+  Double_t GetDistanceFromPixel(AliMFTDigit *pixel);
+
   AliMUONRawCluster* CreateMUONCluster();
   
 private:
 
-  static const Int_t fNMaxMCTracks = 30;
-
+  static const Int_t fNMaxMCTracks         = AliMFTConstants::fNMaxMCTracksPerCluster;
+  static const Int_t fNMaxDigitsPerCluster = AliMFTConstants::fNMaxDigitsPerCluster;
+  
   Double_t fX, fY, fZ;   // cluster global coordinates
   Double_t fErrX, fErrY, fErrZ;
 
   Double_t fNElectrons;
   Int_t fNMCTracks;
-  Int_t fPlane;
+  Int_t fPlane, fDetElemID;
   Int_t fMCLabel[fNMaxMCTracks];
 
   Int_t fSize;   // the number of digits composing the cluster
@@ -89,6 +105,10 @@ private:
   Double_t fTrackChi2; // Chi2 of the track when the associated cluster was attached
   Double_t fLocalChi2; // Local chi2 of the associated cluster with respect to the track
   
+  TClonesArray *fDigitsInCluster;   //! (Temporary) Array of the digits composing the cluster
+
+  Bool_t fIsClusterEditable;
+
   ClassDef(AliMFTCluster, 1)
 
 };