]>
Commit | Line | Data |
---|---|---|
5b4ed716 | 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 | ClassImp(AliTOFTDCHit) | |
36 | ||
37 | AliTOFTDCHit::AliTOFTDCHit() : | |
38 | TObject(), | |
39 | fHitTime(0), | |
40 | fTOTWidth(0), | |
41 | fChan(0), | |
42 | fTDCID(0), | |
43 | fEBit(0), | |
44 | fPSBits(0) | |
45 | { | |
46 | /* default constructor */ | |
47 | } | |
48 | ||
49 | //_________________________________________________________________ | |
50 | ||
51 | AliTOFTDCHit::AliTOFTDCHit(const AliTOFTDCHit &source) : | |
52 | TObject(), | |
53 | fHitTime(source.fHitTime), | |
54 | fTOTWidth(source.fTOTWidth), | |
55 | fChan(source.fChan), | |
56 | fTDCID(source.fTDCID), | |
57 | fEBit(source.fEBit), | |
58 | fPSBits(source.fPSBits) | |
59 | { | |
60 | /* copy constructor */ | |
61 | } | |
62 | ||
63 | //_________________________________________________________________ | |
64 | ||
65 | AliTOFTDCHit & | |
66 | AliTOFTDCHit::operator = (const AliTOFTDCHit &source) | |
67 | { | |
68 | /* operator = */ | |
69 | fHitTime = source.fHitTime; | |
70 | fTOTWidth = source.fTOTWidth; | |
71 | fChan = source.fChan; | |
72 | fTDCID = source.fTDCID; | |
73 | fEBit = source.fEBit; | |
74 | fPSBits = source.fPSBits; | |
75 | return *this; | |
76 | } | |
77 | ||
78 | #if 0 | |
79 | //_________________________________________________________________ | |
80 | ||
81 | AliTOFTDCHit & | |
82 | AliTOFTDCHit::operator - (const AliTOFTDCHit &source) | |
83 | { | |
84 | /* operator - */ | |
85 | fHitTime = fHitTime - source.fHitTime; | |
86 | return *this; | |
87 | } | |
88 | #endif | |
89 | ||
90 | //_________________________________________________________________ | |
91 | ||
92 | AliTOFTDCHit & | |
93 | AliTOFTDCHit::operator -= (const AliTOFTDCHit &source) | |
94 | { | |
95 | /* operator -= */ | |
96 | fHitTime -= source.fHitTime; | |
97 | return *this; | |
98 | } | |
99 | ||
100 | //_________________________________________________________________ | |
101 | ||
102 | AliTOFTDCHit & | |
103 | AliTOFTDCHit::operator << (const AliTOFTDCHit &source) | |
104 | { | |
105 | /* operator << */ | |
106 | /* build packed hit */ | |
107 | fTOTWidth = source.fHitTime - fHitTime; /* compute TOT width */ | |
108 | fTOTWidth = (UShort_t)(fTOTWidth * TIME_TO_TOT_BIN_WIDTH); /* convert into 48.8 ps bins */ | |
109 | fEBit = fEBit | source.fEBit; /* set E bit as or */ | |
110 | fPSBits = 0; /* set PB bits as packed hit */ | |
111 | return *this; | |
112 | } | |
113 | ||
114 | //_________________________________________________________________ | |
115 | ||
116 | AliTOFTDCHit::~AliTOFTDCHit() | |
117 | { | |
118 | /* destructor */ | |
119 | } |