Fixes for coverity
[u/mrichter/AliRoot.git] / PMD / AliPMDclupid.cxx
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 //-----------------------------------------------------//
16 //                                                     //
17 //  Date   : March 22 2004                             //
18 //                                                     //
19 //  Store cluster information                          //
20 //  after discrimination                               //
21 //                                                     //
22 //-----------------------------------------------------//
23 #include "Riostream.h"
24 #include "Rtypes.h"
25 #include "AliPMDclupid.h"
26 #include <stdio.h>
27
28 ClassImp(AliPMDclupid)
29
30 AliPMDclupid::AliPMDclupid():
31   fDet(0),
32   fSMN(0),
33   fTrNo(0),
34   fTrPid(0),
35   fMstatus(0)
36 {
37   // Default constructor
38   for (Int_t i = 0; i < 7; i++)
39     {
40       fClusData[i] = 0.;
41     }
42 }
43 // ------------------------------------------------------------------ //
44 AliPMDclupid::AliPMDclupid(Int_t idet, Int_t ismn, Int_t trno, Int_t trpid,
45                            Int_t mstat, Float_t *clusdata):
46   fDet(idet),
47   fSMN(ismn),
48   fTrNo(trno),
49   fTrPid(trpid),
50   fMstatus(mstat)
51 {
52   // Constructor
53   for (Int_t i = 0; i < 7; i++)
54     {
55       fClusData[i] = clusdata[i];
56     }
57 }
58 // ------------------------------------------------------------------ //
59 AliPMDclupid::AliPMDclupid(AliPMDclupid *pmdclupid):
60   fDet(0),
61   fSMN(0),
62   fTrNo(0),
63   fTrPid(0),
64   fMstatus(0)
65 {
66   *this = *pmdclupid;
67 }
68
69 // ------------------------------------------------------------------ //
70 AliPMDclupid::AliPMDclupid(const AliPMDclupid &pmdclupid):
71   TObject(pmdclupid),
72   fDet(pmdclupid.fDet),
73   fSMN(pmdclupid.fSMN),
74   fTrNo(pmdclupid.fTrNo),
75   fTrPid(pmdclupid.fTrPid),
76   fMstatus(pmdclupid.fMstatus)
77 {
78   //Copy Constructor 
79   for(Int_t i=0; i<7; i++)
80     {
81       fClusData[i] = pmdclupid.fClusData[i];
82     }
83 }
84 // ------------------------------------------------------------------ //
85 AliPMDclupid & AliPMDclupid::operator=(const AliPMDclupid &pmdclupid)
86 {
87   // Assignment operator 
88   if(this != &pmdclupid)
89     {
90       fDet     = pmdclupid.fDet;
91       fSMN     = pmdclupid.fSMN;
92       fTrNo    = pmdclupid.fTrNo;
93       fTrPid   = pmdclupid.fTrPid;
94       fMstatus = pmdclupid.fMstatus;
95       for(Int_t i=0; i<7; i++)
96         {
97           fClusData[i] = pmdclupid.fClusData[i];
98         }
99     }
100   return *this;
101 }
102 // ------------------------------------------------------------------ //
103 AliPMDclupid::~AliPMDclupid()
104 {
105   // Destructor
106 }
107 // ------------------------------------------------------------------ //
108 Int_t AliPMDclupid::GetDetector() const
109 {
110   return fDet;
111 }
112 // ------------------------------------------------------------------ //
113 Int_t AliPMDclupid::GetSMN() const
114 {
115   return fSMN;
116 }
117 // ------------------------------------------------------------------ //
118 Int_t AliPMDclupid::GetClusTrackNo() const
119 {
120   return fTrNo;
121 }
122 // ------------------------------------------------------------------ //
123 Int_t AliPMDclupid::GetClusTrackPid() const
124 {
125   return fTrPid;
126 }
127 // ------------------------------------------------------------------ //
128 Int_t AliPMDclupid::GetClusMatching() const
129 {
130   return fMstatus;
131 }
132 // ------------------------------------------------------------------ //
133 Float_t AliPMDclupid::GetClusX() const
134 {
135   return fClusData[0];
136 }
137 // ------------------------------------------------------------------ //
138 Float_t AliPMDclupid::GetClusY() const
139 {
140   return fClusData[1];
141 }
142 // ------------------------------------------------------------------ //
143 Float_t AliPMDclupid::GetClusADC() const
144 {
145   return fClusData[2];
146 }
147 // ------------------------------------------------------------------ //
148 Float_t AliPMDclupid::GetClusCells() const
149 {
150   return fClusData[3];
151 }
152 // ------------------------------------------------------------------ //
153 Float_t AliPMDclupid::GetClusSigmaX() const
154 {
155   return fClusData[4];
156 }
157 // ------------------------------------------------------------------ //
158 Float_t AliPMDclupid::GetClusSigmaY() const
159 {
160   return fClusData[5];
161 }
162 // ------------------------------------------------------------------ //
163 Float_t AliPMDclupid::GetClusPID() const
164 {
165   return fClusData[6];
166 }
167
168