]>
Commit | Line | Data |
---|---|---|
46d29e70 | 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$ */ |
46d29e70 | 17 | |
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
0a29d0f1 | 20 | // This class contains the TRD points for the ALICE event display. // |
21 | // Used to seperately display dEdx and TR photon hits. // | |
46d29e70 | 22 | // // |
23 | /////////////////////////////////////////////////////////////////////////////// | |
24 | ||
0e9c2ad5 | 25 | #include <TPad.h> |
26 | #include <TView.h> | |
27 | ||
46d29e70 | 28 | #include "AliRun.h" |
29 | #include "AliDetector.h" | |
0e9c2ad5 | 30 | |
31 | #include "AliTRDpoints.h" | |
46d29e70 | 32 | |
33 | ClassImp(AliTRDpoints) | |
34 | ||
35 | //_____________________________________________________________________________ | |
3bc9d03e | 36 | AliTRDpoints::AliTRDpoints() |
37 | :AliPoints() | |
38 | ,fNTRpoints(0) | |
39 | ,fTRpolyMarker(0) | |
46d29e70 | 40 | { |
41 | // | |
42 | // Default constructor | |
43 | // | |
44 | ||
46d29e70 | 45 | } |
46 | ||
47 | //_____________________________________________________________________________ | |
3bc9d03e | 48 | AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT) |
49 | :AliPoints(nhitsE) | |
50 | ,fNTRpoints(nhitsT) | |
51 | ,fTRpolyMarker(0) | |
46d29e70 | 52 | { |
53 | // | |
54 | // Standard constructor | |
55 | // | |
56 | ||
46d29e70 | 57 | } |
58 | ||
59 | //_____________________________________________________________________________ | |
3bc9d03e | 60 | AliTRDpoints::AliTRDpoints(const AliTRDpoints &p) |
61 | :AliPoints(p) | |
62 | ,fNTRpoints(p.fNTRpoints) | |
63 | ,fTRpolyMarker(0) | |
46d29e70 | 64 | { |
65 | // | |
66 | // Copy contructor | |
67 | // | |
3bc9d03e | 68 | |
69 | for (Int_t i = 0; i < 3*fNTRpoints; i++) { | |
70 | ((AliTRDpoints &) p).fTRpoints[i] = fTRpoints[i]; | |
71 | } | |
46d29e70 | 72 | |
73 | } | |
74 | ||
75 | //_____________________________________________________________________________ | |
76 | AliTRDpoints::~AliTRDpoints() | |
77 | { | |
78 | // | |
79 | // Default destructor | |
80 | // | |
81 | ||
3bc9d03e | 82 | if (fTRpolyMarker) { |
83 | delete fTRpolyMarker; | |
84 | fTRpolyMarker = 0; | |
85 | } | |
46d29e70 | 86 | |
87 | } | |
88 | ||
89 | //_____________________________________________________________________________ | |
90 | AliTRDpoints &AliTRDpoints::operator=(const AliTRDpoints &p) | |
91 | { | |
92 | // | |
93 | // Assignment operator | |
94 | // | |
95 | ||
96 | if (this != &p) ((AliTRDpoints &) p).Copy(*this); | |
97 | return *this; | |
98 | ||
99 | } | |
100 | ||
101 | //_____________________________________________________________________________ | |
e0d47c25 | 102 | void AliTRDpoints::Copy(TObject &p) const |
46d29e70 | 103 | { |
104 | // | |
105 | // Copy function | |
106 | // | |
107 | ||
108 | ((AliTRDpoints &) p).fNTRpoints = fNTRpoints; | |
109 | for (Int_t i = 0; i < 3*fNTRpoints; i++) { | |
110 | ((AliTRDpoints &) p).fTRpoints[i] = fTRpoints[i]; | |
111 | } | |
112 | ||
113 | } | |
114 | ||
115 | //_____________________________________________________________________________ | |
116 | void AliTRDpoints::Draw(Option_t *option) | |
117 | { | |
118 | // | |
119 | // Draws a TRD point | |
120 | // | |
121 | ||
122 | AliPoints::Draw(option); | |
123 | ||
46d29e70 | 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 | ||
3bc9d03e | 140 | if (kNTRpoints >= 3*n) { |
46d29e70 | 141 | fNTRpoints = n; |
142 | for (Int_t i = 0; i < 3*n; i++) { | |
143 | fTRpoints[i] = coor[i]; | |
144 | } | |
145 | } | |
146 | else { | |
3bc9d03e | 147 | AliError(Form("Boundary error: %d/%d\n",3*n,kNTRpoints)); |
46d29e70 | 148 | } |
149 | ||
150 | } |