1 /**************************************************************************
2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //////////////////////////////////////////////////////////////////////
20 // Digits classes for the FMD
27 // - ADC count in this channel
34 // - Total energy deposited in the strip
35 // - ADC count in this channel
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.
41 // +-----------------+
42 // | AliFMDBaseDigit |
43 // +-----------------+
48 // +-------------+ +--------------+
49 // | AliFMDDigit | | AliFMDSDigit |
50 // +-------------+ +--------------+
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
58 // Latest changes by Christian Holm Christensen
60 //////////////////////////////////////////////////////////////////////
62 #include "AliFMDDigit.h" // ALIFMDDIGIT_H
63 #include "Riostream.h" // ROOT_Riostream
66 //====================================================================
67 ClassImp(AliFMDBaseDigit)
69 ; // This is here to keep Emacs from indenting the next line
72 //____________________________________________________________________
73 AliFMDBaseDigit::AliFMDBaseDigit()
80 //____________________________________________________________________
81 AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector,
85 : fDetector(detector),
91 // Creates a base data digit object
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)
101 //____________________________________________________________________
103 AliFMDBaseDigit::Print(Option_t* /* option*/) const
105 // Print digit to standard out
106 cout << ClassName() << ": FMD" << fDetector << fRing << "["
107 << setw(3) << fSector << ","
108 << setw(3) << fStrip << "]"
112 //____________________________________________________________________
114 AliFMDBaseDigit::GetName() const
117 n = Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
121 //====================================================================
122 ClassImp(AliFMDDigit)
124 //____________________________________________________________________
125 AliFMDDigit::AliFMDDigit()
131 //____________________________________________________________________
132 AliFMDDigit::AliFMDDigit(UShort_t detector,
139 : AliFMDBaseDigit(detector, ring, sector, strip),
145 // Creates a real data digit object
149 // detector Detector # (1, 2, or 3)
150 // ring Ring ID ('I' or 'O')
151 // sector Sector # (For inner/outer rings: 0-19/0-39)
152 // strip Strip # (For inner/outer rings: 0-511/0-255)
153 // count1 ADC count (a 10-bit word)
154 // count2 ADC count (a 10-bit word) -1 if not used
155 // count3 ADC count (a 10-bit word) -1 if not used
158 //____________________________________________________________________
160 AliFMDDigit::GetTitle() const
163 t = Form("ADC: %d", Counts());
167 //____________________________________________________________________
169 AliFMDDigit::Print(Option_t* /* option*/) const
171 // Print digit to standard out
172 AliFMDBaseDigit::Print();
174 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
178 //====================================================================
179 ClassImp(AliFMDSDigit)
181 //____________________________________________________________________
182 AliFMDSDigit::AliFMDSDigit()
189 //____________________________________________________________________
190 AliFMDSDigit::AliFMDSDigit(UShort_t detector,
198 : AliFMDBaseDigit(detector, ring, sector, strip),
205 // Creates a real data digit object
209 // detector Detector # (1, 2, or 3)
210 // ring Ring ID ('I' or 'O')
211 // sector Sector # (For inner/outer rings: 0-19/0-39)
212 // strip Strip # (For inner/outer rings: 0-511/0-255)
213 // edep Total energy deposited
214 // count1 ADC count (a 10-bit word)
215 // count2 ADC count (a 10-bit word) -1 if not used
216 // count3 ADC count (a 10-bit word) -1 if not used
219 //____________________________________________________________________
221 AliFMDSDigit::Print(Option_t* /* option*/) const
223 // Print digit to standard out
224 AliFMDBaseDigit::Print();
225 cout << "\t" << fEdep << " -> "
226 << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
230 //____________________________________________________________________