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