1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 ***************************************************************************/
17 author: Roberto Preghenella (R+), preghenella@bo.infn.it
21 //////////////////////////////////////////////////////////////////////
24 // This class provides a definition for TDC hits. //
27 //////////////////////////////////////////////////////////////////////
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 )
35 ClassImp(AliTOFTDCHit)
37 AliTOFTDCHit::AliTOFTDCHit() :
46 /* default constructor */
49 //_________________________________________________________________
51 AliTOFTDCHit::AliTOFTDCHit(const AliTOFTDCHit &source) :
53 fHitTime(source.fHitTime),
54 fTOTWidth(source.fTOTWidth),
56 fTDCID(source.fTDCID),
58 fPSBits(source.fPSBits)
60 /* copy constructor */
63 //_________________________________________________________________
66 AliTOFTDCHit::operator = (const AliTOFTDCHit &source)
69 if (this == &source) return *this;
70 TObject::operator=(source);
71 fHitTime = source.fHitTime;
72 fTOTWidth = source.fTOTWidth;
74 fTDCID = source.fTDCID;
76 fPSBits = source.fPSBits;
81 //_________________________________________________________________
84 AliTOFTDCHit::operator - (const AliTOFTDCHit &source)
87 fHitTime = fHitTime - source.fHitTime;
92 //_________________________________________________________________
95 AliTOFTDCHit::operator -= (const AliTOFTDCHit &source)
98 fHitTime -= source.fHitTime;
102 //_________________________________________________________________
105 AliTOFTDCHit::operator << (const AliTOFTDCHit &source)
108 /* build packed hit */
109 fTOTWidth = source.fHitTime - fHitTime; /* compute TOT width */
110 fTOTWidth = (UShort_t)(fTOTWidth * TIME_TO_TOT_BIN_WIDTH); /* convert into 48.8 ps bins */
111 fEBit = fEBit | source.fEBit; /* set E bit as or */
112 fPSBits = 0; /* set PB bits as packed hit */
116 //_________________________________________________________________
118 AliTOFTDCHit::~AliTOFTDCHit()