]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0digit.cxx
added HOMER library from PubSub package HLT-stable-20070905.141318 (rev. 2375)
[u/mrichter/AliRoot.git] / T0 / AliT0digit.cxx
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 /* $Id$ */
17 /////////////////////////////////////////////////////////////////////////
18 //  Class AliT0digit for T0 digits
19 //  fTimeA  - right side TOF signal
20 //  fTimeC  - left side TOF signal
21 //  fTimeBestA - TOF first particle on the right side
22 //  TimeBestC - TOF first particle on the left side
23 //  fTimeAverage = (fTimeBestA + TimeBestC ) /2. T0 signal
24 //  fTimeDiff = fTimeBestA - TimeBestC  
25 //
26 ///////////////////////////////////////////////////////////////////////
27
28 #include "AliT0digit.h"
29 #include "TArrayI.h"
30
31 ClassImp(AliT0digit)
32
33 //-----------------------------------------------
34   AliT0digit::AliT0digit() :TObject(),
35                             fTimeCFD(new TArrayI(24)),    
36                             fQT0( new TArrayI(24)),     
37                             fTimeLED( new TArrayI(24)), 
38                             fQT1( new TArrayI(24)),     
39                             fTimeAverage(99999),
40                             fTimeDiff(99999),
41                             fBestTimeA(99999),
42                             fBestTimeC (99999),
43                             fSumMult(0)
44
45 {
46   //
47 }
48
49 //_____________________________________________________________________________
50
51 AliT0digit::~AliT0digit() {
52   // destructor
53   delete fTimeCFD;
54   delete fQT0;
55   delete fTimeLED;
56   delete fQT1;
57 }
58 //-----------------------------------
59 void AliT0digit::SetTimeCFD (TArrayI &o)
60 {
61   ////////////////////////////////////////
62   if(fTimeCFD)delete  fTimeCFD;
63   fTimeCFD = new TArrayI(24);
64
65   Int_t i;
66   for (i=0; i<24; i++)
67     {
68       Int_t buf=o.At(i);
69       fTimeCFD->AddAt(buf,i);
70     }
71 }
72 //--------------------------------------------
73 void AliT0digit::GetTimeCFD (TArrayI &o)
74 {
75   //
76   Int_t i;
77   for (i=0; i<24; i++)
78     {
79       o[i]=fTimeCFD->At(i);
80     }
81 }
82 //--------------------------------------------
83 void AliT0digit::GetQT0 (TArrayI &o)
84 {
85   //
86   Int_t i;
87   for (i=0; i<24; i++)
88     {
89       o[i]=fQT0->At(i);
90     }
91 }
92 //--------------------------------------------
93 void AliT0digit::SetQT0 (TArrayI &o)
94 {
95   //
96   if(fQT0)delete fQT0;
97   fQT0  = new TArrayI(24);
98   Int_t i;
99   for (i=0; i<24; i++)
100     {
101       Int_t buf=(o.At(i));
102       fQT0->AddAt(buf,i);
103     }
104 }
105 //-----------------------------------
106 void AliT0digit::SetTimeLED (TArrayI &o)
107 {
108   ////////////////////////////////////////
109   if(fTimeLED)delete fTimeLED;
110   fTimeLED = new TArrayI(24);
111
112   Int_t i;
113   for (i=0; i<24; i++)
114     {
115       Int_t buf=o.At(i);
116       fTimeLED->AddAt(buf,i);
117     }
118 }
119 //--------------------------------------------
120 void AliT0digit::GetTimeLED (TArrayI &o)
121 {
122   //
123   Int_t i;
124   for (i=0; i<24; i++)
125     {
126       o[i]=fTimeLED->At(i);
127     }
128 }
129 //--------------------------------------------
130 void AliT0digit::GetQT1 (TArrayI &o)
131 {
132   //
133   Int_t i;
134   for (i=0; i<24; i++)
135     {
136       o[i]=fQT1->At(i);
137     }
138 }
139 //--------------------------------------------
140 void AliT0digit::SetQT1 (TArrayI &o)
141 {
142   //
143   if(fQT1)delete fQT1;
144   fQT1  = new TArrayI(24);
145   Int_t i;
146   for (i=0; i<24; i++)
147     {
148       Int_t buf=(o.At(i));
149       fQT1->AddAt(buf,i);
150     }
151 }