TPC ALTRO mapping class
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.cxx
CommitLineData
4347b38f 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
e802be3e 62#include "AliFMDDigit.h" // ALIFMDDIGIT_H
63#include "Riostream.h" // ROOT_Riostream
8f6ee336 64#include <TString.h>
4347b38f 65
66//====================================================================
925e6570 67ClassImp(AliFMDBaseDigit)
1a1fdef7 68#if 0
8f6ee336 69 ; // This is here to keep Emacs from indenting the next line
1a1fdef7 70#endif
4347b38f 71
72//____________________________________________________________________
73AliFMDBaseDigit::AliFMDBaseDigit()
74 : fDetector(0),
75 fRing('\0'),
76 fSector(0),
77 fStrip(0)
78{}
79
80//____________________________________________________________________
81AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector,
82 Char_t ring,
83 UShort_t sector,
84 UShort_t strip)
85 : fDetector(detector),
86 fRing(ring),
87 fSector(sector),
88 fStrip(strip)
89{
90 //
91 // Creates a base data digit object
92 //
93 // Parameters
94 //
95 // detector Detector # (1, 2, or 3)
96 // ring Ring ID ('I' or 'O')
97 // sector Sector # (For inner/outer rings: 0-19/0-39)
98 // strip Strip # (For inner/outer rings: 0-511/0-255)
99}
100
101//____________________________________________________________________
102void
103AliFMDBaseDigit::Print(Option_t* /* option*/) const
104{
105 // Print digit to standard out
7c09877a 106 cout << ClassName() << ": FMD" << fDetector << fRing << "["
e802be3e 107 << setw(3) << fSector << ","
108 << setw(3) << fStrip << "]"
56b1929b 109 << flush;
4347b38f 110}
111
8f6ee336 112//____________________________________________________________________
113const char*
114AliFMDBaseDigit::GetName() const
115{
116 return Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
117}
118
4347b38f 119//====================================================================
925e6570 120ClassImp(AliFMDDigit)
4347b38f 121
122//____________________________________________________________________
123AliFMDDigit::AliFMDDigit()
124 : fCount1(0),
125 fCount2(-1),
126 fCount3(-1)
127{}
128
129//____________________________________________________________________
130AliFMDDigit::AliFMDDigit(UShort_t detector,
131 Char_t ring,
132 UShort_t sector,
133 UShort_t strip,
134 UShort_t count1,
135 Short_t count2,
136 Short_t count3)
137 : AliFMDBaseDigit(detector, ring, sector, strip),
138 fCount1(count1),
139 fCount2(count2),
140 fCount3(count3)
141{
142 //
143 // Creates a real data digit object
144 //
145 // Parameters
146 //
147 // detector Detector # (1, 2, or 3)
148 // ring Ring ID ('I' or 'O')
149 // sector Sector # (For inner/outer rings: 0-19/0-39)
150 // strip Strip # (For inner/outer rings: 0-511/0-255)
151 // count1 ADC count (a 10-bit word)
152 // count2 ADC count (a 10-bit word) -1 if not used
153 // count3 ADC count (a 10-bit word) -1 if not used
154}
155
156//____________________________________________________________________
157void
158AliFMDDigit::Print(Option_t* /* option*/) const
159{
160 // Print digit to standard out
161 AliFMDBaseDigit::Print();
7c09877a 162 cout << "\t"
163 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
164 << Counts() << endl;
4347b38f 165}
166
167//====================================================================
925e6570 168ClassImp(AliFMDSDigit)
4347b38f 169
170//____________________________________________________________________
171AliFMDSDigit::AliFMDSDigit()
172 : fEdep(0),
173 fCount1(0),
174 fCount2(-1),
175 fCount3(-1)
176{}
177
178//____________________________________________________________________
179AliFMDSDigit::AliFMDSDigit(UShort_t detector,
180 Char_t ring,
181 UShort_t sector,
182 UShort_t strip,
183 Float_t edep,
184 UShort_t count1,
185 Short_t count2,
186 Short_t count3)
187 : AliFMDBaseDigit(detector, ring, sector, strip),
188 fEdep(edep),
189 fCount1(count1),
190 fCount2(count2),
191 fCount3(count3)
192{
193 //
194 // Creates a real data digit object
195 //
196 // Parameters
197 //
198 // detector Detector # (1, 2, or 3)
199 // ring Ring ID ('I' or 'O')
200 // sector Sector # (For inner/outer rings: 0-19/0-39)
201 // strip Strip # (For inner/outer rings: 0-511/0-255)
202 // edep Total energy deposited
203 // count1 ADC count (a 10-bit word)
204 // count2 ADC count (a 10-bit word) -1 if not used
205 // count3 ADC count (a 10-bit word) -1 if not used
206}
207
208//____________________________________________________________________
209void
210AliFMDSDigit::Print(Option_t* /* option*/) const
211{
212 // Print digit to standard out
213 AliFMDBaseDigit::Print();
7c09877a 214 cout << "\t" << fEdep << " -> "
215 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
216 << Counts() << endl;
4347b38f 217}
218
219//____________________________________________________________________
220//
221// EOF
222//