MCTrueView.h
Go to the documentation of this file.
1 ///
2 /// \file MCTrueView.h
3 /// \brief A window that gives full list of MC particles, allowing user to
4 /// turn hits on and off in other views.
5 /// \author jpaley@anl.gov
6 /// \version $Id: MCTrueView.h,v 1.2 2010-11-10 22:38:34 p-novaart Exp $
7 ///
8 #ifndef EVD_MCTRUEVIEW_H
9 #define EVD_MCTRUEVIEW_H
10 #include "TGFrame.h"
11 
13 
14 #include <map>
15 #ifndef __CINT__
16 #include "Simulation/Particle.h"
17 #endif
18 
19 class TGTransientFrame;
20 class TGCompositeFrame;
21 class TGLayoutHints;
22 class TGCheckButton;
23 class TGTextButton;
24 class TGVScrollBar;
25 class TGLabel;
26 class TParticle;
27 namespace sim { class Particle; }
28 
29 namespace evd {
30  class SimulationDrawer;
31  class RawDataDrawer;
32  class RecoBaseDrawer;
33 
34  /// Window containing list of MC particles
36  RQ_OBJECT("evd::MCTrueView")
37 
38  public:
39  MCTrueView(TGMainFrame* mf);
40  ~MCTrueView();
41 
42  const char* Description() const { return "MC Particle List Viewer"; }
43  const char* PrintTag() const { return "mctrue-view"; }
44  void Draw(const char* opt="u");
45  void Update();
46  void UpdateAndDraw();
47  void LoadEvent();
48 
49  enum defs_ {
50  kNPart = 10, // number of particles to list at in the window
51  kPartName = 0,
52  kMother = 1,
53  kTrackId = 2,
54  kMomentum = 3,
55  kVtxZ = 4,
56  kNHit = 5,
57  kTime = 6,
58  kEDep = 7,
59  kNPanel = 8 // number of panels
60  };
61 
62  public:
63  void SortParticle();
64  void SortMother();
65  void SortTrackId();
66  void SortMomentum();
67  void SortVtxZ();
68  void SortNHit();
69  void SortTime();
70  void SortEDep();
71  void HiLite();
72 
73  void HandleMouseWheel(Event_t *event);
74 
75  static bool CompParticle(const sim::Particle& a, const sim::Particle& b);
76  static bool CompMother(const sim::Particle& a, const sim::Particle& b);
77  static bool CompTrackId(const sim::Particle& a, const sim::Particle& b);
78  static bool CompMomentum(const sim::Particle& a, const sim::Particle& b);
79  static bool CompVtxZ(const sim::Particle& a, const sim::Particle& b);
80  static bool CompNHit(const sim::Particle& a, const sim::Particle& b);
81  static bool CompTime(const sim::Particle& a, const sim::Particle& b);
82  static bool CompEDep(const sim::Particle& a, const sim::Particle& b);
83 
84  private:
86  //int fCurrEvent;
87  const sim::Particle* fCheckMap[kNPart];
88 
89  std::vector<int> fPartList;
90 
91  //TGTransientFrame* fMain;
92  TGCompositeFrame* fBigFrame;
93  TGCompositeFrame* fPartFrame[kNPanel];
94 
95  TGLayoutHints fL1,fL2,fL3,fL4,fL5;
96 
97  TGCheckButton* fDrawCheck[kNPart];
98  TGLabel* fPartLabel[kNPanel][kNPart];
99  TGTextButton* fColumnLabel[kNPanel];
100 
101  /*
102  TGCompositeFrame* fButtonFrame;
103  TGTextButton* fDrawAllButton;
104  TGTextButton* fClearAllButton;
105  TGTextButton* fApplyButton;
106  */
107 
108  TGVScrollBar* fScrollBar;
109  TGCompositeFrame* fShowFrame;
110  TGCheckButton* fShowPositive;
111  TGCheckButton* fShowNegative;
112  TGCheckButton* fShowNeutral;
113 
117  };
118 }
119 
120 #endif
121 ////////////////////////////////////////////////////////////////////////
SimulationDrawer * fSim
Definition: MCTrueView.h:114
TGVScrollBar * fScrollBar
Definition: MCTrueView.h:108
TGCompositeFrame * fBigFrame
Definition: MCTrueView.h:92
tree Draw("slc.nhit")
c1 Update()
Aid in the rendering of RecoBase objects.
const char * Description() const
Definition: MCTrueView.h:42
TGCheckButton * fShowNegative
Definition: MCTrueView.h:111
const char * PrintTag() const
Definition: MCTrueView.h:43
TGLayoutHints fL5
Definition: MCTrueView.h:95
TGCompositeFrame * fShowFrame
Definition: MCTrueView.h:109
RecoBaseDrawer * fReco
Definition: MCTrueView.h:116
const Var kTime
Definition: VarsAndCuts.h:33
Window containing list of MC particles.
Definition: MCTrueView.h:35
std::vector< int > fPartList
Definition: MCTrueView.h:89
RawDataDrawer * fRaw
Definition: MCTrueView.h:115
nova event display
const double a
Example routine for calculating the "ultimate e-m mother" of a particle in a simulated event...
Definition: FillTruth.h:16
TGCheckButton * fShowPositive
Definition: MCTrueView.h:110
const Var kVtxZ
const hit & b
Definition: hits.cxx:21
Base class for displaying lists of objects (eg, MC truth, reco, etc.)
Aid in the rendering of RawData objects.
Definition: RawDataDrawer.h:27
kNHit
Definition: demo1.py:19
TGCheckButton * fShowNeutral
Definition: MCTrueView.h:112