]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFcluster.cxx
Enabled option for selecting tree name in trneding macro
[u/mrichter/AliRoot.git] / TOF / AliTOFcluster.cxx
index 316f480926d034d6b6bc27c301c5c92631c1498c..fee67b803dde38b1668f3de829f270d0cd9657af 100644 (file)
@@ -23,100 +23,139 @@ Revision 0.01 2005/07/25 A. De Caro
         (originally implemented by S. Arcelli and C. Zampolli)
 */
 
-// AliTOFcluster Class
-// Description: class for TOF cluster definition
+////////////////////////////////////////////////////////
+//                                                    //
+//    AliTOFcluster Class                             //
+//    Description: class for TOF cluster definition   //
+//                                                    //
+////////////////////////////////////////////////////////
 
 #include "AliTOFcluster.h"
+//#include "AliLog.h"
+//#include "AliGeomManager.h"
+//#include "TGeoMatrix.h"
 
 ClassImp(AliTOFcluster)
 
-AliTOFcluster::AliTOFcluster() {
+AliTOFcluster::AliTOFcluster():
+  AliCluster3D(),
+  fIdx(-1),
+  fQuality(-100), 
+  fR(0),
+  fPhi(0),
+  fTDC(0),
+  fToT(0),
+  fADC(0),
+  fTdcND(0),
+  fTdcRAW(0),
+  fStatus(kTRUE),
+  fDeltaBC(0),
+  fL0L1Latency(0),
+  fESDID(-1)
+ {
   //
   // default ctor
   //
 
   Int_t ii;
-  fR   = 0.;
-  fPhi = 0.;
-  fZ   = 0.;
-  fTDC = 0.;
-  fADC = 0.;
-  fToT = 0.;
-  fTdcND = 0;
-  for (ii=0; ii<3; ii++) fLab[ii]      = -1;
-  fIdx = -1;
   for (ii=0; ii<5; ii++) fdetIndex[ii] = -1;
-  fQuality    = -100; 
 }
 //-------------------------------------------------------------------------
 
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx, Float_t ToT, Double_t TdcND)
-: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 * const ind,
+                            Int_t *par, Bool_t status, Int_t idx):
+  AliCluster3D(volId,x,y,z,sx2,sxy,sxz,sy2,syz,sz2,lab),
+  fIdx(idx),
+  fQuality(-100), 
+  fR(0),
+  fPhi(0),
+  fTDC(par[0]),
+  fToT(par[1]),
+  fADC(par[2]),
+  fTdcND(par[3]),
+  fTdcRAW(par[4]),
+  fStatus(status),
+  fDeltaBC(par[5]),
+  fL0L1Latency(par[6]),
+  fESDID(-1)
+ {
   //
   // 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;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
-  fToT = ToT;
-  fTdcND = TdcND;
-  for (ii=0; ii<3; ii++) fLab[ii]      = l[ii];
-  fIdx = idx;
-  for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-  fQuality    = -100; 
 }
 //-------------------------------------------------------------------------
 
-AliTOFcluster::AliTOFcluster(Double_t *h, Int_t *ind)
-:TObject() {
+AliTOFcluster::AliTOFcluster(const AliTOFcluster & cluster):
+  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),
+  fDeltaBC(cluster.fDeltaBC),
+  fL0L1Latency(cluster.fL0L1Latency),
+  fESDID(-1)
+ {
   //
-  // constructor
+  // copy ctor for AliTOFcluster object
   //
 
   Int_t ii;
-  fR   = h[0];
-  fPhi = h[1];
-  fZ   = h[2];
-  fTDC = h[3];
-  fADC = h[4];
-  for (ii=0; ii<3; ii++) fLab[ii]      = -1;
-  fIdx = -1;
-  for (ii=0; ii<5; ii++) fdetIndex[ii] = ind[ii];
-  fQuality    = -100; 
+  for (ii=0; ii<5; ii++) fdetIndex[ii] = cluster.fdetIndex[ii];
 }
 //-------------------------------------------------------------------------
 
-AliTOFcluster::AliTOFcluster(const AliTOFcluster & cluster)
-:TObject() {
-  //
-  // copy ctor for AliTOFcluster object
-  //
+AliTOFcluster & AliTOFcluster::operator = (const AliTOFcluster & cluster)
+{
+
+  if (this == &cluster)
+    return *this;
+
+  TObject::operator=(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;
+  fDeltaBC=cluster.fDeltaBC;
+  fL0L1Latency=cluster.fL0L1Latency;
+  fESDID = -1;
+  for (Int_t ii=0; ii<5; ii++)
+    fdetIndex[ii] = cluster.fdetIndex[ii];
+  return *this;
 
-  Int_t ii;
-  fR        = cluster.fR;
-  fPhi      = cluster.fPhi;
-  fZ        = cluster.fZ;
-  fTDC      = cluster.fTDC;
-  fADC      = cluster.fADC;
-  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];
-  fQuality    = cluster.fQuality; 
-  fToT    = cluster.fToT; 
-  fTdcND    = cluster.fTdcND; 
 }
 //-------------------------------------------------------------------------
 
 AliTOFcluster::~AliTOFcluster() {
+
   //
   // dtor
   //
 
-  //delete fLab;
-  //delete fdetIndex;
-
 }
+
+