3 #include "TGResourcePool.h"
18 TGMainFrame(gClient->GetRoot(), 560, 300),
23 m_filtersRemoved(
false),
25 m_eventSelectionFrameParent(0),
26 m_eventSelectionFrame(0),
27 m_triggerSelectionFrameParent(0),
28 m_triggerSelectionFrame(0),
33 m_disableFilteringBtn(0),
38 SetWindowName(
"Event Filters");
40 TGVerticalFrame* v1 =
new TGVerticalFrame(
this);
41 AddFrame(v1,
new TGLayoutHints(kLHintsExpandX |kLHintsExpandY));
55 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH);
56 selH->AddFrame(cfr,
new TGLayoutHints(kLHintsExpandX));
57 cfr->AddFrame(
new TGLabel(cfr,
"Event Filter Expression:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 6, 4));
60 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH, 122, 22, kFixedSize);
62 cfr->AddFrame(
new TGLabel(cfr,
"Comment:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 2, 0));
65 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH, 105, 22, kFixedSize);
67 cfr->AddFrame(
new TGLabel(cfr,
"Pass:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 2, 0));
71 TGHorizontalFrame* addBtnFrame =
new TGHorizontalFrame(v1);
72 v1->AddFrame(addBtnFrame,
new TGLayoutHints(kLHintsExpandX));
73 addBtnFrame->AddFrame(
new TGHorizontal3DLine(addBtnFrame),
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY,4 ,8, 2, 2));
79 addBtnFrame->AddFrame(
m_addBtn,
new TGLayoutHints(kLHintsRight, 0, 6, 4, 1));
80 TQObject::Connect(
m_addBtn,
"Clicked()",
"FWGUIEventFilter",
this,
"newEventEntry()");
94 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH);
95 selH->AddFrame(cfr,
new TGLayoutHints(kLHintsExpandX));
96 cfr->AddFrame(
new TGLabel(cfr,
"TriggerResults Filter Expression:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 6, 04));
99 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH, 122, 22, kFixedSize);
101 cfr->AddFrame(
new TGLabel(cfr,
"Comment:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 0, 0));
104 TGCompositeFrame *cfr =
new TGHorizontalFrame(selH, 105, 22, kFixedSize);
106 cfr->AddFrame(
new TGLabel(cfr,
"Pass:"),
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 2, 2, 0, 0));
111 TGHorizontalFrame* addBtnFrame =
new TGHorizontalFrame(v1);
112 v1->AddFrame(addBtnFrame,
new TGLayoutHints(kLHintsExpandX));
114 addBtnFrame->AddFrame(
new TGHorizontal3DLine(addBtnFrame),
new TGLayoutHints(kLHintsExpandX | kLHintsCenterY,4 ,8, 2, 2));
119 addBtnFrame->AddFrame(
m_addBtn,
new TGLayoutHints(kLHintsRight, 0, 6, 4, 1));
120 TQObject::Connect(
m_addBtn,
"Clicked()",
"FWGUIEventFilter",
this,
"newTriggerEntry()");
126 TGHorizontalFrame* headerFrame =
new TGHorizontalFrame(v1);
129 TGHorizontalFrame* xx =
new TGHorizontalFrame(v1);
131 m_rad1 =
new TGRadioButton(xx,
"OR", 81);
132 xx->AddFrame(
m_rad1,
new TGLayoutHints(kLHintsNormal, 2,10, 0, 0));
133 m_rad1->SetState(kButtonDown);
134 m_rad2 =
new TGRadioButton(xx,
"AND", 82);
136 m_rad1->Connect(
"Clicked()",
"FWGUIEventFilter",
this,
"changeFilterMode()");
137 m_rad2->Connect(
"Clicked()",
"FWGUIEventFilter",
this,
"changeFilterMode()");
139 v1->AddFrame(xx,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
141 v1->AddFrame(headerFrame,
new TGLayoutHints(kLHintsNormal, 1, 1, 1, 1));
146 TGHorizontalFrame* hf =
new TGHorizontalFrame(v1);
147 v1->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 20));
151 const TGFont *font = gClient->GetFont(
"-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
153 font = gClient->GetResourcePool()->GetDefaultFont();
155 gval.fMask = kGCBackground | kGCFont | kGCForeground;
156 gval.fFont = font->GetFontHandle();
157 fTextGC = gClient->GetGC(&gval, kTRUE);
159 TGHorizontalFrame *labFrame =
new TGHorizontalFrame(hf, 380, 22, kHorizontalFrame | kFixedWidth);
160 hf->AddFrame(labFrame,
new TGLayoutHints(kLHintsNormal));
162 m_stateLabel =
new TGLabel(labFrame,
"x", fTextGC->GetGC());
163 labFrame->AddFrame(
m_stateLabel,
new TGLayoutHints( kLHintsLeft,2,2,2,2));
169 TGHorizontalFrame* btnFrame =
new TGHorizontalFrame(v1, 280, 30);
170 v1->AddFrame(btnFrame,
new TGLayoutHints(kLHintsCenterX | kLHintsExpandX | kLHintsBottom , 0, 0, 2, 4));
172 TGTextButton* cancel =
new TGTextButton(btnFrame,
" Close ");
173 btnFrame->AddFrame(cancel,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY , 20, 20, 2, 4));
174 cancel->Connect(
"Clicked()",
"FWGUIEventFilter",
this,
"CloseWindow()");
177 TGHorizontalFrame*
f =
new TGHorizontalFrame(btnFrame);
178 btnFrame->AddFrame(f,
new TGLayoutHints(kLHintsRight, 4, 18, 2, 4));
183 m_applyBtn =
new TGTextButton(f,
"Apply Filters");
184 f->AddFrame(
m_applyBtn,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 4, 8, 2, 4));
185 m_applyBtn->Connect(
"Clicked()",
"FWGUIEventFilter",
this,
"apply()");
186 m_applyBtn->SetToolTipText(
"Enable filtering and apply changes.");
201 parent->AddFrame(es,
new TGLayoutHints(kLHintsExpandX));
202 TQObject::Connect(es,
"removeSelector(FWGUIEventSelector*)",
"FWGUIEventFilter",
this,
"deleteEntry(FWGUIEventSelector*)");
203 TQObject::Connect(es,
"selectorChanged()",
"FWGUIEventFilter",
this,
"checkApplyButton()");
212 TGButton *btn = (TGButton *) gTQSender;
214 if (btn->WidgetId() == 81)
215 m_rad2->SetState(kButtonUp);
217 m_rad1->SetState(kButtonUp);
233 m_rad1->SetState(kButtonDown,
false);
234 m_rad2->SetState(kButtonUp,
false);
238 m_rad2->SetState(kButtonDown,
false);
239 m_rad1->SetState(kButtonUp,
false);
250 for(std::list<FWEventSelector*>::iterator
i = sels->begin();
i != sels->end(); ++
i)
290 TGCompositeFrame*
p = 0;
297 Resize(GetWidth(), GetDefaultHeight());
299 gClient->NeedRedraw(
this);
310 Resize(GetWidth(), GetDefaultHeight());
320 Resize(GetWidth(), GetDefaultHeight());
332 fClient->NeedRedraw(
this);
391 if ((*i)->origSelector() == 0 ||
392 (*i)->guiSelector()->m_enabled != (*i)->origSelector()->m_enabled ||
393 (*i)->guiSelector()->m_expression != (*i)->origSelector()->m_expression )
404 m_applyBtn->SetForegroundColor(changed ? 0x40FF80 : 0x000000);
458 if (GetBindList()->IsEmpty())
461 TIter
next(fBindList);
465 while ((m = (TGMapKey *)
next())) {
466 if (m->fKeyCode == event->fCode) {
467 w = (TGFrame *) m->fWindow;
468 if (w->HandleKey(event))
return kTRUE;
static const TString & coreIcondir()
FWEventSelector * origSelector()
void bindCSGActionKeys(const TGMainFrame *f) const
TGTextButton * m_applyBtn
std::string m_triggerProcess
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
FWGUIEventFilter(CmsShowNavigator *)
TGCompositeFrame * m_eventSelectionFrameParent
T x() const
Cartesian x coordinate.
TGCompositeFrame * m_triggerSelectionFrameParent
void applyFiltersFromGUI()
if(c.getParameter< edm::InputTag >("puppiValueMap").label().size()!=0)
void updateFilterStateLabel(int)
CmsShowNavigator * m_navigator
void editFiltersExternally()
TGCompositeFrame * m_triggerSelectionFrame
CmsShowMainFrame * getMainFrame() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static const int s_entryHeight
std::vector< std::string > & getProcessList() const
virtual ~FWGUIEventFilter()
static FWGUIManager * getGUIManager()
FWCustomIconsButton * m_addBtn
void toggleFilterEnable()
TGCompositeFrame * m_eventSelectionFrame
void setupDisableFilteringButton(bool)
Bool_t HandleKey(Event_t *event)
void addSelector(FWEventSelector *sel)
volatile std::atomic< bool > shutdown_flag false
TGTextButton * m_disableFilteringBtn
std::list< FWGUIEventSelector * > m_guiSelectors
TGLabel * makeLabel(TGCompositeFrame *p, const char *txt, int width, int lo=0, int ro=0, int to=2, int bo=0)
void deleteEntry(FWGUIEventSelector *)
virtual void CloseWindow()