]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDDigit.cxx
Minor fix to env var.
[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
4347b38f 64
65//====================================================================
925e6570 66ClassImp(AliFMDBaseDigit)
1a1fdef7 67#if 0
68 ; // This is here to keep Emacs for indenting the next line
69#endif
4347b38f 70
71//____________________________________________________________________
72AliFMDBaseDigit::AliFMDBaseDigit()
73 : fDetector(0),
74 fRing('\0'),
75 fSector(0),
76 fStrip(0)
77{}
78
79//____________________________________________________________________
80AliFMDBaseDigit::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//____________________________________________________________________
101void
102AliFMDBaseDigit::Print(Option_t* /* option*/) const
103{
104 // Print digit to standard out
7c09877a 105 cout << ClassName() << ": FMD" << fDetector << fRing << "["
e802be3e 106 << setw(3) << fSector << ","
107 << setw(3) << fStrip << "]"
56b1929b 108 << flush;
4347b38f 109}
110
111//====================================================================
925e6570 112ClassImp(AliFMDDigit)
4347b38f 113
114//____________________________________________________________________
115AliFMDDigit::AliFMDDigit()
116 : fCount1(0),
117 fCount2(-1),
118 fCount3(-1)
119{}
120
121//____________________________________________________________________
122AliFMDDigit::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//____________________________________________________________________
149void
150AliFMDDigit::Print(Option_t* /* option*/) const
151{
152 // Print digit to standard out
153 AliFMDBaseDigit::Print();
7c09877a 154 cout << "\t"
155 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
156 << Counts() << endl;
4347b38f 157}
158
159//====================================================================
925e6570 160ClassImp(AliFMDSDigit)
4347b38f 161
162//____________________________________________________________________
163AliFMDSDigit::AliFMDSDigit()
164 : fEdep(0),
165 fCount1(0),
166 fCount2(-1),
167 fCount3(-1)
168{}
169
170//____________________________________________________________________
171AliFMDSDigit::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//____________________________________________________________________
201void
202AliFMDSDigit::Print(Option_t* /* option*/) const
203{
204 // Print digit to standard out
205 AliFMDBaseDigit::Print();
7c09877a 206 cout << "\t" << fEdep << " -> "
207 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
208 << Counts() << endl;
4347b38f 209}
210
211//____________________________________________________________________
212//
213// EOF
214//