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