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