1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 #include "AliMUONDigit.h"
20 #include "Riostream.h"
23 ClassImp(AliMUONDigit)
25 //_____________________________________________________________________________
26 AliMUONDigit::AliMUONDigit()
40 // Default constructor
42 for ( Int_t i=0; i<kMAXTRACKS; ++i )
49 //_____________________________________________________________________________
50 AliMUONDigit::AliMUONDigit(const AliMUONDigit& digit)
55 (static_cast<const AliMUONDigit&>(digit)).Copy(*this);
59 //_____________________________________________________________________________
60 AliMUONDigit::~AliMUONDigit()
65 //_____________________________________________________________________________
67 AliMUONDigit::operator=(const AliMUONDigit& digit)
69 AliMUONDigit a(digit);
74 //______________________________________________________________________________
76 AliMUONDigit::Copy(TObject& obj) const
78 // Copy this line to line.
81 AliMUONDigit& digit = static_cast<AliMUONDigit&>(obj);
84 digit.fCathode = fCathode;
85 digit.fSignal = fSignal;
87 digit.fDetElemId = fDetElemId;
88 digit.fManuId = fManuId;
89 digit.fManuChannel = fManuChannel;
91 digit.fIsSaturated = fIsSaturated;
95 //_____________________________________________________________________________
96 AliMUONDigit::AliMUONDigit(Int_t *digits)
99 // Creates a MUON digit object to be updated
103 fCathode = digits[2];
105 fPhysics = digits[4];
107 fDetElemId = digits[6];
111 fIsSaturated = kFALSE;
113 //_____________________________________________________________________________
114 AliMUONDigit::AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits)
117 // Creates a MUON digit object
121 fCathode = digits[2];
123 fPhysics = digits[4];
125 fDetElemId = digits[6];
129 for(Int_t i=0; i<kMAXTRACKS; i++) {
130 fTcharges[i] = charges[i];
131 fTracks[i] = tracks[i];
136 //_____________________________________________________________________________
137 Int_t AliMUONDigit::Compare(const TObject *obj) const
141 AliMUONDigit* d = (AliMUONDigit*) obj;
143 return ( fDetElemId > d->DetElemId()) ? 1 : -1;
147 //_____________________________________________________________________________
149 AliMUONDigit::Print(Option_t* opt) const
151 cout << "DetEle " << setw(5) << DetElemId()
152 << " Cath " << setw(2) << Cathode()
153 << " (Ix,Iy)=(" << setw(3) << PadX() << "," << setw(3) << PadY()
155 << " (Manu,Channel)=(" << setw(4) << ManuId()
156 << "," << setw(3) << ManuChannel() << ")"
157 << " Signal=" << setw(6) << Signal()
158 << " Physics=" << setw(4) << Physics();
167 cout << " ADC=" << setw(4) << ADC();
168 TString options(opt);
170 if ( options.Contains("tracks") )
172 cout << " Track0=" << setw(3) << Track(0)
173 << " Charge0=" << setw(4) << TrackCharge(0)
174 << " Track1=" << setw(3) << Track(1)
175 << " Charge1=" << setw(4) << TrackCharge(1);
180 //_____________________________________________________________________________
182 AliMUONDigit::IsSaturated() const
187 //_____________________________________________________________________________
189 AliMUONDigit::ManuId() const
194 //_____________________________________________________________________________
196 AliMUONDigit::ManuChannel() const
201 //_____________________________________________________________________________
203 AliMUONDigit::ADC() const
208 //_____________________________________________________________________________
210 AliMUONDigit::SetADC(Int_t adc)
215 //_____________________________________________________________________________
217 AliMUONDigit::SetElectronics(Int_t manuId, Int_t manuChannel)
220 //FIXME: should we check that the values are ok here ??
223 fManuChannel=manuChannel;
226 //_____________________________________________________________________________
228 AliMUONDigit::Saturated(Bool_t saturated)
230 fIsSaturated=saturated;