From Laurent:
[u/mrichter/AliRoot.git] / MUON / AliMUONDigit.cxx
CommitLineData
a9e2aefa 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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
88cb7938 16/* $Id$ */
a9e2aefa 17
18#include "AliMUONDigit.h"
19
8c343c7c 20
a9e2aefa 21ClassImp(AliMUONDigit)
22//_____________________________________________________________________________
61adb9bd 23 AliMUONDigit::AliMUONDigit(const AliMUONDigit& digits):TObject(digits)
24{
25// copy constructor
26
27 fPadX = digits.fPadX;
28 fPadY = digits.fPadY;
29 fCathode = digits.fCathode;
30 fSignal = digits.fSignal;
31 fPhysics = digits.fPhysics;
32 fHit = digits.fHit;
a713db22 33 fDetElemId = digits.fDetElemId;
61adb9bd 34
35 for(Int_t i=0; i<kMAXTRACKS; i++) {
36 fTcharges[i] = digits.fTcharges[i];
37 fTracks[i] = digits.fTracks[i];
38 }
39}
40
41//_____________________________________________________________________________
30178c30 42 AliMUONDigit::AliMUONDigit()
76fa1113 43 : TObject(),
44 fPadX(0),
45 fPadY(0),
46 fCathode(0),
47 fSignal(0),
48 fPhysics(0),
49 fHit(0),
50 fDetElemId(0)
30178c30 51{
52// Default constructor
76fa1113 53
54 for(Int_t i=0; i<kMAXTRACKS; i++) {
55 fTcharges[i] = 0;
56 fTracks[i] = 0;
57 }
30178c30 58}
59
60//_____________________________________________________________________________
a9e2aefa 61AliMUONDigit::AliMUONDigit(Int_t *digits)
62{
63 //
64 // Creates a MUON digit object to be updated
65 //
66 fPadX = digits[0];
67 fPadY = digits[1];
a450cfad 68 fCathode = digits[2];
69 fSignal = digits[3];
70 fPhysics = digits[4];
71 fHit = digits[5];
a713db22 72 fDetElemId = digits[6];
a9e2aefa 73}
74//_____________________________________________________________________________
75AliMUONDigit::AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits)
76{
77 //
78 // Creates a MUON digit object
79 //
80 fPadX = digits[0];
81 fPadY = digits[1];
a450cfad 82 fCathode = digits[2];
83 fSignal = digits[3];
84 fPhysics = digits[4];
85 fHit = digits[5];
a713db22 86 fDetElemId = digits[6];
a450cfad 87
cb73aa80 88 for(Int_t i=0; i<kMAXTRACKS; i++) {
a9e2aefa 89 fTcharges[i] = charges[i];
90 fTracks[i] = tracks[i];
91 }
92}
93
94AliMUONDigit::~AliMUONDigit()
95{
96 // Destructor
97}
61adb9bd 98
99//_____________________________________________________________________________
100AliMUONDigit& AliMUONDigit::operator=(const AliMUONDigit& digits)
101{
102 if (this == &digits)
103 return *this;
104
105 fPadX = digits.fPadX;
106 fPadY = digits.fPadY;
107 fCathode = digits.fCathode;
108 fSignal = digits.fSignal;
109 fPhysics = digits.fPhysics;
110 fHit = digits.fHit;
a713db22 111 fDetElemId = digits.fDetElemId;
61adb9bd 112
113 for(Int_t i=0; i<kMAXTRACKS; i++) {
114 fTcharges[i] = digits.fTcharges[i];
115 fTracks[i] = digits.fTracks[i];
116 }
117
118 return *this;
119}
a713db22 120//_____________________________________________________________________________
121Int_t AliMUONDigit::Compare(const TObject *obj) const
122{
123// sort by idDE
124
125 AliMUONDigit* d = (AliMUONDigit*) obj;
126
127 return ( fDetElemId > d->DetElemId()) ? 1 : -1;
128
129}