]> git.uio.no Git - u/mrichter/AliRoot.git/blob - START/AliSTARTdigit.cxx
track matching macros from Alberto
[u/mrichter/AliRoot.git] / START / AliSTARTdigit.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 AliSTARTdigit for START digits
19 //  fTimeRight  - right side TOF signal
20 //  fTimeLeft  - left side TOF signal
21 //  fTimeBestRight - TOF first particle on the right side
22 //  TimeBestLeft - TOF first particle on the left side
23 //  fTimeAverage = (fTimeBestRight + TimeBestLeft ) /2. START signal
24 //  fTimeDiff = fTimeBestRight - TimeBestLeft  
25 //
26 ///////////////////////////////////////////////////////////////////////
27
28 #include "AliSTARTdigit.h"
29 #include "TArrayI.h"
30
31 ClassImp(AliSTARTdigit)
32
33 //-----------------------------------------------
34   AliSTARTdigit::AliSTARTdigit() :TObject()
35 {
36
37   fTimeAverage   = 99999;
38   fTimeDiff      = 99999;
39   fBestTimeRight = 99999;
40   fBestTimeLeft  = 99999;
41
42   fTime = new TArrayI(24);
43   fADC  = new TArrayI(24);
44   fTimeAmp = new TArrayI(24);
45   fADCAmp  = new TArrayI(24);
46 }
47
48 //-----------------------------------
49 AliSTARTdigit::~AliSTARTdigit() {
50   // destructor
51   delete fTime;
52   delete fADC;
53   delete fTimeAmp;
54   delete fADCAmp;
55 }
56 //-----------------------------------
57 void AliSTARTdigit::SetTime (TArrayI &o)
58 {
59   ////////////////////////////////////////
60   fTime = new TArrayI(24);
61
62   Int_t i;
63   for (i=0; i<24; i++)
64     {
65       Int_t buf=o.At(i);
66       fTime->AddAt(buf,i);
67     }
68 }
69 //--------------------------------------------
70 void AliSTARTdigit::GetTime (TArrayI &o)
71 {
72   //
73   Int_t i;
74   for (i=0; i<24; i++)
75     {
76       o[i]=fTime->At(i);
77     }
78 }
79 //--------------------------------------------
80 void AliSTARTdigit::GetADC (TArrayI &o)
81 {
82   //
83   Int_t i;
84   for (i=0; i<24; i++)
85     {
86       o[i]=fADC->At(i);
87     }
88 }
89 //--------------------------------------------
90 void AliSTARTdigit::SetADC (TArrayI &o)
91 {
92   //
93   fADC  = new TArrayI(24);
94   Int_t i;
95   for (i=0; i<24; i++)
96     {
97       Int_t buf=(o.At(i));
98       fADC->AddAt(buf,i);
99     }
100 }
101 //-----------------------------------
102 void AliSTARTdigit::SetTimeAmp (TArrayI &o)
103 {
104   ////////////////////////////////////////
105   fTimeAmp = new TArrayI(24);
106
107   Int_t i;
108   for (i=0; i<24; i++)
109     {
110       Int_t buf=o.At(i);
111       fTimeAmp->AddAt(buf,i);
112     }
113 }
114 //--------------------------------------------
115 void AliSTARTdigit::GetTimeAmp (TArrayI &o)
116 {
117   //
118   Int_t i;
119   for (i=0; i<24; i++)
120     {
121       o[i]=fTimeAmp->At(i);
122     }
123 }
124 //--------------------------------------------
125 void AliSTARTdigit::GetADCAmp (TArrayI &o)
126 {
127   //
128   Int_t i;
129   for (i=0; i<24; i++)
130     {
131       o[i]=fADCAmp->At(i);
132     }
133 }
134 //--------------------------------------------
135 void AliSTARTdigit::SetADCAmp (TArrayI &o)
136 {
137   //
138   fADCAmp  = new TArrayI(24);
139   Int_t i;
140   for (i=0; i<24; i++)
141     {
142       Int_t buf=(o.At(i));
143       fADCAmp->AddAt(buf,i);
144     }
145 }