]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDpoints.cxx
Remove AliTRDconst
[u/mrichter/AliRoot.git] / TRD / AliTRDpoints.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 $Log$
18 Revision 1.2  2000/10/06 16:49:46  cblume
19 Made Getters const
20
21 Revision 1.1.2.1  2000/09/18 13:44:21  cblume
22 New class AliTRDpoints to display the TR photon hits
23
24 */
25
26 ///////////////////////////////////////////////////////////////////////////////
27 //                                                                           //
28 //  This class contains the TRD points for the ALICE event display           //
29 //                                                                           //
30 ///////////////////////////////////////////////////////////////////////////////
31
32 #include <TPad.h>
33 #include <TView.h>
34
35 #include "AliRun.h"
36 #include "AliDetector.h"
37
38 #include "AliTRDpoints.h"
39  
40 ClassImp(AliTRDpoints)
41
42 //_____________________________________________________________________________
43 AliTRDpoints::AliTRDpoints():AliPoints()
44 {
45   //
46   // Default constructor
47   //
48
49   fNTRpoints    = 0;
50   fTRpolyMarker = 0;
51
52 }
53
54 //_____________________________________________________________________________
55 AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT):AliPoints(nhitsE)
56 {
57   //
58   // Standard constructor
59   //
60
61   fNTRpoints    = nhitsT;
62   fTRpolyMarker = 0;
63
64 }
65          
66 //_____________________________________________________________________________
67 AliTRDpoints::AliTRDpoints(const AliTRDpoints &p)
68 {
69   //
70   // Copy contructor
71   //
72  
73   ((AliTRDpoints &) p).Copy(*this);
74
75 }
76
77 //_____________________________________________________________________________
78 AliTRDpoints::~AliTRDpoints()
79 {
80   //
81   // Default destructor
82   //
83
84   if (fTRpolyMarker) delete fTRpolyMarker;
85
86 }
87
88 //_____________________________________________________________________________
89 AliTRDpoints &AliTRDpoints::operator=(const AliTRDpoints &p)
90 {
91   //
92   // Assignment operator 
93   //
94
95   if (this != &p) ((AliTRDpoints &) p).Copy(*this);
96   return *this;
97
98 }
99
100 //_____________________________________________________________________________
101 void AliTRDpoints::Copy(TObject &p)
102 {
103   //
104   // Copy function
105   //
106
107   ((AliTRDpoints &) p).fNTRpoints = fNTRpoints; 
108   for (Int_t i = 0; i < 3*fNTRpoints; i++) {
109     ((AliTRDpoints &) p).fTRpoints[i] = fTRpoints[i];
110   }
111
112 }
113
114 //_____________________________________________________________________________
115 void AliTRDpoints::Draw(Option_t *option) 
116 {
117   //
118   // Draws a TRD point
119   //
120
121   AliPoints::Draw(option);
122
123   //if (fTRpolyMarker) delete fTRpolyMarker;
124   if (fNTRpoints) {
125     fTRpolyMarker = new TPolyMarker3D(fNTRpoints,fTRpoints,29);
126     fTRpolyMarker->SetMarkerColor(2); 
127     fTRpolyMarker->SetMarkerSize(0.8);
128     fTRpolyMarker->Draw(option);
129   }
130
131 }
132
133 //_____________________________________________________________________________
134 void AliTRDpoints::SetTRpoints(Int_t n, Float_t *coor) 
135 {
136   //
137   // Sets the number and the coordinates of the photon hits
138   //
139
140   if (kNTRpoints >= 3 * n) {
141     fNTRpoints = n;
142     for (Int_t i = 0; i < 3*n; i++) {
143       fTRpoints[i] = coor[i];
144     } 
145   }
146   else {
147     printf("AliTRDpoints::SetTRpoints -- ");
148     printf("Boundary error: %d/%d\n",3*n,kNTRpoints);
149   }
150
151 }