]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CRT/AliCRTdigit.cxx
d8e829b48949047e22f1801a30c920188bb76d29
[u/mrichter/AliRoot.git] / CRT / AliCRTdigit.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 #include "AliCRTdigit.h"
19
20 #include <TArrayF.h>
21 #include <TArrayI.h>
22
23 ClassImp(AliCRTdigit)
24
25 //_____________________________________________________________________________
26 AliCRTdigit::AliCRTdigit()
27   : AliDigit(),
28     fSector(0),
29     fPlate(0),
30     fStrip(0),
31     fPadx(0),
32     fPadz(0),
33     fNDigits(0),
34     fTdc(0),
35     fAdc(0),
36     fTracks(0)
37 {
38   //
39   // Default constructor
40   //
41 }
42
43 //_____________________________________________________________________________
44 AliCRTdigit::AliCRTdigit(Int_t tracknum, Int_t *vol, Float_t *digit)
45   : AliDigit(),
46     fSector(vol[0]),
47     fPlate(vol[1]),
48     fStrip(vol[2]),
49     fPadx(vol[3]),
50     fPadz(vol[4]),
51     fNDigits(1),
52     fTdc(new TArrayF(fNDigits)),
53     fAdc(new TArrayF(fNDigits)),
54     fTracks(new TArrayI(fNDigits))
55 {
56   
57   //
58   // Creates CRT digit
59   // The creator for the AliCRTdigit class. This routine fills the
60   // AliCRTdigit data members from the array digits. 
61   //
62   (*fTdc)[0] = digit[0];
63   (*fAdc)[0] = digit[1];
64   //fTracks = new TArrayI(kMAXDIGITS*fNDigits);
65   (*fTracks)[0] = tracknum;
66   //for (Int_t i = 1; i <kMAXDIGITS*fNDigits; i++) {
67   for (Int_t i = 1; i <fNDigits; i++) {
68     (*fTracks)[i] = -1;
69   }
70
71 }
72
73 //_____________________________________________________________________________
74 AliCRTdigit::AliCRTdigit(const AliCRTdigit& digit)
75   : AliDigit(digit),
76     fSector(digit.fSector),
77     fPlate(digit.fPlate),
78     fStrip(digit.fStrip),
79     fPadx(digit.fPadx),
80     fPadz(digit.fPadz),
81     fNDigits(digit.fNDigits),
82     fTdc(digit.fTdc),  
83     fAdc(digit.fAdc),
84     fTracks(digit.fTracks)
85 {
86   //
87   //-- Copy constructor
88   //
89 }
90
91 //_____________________________________________________________________________
92 AliCRTdigit::~AliCRTdigit()
93 {
94   //
95   //
96   //
97   if ( fTracks ) { delete fTracks; fTracks = 0; }
98   if ( fAdc ) { delete fAdc; fAdc = 0; }
99   if ( fTdc ) { delete fTdc; fTdc = 0; }
100 }
101
102 //_____________________________________________________________________________
103 AliCRTdigit& AliCRTdigit::operator=(const AliCRTdigit& digit)
104 {
105   //
106   //-- Asingment operator.
107   //
108   fSector = digit.fSector;
109   fPlate  = digit.fPlate;
110   fStrip  = digit.fStrip;
111   fPadx   = digit.fPadx;
112   fPadz   = digit.fPadz;
113   fNDigits = digit.fNDigits;
114   fTdc = digit.fTdc;
115   fAdc = digit.fAdc;
116   fTracks = digit.fTracks;
117   return *this;
118 }