GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AgataHitDisplay.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004-2006 by Olivier Stezowski & Christian Finck *
3  * stezow(AT)ipnl.in2p3.fr, cfinck(AT)ires.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * FreAgataHitDisplaye Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef Gw_AgataHitDisplay
24 #include "AgataHitDisplay.h"
25 #endif
26 
27 
28 using namespace Gw;
29 
30 //
32 
33 //__________________________________________________________
34 AgataHitDisplay::AgataHitDisplay(const Text_t* name)
35  : TEveQuadSet(name),
36  fPalette(new TEveRGBAPalette()),
37  fMaxEnergy(-1),
38  fQuadWidth(0.4),
39  fQuadHeight(0.4),
40  fSelectedIdx(-1),
41  fSelectedValue(-1),
42  fLog("AgataHitDisplay")
43 {
44  // default constructor
45  SetOwnIds(kTRUE);
46 }
47 
48 //__________________________________________________________
50 {
51  // default destructor
52  delete fPalette;
53 }
54 
55 //__________________________________________________________
57 {
58 
59  TEveDigitSet::DigitBase_t* selectedDigit = GetDigit(idx);
60 
61  if (selectedDigit)
62  fSelectedValue = selectedDigit->fValue;
63 
64  fSelectedIdx = idx;
65 
66  SecSelected(this, idx);
67 }
68 
69 //__________________________________________________________
71 {
72  fPalette->SetMax(Int_t(e+0.5));
73  fMaxEnergy = Int_t(e+0.5);
74  SetPalette(fPalette);
75 }
76 
77 //__________________________________________________________
78 void AgataHitDisplay::AddHit(Float_t e, Float_t x, Float_t y, Float_t z)
79 {
80  AddQuad(x-GetDefWidth()/2., y-GetDefHeight()/2., z);
81  DigitValue(Int_t(e+0.5));
82 }
83 
84 //__________________________________________________________
86 {
87  Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
88 }
ClassImp(AgataHitDisplay) AgataHitDisplay
void AddHit(Float_t e, Float_t x, Float_t y, Float_t z)
Add hit.
void SetMaxEnergy(Float_t e)
Set Max energy.
void ResetHits()
Reset hits.
AgataHitDisplay a class to display hits on event.
void DigitSelected(Int_t idx)
overwrite base function