StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TurnDisplay.C
1 //*-- Author : Valery Fine(fine@bnl.gov) 02/12/99
2 // $Id: TurnDisplay.C,v 1.8 2000/08/31 21:28:01 fine Exp $
3  StEventDisplayMaker *dsMaker = 0;
4  StVirtualEventFilter *trackFilter;
5 //___________________________________________________________________
6 void TurnDisplay(const Char_t *filterName=0) {
7  //
8  // TurnDisplay.C macro:
9  //
10  // - Load StEventDisplayMaker
11  // - Load user-defined filter class if provided
12  // - defines the tables one wants to be drawn
13 
14  if (chain->IsA() == StChain::Class() || !chain->GetOption("DISPLAY") ) {
15  gSystem->Load("St_geom_Maker");
16  gSystem->Load("StEventDisplayMaker");
17  StMaker *mini = new St_geom_Maker();
18  mini->Init();
19  dsMaker = new StEventDisplayMaker();
20  dsMaker->Init();
21  }
22  dsMaker = (StEventDisplayMaker *) chain->GetMaker("EventDisplay");
23  if (dsMaker) {
24  if (filterName && filterName[0]) {
25  gSystem->Load(filterName); // Load the user-defined filter
26  TClass *filterClass = gROOT->GetClass(filterName);
27  if (filterClass) {
28  trackFilter = (StVirtualEventFilter *)filterClass->New();
29 
30  // Activate some filter channels
31  dsMaker->SetFilter(trackFilter,StEventDisplayMaker::kTable);
32  trackFilter->TurnOn();
33 
34  trackFilter = (StVirtualEventFilter *)filterClass->New();
35  dsMaker->SetFilter(trackFilter,StEventDisplayMaker::kTptTrack);
36  }
37  else {
38  cout << " *** ERROR ***: There is no class filter <" << filterName << ">. The defualt one will be used instead" << endl;
39  dsMaker->SetTableFlag();
40  }
41  }
42  else {
43  dsMaker->SetTableFlag();
44  dsMaker->SetTptTrackFlag();
45  }
46 
47  // define "Event" geometry (the objects to be drawn out)
48  // This is under construction !!!!
49  //___________________________________________________________________
50  //
51  // User defined area follow:
52  //___________________________________________________________________
53 
54  // "Reference tables" have no (x,y,z) information and can not be drawn
55  // They should be sorted by the foreign key provided in brackets to be effecient
56  // No filter channel used. No default action
57 
58  dsMaker->AddName("dst/dst_dedx(id_track)"); //Add the "reference" tables to the Event Display list
59  // dsMaker->AddName("g2t_track(ge_pid)"); //Add the "reference" tables to the Event Display list
60  // dsMaker->AddName("g2t_vertex(id)"); //Add the "reference" tables to the Event Display list
61 
62  // "Regular" tables:
63  // contain 3 columns associated with x,y,z and
64  // foreing key to link all points together
65 
66  // dsMaker->AddName("g2t_tpc_hit(track_p,x[0]:x[1]:x[2])"); //Add the tables to the Event Display list
67  // dsMaker->AddName("g2t_svt_hit(track_p,x[0]:x[1]:x[2])"); //Add the tables to the Event Display list
68  dsMaker->AddName("tphit(id_globtrk,x:y:z)"); //Add the tables to the Event Display list
69  // dsMaker->AddName("scs_spt(id_globtrk,x[0]:x[1]:x[2])"); //Add the tables to the Event Display list
70 
71  // extra table to check packed options
72  // http://www.star.bnl.gov/STAR/html/comp_l/root/html/egr_globtrk_st.html
73 
74  // dsMaker->AddName("egr_globtrk(id,position[0]:position[1]:charge)"); //Add the tables to the Event Display list
75 
76  // "Packed" tables:
77  // contain 1 columns with 2 long numbers associated with packed x,y,z and
78  // foreing key to link all points together
79  // http://www.star.bnl.gov/STAR/html/comp_l/root/html/dst_point_st.html
80  dsMaker->AddName("dst/point(id_track,position[0]:position[1]:charge)"); //Add the tables to the Event Display list
81 
82  // "Irregular" tables: has no column associated directly with (x,y,z) coordinates
83  dsMaker->AddName("dst/primtrk");
84  dsMaker->AddName("tptrack"); // the table has no column with (x,y,z) coordinates,
85  // a special method has to be invoked to draw this table
86  //___________________________________________________________________
87  //
88  // End of the user defined area follow:
89  //___________________________________________________________________
90  if (trackFilter) trackFilter->TurnOn();
91  dsMaker->SetDebug();
92  dsMaker->TurnOn();
93  }
94  }
95 //__________________________________________________________________________
96 // $Log: TurnDisplay.C,v $
97 // Revision 1.8 2000/08/31 21:28:01 fine
98 // new default to draw dst objects
99 //
100 // Revision 1.7 2000/04/18 21:43:14 fine
101 // make TurnDisplay macro available for doEvents
102 //
103 // Revision 1.6 1999/12/27 21:47:06 fine
104 // St_geom_Maker has been added
105 //
106 // Revision 1.5 1999/12/27 20:54:39 fine
107 // it shows how to active the ttrack points
108 //
109 // Revision 1.4 1999/12/19 00:12:34 fine
110 // some corrections for the packed tables
111 //
112 // Revision 1.3 1999/12/06 04:46:56 fine
113 // Bug fixes
114 //
115 // Revision 1.2 1999/12/02 19:56:22 fine
116 // Clean up
117 //
118 // Revision 1.1 1999/12/02 18:49:35 fine
119 // two new macro to play with Event Display have been introduced
120 //