1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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.
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
33 //____________________________________________________________________
34 AliFMDPoints::AliFMDPoints(AliFMDHit* hit, UInt_t color)
35 : AliPoints(1), fMarker(0)
39 // hit Hit to represent
40 // color Color of marker
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,
47 fMarker->SetLineColor(color);
48 fMarker->SetRefObject(this);
54 //____________________________________________________________________
55 AliFMDPoints::AliFMDPoints(const AliFMDPoints& other)
56 : AliPoints(other), fMarker(other.fMarker)
61 //____________________________________________________________________
63 AliFMDPoints::operator=(const AliFMDPoints& other)
65 // Assignment operator
66 fMarker = other.fMarker;
71 //____________________________________________________________________
72 AliFMDPoints::~AliFMDPoints()
75 // if (fMarker) delete fMarker;
77 //____________________________________________________________________
79 AliFMDPoints::SetXYZ(Double_t x, Double_t y, Double_t z)
81 // Set (x,y,z) position of marker
86 if (fMarker) fMarker->SetPosition(x, y, z);
89 //____________________________________________________________________
91 AliFMDPoints::DistancetoPrimitive(Int_t px, Int_t py)
93 // Calculate distance from (px,py) to this
95 // Px X-coordinate of marker
96 // Py Y-coordinate of marker
99 return fMarker->DistancetoPrimitive(px, py);
101 //____________________________________________________________________
103 AliFMDPoints::Draw(Option_t* option)
107 // option See TMarker3DBox::Draw
108 if (fMarker) fMarker->Draw(option);
110 //____________________________________________________________________
112 AliFMDPoints::Paint(Option_t* option)
116 // option See TMarker3DBox::Paint
117 if (fMarker) fMarker->Paint(option);
120 //____________________________________________________________________
122 AliFMDPoints::SetMarkerColor(Color_t colour)
124 // Set the marker color
126 // colour Colour of marker
127 if (fMarker) fMarker->SetLineColor(colour);
130 //____________________________________________________________________