21 #include <TApplication.h>
27 :TGMainFrame(p, w, h),evMan_(evman),display_(dm),attrView_(0),
28 thisClusPattern_(0),trackPattern_(0),simplePartPattern_(0)
31 mainFrame_=
new TGCompositeFrame(
this,200,300,kVerticalFrame);
33 AddFrame(
mainFrame_,
new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
36 SetWindowName(
"PFRootEvent Dialog");
48 if (gROOT->GetListOfCanvases()->FindObject(
"graphic Attributes"))
63 attrView_ =
new TCanvas(
"graphic Attributes",
"graphic Attributes",180,300);
64 const char *action1=
"win->DialogFrame::modifyAttr()";
65 const char *action2=
"win->DialogFrame::closeCanvasAttr()";
66 TButton *accept_ =
new TButton(
"modify",action1,0.1,0.2,0.5,0.3);
67 TButton *cancel_ =
new TButton(
"cancel",action2,0.54,0.2,0.9,0.3);
70 x[0]=0.1;x[1]=0.3;x[2]=0.5;
71 y[0]=0.6;y[1]=0.6;y[2]=0.6;
76 TText *
tt=
new TText(0.6,0.78,
"clusters");
85 TText *tt2=
new TText(0.6,0.58,
"recTracks");
86 tt2->SetTextSize(.08);
96 TGCompositeFrame *h1Frame1 =
new TGCompositeFrame(
mainFrame_, 100, 100, kHorizontalFrame | kRaisedFrame);
97 mainFrame_->AddFrame(h1Frame1,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
99 lo =
new TGLayoutHints(kLHintsLeft|kLHintsExpandX |kLHintsExpandY ,5,2,5,2);
102 TGGroupFrame *gr1=
new TGGroupFrame(h1Frame1,
"Draw Selection",kVerticalFrame);
103 gr1->SetLayoutManager(
new TGMatrixLayout(gr1,9,3,5));
107 selectObject_[0]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=0)");
110 selectObject_[1]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=1)");
113 selectObject_[2]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=2)");
116 selectObject_[3]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=3)");
119 selectObject_[4]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=4)");
122 selectObject_[5]->Connect(
"Clicked()",
"DialogFrame",
this,
"doModifyOptions(=5)");
125 selectObject_[6]->Connect(
"Clicked()",
"DialogFrame",
this,
"areBremVisible()");
128 selectObject_[7]->Connect(
"Clicked()",
"DialogFrame",
this,
"isPFBlockVisible()");
132 TGNumberFormat::ELimit lim = TGNumberFormat::kNELLimitMinMax;
134 for (
int i=0;
i<6;++
i){
154 for (
int i=0;
i<6;++
i) {
160 TGLayoutHints *lo1=
new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
161 TGLabel *
label=
new TGLabel(gr1,
" ");
162 gr1->AddFrame(label,lo1);
163 label=
new TGLabel(gr1,
" En/Pt Threshold");
164 gr1->AddFrame(label,lo1);
165 label=
new TGLabel(gr1,
" (Gev) ");
166 gr1->AddFrame(label,lo1);
168 for (
int i=0;
i<6;++
i) {
180 TGLabel *label0 =
new TGLabel(gr1,
" ");
182 gr1->AddFrame(label0,lo1);
183 gr1->AddFrame(label0,lo1);
185 h1Frame1->AddFrame(gr1,lo);
189 TGVerticalFrame *optionFrame =
new TGVerticalFrame(h1Frame1,10,10,kSunkenFrame);
193 TGHorizontalFrame *h2 =
new TGHorizontalFrame(optionFrame,10,10);
194 TGGroupFrame *printGroup =
new TGGroupFrame(h2,
" Print", kVerticalFrame);
195 lab1 =
new TGLabel(printGroup,
" ");
196 lab2 =
new TGLabel(printGroup,
" ");
198 printGroup->SetLayoutManager(
new TGMatrixLayout(printGroup, 7,3,3));
199 printButton_[0] =
new TGCheckButton(printGroup,
"RecHits ");
201 printButton_[0]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=0)");
202 printButton_[1] =
new TGCheckButton(printGroup,
"Clusters");
204 printButton_[1]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=1)");
205 printButton_[2] =
new TGCheckButton(printGroup,
"PFBlocks");
207 printButton_[2]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=2)");
208 printButton_[3] =
new TGCheckButton(printGroup,
"PFCandidates ");
210 printButton_[3]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=3)");
211 printButton_[4] =
new TGCheckButton(printGroup,
"PFJets ");
213 printButton_[4]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=4)");
214 printButton_[5] =
new TGCheckButton(printGroup,
"SimParticles ");
216 printButton_[5]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=5)");
217 printButton_[6] =
new TGCheckButton(printGroup,
"GenParticles");
218 TGLabel *maxl =
new TGLabel(printGroup,
"max lines:");
224 printButton_[6]->Connect(
"Clicked()",
"DialogFrame",
this,
"selectPrintOption(=6)");
227 for(UInt_t
i = 0 ;
i<6 ; ++
i){
229 printGroup->AddFrame(lab1,lo1);
230 printGroup->AddFrame(lab2,lo1);
233 printGroup->AddFrame(maxl,lo1);
237 TGTextButton *sendPrintButton =
new TGTextButton(h2,
"Print");
238 sendPrintButton->Connect(
"Clicked()",
"DialogFrame",
this,
"doPrint()");
240 h2->AddFrame(printGroup,lo1);
241 h2->AddFrame(sendPrintButton,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY,2,2,2,2));
243 TGGroupFrame *viewGroup =
new TGGroupFrame(optionFrame,
"View",kHorizontalFrame);
244 lab1 =
new TGLabel(viewGroup,
" ");
245 lab2 =
new TGLabel(viewGroup,
" ");
246 viewGroup->SetLayoutManager(
new TGMatrixLayout(viewGroup, 3,3,3));
248 TGTextButton *lookFor =
new TGTextButton(viewGroup,
"Look for");
249 lookFor->Connect(
"Clicked()",
"DialogFrame",
this,
"doLookForGenParticle()");
250 TGLabel *genPartNb =
new TGLabel(viewGroup,
"Gen Particle Nb:");
256 TGTextButton *unZoomButton =
new TGTextButton(viewGroup,
"Unzoom");
257 unZoomButton->Connect(
"Clicked()",
"DialogFrame",
this,
"unZoom()");
259 TGTextButton *newAttrBis =
new TGTextButton(viewGroup,
"Modify Graphic Attr");
260 newAttrBis->Connect(
"Clicked()",
"DialogFrame",
this,
"createCanvasAttr()");
262 viewGroup->AddFrame(lookFor,lo1);
263 viewGroup->AddFrame(genPartNb,lo1),
265 viewGroup->AddFrame(unZoomButton,lo1);
266 viewGroup->AddFrame(lab1,lo1);
267 viewGroup->AddFrame(lab2,lo1);
268 viewGroup->AddFrame(newAttrBis,lo1);
271 optionFrame->AddFrame(h2,lo);
272 optionFrame->AddFrame(viewGroup,lo1);
273 h1Frame1->AddFrame(optionFrame,lo);
278 TGHorizontalFrame *h1 =
new TGHorizontalFrame(
mainFrame_,20,30);
279 mainFrame_->AddFrame(h1,
new TGLayoutHints(kLHintsCenterX,2,2,2,2));
281 nextButton =
new TGTextButton(h1,
"Draw Next");
282 nextButton->Connect(
"Clicked()",
"DialogFrame",
this,
"doNextEvent()");
283 h1->AddFrame(
nextButton,
new TGLayoutHints(kLHintsBottom|kLHintsCenterX,2,2,2,2));
286 previousButton->Connect(
"Clicked()",
"DialogFrame",
this,
"doPreviousEvent()");
287 h1->AddFrame(
previousButton,
new TGLayoutHints(kLHintsBottom|kLHintsCenterX,2,2,2,2));
291 reProcessButton->Connect(
"Clicked()",
"DialogFrame",
this,
"doReProcessEvent()");
292 h1->AddFrame(
reProcessButton,
new TGLayoutHints(kLHintsBottom|kLHintsCenterX,2,2,2,2));
300 exitButton =
new TGTextButton(h1,
"&Exit",
"gApplication->Terminate(0)");
301 h1->AddFrame(
exitButton,
new TGLayoutHints(kLHintsBottom|kLHintsCenterX,2,2,2,2));
308 gApplication->Terminate(0);
480 switch (GET_MSG(msg)) {
482 switch (GET_SUBMSG(msg)) {
485 case EN :
case EN+1:
case EN+2:
case EN+3:
case EN+4:
case EN+5:
508 switch (GET_SUBMSG(msg)) {
void displayAll(bool noRedraw=true)
bool printPFJets_
print PFJets yes/no
bool printPFBlocks_
print PFBlocks yes/no
virtual void CloseWindow()
void doModifyPtThreshold(unsigned obj, double val)
void doModifyOptions(unsigned obj)
TGTextButton * exitButton
TAttLine * trackPatternL_
TGNumberEntryField * threshEntry_[6]
DialogFrame(PFRootEventManager *evman, DisplayManager *dm, const TGWindow *p, UInt_t w, UInt_t h)
TMarker * thisClusPattern_
void drawWithNewGraphicAttributes()
void lookForGenParticle(unsigned barcode)
look for particle with index i in MC truth.
TGTextButton * previousButton
TGCheckButton * selectObject_[8]
TGNumberEntryField * particleTypeEntry_
TAttMarker * trackPatternM_
void print(std::ostream &out=std::cout, int maxNLines=-1) const
print information
bool printClusters_
print clusters yes/no
void doPrintGenParticles()
void enableDrawBrem(bool state)
virtual bool ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
TGCheckButton * printButton_[7]
TGNumberEntryField * maxLineEntry_
bool printPFCandidates_
print PFCandidates yes/no
TAttMarker * clusPattern_
TGDoubleHSlider * thresholdS_[6]
void selectPrintOption(int opt)
DisplayManager * display_
void printGenParticles(std::ostream &out=std::cout, int maxNLines=-1) const
print the HepMC truth
TGTextButton * nextButton
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
TGCompositeFrame * mainFrame_
void enableDrawPFBlock(bool state)
void doLookForGenParticle()
TGraph * simplePartPattern_
bool printSimParticles_
print true particles yes/no
PFRootEventManager * evMan_
TGTextButton * reProcessButton
ROOT interface to particle flow package.
bool printGenParticles_
print MC truth yes/no
tuple size
Write out results.
static const int PARTTYPE
bool printRecHits_
print rechits yes/no