////////////////////////////////////////////////////////
#include "AliTOFcluster.h"
+#include "AliLog.h"
+#include "AliGeomManager.h"
+#include "TGeoMatrix.h"
ClassImp(AliTOFcluster)
AliTOFcluster::AliTOFcluster():
+ AliCluster3D(),
fIdx(-1),
+ fQuality(-100),
fR(0),
fPhi(0),
- fZ(0),
- fQuality(-100),
fTDC(0),
fToT(0),
fADC(0),
//
Int_t ii;
- for (ii=0; ii<3; ii++) fLab[ii] = -1;
for (ii=0; ii<5; ii++) fdetIndex[ii] = -1;
}
//-------------------------------------------------------------------------
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par, Bool_t status,Int_t *l, Int_t idx):
- TObject(),
+AliTOFcluster::AliTOFcluster(UShort_t volId,
+ Float_t x, Float_t y, Float_t z,
+ Float_t sx2, Float_t sxy, Float_t sxz,
+ Float_t sy2, Float_t syz,
+ Float_t sz2, Int_t *lab, Int_t *ind, Int_t *par, Bool_t status, Int_t idx):
+ AliCluster3D(volId,x,y,z,sx2,sxy,sxz,sy2,syz,sz2,lab),
fIdx(idx),
- fR(h[0]),
- fPhi(h[1]),
- fZ(h[2]),
fQuality(-100),
+ fR(0),
+ fPhi(0),
fTDC(par[0]),
fToT(par[1]),
fADC(par[2]),
//
// constructor
//
+ Int_t ii;
+ for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
+
+ Float_t xyz[3];
+ GetGlobalXYZ(xyz);
+ fR=TMath::Sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
+ fPhi=TMath::ATan2(xyz[1], xyz[0]);
- Int_t ii;
- for (ii=0; ii<3; ii++) fLab[ii] = l[ii];
- for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-}
-//-------------------------------------------------------------------------
-
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par):
- TObject(),
- fIdx(-1),
- fR(h[0]),
- fPhi(h[1]),
- fZ(h[2]),
- fQuality(-100),
- fTDC(par[0]),
- fToT(par[1]),
- fADC(par[2]),
- fTdcND(par[3]),
- fTdcRAW(par[4]),
- fStatus(kTRUE)
- {
- //
- // constructor
- //
-
- Int_t ii;
- for (ii=0; ii<3; ii++) fLab[ii] = -1;
- for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
}
//-------------------------------------------------------------------------
AliTOFcluster::AliTOFcluster(const AliTOFcluster & cluster):
- TObject(),
- fIdx(-1),
- fR(0),
- fPhi(0),
- fZ(0),
- fQuality(-100),
- fTDC(0),
- fToT(0),
- fADC(0),
- fTdcND(0),
- fTdcRAW(0),
- fStatus(kTRUE)
+ AliCluster3D(cluster),
+ fIdx(cluster.fIdx),
+ fQuality(cluster.fQuality),
+ fR(cluster.fR),
+ fPhi(cluster.fPhi),
+ fTDC(cluster.fTDC),
+ fToT(cluster.fToT),
+ fADC(cluster.fADC),
+ fTdcND(cluster.fTdcND),
+ fTdcRAW(cluster.fTdcRAW),
+ fStatus(cluster.fStatus)
{
//
// copy ctor for AliTOFcluster object
//
Int_t ii;
- fR = cluster.fR;
- fPhi = cluster.fPhi;
- fZ = cluster.fZ;
- fQuality = cluster.fQuality;
- for (ii=0; ii<3; ii++) fLab[ii] = cluster.fLab[ii];
- fIdx = cluster.fIdx;
for (ii=0; ii<5; ii++) fdetIndex[ii] = cluster.fdetIndex[ii];
- fTDC = cluster.fTDC;
- fToT = cluster.fToT;
- fADC = cluster.fADC;
- fTdcND = cluster.fTdcND;
- fTdcRAW = cluster.fTdcRAW;
- fStatus = cluster.fStatus;
}
//-------------------------------------------------------------------------
AliTOFcluster::~AliTOFcluster() {
+
//
// dtor
//
- //delete fLab;
- //delete fdetIndex;
-
}
+
+
//////////////////////////////////////////////
#include "TMath.h"
-#include "TObject.h"
+#include "AliCluster3D.h"
-class AliTOFcluster : public TObject {
+class AliTOFcluster : public AliCluster3D {
public:
AliTOFcluster(); // default ctor
- AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par, Bool_t status,Int_t *l, Int_t idx); // ctor
- AliTOFcluster(Double_t *h, Int_t *ind, Int_t *par); // ctor
+ AliTOFcluster(UShort_t volId,
+ Float_t x, Float_t y, Float_t z,
+ Float_t sx2, Float_t sxy, Float_t sxz,
+ Float_t sy2, Float_t syz,
+ Float_t sz2, Int_t *lab, Int_t *ind, Int_t *par, Bool_t status, Int_t idx); // ctor
AliTOFcluster(const AliTOFcluster & cluster); // copy ctor
virtual ~AliTOFcluster(); // dtor
+ // Getters and Setters
Double_t GetR() const {return fR;} // Cluster Radius
Double_t GetPhi() const {return fPhi;} // Cluster Phi
- Double_t GetZ() const {return fZ;} // Cluster Z
Int_t GetTDC() const {return fTDC;} // Cluster ToF
Int_t GetTDCND() const {return fTdcND;} // Cluster ToF
Int_t GetTDCRAW() const {return fTdcRAW;} // Cluster Raw time
Int_t GetADC() const {return TMath::Abs(fADC);} // Cluster Charge
Int_t GetToT() const {return fToT;} // Cluster Charge
Int_t IsUsed() const {return (fADC<0) ? 1 : 0;} // Flagging
- Int_t GetLabel(Int_t n) const {return fLab[n];} // Labels of tracks in Cluster
Int_t GetDetInd(Int_t n) const {return fdetIndex[n];} // Cluster Detector Indeces
Int_t GetIndex() const {return fIdx;} // Cluster Index
- void Use() {fADC=-fADC;}
+ void Use(Int_t = 0) {fADC=-fADC;}
Double_t GetQuality() const {return fQuality;}
void SetQuality(Double_t quality) {fQuality = quality;}
Bool_t GetStatus() const {return fStatus;}
private:
- Int_t fLab[3]; // track labels
Int_t fIdx; // index of this cluster
Int_t fdetIndex[5]; // Cluster detector Indeces (sector,plate,strip,padz,padx)
- // Cluster Position
+ // Cluster Quality
+ Double_t fQuality; // quality of the best track
+
+ // Cluster Global Position
Double_t fR; // r-coordinate
Double_t fPhi; // phi-coordinate
- Double_t fZ; // z-coordinate
- Double_t fQuality; // quality of the best track
// TOF Signal parameters
Int_t fTDC; // TDC count
Int_t fTdcRAW; // RAW TDC count
Bool_t fStatus; // cluster online status
- ClassDef(AliTOFcluster, 5) // TOF cluster
+ ClassDef(AliTOFcluster, 6) // TOF cluster
};
#endif