GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AgataTrackDisplay.h
Go to the documentation of this file.
1 #ifndef Gw_AgataTrackDisplay
2 #define Gw_AgataTrackDisplay
3 
4 #include <map>
5 #include <vector>
6 
7 #ifndef ROOT_TArrayF
8 #include "TArrayF.h"
9 #endif
10 
11 #ifndef ROOT_TEveBoxSet
12 #include "TEveBoxSet.h"
13 #endif
14 
15 #ifndef ROOT_TString
16 #include "TString.h"
17 #endif
18 
19 #include "GwLogMessage.h"
20 
21 namespace Gw {
22 
27 class AgataTrackDisplay : public TEveBoxSet
28 {
29 
30 public:
31  AgataTrackDisplay(const Text_t* name);
32  virtual ~AgataTrackDisplay();
33 
35  void SetBoxWidth(Float_t w) { fBoxWidth = w;}
36  void SetBoxHeight(Float_t h) { fBoxHeight = h; }
37 
39  Float_t GetBoxWidth() { return fBoxWidth; }
40  Float_t GetBoxHeight() { return fBoxHeight; }
41 
43  Int_t GetSelectedValue() { return fSelectedValue; }
44 
46  Int_t GetSelectedIdx() { return fSelectedIdx; }
47 
49  void FirstEnergy() { fTotalEnergyIter = fTotalEnergyArray.begin(); }
50 
52  Int_t NextEnergy();
53 
55  Int_t GetNofTracks() { return fNofTracks; }
56 
58  void DigitSelected(Int_t idx);
59 
61  void AddNewTrack();
62 
64  void AddTracklet(Float_t e, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2, Bool_t eTot = false);
65 
67  void ResetTracks();
68 
70  void SetMaxEnergy(Float_t e);
71 
73  Float_t GetMaxEnergy() { return fMaxEnergy; }
74 
76  std::pair<Int_t, Int_t> GetIndexes(Int_t index);
77 
79  void SetStyle(TString s);
80 
81 private:
82 
83  TEveRGBAPalette *fPalette; // color palette
84 
85  Int_t fMaxEnergy; // max energy
86 
87  Float_t fBoxWidth; // width of track box
88  Float_t fBoxHeight; // height of track box
89 
90  Int_t fSelectedIdx; // selected digit index
91  Int_t fSelectedValue; // selected digit value
92 
93  TArrayF fBoxVert; // vertices of track box
94 
95  Int_t fNofTracks; // track id
96  Int_t fHitIdPerTrack; // hit id for a given track
97 
98  TString fStyle; // flag for display
99 
100  std::map<Int_t, std::pair<Int_t,Int_t> > fMapIdx; // index map for mapping track indexes with BoxSet indexes
101 
102  std::vector<Int_t> fTotalEnergyArray; // total energy array
103 
104  std::vector<Int_t>::const_iterator fTotalEnergyIter; // total energy iterator
105 
106 
107  mutable LogMessage fLog;
108 
109 protected:
110 
112  Float_t* MakeRecTVert(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
113 
115  void MakeSize(Float_t e);
116 
118  void SetIndexes();
119 
121 };
122 
123 } // end namespace
124 
125 #endif
Int_t NextEnergy()
return next total energy
void SetIndexes()
Set indexes.
void SetBoxHeight(Float_t h)
AgataTrackDisplay a class to display tracks on event.
void SetBoxWidth(Float_t w)
Set width/height of Box.
Int_t GetNofTracks()
return number of tracks
void ResetTracks()
Reset tracks.
void FirstEnergy()
return first total energy
AgataTrackDisplay(const Text_t *name)
Int_t GetSelectedValue()
Get current digit value.
Base class for a Log message.
Definition: GwLogMessage.h:94
Float_t GetMaxEnergy()
Get Max energy.
void SetStyle(TString s)
Set style (rec/cone)
header file for GwLogMessage.cpp
void DigitSelected(Int_t idx)
overwrite base function
void AddTracklet(Float_t e, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2, Bool_t eTot=false)
Add Track.
std::pair< Int_t, Int_t > GetIndexes(Int_t index)
Get index pair.
void AddNewTrack()
Add new track, resetting counter.
void MakeSize(Float_t e)
Make track size.
Int_t GetSelectedIdx()
Get selected digit index.
void SetMaxEnergy(Float_t e)
Set Max energy.
ClassDef(AgataTrackDisplay, 1)
Float_t GetBoxWidth()
Get width/height of Box.
Float_t * MakeRecTVert(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
log message