57 class StEventDisplayMaker;
58 class StEventDisplayInfo;
66 static StEventDisplayMaker *fgDispMk;
67 static TGMainFrame *fgBar;
68 static StEventDisplayInfo *fgHlp;
77 TGTextButton *AddButt(
const Char_t *buttonName,
const Char_t *command)
79 TGTextButton *tb =
new TGTextButton(fBar,buttonName,command);
84 UInt_t uHintsNam = kLHintsCenterY | kLHintsFillX;
85 TGTableLayoutHints *hi =
new TGTableLayoutHints(col,col+1,row,row+1
89 fBar->AddFrame(tb,hi);
98 fgChain = 0; fgDispMk=0; fgHlp = 0; fNum=0;
100 TClass *kl = gROOT->GetClass(
"StChain");
101 if (kl && kl->GetClassInfo())
103 fgChain = StMaker::GetChain();
104 fgDispMk = (StEventDisplayMaker*)fgChain->GetMaker(
"EventDisplay");
113 const char *listEvents[] = {
114 "dst/point" ,
"dst/point(id_track,position[0]:position[1]:charge)",
115 "dst/primtrk" ,
"dst/primtrk" ,
116 "dst/globtrk" ,
"dst/globtrk" ,
117 "dst/vertex" ,
"dst/vertex(vtx_id,x:y:z)" ,
118 "All Used Hits" ,
"StEvent(All Used Hits)" ,
119 "All Unused Hits" ,
"StEvent(All Unused Hits)" ,
120 "TPC Used Hits" ,
"StEvent(Tpc Used Hits)" ,
121 "TPC Unused Hits" ,
"StEvent(Tpc Unused Hits)" ,
122 "FTPC Used Hits" ,
"StEvent(Ftpc Used Hits)" ,
123 "FTPC Unused Hits" ,
"StEvent(Ftpc Unused Hits)" ,
124 "SVT Used Hits" ,
"StEvent(Svt Used Hits)" ,
125 "SVT Unused Hits" ,
"StEvent(Svt Unused Hits)" ,
126 "SSD Used Hits" ,
"StEvent(Ssd Used Hits)" ,
127 "SSD Unused Hits" ,
"StEvent(Ssd Unused Hits)" ,
128 "RICH Used Hits" ,
"StEvent(Rich Used Hits)" ,
129 "RICH Unused Hits" ,
"StEvent(Rich Unused Hits)" ,
130 "EMC Used Hits" ,
"StEvent(Emc Used Hits)" ,
131 "EMC Unused Hits" ,
"StEvent(Emc Unused Hits)" ,
132 "TOF Used Hits" ,
"StEvent(Tof Used Hits)" ,
133 "TOF Unused Hits" ,
"StEvent(Tof Unused Hits)" ,
134 "All Tracks", ,
"StEvent(All Tracks)" ,
135 "All Track Hits" ,
"StEvent(All Track Hits)" ,
136 "Primary Tracks" ,
"StEvent(Primary Tracks)" ,
137 "Primary Track Hits" ,
"StEvent(Primary Track Hits)" ,
138 "Kink Tracks" ,
"StEvent(Kink Tracks)" ,
139 "Kink Track Hits" ,
"StEvent(Kink Track Hits)" ,
140 "V0 Tracks" ,
"StEvent(V0 Tracks)" ,
141 "V0 Track Hits" ,
"StEvent(V0 Track Hits)" ,
142 "Xi Tracks" ,
"StEvent(Xi Tracks)" ,
143 "Xi Track Hits" ,
"StEvent(Xi Track Hits)" ,
146 fBar =
new TGMainFrame(gClient->GetRoot(), 250,550);
147 fBar->SetWindowName(
"EventControl");
148 TGTableLayout *lay =
new TGTableLayout(fBar,40,4,0,0);
149 fBar->SetLayoutManager(lay);
156 for (i=0;listEvents[i];i+=2) {
157 TGTextButton *button = AddButt(listEvents[i],
"");
158 sprintf(cbuf,
"StEventControlPanel::ToggleDisplayName(\"%s\",(TGTextButton*)%p)"
159 ,listEvents[i+1],button);
160 button->SetCommand(cbuf);
163 AddButt(
"Show selections",
"StEventControlPanel::PrintNames();");
176 static void PrintNames()
178 if (!fgDispMk)
return;
179 TList *tl = fgDispMk->GetNameList();
180 if (!fgHlp)
new StEventDisplayInfo(&fgHlp,
"Draw Selections", 200, 100);
181 TListIter nextOne(tl);
184 while ((n=nextOne())) {
185 if (nk) {fgHlp->AddText(n->GetName());}
186 else {fgHlp->SetText(n->GetName());}
194 if (!fgDispMk)
return;
195 TList *tl = fgDispMk->GetNameList();
197 TGButton *but=0;TObject *n=0;
198 TList *frameList = fBar->GetList();
199 TListIter nextFrame(frameList);
200 TGFrameElement *fe=0;
201 while ((fe=(TGFrameElement*)nextFrame())) {
202 but = (TGButton*)fe->fFrame;
203 TListIter nextOne(tl);
204 while ((n=nextOne())) {
205 if (strchr(n->GetName(),
'(')==0)
continue;
206 if (strstr(but->GetCommand(),n->GetName()))
break; }
207 int state = (n) ? kButtonDown:kButtonUp;
208 but->SetState(state);
213 static void ToggleDisplayName(
const char *name,TGTextButton *button)
215 if (!fgDispMk)
return;
216 TList *lis = fgDispMk->GetNameList();
217 if (!lis || !(lis->FindObject(name))) {
218 fgDispMk->AddName(name);
219 button->SetState(kButtonDown);
221 fgDispMk->RemoveName(name);
222 button->SetState(kButtonUp);
226 TGTextButton *AddFilter(TObject *filter)
229 sprintf(cbuf,
"((StFilterABC*)%p)->Update();",filter);
230 printf(
"AddFilter: %s::%s\n",filter->GetName(),cbuf);
231 return AddButt(filter->GetName(), cbuf);
240 fBar->MapSubwindows();