LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliComplexCluster.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 29 153 19.0 %
Date: 2016-06-14 17:26:59 Functions: 33 155 21.3 %

          Line data    Source code
       1             : #ifndef ALICOMPLEXCLUSTER_H
       2             : #define ALICOMPLEXCLUSTER_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /// \class AliComplexCluster
       7             : ///
       8             : /// \author M. Ivanov
       9             : 
      10             : #include "TObject.h"
      11             : #include "TMath.h"
      12             : #include "AliTPCclusterMI.h"
      13             : #include "limits.h"
      14             : 
      15             : namespace AliComplexClusterHelper {
      16             :   inline Int_t Clamp(Int_t val, Int_t min, Int_t max)
      17             :   {
      18             :     // limit to range, inspire by boost clamp
      19     3720960 :     return (val<min)?min:(val>max)?max:val;
      20             :   }
      21             : }
      22             : 
      23             : 
      24           0 : class AliComplexCluster : public TObject {
      25             : public:
      26             : 
      27             :   AliComplexCluster();
      28           0 :   virtual ~AliComplexCluster() {;}
      29             :   Bool_t    IsSortable() const;
      30             :   Int_t Compare(const TObject *o) const;
      31             :   // the following getters are needed by HLT
      32             :   // please dont remove... C. Loizides
      33           0 :   Int_t GetTrack(Int_t i)const {return fTracks[i];} //labels of overlapped tracks
      34           0 :   Float_t GetX()const {return fX;}
      35           0 :   Float_t GetY()const {return fY;}
      36           0 :   Float_t GetQ()const {return fQ;}
      37           0 :   Float_t GetSigmaX2()const {return fSigmaX2;}
      38           0 :   Float_t GetSigmaY2()const {return fSigmaY2;}
      39           0 :   Float_t GetSigmaXY()const {return fSigmaXY;}
      40           0 :   Float_t GetArea()const {return fArea;}
      41           0 :   Float_t GetMax()const {return fMax;}
      42             : private:
      43             :   Int_t     fTracks[3];///< labels of overlapped tracks
      44             :   Float_t   fX ;       ///< Y of cluster
      45             :   Float_t   fY ;       ///< Z of cluster
      46             :   Float_t   fQ ;       ///< Q of cluster (in ADC counts)
      47             :   Float_t   fSigmaX2;  ///< Sigma Y square of cluster
      48             :   Float_t   fSigmaY2;  ///< Sigma Z square of cluster
      49             :   Float_t   fSigmaXY;  ///< XY moment
      50             :   Float_t   fArea;     ///< area of cluster
      51             :   Float_t   fMax;     ///< amplitude at maximum
      52             : 
      53             :   /// \cond CLASSIMP
      54          24 :   ClassDef(AliComplexCluster, 1);
      55             :   /// \endcond
      56             : 
      57             :     // Cluster manager
      58             : };
      59             : 
      60             : //RS: this is old, non-economical and virtualized class, for bwd compatibility only
      61           0 : class AliTPCTrackerPoint  {  
      62             :  public:
      63             : 
      64             :   AliTPCTrackerPoint():
      65           0 :     fTX(0),
      66           0 :     fTZ(0),
      67           0 :     fTY(0),
      68           0 :     fTAngleZ(0),
      69           0 :     fTAngleY(0),
      70           0 :     fSigmaZ(0),
      71           0 :     fSigmaY(0),
      72           0 :     fErrZ(0),
      73           0 :     fErrY(0),
      74           0 :     fIsShared(0){}
      75           0 :   virtual ~AliTPCTrackerPoint(){}
      76             :   AliTPCTrackerPoint &operator=(const AliTPCTrackerPoint& o);
      77           0 :   Float_t  GetX() const  {return (fTX*0.01);}
      78           0 :   Float_t  GetZ() const {return (fTZ*0.01);}
      79           0 :   Float_t  GetY() const {return (fTY*0.01);}
      80           0 :   Float_t  GetAngleZ() const  {return (Float_t(fTAngleZ)*0.02);}
      81           0 :   Float_t  GetAngleY() const {return (Float_t(fTAngleY)*0.02);}
      82             :   //
      83           0 :   void     SetX(Float_t x)  { fTX = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(x*100.), SHRT_MIN, SHRT_MAX));}
      84           0 :   void     SetY(Float_t y)  { fTY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
      85           0 :   void     SetZ(Float_t z)  { fTZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
      86           0 :   void     SetAngleZ(Float_t anglez) {fTAngleZ = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(anglez*50.),SCHAR_MIN,SCHAR_MAX));}
      87           0 :   void     SetAngleY(Float_t angley) {fTAngleY = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(angley*50.),SCHAR_MIN,SCHAR_MAX));}
      88           0 :   Float_t  GetSigmaZ() const {return (fSigmaZ*0.02);}
      89           0 :   Float_t  GetSigmaY() const {return (fSigmaY*0.02);}  
      90           0 :   Float_t  GetErrZ()   const {return (fErrZ*0.005);}
      91           0 :   Float_t  GetErrY()   const {return (fErrY*0.005);}
      92           0 :   void     SetErrZ(Float_t errz) {fErrZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(errz*200.),0,UCHAR_MAX));}
      93           0 :   void     SetErrY(Float_t erry) {fErrY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(erry*200.),0,UCHAR_MAX));}
      94             : 
      95           0 :   void     SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
      96           0 :   void     SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
      97             : 
      98           0 :   Char_t   IsShared() const {return fIsShared;}
      99           0 :   void     SetShared(Char_t s) {fIsShared=s;}
     100             :   //
     101             :  private:
     102             :   Short_t   fTX;        ///< x position of the cluster  in cm - 10 mum prec
     103             :   Short_t   fTZ;        ///< current prolongation in Z  in cm - 10 mum prec.
     104             :   Short_t   fTY;        ///< current prolongation in Y  in cm - 10 mum prec.
     105             :   Char_t    fTAngleZ;    ///< angle
     106             :   Char_t    fTAngleY;    ///< angle
     107             :   UShort_t  fSigmaZ;     ///< shape  Z - normalised shape - normaliziation 1 - precision 2 percent
     108             :   UShort_t  fSigmaY;     ///< shape  Y - normalised shape - normaliziation 1 - precision 2 percent
     109             :   UShort_t  fErrZ;       ///< z error estimate - in  mm - 50 mum precision
     110             :   UShort_t  fErrY;       ///< y error estimate - in  mm - 50 mum precision
     111             :   Char_t   fIsShared;     ///< indicate sharing of the point between several tracks
     112             : 
     113             :   /// \cond CLASSIMP
     114          24 :   ClassDef(AliTPCTrackerPoint, 2);
     115             :   /// \endcond  
     116             : };
     117             : 
     118             : //RS: this is new, more economic class for TrackerPoints, avoiding vtable pointer per point
     119             : class AliTPCTrackerPoints  {  
     120             :   //
     121             :  public:
     122             :   class Point {
     123             :   public:
     124    10159464 :   Point():fTX(0),fTZ(0),fTY(0),fTAngleZ(0),fTAngleY(0),fSigmaZ(0),fSigmaY(0),fErrZ(0),fErrY(0) {}
     125     9941952 :     ~Point(){}
     126             :     Point &operator=(const Point& o) {
     127           0 :       if(this!=&o) {
     128           0 :         fTX = o.fTX;
     129           0 :         fTY = o.fTY;
     130           0 :         fTZ = o.fTZ;
     131           0 :         fTAngleZ = o.fTAngleZ;
     132           0 :         fTAngleY = o.fTAngleY;
     133           0 :         fSigmaZ = o.fSigmaZ;
     134           0 :         fSigmaY = o.fSigmaY;
     135           0 :         fErrZ   = o.fErrZ;
     136           0 :         fErrY   = o.fErrY;
     137           0 :       }
     138           0 :       return *this;
     139             :     }
     140             :     //
     141             :     Point &operator=(const AliTPCTrackerPoint& o) {
     142           0 :       fTX = o.GetX();
     143           0 :       fTY = o.GetY();
     144           0 :       fTZ = o.GetZ();
     145           0 :       fTAngleZ = o.GetAngleZ();
     146           0 :       fTAngleY = o.GetAngleY();
     147           0 :       fSigmaZ = o.GetSigmaZ();
     148           0 :       fSigmaY = o.GetSigmaY();
     149           0 :       fErrZ   = o.GetErrZ();
     150           0 :       fErrY   = o.GetErrY();
     151           0 :       return *this;
     152             :     }
     153       12960 :     Float_t  GetX() const  {return (fTX*0.01);}
     154        6688 :     Float_t  GetZ() const {return (fTZ*0.01);}
     155        6688 :     Float_t  GetY() const {return (fTY*0.01);}
     156      265296 :     Float_t  GetAngleZ() const  {return (Float_t(fTAngleZ)*0.02);}
     157      265296 :     Float_t  GetAngleY() const {return (Float_t(fTAngleY)*0.02);}
     158             :     //
     159      206720 :     void     SetX(Float_t x)  { fTX = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(x*100.), SHRT_MIN, SHRT_MAX));}
     160      206720 :     void     SetY(Float_t y)  { fTY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
     161      206720 :     void     SetZ(Float_t z)  { fTZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
     162      206720 :     void     SetAngleZ(Float_t anglez) {fTAngleZ = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(anglez*50.),SCHAR_MIN,SCHAR_MAX));}
     163      206720 :     void     SetAngleY(Float_t angley) {fTAngleY = Char_t(AliComplexClusterHelper::Clamp(TMath::Nint(angley*50.),SCHAR_MIN,SCHAR_MAX));}
     164             :     //
     165           0 :     Float_t  GetSigmaZ() const {return (fSigmaZ*0.02);}
     166      269816 :     Float_t  GetSigmaY() const {return (fSigmaY*0.02);}  
     167           0 :     Float_t  GetErrZ()   const {return (fErrZ*0.005);}
     168           0 :     Float_t  GetErrY()   const {return (fErrY*0.005);}
     169             :     //
     170      206720 :     void     SetErrZ(Float_t errz) {fErrZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(errz*200.),0,UCHAR_MAX));}
     171      206720 :     void     SetErrY(Float_t erry) {fErrY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(erry*200.),0,UCHAR_MAX));}
     172      206720 :     void     SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
     173      206720 :     void     SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
     174             : 
     175             :     //
     176             :   private:
     177             :     Short_t   fTX;        ///< x position of the cluster  in cm - 10 mum prec
     178             :     Short_t   fTZ;        ///< current prolongation in Z  in cm - 10 mum prec.
     179             :     Short_t   fTY;        ///< current prolongation in Y  in cm - 10 mum prec.
     180             :     Char_t    fTAngleZ;    ///< angle
     181             :     Char_t    fTAngleY;    ///< angle
     182             :     UChar_t   fSigmaZ;     ///< shape  Z - normalised shape - normaliziation 1 - precision 2 percent
     183             :     UChar_t   fSigmaY;     ///< shape  Y - normalised shape - normaliziation 1 - precision 2 percent
     184             :     UChar_t   fErrZ;       ///< z error estimate - in  mm - 50 mum precision
     185             :     UChar_t   fErrY;       ///< y error estimate - in  mm - 50 mum precision
     186             :   };
     187             :   
     188             :  public:
     189             :   AliTPCTrackerPoints();
     190     2563648 :   ~AliTPCTrackerPoints() {}
     191             :   AliTPCTrackerPoints &operator=(const AliTPCTrackerPoints& o);
     192             :   AliTPCTrackerPoints(const AliTPCTrackerPoints& o);
     193             :   void Clear();
     194             :   //
     195        1152 :   void     SetShared(int i)      {fShared[i/8] |= 0x1<<(i%8);}
     196      273560 :   Bool_t   IsShared(int i) const {return fShared[i/8] & 0x1<<(i%8);}
     197      482136 :   const Point*   GetPoint(int i) const {return &fPoints[i];}
     198             :   void     SetPoint(int i, const AliTPCTrackerPoint* o);
     199             :   //
     200             :  protected:
     201             :   //
     202             :   UChar_t  fShared[20];         // shared map
     203             :   Point    fPoints[159];        // array of compact non-virtualized points
     204             :   //
     205          30 :   ClassDef(AliTPCTrackerPoints, 1);
     206             : };
     207             : 
     208           0 : class AliTPCClusterPoint  {
     209             :  public:
     210             :   AliTPCClusterPoint():
     211           0 :                       fCZ(0),
     212           0 :                       fCY(0), 
     213           0 :                       fSigmaZ(0),
     214           0 :                       fSigmaY(0),
     215           0 :                       fQ(0),
     216           0 :                       fMax(0),
     217           0 :                       fCType(0){}
     218           0 :   virtual ~AliTPCClusterPoint(){}
     219           0 :   Float_t  GetZ() const    {return (fCZ*0.01);}
     220           0 :   Float_t  GetY() const   {return (fCY*0.01);}
     221           0 :   Float_t  GetSigmaZ() const {return (fSigmaZ*0.02);}
     222           0 :   Float_t  GetSigmaY() const {return (fSigmaY*0.02);}  
     223           0 :   Int_t  GetType() const  {return fCType;}
     224           0 :   Int_t  GetMax()  const {return fMax;}
     225           0 :   Float_t  GetQ()  const {return fQ;}
     226             : 
     227             :   //
     228           0 :   void     SetY(Float_t y){ fCY = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(y*100.), SHRT_MIN, SHRT_MAX));}
     229           0 :   void     SetZ(Float_t z){ fCZ = Short_t(AliComplexClusterHelper::Clamp(TMath::Nint(z*100.), SHRT_MIN, SHRT_MAX));}
     230           0 :   void     SetSigmaZ(Float_t sigmaz) {fSigmaZ = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmaz*50.),0,UCHAR_MAX));}
     231           0 :   void     SetSigmaY(Float_t sigmay) {fSigmaY = UChar_t(AliComplexClusterHelper::Clamp(TMath::Nint(sigmay*50.),0,UCHAR_MAX));}
     232             : 
     233           0 :   void     SetQ(Float_t q) {fQ = UShort_t(q);}
     234           0 :   void     SetMax(Float_t max) {fMax = UShort_t(max);}
     235           0 :   void     SetType(Char_t type) {fCType = type;}
     236             :  private:
     237             :   Short_t  fCZ;       ///< current cluster position Z in cm - 100 mum precision
     238             :   Short_t  fCY;       ///< current cluster position Y in cm - 100 mum precision
     239             :   UChar_t  fSigmaZ;   ///< shape  Z - normalised shape - normaliziation 1 - precision 2 percent
     240             :   UChar_t  fSigmaY;   ///< shape  Y - normalised shape - normaliziation 1 - precision 2 percent
     241             :   UShort_t fQ;        ///< total charge in cluster
     242             :   UShort_t fMax;      ///< charge at maximum
     243             :   Char_t   fCType;    ///< type of the cluster
     244             : 
     245             :   /// \cond CLASSIMP
     246          24 :   ClassDef(AliTPCClusterPoint, 1);
     247             :   /// \endcond  
     248             : };
     249             : 
     250             : 
     251           0 : class AliTPCExactPoint : public TObject{
     252             :  public:
     253           0 :   AliTPCExactPoint():TObject(),
     254           0 :     fEZ(0.),
     255           0 :     fEY(0.),
     256           0 :     fEX(0.),
     257           0 :     fEAngleZ(0.),
     258           0 :     fEAngleY(0.),
     259           0 :     fEAmp(0.),
     260           0 :     fEPrim(0.),
     261           0 :     fTrackID(0),
     262           0 :     fRow(0),
     263           0 :     fSec(0){}
     264             :  private:
     265             :   Float_t fEZ;       ///< current "exact" position according simulation
     266             :   Float_t fEY;       ///< current "exact" position according simulation
     267             :   Float_t fEX;       ///< x poistion of the cluster
     268             :   Float_t fEAngleZ;  ///< angle Z
     269             :   Float_t fEAngleY;  ///< angle Y
     270             :   Float_t fEAmp;     ///< total charge deposited in row
     271             :   Float_t fEPrim;    ///< primary charge deposited in row
     272             :   Int_t   fTrackID;  ///< id of the track
     273             :   Int_t   fRow;      ///< row
     274             :   Int_t   fSec;      ///< sector
     275             : 
     276             :   /// \cond CLASSIMP
     277          24 :   ClassDef(AliTPCExactPoint, 1);
     278             :   /// \endcond 
     279             : };
     280             : 
     281             : 
     282           0 : class AliTPCTrackPoint: public TObject{
     283             :  public:
     284           0 :   AliTPCTrackPoint():TObject(),
     285           0 :     fTPoint(),
     286           0 :     fCPoint(){}
     287             : 
     288             :   // AliTPCClusterPoint & GetCPoint(){return fCPoint;}
     289           0 :   AliTPCTrackerPoint & GetTPoint(){return fTPoint;}
     290           0 :   AliTPCclusterMI & GetCPoint(){return fCPoint;}  
     291             :  private:
     292             :   //  AliTPCClusterPoint fCPoint; 
     293             :   //Char_t fIsShared;
     294             :   AliTPCTrackerPoint fTPoint;  ///< track point
     295             :   AliTPCclusterMI    fCPoint;  ///< cluster point
     296             : 
     297             :   /// \cond CLASSIMP
     298          24 :   ClassDef(AliTPCTrackPoint, 1);
     299             :   /// \endcond
     300             : };
     301             : 
     302           0 : class AliTPCTrackPoint2: public AliTPCTrackPoint{
     303             :  public:
     304           0 :   AliTPCTrackPoint2():AliTPCTrackPoint(),
     305           0 :     fGX(0.),
     306           0 :     fGY(0.),
     307           0 :     fGZ(0.),
     308           0 :     fDY(0.),
     309           0 :     fDZ(0.),
     310           0 :     fDYU(0.),
     311           0 :     fDYD(0),
     312           0 :     fDZU(0.),
     313           0 :     fDZD(0.),
     314           0 :     fDDY(0),
     315           0 :     fDDZ(0.),
     316           0 :     fID(0),
     317           0 :     fLab(0){}
     318             :  private: 
     319             :   Float_t fGX;    ///< global poition of the point
     320             :   Float_t fGY;    ///< global poition of the point
     321             :   Float_t fGZ;    ///< global poition of the point
     322             :   //
     323             :   Float_t fDY;    ///< distortion of the clusters from the global helix (3 point interpolation)
     324             :   Float_t fDZ;    ///< distortion of the clusters from the global helix (3 point interpolation)
     325             :   //
     326             :   Float_t fDYU;  ///< derivation in y up
     327             :   Float_t fDYD;  ///< distortion of y down
     328             :   //
     329             :   Float_t fDZU;  ///< derivation in y up
     330             :   Float_t fDZD;  ///< distortion of y down
     331             :   //
     332             :   Float_t fDDY;  ///< derivation in y,z up-down
     333             :   Float_t fDDZ;  ///< derivation in y,z up-down
     334             :   //
     335             :   Int_t   fID;            ///< id of the corresponding track
     336             :   Int_t   fLab;           ///< MC label of the track
     337             : 
     338             :   /// \cond CLASSIMP
     339          24 :   ClassDef(AliTPCTrackPoint2, 1);
     340             :   /// \endcond
     341             : };
     342             : 
     343             : #endif //ALICOMPLEXCLUSTER_H

Generated by: LCOV version 1.11