]>
Commit | Line | Data |
---|---|---|
02a27b50 | 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 | /* $Id$ */ | |
16 | /** @file AliFMDPoints.cxx | |
17 | @author Christian Holm Christensen <cholm@nbi.dk> | |
18 | @date Tue Apr 11 12:42:50 2006 | |
19 | @brief Specialised class for drawing hits in the FMD. | |
20 | @ingroup FMD_sim | |
21 | */ | |
22 | // Specialised class for drawing hits in the FMD. The normal | |
23 | // AliPoints class isn't really suited for the FMD, as it connects the | |
24 | // dots between hits from the same particle. However, in the FMD, all | |
25 | // hits are not identified by a track, so this has little meaning. | |
26 | // What is more interresting, is the actual size of the hit. | |
27 | #include <TMath.h> // ROOT_TMath | |
28 | #include <TVector3.h> // ROOT_TVector3 | |
29 | #include <TMarker3DBox.h> // ROOT_TMarker3DBox | |
30 | #include "AliFMDHit.h" // ALIFMDHIT_H | |
31 | #include "AliFMDPoints.h" // ALIFMDPOINTS_H | |
32 | ||
33 | //____________________________________________________________________ | |
34 | AliFMDPoints::AliFMDPoints(AliFMDHit* hit, UInt_t color) | |
35 | : AliPoints(1), fMarker(0) | |
36 | { | |
37 | // Constructor | |
38 | // Params: | |
39 | // hit Hit to represent | |
40 | // color Color of marker | |
41 | // | |
42 | if (!hit) return; | |
43 | Float_t size = TMath::Min(TMath::Max(hit->Edep() * .1, .1), 1.); | |
44 | TVector3 p(hit->Px(), hit->Py(), hit->Pz()); | |
45 | fMarker = new TMarker3DBox(hit->X(), hit->Y(), hit->Z(), size, size, size, | |
46 | p.Theta(), p.Phi()); | |
47 | fMarker->SetLineColor(color); | |
48 | fMarker->SetRefObject(this); | |
49 | fP[0] = hit->X(); | |
50 | fP[1] = hit->Y(); | |
51 | fP[2] = hit->Z(); | |
52 | } | |
53 | ||
54 | //____________________________________________________________________ | |
55 | AliFMDPoints::AliFMDPoints(const AliFMDPoints& other) | |
56 | : AliPoints(other), fMarker(other.fMarker) | |
57 | { | |
58 | // Copy constructor | |
59 | } | |
60 | ||
61 | //____________________________________________________________________ | |
62 | AliFMDPoints& | |
63 | AliFMDPoints::operator=(const AliFMDPoints& other) | |
64 | { | |
65 | // Assignment operator | |
66 | fMarker = other.fMarker; | |
67 | return *this; | |
68 | } | |
69 | ||
70 | ||
71 | //____________________________________________________________________ | |
72 | AliFMDPoints::~AliFMDPoints() | |
73 | { | |
74 | // Destructor | |
75 | // if (fMarker) delete fMarker; | |
76 | } | |
77 | //____________________________________________________________________ | |
78 | void | |
79 | AliFMDPoints::SetXYZ(Double_t x, Double_t y, Double_t z) | |
80 | { | |
81 | // Set (x,y,z) position of marker | |
82 | // Params | |
83 | // X X position | |
84 | // Y Y position | |
85 | // Z Z position | |
86 | if (fMarker) fMarker->SetPosition(x, y, z); | |
87 | } | |
88 | ||
89 | //____________________________________________________________________ | |
90 | Int_t | |
91 | AliFMDPoints::DistancetoPrimitive(Int_t px, Int_t py) | |
92 | { | |
93 | // Calculate distance from (px,py) to this | |
94 | // Params: | |
95 | // Px X-coordinate of marker | |
96 | // Py Y-coordinate of marker | |
97 | // Return | |
98 | // Distance to this | |
99 | return fMarker->DistancetoPrimitive(px, py); | |
100 | } | |
101 | //____________________________________________________________________ | |
102 | void | |
103 | AliFMDPoints::Draw(Option_t* option) | |
104 | { | |
105 | // Draw on pad | |
106 | // Params | |
107 | // option See TMarker3DBox::Draw | |
108 | if (fMarker) fMarker->Draw(option); | |
109 | } | |
110 | //____________________________________________________________________ | |
111 | void | |
112 | AliFMDPoints::Paint(Option_t* option) | |
113 | { | |
114 | // Draw on pad | |
115 | // Params | |
116 | // option See TMarker3DBox::Paint | |
117 | if (fMarker) fMarker->Paint(option); | |
118 | } | |
119 | ||
120 | //____________________________________________________________________ | |
121 | void | |
122 | AliFMDPoints::SetMarkerColor(Color_t colour) | |
123 | { | |
124 | // Set the marker color | |
125 | // Params | |
126 | // colour Colour of marker | |
127 | if (fMarker) fMarker->SetLineColor(colour); | |
128 | } | |
129 | ||
130 | //____________________________________________________________________ | |
131 | // | |
132 | // EOF | |
133 | // |