]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDigit.cxx
Incrementing class versions
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.cxx
1 /**************************************************************************
2  * Copyright(c) 2004, 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 //////////////////////////////////////////////////////////////////////
19 //
20 //  Digits classes for the FMD                
21 //
22 //  Digits consists of
23 //   - Detector #
24 //   - Ring ID                                             
25 //   - Sector #     
26 //   - Strip #
27 //   - ADC count in this channel                                  
28 //
29 //  Digits consists of
30 //   - Detector #
31 //   - Ring ID                                             
32 //   - Sector #     
33 //   - Strip #
34 //   - Total energy deposited in the strip
35 //   - ADC count in this channel                                  
36 //
37 // As the Digits and SDigits have so much in common, the classes
38 // AliFMDDigit and AliFMDSDigit are implemented via a base
39 // class AliFMDBaseDigit.
40 ///
41 //              +-----------------+
42 //              | AliFMDBaseDigit |
43 //              +-----------------+
44 //                      ^
45 //                      |
46 //                +------------+
47 //                |            |
48 //      +-------------+ +--------------+
49 //      | AliFMDDigit | | AliFMDSDigit |
50 //      +-------------+ +--------------+
51 //
52 // (Note, that I'd really would have liked to implement AliFMDHit as a
53 // derived class from some base class - say AliFMDStrip, and the Digit
54 // classes would (eventually) have derived from that as well.
55 // However, ROOT doesn't do well with multiple inheritance, so I chose
56 // not to anyway).
57 //
58 // Latest changes by Christian Holm Christensen
59 //
60 //////////////////////////////////////////////////////////////////////
61
62 #include "AliFMDDigit.h"        // ALIFMDDIGIT_H
63 #include "Riostream.h"          // ROOT_Riostream
64
65 //====================================================================
66 ClassImp(AliFMDBaseDigit)
67 #if 0
68   ; // This is here to keep Emacs for indenting the next line
69 #endif
70
71 //____________________________________________________________________
72 AliFMDBaseDigit::AliFMDBaseDigit()
73   : fDetector(0), 
74     fRing('\0'), 
75     fSector(0), 
76     fStrip(0)
77 {}
78
79 //____________________________________________________________________
80 AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector, 
81                          Char_t   ring, 
82                          UShort_t sector, 
83                          UShort_t strip)
84   : fDetector(detector), 
85     fRing(ring), 
86     fSector(sector), 
87     fStrip(strip)
88 {
89   //
90   // Creates a base data digit object
91   //
92   // Parameters 
93   //
94   //    detector  Detector # (1, 2, or 3)                      
95   //    ring      Ring ID ('I' or 'O')
96   //    sector    Sector # (For inner/outer rings: 0-19/0-39)
97   //    strip     Strip # (For inner/outer rings: 0-511/0-255)
98 }
99
100 //____________________________________________________________________
101 void
102 AliFMDBaseDigit::Print(Option_t* /* option*/) const 
103 {
104   // Print digit to standard out 
105   cout << ClassName() << ": FMD" << fDetector << fRing << "[" 
106        << setw(3) << fSector << ","
107        << setw(3) << fStrip << "]" 
108        << flush;
109 }
110
111 //====================================================================
112 ClassImp(AliFMDDigit)
113
114 //____________________________________________________________________
115 AliFMDDigit::AliFMDDigit()
116   : fCount1(0),
117     fCount2(-1),
118     fCount3(-1)
119 {}
120
121 //____________________________________________________________________
122 AliFMDDigit::AliFMDDigit(UShort_t detector, 
123                          Char_t   ring, 
124                          UShort_t sector, 
125                          UShort_t strip, 
126                          UShort_t count1,
127                          Short_t  count2, 
128                          Short_t  count3)
129   : AliFMDBaseDigit(detector, ring, sector, strip), 
130     fCount1(count1),
131     fCount2(count2),
132     fCount3(count3)
133 {
134   //
135   // Creates a real data digit object
136   //
137   // Parameters 
138   //
139   //    detector  Detector # (1, 2, or 3)                      
140   //    ring      Ring ID ('I' or 'O')
141   //    sector    Sector # (For inner/outer rings: 0-19/0-39)
142   //    strip     Strip # (For inner/outer rings: 0-511/0-255)
143   //    count1    ADC count (a 10-bit word)
144   //    count2    ADC count (a 10-bit word) -1 if not used
145   //    count3    ADC count (a 10-bit word) -1 if not used
146 }
147
148 //____________________________________________________________________
149 void
150 AliFMDDigit::Print(Option_t* /* option*/) const 
151 {
152   // Print digit to standard out 
153   AliFMDBaseDigit::Print();
154   cout << "\t" 
155        << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = " 
156        << Counts() << endl;
157 }
158
159 //====================================================================
160 ClassImp(AliFMDSDigit)
161
162 //____________________________________________________________________
163 AliFMDSDigit::AliFMDSDigit()
164   : fEdep(0), 
165     fCount1(0),
166     fCount2(-1),
167     fCount3(-1)
168 {}
169
170 //____________________________________________________________________
171 AliFMDSDigit::AliFMDSDigit(UShort_t detector, 
172                            Char_t   ring, 
173                            UShort_t sector, 
174                            UShort_t strip, 
175                            Float_t  edep,
176                            UShort_t count1,
177                            Short_t  count2, 
178                            Short_t  count3)
179   : AliFMDBaseDigit(detector, ring, sector, strip), 
180     fEdep(edep),
181     fCount1(count1),
182     fCount2(count2),
183     fCount3(count3)
184 {
185   //
186   // Creates a real data digit object
187   //
188   // Parameters 
189   //
190   //    detector  Detector # (1, 2, or 3)                      
191   //    ring      Ring ID ('I' or 'O')
192   //    sector    Sector # (For inner/outer rings: 0-19/0-39)
193   //    strip     Strip # (For inner/outer rings: 0-511/0-255)
194   //    edep      Total energy deposited 
195   //    count1    ADC count (a 10-bit word)
196   //    count2    ADC count (a 10-bit word) -1 if not used
197   //    count3    ADC count (a 10-bit word) -1 if not used
198 }
199
200 //____________________________________________________________________
201 void
202 AliFMDSDigit::Print(Option_t* /* option*/) const 
203 {
204   // Print digit to standard out 
205   AliFMDBaseDigit::Print();
206   cout << "\t" << fEdep << " -> "
207        << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = " 
208        << Counts() << endl;
209 }
210
211 //____________________________________________________________________
212 //
213 // EOF
214 //