LCOV - code coverage report
Current view: top level - TOF/TOFbase - AliTOFTDCHit.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 36 38 94.7 %
Date: 2016-06-14 17:26:59 Functions: 10 11 90.9 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             : ***************************************************************************/
      15             : 
      16             : /*
      17             :   author: Roberto Preghenella (R+), preghenella@bo.infn.it
      18             : */
      19             : 
      20             : 
      21             : //////////////////////////////////////////////////////////////////////
      22             : //                                                                  //
      23             : //                                                                  //
      24             : //        This class provides a definition for TDC hits.            //
      25             : //                                                                  //
      26             : //                                                                  //
      27             : //////////////////////////////////////////////////////////////////////
      28             : 
      29             : #include "AliTOFTDCHit.h"
      30             : #define TIME_BIN_WIDTH          24.4e-3//ns
      31             : #define TOT_BIN_WIDTH           48.8e-3//ns
      32             : #define TIME_TO_TOT_BIN_WIDTH   ( TIME_BIN_WIDTH / TOT_BIN_WIDTH )
      33             : #define TOT_TO_TIME_BIN_WIDTH   ( TOT_BIN_WIDTH / TIME_BIN_WIDTH )
      34             : 
      35          26 : ClassImp(AliTOFTDCHit)
      36             : 
      37             : AliTOFTDCHit::AliTOFTDCHit() :
      38         656 :   TObject(),
      39         656 :   fHitTime(0),
      40         656 :   fTOTWidth(0),
      41         656 :   fChan(0),
      42         656 :   fTDCID(0),
      43         656 :   fEBit(0),
      44         656 :   fPSBits(0)
      45        3280 : {
      46             :   /* default constructor */
      47        1312 : }
      48             : 
      49             : //_________________________________________________________________
      50             : 
      51             : AliTOFTDCHit::AliTOFTDCHit(const AliTOFTDCHit &source) :
      52         600 :   TObject(),
      53         600 :   fHitTime(source.fHitTime),
      54         600 :   fTOTWidth(source.fTOTWidth),
      55         600 :   fChan(source.fChan),
      56         600 :   fTDCID(source.fTDCID),
      57         600 :   fEBit(source.fEBit),
      58         600 :   fPSBits(source.fPSBits)
      59        3000 : {
      60             :   /* copy constructor */
      61        1200 : }
      62             : 
      63             : //_________________________________________________________________
      64             : 
      65             : AliTOFTDCHit &
      66             : AliTOFTDCHit::operator = (const AliTOFTDCHit &source)
      67             : {
      68             :   /* operator = */
      69         400 :   if (this == &source) return *this;
      70         200 :   TObject::operator=(source);
      71         200 :   fHitTime = source.fHitTime;
      72         200 :   fTOTWidth = source.fTOTWidth;
      73         200 :   fChan = source.fChan;
      74         200 :   fTDCID = source.fTDCID;
      75         200 :   fEBit = source.fEBit;
      76         200 :   fPSBits = source.fPSBits;
      77         200 :   return *this;
      78         200 : }
      79             : 
      80             : #if 0
      81             : //_________________________________________________________________
      82             : 
      83             : AliTOFTDCHit &
      84             : AliTOFTDCHit::operator - (const AliTOFTDCHit &source)
      85             : {
      86             :   /* operator - */
      87             :   fHitTime = fHitTime - source.fHitTime;
      88             :   return *this;
      89             : }
      90             : #endif
      91             : 
      92             : //_________________________________________________________________
      93             : 
      94             : AliTOFTDCHit &
      95             : AliTOFTDCHit::operator -= (const AliTOFTDCHit &source)
      96             : {
      97             :   /* operator -= */
      98           0 :   fHitTime -= source.fHitTime;
      99           0 :   return *this;
     100             : }
     101             : 
     102             : //_________________________________________________________________
     103             : 
     104             : AliTOFTDCHit &
     105             : AliTOFTDCHit::operator << (const AliTOFTDCHit &source)
     106             : {
     107             :   /* operator << */
     108             :   /* build packed hit */
     109         400 :   fTOTWidth = source.fHitTime - fHitTime; /* compute TOT width */
     110         200 :   fTOTWidth = (UShort_t)(fTOTWidth * TIME_TO_TOT_BIN_WIDTH); /* convert into 48.8 ps bins */
     111         200 :   fEBit = fEBit | source.fEBit; /* set E bit as or */
     112         200 :   fPSBits = 0; /* set PB bits as packed hit */
     113         200 :   return *this;
     114             : }
     115             : 
     116             : //_________________________________________________________________
     117             : 
     118             : AliTOFTDCHit::~AliTOFTDCHit()
     119        2348 : {
     120             :   /* destructor */
     121        2988 : }

Generated by: LCOV version 1.11