]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFClusterFinderV1.h
Fix for coverity (AdC)
[u/mrichter/AliRoot.git] / TOF / AliTOFClusterFinderV1.h
index 66c1514f3c9e20d86514698346f20b20fd71be09..5cb3e9df9b7de551e770bad7c1b9bc5409298ad9 100644 (file)
@@ -7,6 +7,7 @@
 // and feed TOF tracking 
 
 #include "TObject.h"
+#include "TTask.h"
 
 #include "AliTOFGeometry.h"
 #include "AliTOFRawStream.h"
@@ -22,46 +23,60 @@ class AliTOFcalib;
 class AliTOFDigitMap;
 class AliTOFRecoParam;
 
-class AliTOFClusterFinderV1 : public TObject
+class  AliTOFselectedDigit : public TObject { 
+ public:
+  AliTOFselectedDigit() :
+    fTDC(0.),fADC(0.),fTOT(0.),fWeight(0.),fIndex(-1) {
+    for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=-1;
+    for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=-1;
+  };
+  AliTOFselectedDigit(Int_t * const ind, Double_t h1, Double_t h2, Double_t h3, Double_t h4, Int_t idx, Int_t * const l):
+    TObject(),
+    fTDC(h1),fADC(h2),fTOT(h3),fWeight(h4),fIndex(idx) {
+    for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=ind[ii];
+    for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=l[ii];
+  };
+  AliTOFselectedDigit(const AliTOFselectedDigit & source) :
+    TObject(source),
+    fTDC(source.fTDC),fADC(source.fADC),fTOT(source.fTOT),fWeight(source.fWeight),fIndex(source.fIndex)
+    {
+      for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=source.fDetectorIndex[ii];
+      for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=source.fTrackLabel[ii];
+    };
+  AliTOFselectedDigit & operator=(const AliTOFselectedDigit & source)
+    { if (this == &source) return *this;
+      TObject::operator=(source);
+      for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=source.fDetectorIndex[ii];
+      fTDC=source.fTDC;fADC=source.fADC;fTOT=source.fTOT;fWeight=source.fWeight;fIndex=source.fIndex;
+      for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=source.fTrackLabel[ii];
+      return *this; };
+
+  Double_t GetTDC()    const {return fTDC;} // digit TOF
+  Double_t GetADC()    const {return fADC;} // digit ADC
+  Double_t GetTOT()    const {return fTOT;} // digit TOT
+  Double_t GetWeight() const {return fWeight;} // digit weight
+  Int_t GetTrackLabel(Int_t n)    const {return fTrackLabel[n];} // Labels of tracks in digit
+  Int_t GetDetectorIndex(Int_t n) const {return fDetectorIndex[n];} // Digit Detector Index n
+  Int_t GetIndex()     const {return fIndex;} // Digit Index
+
+ private: 
+
+  Int_t fDetectorIndex[5]; //digit detector indices (sector, plate, strip, padX, padZ) 
+  Double_t fTDC; //TDC count
+  Double_t fADC; //ADC count
+  Double_t fTOT; //TOT count
+  Double_t fWeight; //weight
+  Int_t fIndex; //index of the digit in the TOF digit tree
+  Int_t fTrackLabel[3]; //track labels
+
+}; 
+
+
+class AliTOFClusterFinderV1 : public TTask
 {
 
   enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters
 
-
-  class AliTOFselectedDigit { 
-    friend class AliTOFClusterFinderV1; // to define AliTOFClusterFinderV1 friend object
-   public:
-   AliTOFselectedDigit() :
-     fTDC(0.),fADC(0.),fTOT(0.),fWeight(0.),fIndex(-1) {
-       for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=-1;
-       for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=-1;
-   };
-   AliTOFselectedDigit(Int_t * const ind, Double_t h1, Double_t h2, Double_t h3, Double_t h4, Int_t idx, Int_t * const l):
-     fTDC(h1),fADC(h2),fTOT(h3),fWeight(h4),fIndex(idx) {
-     for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=ind[ii];
-     for (Int_t ii=0; ii<5; ii++) fTrackLabel[ii]=l[ii];
-   };
-
-
-   Double_t GetTDC()    const {return fTDC;} // digit TOF
-   Double_t GetADC()    const {return fADC;} // digit ADC
-   Double_t GetTOT()    const {return fTOT;} // digit TOT
-   Double_t GetWeight() const {return fWeight;} // digit weight
-   Int_t GetTrackLabel(Int_t n)    const {return fTrackLabel[n];} // Labels of tracks in digit
-   Int_t GetDetectorIndex(Int_t n) const {return fDetectorIndex[n];} // Digit Detector Index n
-   Int_t GetIndex()     const {return fIndex;} // Digit Index
-
-   private: 
-
-   Int_t fDetectorIndex[5]; //digit detector indices (sector, plate, strip, padX, padZ) 
-   Double_t fTDC; //TDC count
-   Double_t fADC; //ADC count
-   Double_t fTOT; //TOT count
-   Double_t fWeight; //weight
-   Int_t fIndex; //index of the digit in the TOF digit tree
-   Int_t fTrackLabel[3]; //track labels
-   }; 
-
  public:
 
   AliTOFClusterFinderV1(AliTOFcalib *calib);
@@ -100,6 +115,8 @@ class AliTOFClusterFinderV1 : public TObject
   void  SetMaxDeltaTime(Int_t a)   {fMaxDeltaTime = a;}; // to set deltaTime [bin number]
   void  SetMaxDeltaTime(Float_t a) {fMaxDeltaTime = (Int_t)(a/AliTOFGeometry::TdcBinWidth());}; // to set deltaTime [ps]
   Int_t GetMaxDeltaTime()     const {return fMaxDeltaTime;};
+  Int_t GetNumberOfTOFclusters() const {return fNumberOfTofClusters;}
+  Int_t GetNumberOfTOFtrgPads() const {return fNumberOfTofTrgPads;}
 
 
   void SetCalibrateFlag(Bool_t dummy) {fCalibrateTOFtimes = dummy;};
@@ -113,6 +130,7 @@ class AliTOFClusterFinderV1 : public TObject
   TClonesArray *fRecPoints;   // List of reconstructed points
   Int_t fNumberOfTofClusters; // Number of TOF Clusters
   Int_t fNumberOfTofDigits;   // Number of TOF Digits
+  Int_t fNumberOfTofTrgPads;  // Number of TOF trigger pads
 
  private:
 
@@ -147,7 +165,7 @@ class AliTOFClusterFinderV1 : public TObject
 
   Bool_t fCalibrateTOFtimes;     // used for check
 
-  ClassDef(AliTOFClusterFinderV1,3) // To run TOF clustering
+  ClassDef(AliTOFClusterFinderV1,6) // To run TOF clustering
 };
 #endif