]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFClusterFinderV1.h
Added macro to lauch TOF QA task with extended functionality via plugin
[u/mrichter/AliRoot.git] / TOF / AliTOFClusterFinderV1.h
index 7b3b908e78c4f80c5effddd59b07b598ae42dba4..6ddd971d1844e79c301803b168232168909f07b6 100644 (file)
@@ -7,7 +7,9 @@
 // and feed TOF tracking 
 
 #include "TObject.h"
+#include "TNamed.h"
 
+#include "AliTOFGeometry.h"
 #include "AliTOFRawStream.h"
 
 class TClonesArray;
@@ -19,8 +21,58 @@ class AliRawReader;
 class AliTOFcluster;
 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 TNamed
 {
 
   enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters
@@ -47,78 +99,26 @@ class AliTOFClusterFinderV1 : public TObject
   void SetVerbose(Int_t Verbose){fVerbose=Verbose;} // To set the verbose level
   void SetDecoderVersion(Int_t version){fDecoderVersion=version;} // To set the decoder version
   Bool_t GetDecoderVersion() const {return fDecoderVersion;} // To get the decoder version
-  UShort_t GetClusterVolIndex(Int_t *ind) const; //Volume Id getter
+  //UShort_t GetClusterVolIndex(Int_t *ind) const; //Volume Id getter
   void GetClusterPars(Int_t *ind, Double_t *pos, Double_t *cov) const; //cluster par getter
-  void GetClusterPars(Bool_t check, Int_t counter, Int_t **ind, Double_t *weight,
+  void GetClusterPars(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight,
                      Double_t *pos, Double_t *cov) const; //cluster par getter
 
   void FindOnePadClusterPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip);
+  void FindClustersWithoutTOT(Int_t nSector, Int_t nPlate, Int_t nStrip);
   void FindClustersPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip, Int_t group);
 
   void FindClusters34(Int_t nSector, Int_t nPlate, Int_t nStrip);
   void FindClusters23(Int_t nSector, Int_t nPlate, Int_t nStrip);
   void FindClusters24(Int_t nSector, Int_t nPlate, Int_t nStrip);
 
-  void SetMaxDeltaTime(Int_t a) {fMaxDeltaTime = a;};
-  Int_t GetMaxDeltaTime()       {return fMaxDeltaTime;};
+  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;};
 
- public:
-  class AliTOFselectedDigit { 
-    friend class AliTOFClusterFinderV1; 
-   public:
-   AliTOFselectedDigit() 
-     :
-     fTDC(0.),
-     fADC(0.),
-     fTOT(0.),
-     fWeight(0.),
-     fIndex(-1) {
-     fDetectorIndex[0]=-1;
-     fDetectorIndex[1]=-1;
-     fDetectorIndex[2]=-1;
-     fDetectorIndex[3]=-1;
-     fDetectorIndex[4]=-1;
-     fTrackLabel[0]=-1;
-     fTrackLabel[1]=-1;
-     fTrackLabel[2]=-1;
-   };
-   AliTOFselectedDigit(Int_t *ind, Double_t h1, Double_t h2, Double_t h3, Double_t h4, Int_t idx, Int_t *l)
-     :
-     fTDC(h1),
-     fADC(h2),
-     fTOT(h3),
-     fWeight(h4),
-     fIndex(idx) {
-     fDetectorIndex[0]=ind[0];
-     fDetectorIndex[1]=ind[1];
-     fDetectorIndex[2]=ind[2];
-     fDetectorIndex[3]=ind[3];
-     fDetectorIndex[4]=ind[4];
-     fTrackLabel[0]=l[0];
-     fTrackLabel[1]=l[1];
-     fTrackLabel[2]=l[2];
-   };
-
-
-   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
-   }; 
 
+  void SetCalibrateFlag(Bool_t dummy) {fCalibrateTOFtimes = dummy;};
+  Bool_t GetCalibrateFlag() const {return fCalibrateTOFtimes;};
 
  protected:
 
@@ -131,14 +131,16 @@ class AliTOFClusterFinderV1 : public TObject
 
  private:
 
-  Int_t fMaxDeltaTime; // max time difference in between two tof measurements
-                       // for two neighbouring pads
+  const AliTOFRecoParam* fkRecoParam; // pointer to TOF reconstruction parameters
+
+  Int_t fMaxDeltaTime; // max time difference in between two tof
+                       // measurements for two neighbouring pads
 
   Int_t InsertCluster(AliTOFcluster *tofCluster);    // Fills TofClusters Array
   Int_t FindClusterIndex(Double_t z) const; // Returns cluster index 
   Bool_t MakeSlewingCorrection(Int_t *detectorIndex, Int_t tofDigitToT, Int_t tofDigitTdc,
                               Int_t &tdcCorr);
-  void TOFclusterError(Bool_t check, Int_t counter, Int_t **ind, Double_t *weight,
+  void TOFclusterError(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight,
                       Double_t ppos[], Double_t cov[]) const;
 
   void AverageCalculations(Int_t number, Float_t *interestingX,
@@ -151,12 +153,16 @@ class AliTOFClusterFinderV1 : public TObject
   Bool_t fDecoderVersion;   // setting whether to use the new decoder version 
                             //  -true -> new version
                             //  -false ->old version  (default value!!)
-  AliTOFcalib *fTOFcalib;       // pointer to the TOF calibration info
-  AliTOFDigitMap* fTOFdigitMap; // TOF digit map pointer
+  AliTOFcalib *fTOFcalib;        // pointer to the TOF calibration info
+  AliTOFDigitMap* fTOFdigitMap;  // TOF digit map pointer
+  AliTOFGeometry *fTOFGeometry;  // pointer to the TOF geometry
+  TTree *fTOFdigits;             // pointer to the TOF digit tree
 
   AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable
 
-  ClassDef(AliTOFClusterFinderV1,2) // To run TOF clustering
+  Bool_t fCalibrateTOFtimes;     // used for check
+
+  ClassDef(AliTOFClusterFinderV1,5) // To run TOF clustering
 };
 #endif