LCOV - code coverage report
Current view: top level - TPC/TPCsim - AliTPCTrackHitsV2.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 56 112 50.0 %
Date: 2016-06-14 17:26:59 Functions: 49 67 73.1 %

          Line data    Source code
       1             : #ifndef ALITPCTRACKHITSV2_H
       2             : #define ALITPCTRACKHITSV2_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /* $Id$ */
       7             : ////////////////////////////////////////////////
       8             : //  Manager class for TPC   hits                   //
       9             : ////////////////////////////////////////////////
      10             : //
      11             : 
      12             : #include "TObject.h"
      13             : #include "TClonesArray.h"
      14             : 
      15             : 
      16             : class AliTPChit;
      17             : class AliTPCTempHitInfoV2;
      18             : class AliTPCCurrentHitV2;
      19             : class AliHit;
      20             : 
      21             : class AliTrackHitsParamV2 : public TObject {
      22             : 
      23             : 
      24             : public:
      25             :   AliTrackHitsParamV2();
      26             : 
      27           0 :    AliTrackHitsParamV2(const AliTrackHitsParamV2 &hit):  TObject(hit),
      28           0 :    fTrackID(0), 
      29           0 :    fVolumeID(0),
      30           0 :    fR(0.),  
      31           0 :    fZ(0.),  
      32           0 :    fFi(0.), 
      33           0 :    fAn(0.), 
      34           0 :    fAd(0.), 
      35           0 :    fTheta(0.), 
      36           0 :    fThetaD(0.), 
      37           0 :    fNHits(0), 
      38           0 :    fHitDistance(0), 
      39           0 :    fCharge(0),
      40           0 :    fTime(0) 
      41           0 :     {hit.Copy(*this);}
      42             :   AliTrackHitsParamV2& operator = (const AliTrackHitsParamV2 &hit)
      43           0 :      {hit.Copy(*this); return (*this);}
      44             :   ~AliTrackHitsParamV2();
      45             : 
      46    16728608 :   Int_t   GetTrackID()            const {return fTrackID;}
      47    16589498 :   Int_t   GetVolumeID()           const {return fVolumeID;}
      48    25599144 :   Float_t GetR()                  const {return fR;}
      49    22381770 :   Float_t GetZ()                  const {return fZ;}
      50    22395910 :   Float_t GetFi()                 const {return fFi;}
      51    36032206 :   Float_t GetAn()                 const {return fAn;}
      52    17965220 :   Float_t GetAd()                 const {return fAd;}
      53    36032206 :   Float_t GetTheta()              const {return fTheta;}
      54    17965220 :   Float_t GetThetaD()             const {return fThetaD;}
      55    15422538 :   Int_t   GetNHits()              const {return fNHits;}
      56             : 
      57           0 :   Short_t HitDistance(Int_t i) const {return fHitDistance[i];}
      58           0 :   Short_t Charge(Int_t i)      const {return fCharge[i];}
      59           0 :   Short_t Time(Int_t i)        const {return fTime[i];}
      60             : 
      61    16479360 :   Short_t& HitDistance(Int_t i) {return fHitDistance[i];}
      62    16479900 :   Short_t& Charge(Int_t i)      {return fCharge[i];}
      63    16479900 :   Short_t& Time(Int_t i)        {return fTime[i];}
      64             : 
      65             :   void SetHitDistance(Int_t i)
      66      140942 :     {Short_t *s=new Short_t[i];
      67      140942 :     delete [] fHitDistance; fHitDistance=s;}
      68             : 
      69             :   void SetCharge(Int_t i)
      70      140942 :     {Short_t *s=new Short_t[i];
      71      140942 :     delete [] fCharge; fCharge=s;}
      72             : 
      73             :   void SetTime(Int_t i)
      74      140942 :     {Short_t *s=new Short_t[i];
      75      140942 :     delete [] fTime; fTime=s;}
      76             : 
      77             :   void ResizeHitDistance(Int_t i)
      78      108640 :     {Short_t *s=new Short_t[i];
      79       54320 :     memcpy(s, fHitDistance, sizeof(Short_t)*i); 
      80      162960 :     delete [] fHitDistance; fHitDistance=s;}
      81             : 
      82             :   void ResizeCharge(Int_t i)
      83      108640 :     {Short_t *s=new Short_t[i];
      84       54320 :     memcpy(s, fCharge, sizeof(Short_t)*i); 
      85      162960 :     delete [] fCharge; fCharge=s;}
      86             : 
      87             :   void ResizeTime(Int_t i)
      88      108640 :     {Short_t *s=new Short_t[i];
      89       54320 :     memcpy(s, fTime, sizeof(Short_t)*i); 
      90      162960 :     delete [] fTime; fTime=s;}
      91             : 
      92      281728 :   void SetTrackID(Int_t id)    {fTrackID=id;}
      93      140942 :   void SetVolumeID(Short_t id) {fVolumeID=id;}
      94      140942 :   void SetR(Float_t r)         {fR=r;}
      95      249110 :   void SetZ(Float_t z)         {fZ=z;}
      96      262710 :   void SetFi(Float_t fi)       {fFi=fi;}
      97     4271542 :   void SetAn(Float_t an)       {fAn=an;}
      98     4271478 :   void SetAd(Float_t ad)       {fAd=ad;}
      99     4257942 :   void SetTheta(Float_t t)     {fTheta=t;}
     100     4257878 :   void SetThetaD(Float_t t)    {fThetaD=t;}
     101      249582 :   void SetNHits(Int_t n)       {fNHits=n;}
     102             : 
     103             :   Float_t Eta() const;
     104             : 
     105             :  private:
     106             :   Int_t fTrackID; // ID of the track
     107             :   Short_t fVolumeID;// volume ID
     108             :   Float_t fR;  //radius
     109             :   Float_t fZ;  //z position
     110             :   Float_t fFi; //radial angle
     111             :   Float_t fAn; //angle with  the radial vector
     112             :   Float_t fAd; //derivation of angle
     113             :   Float_t fTheta; //theta angle
     114             :   Float_t fThetaD; //theta angle derivation
     115             :   Int_t   fNHits; //nuber of thits
     116             :   Short_t * fHitDistance; //[fNHits] array of hits distances
     117             :   Short_t * fCharge; //[fNHits] array of charges
     118             :   Short_t * fTime; //[fNHits] array of hits time
     119             :   static Int_t fgCounter1; //First internal counter
     120             :   static Int_t fgCounter2; // Second internal counter
     121             : 
     122             :   void Copy(TObject &) const
     123           0 :   {Error("Copy","Not Implemented");}
     124             : 
     125          14 :   ClassDef(AliTrackHitsParamV2,2)  
     126             : };
     127             : 
     128             : 
     129             : class AliTPCTrackHitsV2 : public TObject {
     130             : 
     131             : public:
     132             :   AliTPCTrackHitsV2();
     133             :   ~AliTPCTrackHitsV2();
     134           0 :   AliTPCTrackHitsV2(const AliTPCTrackHitsV2 &hit):  TObject(hit), 
     135           0 :   fArray(0), 
     136           0 :   fSize(hit.fSize),           
     137           0 :   fPrecision(hit.fPrecision),  
     138           0 :   fStep(hit.fStep),       
     139           0 :   fMaxDistance(hit.fMaxDistance),   
     140           0 :   fNVolumes(hit.fNVolumes), 
     141           0 :   fVolumes(0),         
     142           0 :   fTempInfo(hit.fTempInfo), 
     143           0 :   fCurrentHit(hit.fCurrentHit),  
     144           0 :   fHit(hit.fHit) 
     145           0 :     { //
     146             :       //copy constructor
     147             :       //
     148             :         
     149           0 :       (*fArray) = (*hit.fArray);
     150             :         //
     151           0 :         delete [] fVolumes;
     152           0 :         fVolumes = new Int_t[fNVolumes];
     153           0 :         memcpy(fVolumes,hit.fVolumes,fNVolumes*sizeof(Int_t));
     154           0 :     }
     155             :   AliTPCTrackHitsV2& operator = (const AliTPCTrackHitsV2 &hit)
     156             :     {
     157           0 :       if(this!=&hit){
     158           0 :         TObject::operator=(hit);
     159           0 :         fSize=hit.fSize;           
     160           0 :         fPrecision=hit.fPrecision;  
     161           0 :         fStep=hit.fStep;       
     162           0 :         fMaxDistance=hit.fMaxDistance;   
     163           0 :         fNVolumes=hit.fNVolumes;                   
     164           0 :         fTempInfo=hit.fTempInfo; 
     165           0 :         fCurrentHit=hit.fCurrentHit;  
     166           0 :         fHit=hit.fHit;
     167             :         //
     168             :         //delete fArray;
     169           0 :         fArray->Clear();
     170           0 :         (*fArray)=(*hit.fArray);  
     171             :         //
     172           0 :         delete [] fVolumes;
     173           0 :         fVolumes = new Int_t[fNVolumes];
     174           0 :         memcpy(fVolumes,hit.fVolumes,fNVolumes*sizeof(Int_t));
     175             :         //
     176           0 :       }
     177             :      
     178           0 :      return *this;
     179             :     }
     180             : 
     181             : 
     182             :   void Clear(Option_t * /*option*/ ="");
     183             :   void AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x, 
     184             :                     Double_t y, Double_t z,Int_t q,Float_t time);
     185             :   void AddHit(Int_t volumeID, Int_t trackID, Double_t r, 
     186             :               Double_t z, Double_t fi,Int_t q,Float_t time);
     187             :  
     188             :   Bool_t First(); //set current hit to first hit 
     189             :   Bool_t Next();  //set current hit to next
     190             :   AliHit * GetHit() const;
     191             :   AliTrackHitsParamV2 * GetParam();
     192             : 
     193         224 :   TClonesArray * GetArray(){return fArray;}
     194           0 :   Int_t  GetEntriesFast() const { return fSize;}
     195     1479706 :   void SetHitPrecision(Double_t prec) {fPrecision=prec;}
     196           2 :   void SetStepPrecision(Double_t prec) {fStep=prec;}
     197           2 :   void SetMaxDistance(UInt_t distance) {fMaxDistance = distance;}
     198             :   Bool_t  FlushHitStack(Bool_t force=kTRUE);    //
     199       16128 :   Int_t *  GetVolumes(){ return fVolumes;}
     200       16128 :   Int_t GetNVolumes() const {return fNVolumes;}
     201     4552282 :   static Double_t GetKPrecision()  {return fgkPrecision;}
     202     4307844 :   static Double_t GetKPrecision2() {return fgkPrecision2;}
     203             : 
     204             : public:
     205             :   void AddVolume(Int_t volume); //add volumes to tthe list of volumes
     206             :   void FlushHitStack2(Int_t index1, Int_t index2);   //
     207             : 
     208             : protected:
     209             :   TClonesArray * fArray;  //array of compressed hits
     210             :   Int_t fSize;            //total number of hits in track
     211             :   Double_t fPrecision;  // required precision
     212             :   Double_t fStep;       //unit step size
     213             :   UInt_t fMaxDistance;   //maximal distance between two connected hits 
     214             :   Int_t fNVolumes;      //number of volumes in track  
     215             :   Int_t *  fVolumes;    //[fNVolumes] list of volumes
     216             :   AliTPCTempHitInfoV2 * fTempInfo; //!information about track
     217             :   AliTPCCurrentHitV2  * fCurrentHit; //!information about current hit 
     218             :   AliHit * fHit;                     //! current hit information
     219             :   static const Double_t fgkPrecision;  //precision 
     220             :   static const Double_t fgkPrecision2;  //precision
     221             :   static const Double_t fgkTimePrecision;  //hit time precision 
     222             :   static Int_t fgCounter1; // First internal counter
     223             :   static Int_t fgCounter2; // Second internal counter
     224             : 
     225             : private:
     226             :   void Copy(TObject &) const
     227           0 :   {Error("Copy","Not Implemented");}
     228             : 
     229             : 
     230          22 :   ClassDef(AliTPCTrackHitsV2,2) 
     231             : };
     232             : 
     233             : class AliTPCCurrentHitV2 {
     234             : public:
     235    74996940 :   Int_t    GetStackIndex() const {return fStackIndex;}
     236    16473176 :   void     SetStackIndex(Int_t i) {fStackIndex=i;}
     237    19419564 :   Int_t    GetParamIndex() const {return fParamIndex;}
     238     1474004 :   void     SetParamIndex(Int_t i) {fParamIndex=i;}
     239    89995032 :   Double_t GetR() const {return fR;}
     240    16472636 :   void     SetR(Double_t r) {fR=r;}
     241    30000606 :   Bool_t   GetStatus() const {return fStatus;}
     242         591 :   void     SetStatus(Bool_t s) {fStatus=s;}
     243             : private:
     244             :   Int_t   fParamIndex;//  - current param pointer
     245             :   Int_t   fStackIndex; // - current hit stack index
     246             :   Double_t fR;   //current Radius
     247             :   Bool_t  fStatus; //current status    
     248             : };   
     249             : 
     250             : 
     251             : 
     252             : #endif //ALITPCTRACKHITSV2_H

Generated by: LCOV version 1.11