]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/info/AliTRDclusterInfo.h
move OCDB manipulation from local train (run.C) to the task level
[u/mrichter/AliRoot.git] / PWG1 / TRD / info / AliTRDclusterInfo.h
1 #ifndef ALITRDCLUSTERINFO_H
2 #define ALITRDCLUSTERINFO_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7
8 #ifndef Root_TObject
9 #include "TObject.h"
10 #endif
11
12 class AliTRDcluster;
13 class AliTRDclusterInfo : public TObject
14 {
15 public:
16   AliTRDclusterInfo();
17
18   Float_t   GetAnisochronity() const {return fD;}
19   inline void GetCluster(Int_t &det, Float_t &x, Float_t &y, Float_t &z, Float_t &q, Int_t &t, Float_t *cov=0x0) const;
20   void      GetMC(Int_t &pdg, Int_t &label) const{
21       pdg  = fPdg;
22       label= fLbl; }
23   void      GetGlobalPosition(Float_t &yt, Float_t &zt, Float_t &dydx, Float_t &dzdx, Float_t *cov=0x0) const {
24       dydx = fdydx;
25       dzdx = fdzdx;
26       yt   = fYt;
27       zt   = fZt;
28       if(cov) memcpy(cov, fCov, 3*sizeof(Float_t));}
29   void      GetCenterPad(Int_t &c, Int_t &r) const {c=fCol; r=fRow;}
30   Float_t   GetResolution() const {return fdy;}
31   Float_t   GetDriftLength() const {return fXd;}
32   Float_t   GetYDisplacement() const {return fYd;}
33   Float_t   GetTilt() const { return fTilt;}
34
35   void      Print(Option_t *opt="") const;
36
37   void      SetAnisochronity(Float_t d) {fD = d;}
38   void      SetCluster(const AliTRDcluster *c);
39   void      SetMC(Int_t pdg, Int_t label){
40       fPdg  = pdg;
41       fLbl  = label;}
42   void      SetGlobalPosition(Float_t yt, Float_t zt, Float_t dydx, Float_t dzdx, Float_t *cov=0x0) {
43       fdydx = dydx;
44       fdzdx = dzdx;
45       fYt   = yt;
46       fZt   = zt;
47       if(cov) memcpy(fCov, cov, 3*sizeof(Float_t));}
48   void      SetResolution(Float_t dy) {fdy = dy;}
49   void      SetDriftLength(Float_t d) {fXd = d;}
50   void      SetTilt(Float_t t) {fTilt = t;}
51
52 private:
53   UShort_t fDet;   // detector
54   UChar_t  fCol;   // central pad column
55   UChar_t  fRow;   // pad row
56   Short_t  fPdg;   // particle code
57   Short_t  fLbl;   // track label (MC)
58   Short_t  fLocalTime; // calibrate drift time
59   Float_t  fQ;     // cluster charge (REC)
60   Float_t  fX;     // x coordinate (REC)
61   Float_t  fY;     // y coordinate (REC)
62   Float_t  fYd;    // displacement from pad center y coordinate
63   Float_t  fZ;     // z coordinate (REC)
64   Float_t  fdydx;  // slope in phi (MC)
65   Float_t  fdzdx;  // slope in theta (MC)
66   Float_t  fXd;    // drift length
67   Float_t  fYt;    // y coordinate (MC)
68   Float_t  fZt;    // z coordinate (MC)
69   Float_t  fCov[3];// covariance matrix in the yz plane (track)
70   Float_t  fCovCl[3];// covariance matrix in the yz plane (cluster)
71   Float_t  fdy;    // difference in y after tilt correction
72   Float_t  fD;     // distance to the anode wire
73   Float_t  fTilt;  // pad tilt;
74
75   ClassDef(AliTRDclusterInfo, 2) // extracted cluster2MC information
76 };
77
78
79 //_________________________________________________
80 inline void AliTRDclusterInfo::GetCluster(Int_t &det, Float_t &x, Float_t &y, Float_t &z, Float_t &q, Int_t &t, Float_t *cov) const
81 {
82   det = fDet;
83   x   = fX;
84   y   = fY;
85   z   = fZ;
86   q   = fQ;
87   t   = fLocalTime;
88   if(cov) memcpy(cov, fCovCl, 3*sizeof(Float_t));
89 }
90
91 #endif
92