1 |
//------------------------------------------------------------------------------------------------------------------------------------------------------- |
//------------------------------------------------------------------------------------------------------------------------------------------------------- |
2 |
// |
// |
3 |
// EventViewer.c version 8.01 (2006-01-10) |
// EventViewer.c version 9.02 (2006-03-09) |
4 |
// |
// |
5 |
// Shows PAMELA events - Emiliano Mocchiutti |
// Shows PAMELA events - Emiliano Mocchiutti |
6 |
// |
// |
10 |
// |
// |
11 |
// Standard use: |
// Standard use: |
12 |
// |
// |
13 |
// root[0] .L ShowEvent.c |
// bash> EventViewer |
|
// root[1] ShowEvent("/home/dati/filesFromYoda/DW_050112_00600/"); |
|
14 |
// |
// |
15 |
// For further informations use: |
// For further informations use: |
16 |
// |
// |
17 |
// root[3] ShowEvent(); |
// EventViewer --help |
18 |
// |
// |
19 |
// or |
// or |
20 |
// |
// |
21 |
// root[4] ShowEvent("help"); |
// EventViewer --version |
22 |
// |
// |
23 |
//------------------------------------------------------------------------------------------------------------------------------------------------------- |
//------------------------------------------------------------------------------------------------------------------------------------------------------- |
24 |
// |
// |
25 |
// Changelog: |
// Changelog: |
26 |
// |
// |
27 |
|
// 9.01 - 9.02 (2006-03-09): Now reads tracker software output from v3r02. Small bugs fixed (figure not editable now and complete text inside the GUI if there are only files with the same name). |
28 |
|
// |
29 |
|
// 9.00 - 9.01 (2006-03-03): Many bugs fixed and some correction in the behaviour in some cases (many thanks to Silvio for help in developing and debugging!). |
30 |
|
// |
31 |
|
// 8.02 - 9.00 (2006-02-17): Added the Graphic User Interface, fixed some old bugs, many new features (on fly load and unload files and selection files, stop searching |
32 |
|
// while in selection mode, on fly level0/best level switching, fork the application/no text output flag,... ) |
33 |
|
// |
34 |
|
// 8.01 - 8.02 (2006-02-16): Don't show positions not used in determine the track. Shows S4 mip values in standard mode (not scientific notation). |
35 |
|
// |
36 |
// 8.00 - 8.01 (2006-01-10): Added tracker measured positions used to determine the track. |
// 8.00 - 8.01 (2006-01-10): Added tracker measured positions used to determine the track. |
37 |
// |
// |
38 |
// 7.03 - 8.00 (2005-11-24): many changes to compile the macro. The code is still very redundant and heavy but some bugs were fixed and now it should be more stable. |
// 7.03 - 8.00 (2005-11-24): many changes to compile the macro. The code is still very redundant and heavy but some bugs were fixed and now it should be more stable. |
172 |
#include <iostream> |
#include <iostream> |
173 |
#include <iomanip> |
#include <iomanip> |
174 |
// |
// |
175 |
|
#include <TObjectTable.h> |
176 |
|
#include <TGClient.h> |
177 |
|
#include <TGButton.h> |
178 |
|
#include <TGComboBox.h> |
179 |
|
#include <TGLabel.h> |
180 |
|
#include <TGTextEntry.h> |
181 |
|
#include <TGFrame.h> |
182 |
|
#include <TGButtonGroup.h> |
183 |
|
#include <TGProgressBar.h> |
184 |
|
#include <TGMsgBox.h> |
185 |
|
#include <TGComboBox.h> |
186 |
|
// |
187 |
#include <TTree.h> |
#include <TTree.h> |
188 |
#include <TClassEdit.h> |
#include <TClassEdit.h> |
189 |
#include <TObject.h> |
#include <TObject.h> |
280 |
gSystem->Unload(libload.str().c_str()); |
gSystem->Unload(libload.str().c_str()); |
281 |
#endif |
#endif |
282 |
} |
} |
283 |
|
|
284 |
|
// |
285 |
|
// GUI |
286 |
|
// |
287 |
|
|
288 |
|
class PAMevcontrol : public TGMainFrame { |
289 |
|
//RQ_OBJECT("PAMevcontrol"); |
290 |
|
|
291 |
|
private: |
292 |
|
TGHProgressBar *fHProg1; |
293 |
|
TGTextEntry *fText2; |
294 |
|
TGTextEntry *fText4; |
295 |
|
TGComboBox *fCombo; |
296 |
|
TCanvas *thefigure; |
297 |
|
struct Variables *cvar; |
298 |
|
|
299 |
|
public: |
300 |
|
PAMevcontrol(const TGWindow *p,UInt_t w,UInt_t h,struct Variables & var, TCanvas &figure); |
301 |
|
virtual ~PAMevcontrol(); |
302 |
|
void chktof(); |
303 |
|
void chkac(); |
304 |
|
void chktrk(); |
305 |
|
void chkcalo(); |
306 |
|
void chks4(); |
307 |
|
void chknd(); |
308 |
|
void chkinfo(); |
309 |
|
void chknames(); |
310 |
|
void chkpalette(); |
311 |
|
void radiocolor(); |
312 |
|
void radiobw(); |
313 |
|
void radiotrack(); |
314 |
|
void forcel0(); |
315 |
|
void next(); |
316 |
|
void prev(); |
317 |
|
void stop(); |
318 |
|
void SetFilename(); |
319 |
|
void SetFilter(); |
320 |
|
void jumpto(); |
321 |
|
void radioevent(); |
322 |
|
void radioprog(); |
323 |
|
void saveas(); |
324 |
|
void CompleteText(); |
325 |
|
void Close(); |
326 |
|
void increment(float val); |
327 |
|
void DIALOG(Int_t ty, TString warn); |
328 |
|
void clearselfi(); |
329 |
|
void upgrnamfi(); |
330 |
|
void Terminate(); |
331 |
|
ClassDef(PAMevcontrol,0); |
332 |
|
}; |
333 |
|
|
334 |
|
PAMevcontrol::PAMevcontrol(const TGWindow *p,UInt_t w,UInt_t h,Variables & var, TCanvas &figure) : TGMainFrame(p, w, h){ |
335 |
|
// |
336 |
|
SetCleanup(kDeepCleanup); |
337 |
|
DontCallClose(); |
338 |
|
Connect("CloseWindow()","PAMevcontrol",this,"Terminate()"); |
339 |
|
// |
340 |
|
cvar = &var; |
341 |
|
thefigure = &figure; |
342 |
|
// |
343 |
|
TGCompositeFrame *cframe1 = new TGCompositeFrame(this, 280, 60, kVerticalFrame); |
344 |
|
TGCompositeFrame *cframe2 = new TGCompositeFrame(this, 280, 60, kVerticalFrame); |
345 |
|
TGCompositeFrame *cframe3 = new TGCompositeFrame(this, 280, 60, kVerticalFrame); |
346 |
|
TGCompositeFrame *cframe4 = new TGCompositeFrame(this, 280, 60, kVerticalFrame); |
347 |
|
TGGroupFrame *gf = new TGGroupFrame(cframe1, "Appearance"); |
348 |
|
TGGroupFrame *inputf = new TGGroupFrame(cframe2, "Input"); |
349 |
|
TGGroupFrame *jumpf = new TGGroupFrame(cframe3, "Jump to"); |
350 |
|
TGGroupFrame *savef = new TGGroupFrame(cframe4, "Save figure as"); |
351 |
|
// |
352 |
|
TGHorizontalFrame *htexts = new TGHorizontalFrame(savef,400,800); |
353 |
|
TGHorizontalFrame *htextsl = new TGHorizontalFrame(cframe4,400,800); |
354 |
|
TGHorizontalFrame *htext = new TGHorizontalFrame(inputf,400,800); |
355 |
|
TGHorizontalFrame *htext2 = new TGHorizontalFrame(inputf,400,800); |
356 |
|
TGHorizontalFrame *htext3 = new TGHorizontalFrame(jumpf,400,800); |
357 |
|
TGHorizontalFrame *htext4 = new TGHorizontalFrame(jumpf,400,80); |
358 |
|
TGHorizontalFrame *hframe = new TGHorizontalFrame(this,400,800); |
359 |
|
TGHorizontalFrame *hframe1 = new TGHorizontalFrame(gf, 280, 50); |
360 |
|
TGHorizontalFrame *hframe2 = new TGHorizontalFrame(gf, 280, 40); |
361 |
|
TGHorizontalFrame *hframe3 = new TGHorizontalFrame(gf, 280, 40); |
362 |
|
TGHorizontalFrame *hframe4 = new TGHorizontalFrame(gf,280,10); |
363 |
|
TGVerticalFrame *hframe5 = new TGVerticalFrame(hframe4, 280, 40); |
364 |
|
TGHorizontalFrame *hfrprog = new TGHorizontalFrame(this,400,800); |
365 |
|
// |
366 |
|
TGTextEntry *fText = new TGTextEntry(htext, new TGTextBuffer(20),-1); |
367 |
|
fText->SetText(cvar->thefilename.Data()); |
368 |
|
TGTextButton *Load = new TGTextButton(htext,"Load"); |
369 |
|
Load->Connect("Pressed()","TGTextEntry",fText,"ReturnPressed()"); |
370 |
|
fText->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilename()"); |
371 |
|
fText->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()"); |
372 |
|
htext->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5)); |
373 |
|
htext->AddFrame(Load, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,0,5,5,5)); |
374 |
|
inputf->AddFrame(new TGLabel(inputf, new TGHotString("Filename:"))); |
375 |
|
inputf->AddFrame(htext, new TGLayoutHints(kLHintsExpandX)); |
376 |
|
// |
377 |
|
fText2 = new TGTextEntry(htext2, new TGTextBuffer(20),-1); |
378 |
|
fText2->SetText(cvar->thefilter.Data()); |
379 |
|
TGTextButton *Load2 = new TGTextButton(htext2,"Load"); |
380 |
|
Load2->Connect("Clicked()","TGTextEntry",fText2,"ReturnPressed()"); |
381 |
|
fText2->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilter()"); |
382 |
|
fText2->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()"); |
383 |
|
htext2->AddFrame(fText2, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5)); |
384 |
|
htext2->AddFrame(Load2, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,0,5,5,5)); |
385 |
|
inputf->AddFrame(new TGLabel(inputf, new TGHotString("Selection file:"))); |
386 |
|
inputf->AddFrame(htext2, new TGLayoutHints(kLHintsExpandX)); |
387 |
|
// |
388 |
|
cframe2->AddFrame(inputf,new TGLayoutHints(kLHintsExpandX,5,5,5,5)); |
389 |
|
// |
390 |
|
TGCheckButton *fchktof = new TGCheckButton(hframe1, "TOF"); |
391 |
|
fchktof->Connect("Clicked()","PAMevcontrol", this,"chktof()"); |
392 |
|
if ( cvar->TOF ) fchktof->SetState(kButtonDown); |
393 |
|
hframe1->AddFrame(fchktof, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,5,5,5)); |
394 |
|
// |
395 |
|
TGCheckButton *fchkac = new TGCheckButton(hframe1, "AC"); |
396 |
|
fchkac->Connect("Clicked()","PAMevcontrol", this,"chkac()"); |
397 |
|
if ( cvar->AC ) fchkac->SetState(kButtonDown); |
398 |
|
hframe1->AddFrame(fchkac, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,25,5,5)); |
399 |
|
// |
400 |
|
TGCheckButton *fchktrk = new TGCheckButton(hframe1, "Tracker"); |
401 |
|
fchktrk->Connect("Clicked()","PAMevcontrol",this,"chktrk()"); |
402 |
|
if ( cvar->TRK ) fchktrk->SetState(kButtonDown); |
403 |
|
hframe1->AddFrame(fchktrk, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5)); |
404 |
|
// |
405 |
|
gf->AddFrame(hframe1, new TGLayoutHints(kLHintsExpandX)); |
406 |
|
// |
407 |
|
TGCheckButton *fchks4 = new TGCheckButton(hframe2, "S4"); |
408 |
|
fchks4->Connect("Clicked()","PAMevcontrol",this,"chks4()"); |
409 |
|
if ( cvar->S4 ) fchks4->SetState(kButtonDown); |
410 |
|
hframe2->AddFrame(fchks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,15,5,5)); |
411 |
|
// |
412 |
|
TGCheckButton *fchknd = new TGCheckButton(hframe2, "ND"); |
413 |
|
fchknd->Connect("Clicked()","PAMevcontrol",this,"chknd()"); |
414 |
|
if ( cvar->ND ) fchknd->SetState(kButtonDown); |
415 |
|
hframe2->AddFrame(fchknd, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,25,5,5)); |
416 |
|
// |
417 |
|
TGCheckButton *fchkcalo = new TGCheckButton(hframe2, "Calorimeter"); |
418 |
|
fchkcalo->Connect("Clicked()","PAMevcontrol",this,"chkcalo()"); |
419 |
|
if ( cvar->CALO ) fchkcalo->SetState(kButtonDown); |
420 |
|
hframe2->AddFrame(fchkcalo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,2,5,5)); |
421 |
|
// |
422 |
|
gf->AddFrame(hframe2, new TGLayoutHints(kLHintsExpandX)); |
423 |
|
// |
424 |
|
TGCheckButton *fchkinfo = new TGCheckButton(hframe3, "Infos"); |
425 |
|
fchkinfo->Connect("Clicked()","PAMevcontrol",this,"chkinfo()"); |
426 |
|
if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); |
427 |
|
hframe3->AddFrame(fchkinfo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,5,5,5)); |
428 |
|
// |
429 |
|
TGCheckButton *fchknames = new TGCheckButton(hframe3, "Names"); |
430 |
|
fchknames->Connect("Clicked()","PAMevcontrol",this,"chknames()"); |
431 |
|
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); |
432 |
|
hframe3->AddFrame(fchknames, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,5,5,5)); |
433 |
|
TGCheckButton *fchkpalette = new TGCheckButton(hframe3, "Palette"); |
434 |
|
fchkpalette->Connect("Clicked()","PAMevcontrol",this,"chkpalette()"); |
435 |
|
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); |
436 |
|
hframe3->AddFrame(fchkpalette, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5)); |
437 |
|
gf->AddFrame(hframe3, new TGLayoutHints(kLHintsExpandX)); |
438 |
|
// |
439 |
|
TGVButtonGroup *group = new TGVButtonGroup(hframe4); |
440 |
|
TGRadioButton *bwc0; |
441 |
|
TGRadioButton *bwc1; |
442 |
|
bwc0 = new TGRadioButton(group, "Colour"); |
443 |
|
bwc1 = new TGRadioButton(group, "B/W"); |
444 |
|
if ( cvar->bw ){ |
445 |
|
bwc1->SetState(kButtonDown); |
446 |
|
} else { |
447 |
|
bwc0->SetState(kButtonDown); |
448 |
|
}; |
449 |
|
bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()"); |
450 |
|
bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()"); |
451 |
|
hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,1,5,5,5)); |
452 |
|
// |
453 |
|
// |
454 |
|
TGCheckButton *ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND"); |
455 |
|
ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()"); |
456 |
|
if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
457 |
|
hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,2,5,5)); |
458 |
|
TGCheckButton *ffl0 = new TGCheckButton(hframe5, "Force LEVEL0"); |
459 |
|
ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()"); |
460 |
|
if ( cvar->fl0 ) ffl0->SetState(kButtonDown); |
461 |
|
hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,2,5,5)); |
462 |
|
// |
463 |
|
hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5)); |
464 |
|
gf->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX)); |
465 |
|
// |
466 |
|
cframe1->AddFrame(gf, new TGLayoutHints(kLHintsExpandX)); |
467 |
|
// |
468 |
|
TGHButtonGroup *jgroup = new TGHButtonGroup(htext4); |
469 |
|
TGRadioButton *jbwc0; |
470 |
|
TGRadioButton *jbwc1; |
471 |
|
jbwc0 = new TGRadioButton(jgroup, "event "); |
472 |
|
jbwc1 = new TGRadioButton(jgroup, "progressive"); |
473 |
|
jbwc1->SetState(kButtonDown); |
474 |
|
jbwc0->Connect("Pressed()", "PAMevcontrol",this,"radioevent()"); |
475 |
|
jbwc1->Connect("Pressed()", "PAMevcontrol",this,"radioprog()"); |
476 |
|
htext4->AddFrame(jgroup,new TGLayoutHints(kLHintsExpandX,1,1,0,0)); |
477 |
|
// |
478 |
|
TGTextEntry *fText3 = new TGTextEntry(htext3, new TGTextBuffer(6),-1); |
479 |
|
TGTextButton *Jump = new TGTextButton(htext3,"go"); |
480 |
|
Jump->Connect("Clicked()","TGTextEntry",fText3,"ReturnPressed()"); |
481 |
|
fText3->Connect("ReturnPressed()", "PAMevcontrol", this,"jumpto()"); |
482 |
|
htext3->AddFrame(new TGLabel(htext3, new TGHotString("number")), new TGLayoutHints(kLHintsExpandX,0,0,1,1)); |
483 |
|
htext3->AddFrame(fText3, new TGLayoutHints(kLHintsExpandX, 0, 8, 0, 0)); |
484 |
|
htext3->AddFrame(Jump, new TGLayoutHints(kLHintsExpandX,0,0,0,0)); |
485 |
|
jumpf->AddFrame(htext4, new TGLayoutHints(kLHintsExpandX,0,0,1,1)); // |
486 |
|
jumpf->AddFrame(htext3, new TGLayoutHints(kLHintsExpandX,0,0,0,1)); // |
487 |
|
// |
488 |
|
cframe3->AddFrame(jumpf,new TGLayoutHints(kLHintsExpandX,5,5,5,5)); |
489 |
|
// |
490 |
|
fText4 = new TGTextEntry(htexts, new TGTextBuffer(18),-1); |
491 |
|
TGTextButton *save = new TGTextButton(htextsl,"save"); |
492 |
|
save->Connect("Clicked()","TGTextEntry",fText4,"ReturnPressed()"); |
493 |
|
fText4->Connect("ReturnPressed()", "PAMevcontrol", this,"saveas()"); |
494 |
|
fText4->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()"); |
495 |
|
htexts->AddFrame(fText4, new TGLayoutHints(kLHintsExpandX, 0, 8, 1, 1)); |
496 |
|
// |
497 |
|
fCombo = new TGComboBox(htexts, 98); |
498 |
|
fCombo->AddEntry(".ps", 0); |
499 |
|
fCombo->AddEntry(".eps", 1); |
500 |
|
fCombo->AddEntry(".gif", 2); |
501 |
|
fCombo->AddEntry(".jpg", 3); |
502 |
|
fCombo->AddEntry(".tiff", 4); |
503 |
|
fCombo->AddEntry(".xpm", 5); |
504 |
|
fCombo->AddEntry(".pdf", 6); |
505 |
|
fCombo->AddEntry(".xml", 7); |
506 |
|
fCombo->AddEntry(".png", 8); |
507 |
|
fCombo->AddEntry(".svg", 9); |
508 |
|
fCombo->AddEntry(".root", 10); |
509 |
|
fCombo->AddEntry(".C", 11); |
510 |
|
fCombo->Select(0); |
511 |
|
fCombo->Resize(50,23); |
512 |
|
// htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsCenterX | kLHintsTop | kLHintsLeft | kLHintsCenterY | kLHintsExpandX, 0, 8, 1, 1)); |
513 |
|
htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsExpandY | kLHintsRight, 2, 2, 2, 1)); |
514 |
|
// |
515 |
|
htextsl->AddFrame(save, new TGLayoutHints(kLHintsExpandX,0,0,2,1)); |
516 |
|
savef->AddFrame(htexts, new TGLayoutHints(kLHintsExpandX,0,0,2,5)); |
517 |
|
// savef->AddFrame(htextsl, new TGLayoutHints(kLHintsExpandX,5,2,5,2)); |
518 |
|
savef->AddFrame(htextsl, new TGLayoutHints(kLHintsExpandX,8,0,5,2)); |
519 |
|
// |
520 |
|
cframe4->AddFrame(savef,new TGLayoutHints(kLHintsExpandX,5,5,5,5)); |
521 |
|
// |
522 |
|
fHProg1 = new TGHProgressBar(hfrprog, TGProgressBar::kFancy, 260); |
523 |
|
fHProg1->SetBarColor("green"); |
524 |
|
fHProg1->ShowPosition(); |
525 |
|
hfrprog->AddFrame(fHProg1, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY | kLHintsExpandX,5,5,5,5)); |
526 |
|
// |
527 |
|
// |
528 |
|
TGTextButton *prev = new TGTextButton(hframe,"< &Back"); |
529 |
|
prev->Connect("Clicked()","PAMevcontrol",this,"prev()"); |
530 |
|
hframe->AddFrame(prev, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,5,5,3,4)); |
531 |
|
// |
532 |
|
TGTextButton *exit = new TGTextButton(hframe,"E&xit"); |
533 |
|
exit->Connect("Clicked()","PAMevcontrol",this,"Terminate()"); |
534 |
|
//,"gApplication->Terminate(0)"); |
535 |
|
exit->SetToolTipText("Quit the event viewer"); |
536 |
|
hframe->AddFrame(exit, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,5,5,3,4)); |
537 |
|
// |
538 |
|
TGTextButton *stop = new TGTextButton(hframe,"&Stop"); |
539 |
|
stop->Connect("Clicked()","PAMevcontrol",this,"stop()"); |
540 |
|
hframe->AddFrame(stop, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,5,5,3,4)); |
541 |
|
// |
542 |
|
TGTextButton *next = new TGTextButton(hframe,"&Next >"); |
543 |
|
next->Connect("Clicked()","PAMevcontrol",this,"next()"); |
544 |
|
hframe->AddFrame(next, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,5,5,3,4)); |
545 |
|
// |
546 |
|
// |
547 |
|
// AddFrame(htext, new TGLayoutHints(kLHintsExpandX,2,2,15,1)); |
548 |
|
AddFrame(cframe2, new TGLayoutHints(kLHintsExpandX,1,1,1,1)); |
549 |
|
AddFrame(cframe1, new TGLayoutHints(kLHintsExpandX,1,1,1,1)); |
550 |
|
AddFrame(cframe3, new TGLayoutHints(kLHintsExpandX,1,1,1,1)); |
551 |
|
AddFrame(cframe4, new TGLayoutHints(kLHintsExpandX,1,1,1,1)); |
552 |
|
AddFrame(hfrprog, new TGLayoutHints(kLHintsExpandX,1,1,1,1)); |
553 |
|
AddFrame(hframe, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,1,1,1,1)); |
554 |
|
// Set a name to the main frame |
555 |
|
SetWindowName("PAMELA Event Viewer control panel"); |
556 |
|
// Map all subwindows of main frame |
557 |
|
MapSubwindows(); |
558 |
|
// Initialize the layout algorithm |
559 |
|
Resize(GetDefaultSize()); |
560 |
|
// Map main frame |
561 |
|
MapWindow(); |
562 |
|
} |
563 |
|
|
564 |
|
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
565 |
|
// |
566 |
|
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 3 -> ERROR |
567 |
|
// |
568 |
|
Int_t retval; |
569 |
|
TString title; |
570 |
|
EMsgBoxIcon mb_icon = kMBIconStop; |
571 |
|
if ( ty == 0 ){ |
572 |
|
title="INFO"; |
573 |
|
mb_icon = kMBIconAsterisk; |
574 |
|
}; |
575 |
|
if ( ty == 1 ){ |
576 |
|
title="WARNING!"; |
577 |
|
mb_icon = kMBIconExclamation; |
578 |
|
}; |
579 |
|
if ( ty == 2 ){ |
580 |
|
title="ERROR!!"; |
581 |
|
mb_icon = kMBIconStop; |
582 |
|
}; |
583 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
584 |
|
} |
585 |
|
|
586 |
|
|
587 |
|
void PAMevcontrol::SetFilename() { |
588 |
|
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
589 |
|
TString text = entry->GetText(); |
590 |
|
cvar->thefilename=text.Data(); |
591 |
|
cvar->nevents = 0; |
592 |
|
cvar->firstevno = 0; |
593 |
|
cvar->lastevno = 0; |
594 |
|
cvar->restart = true; |
595 |
|
cvar->waitforever = false; |
596 |
|
} |
597 |
|
|
598 |
|
void PAMevcontrol::SetFilter() { |
599 |
|
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
600 |
|
TString text = entry->GetText(); |
601 |
|
cvar->thefilter=text.Data(); |
602 |
|
cvar->i--; |
603 |
|
cvar->selex = false; |
604 |
|
cvar->nevents = 0; |
605 |
|
cvar->firstevno = 0; |
606 |
|
cvar->lastevno = 0; |
607 |
|
cvar->refresh = true; |
608 |
|
} |
609 |
|
|
610 |
|
void PAMevcontrol::CompleteText() { |
611 |
|
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
612 |
|
TString text = entry->GetText(); |
613 |
|
Int_t curspos = entry->GetCursorPosition(); |
614 |
|
Int_t ncurspos = 0; |
615 |
|
TString textrem; |
616 |
|
stringcopy(textrem,text,curspos,text.Length()); |
617 |
|
text.Resize(curspos); |
618 |
|
if ( !strcmp(text.Data(),"") ) { |
619 |
|
stringstream ntext; |
620 |
|
ntext.str(""); |
621 |
|
ntext << gSystem->ExpandPathName("$HOME"); |
622 |
|
text = ntext.str().c_str(); |
623 |
|
curspos=ntext.str().length(); |
624 |
|
}; |
625 |
|
char *test = gSystem->ExpandPathName(text.Data()); |
626 |
|
const char *dir = gSystem->DirName(test); |
627 |
|
const char *base = gSystem->BaseName(test); |
628 |
|
TString lbase = base; |
629 |
|
Int_t lenbase = lbase.Length(); |
630 |
|
TSystemDirectory *tsd = new TSystemDirectory("",dir); |
631 |
|
TSystemFile *file; |
632 |
|
TList *lsmatch = new TList; |
633 |
|
Int_t numf = 0; |
634 |
|
Int_t numgo = 0; |
635 |
|
Int_t charmac = 0; |
636 |
|
TString tbase; |
637 |
|
Int_t k = 0; |
638 |
|
stringstream newtext; |
639 |
|
TSystemFile *mfile; |
640 |
|
TSystemFile nfile; |
641 |
|
TList *lsf = new TList; |
642 |
|
const char *ctbase; |
643 |
|
if ( !tsd->GetListOfFiles() ){ |
644 |
|
gVirtualX->Bell(0); |
645 |
|
goto end; |
646 |
|
}; |
647 |
|
lsf = tsd->GetListOfFiles(); |
648 |
|
file = (TSystemFile*)lsf->First(); |
649 |
|
// |
650 |
|
while( (TSystemFile*)lsf->After(file) ){ |
651 |
|
numf++; |
652 |
|
file = (TSystemFile*)lsf->After(file); |
653 |
|
if ( !strncmp(file->GetName(),base,lenbase) ){ |
654 |
|
numgo++; |
655 |
|
lsmatch->AddLast(file); |
656 |
|
const char *ctbase = file->GetName(); |
657 |
|
tbase = ctbase; |
658 |
|
charmac = tbase.Length(); |
659 |
|
}; |
660 |
|
}; |
661 |
|
newtext.str(""); |
662 |
|
if ( numgo > 0 ){ |
663 |
|
mfile = (TSystemFile*)lsmatch->First(); |
664 |
|
ctbase = mfile->GetName(); |
665 |
|
while ( (!strcmp(ctbase,"..") || !strcmp(ctbase,".")) && (TSystemFile*)lsmatch->After(mfile) ) { |
666 |
|
mfile = (TSystemFile*)lsmatch->After(mfile); |
667 |
|
ctbase = mfile->GetName(); |
668 |
|
}; |
669 |
|
tbase = ctbase; |
670 |
|
base = ctbase; |
671 |
|
charmac = tbase.Length();; |
672 |
|
while( (TSystemFile*)lsmatch->After(mfile) ){ |
673 |
|
mfile = (TSystemFile*)lsmatch->After(mfile); |
674 |
|
ctbase = mfile->GetName(); |
675 |
|
while ( (!strcmp(ctbase,"..") || !strcmp(ctbase,".")) && (TSystemFile*)lsmatch->After(mfile) ) { |
676 |
|
mfile = (TSystemFile*)lsmatch->After(mfile); |
677 |
|
ctbase = mfile->GetName(); |
678 |
|
}; |
679 |
|
tbase = ctbase; |
680 |
|
k = 0; |
681 |
|
for ( Int_t i=lenbase; i<=tbase.Length(); i++){ |
682 |
|
if ( !strncmp(tbase.Data(),base,i) && strcmp(tbase.Data(),base) ){ |
683 |
|
k = i; |
684 |
|
}; |
685 |
|
}; |
686 |
|
if ( k <= charmac){ |
687 |
|
charmac = k; |
688 |
|
}; |
689 |
|
}; |
690 |
|
}; |
691 |
|
if ( !charmac ) { |
692 |
|
gVirtualX->Bell(0); |
693 |
|
goto end; |
694 |
|
}; |
695 |
|
tbase.Resize(charmac); |
696 |
|
if ( !strcmp(dir,"") || !strcmp(dir,"/") ){ |
697 |
|
newtext << "/" << tbase.Data(); |
698 |
|
} else { |
699 |
|
newtext << dir << "/" << tbase.Data(); |
700 |
|
}; |
701 |
|
nfile = TSystemFile(tbase.Data(),dir); |
702 |
|
if ( nfile.IsDirectory() && numgo == 1 ) newtext << "/"; |
703 |
|
ncurspos = newtext.str().length(); |
704 |
|
if ( textrem.Length() ) newtext << textrem.Data(); |
705 |
|
entry->SetText(newtext.str().c_str()); |
706 |
|
entry->SetCursorPosition(ncurspos); |
707 |
|
end: |
708 |
|
lsf->Clear(); |
709 |
|
lsmatch->Clear(); |
710 |
|
} |
711 |
|
|
712 |
|
void PAMevcontrol::saveas() { |
713 |
|
TString text = fText4->GetText(); |
714 |
|
Int_t sel=fCombo->GetSelected(); |
715 |
|
TString ty; |
716 |
|
switch (sel){ |
717 |
|
case (0): |
718 |
|
ty = ".ps"; |
719 |
|
break; |
720 |
|
case (1): |
721 |
|
ty = ".eps"; |
722 |
|
break; |
723 |
|
case (2): |
724 |
|
ty = ".gif"; |
725 |
|
break; |
726 |
|
case (3): |
727 |
|
ty = ".jpg"; |
728 |
|
break; |
729 |
|
case (4): |
730 |
|
ty = ".tiff"; |
731 |
|
break; |
732 |
|
case (5): |
733 |
|
ty = ".xpm"; |
734 |
|
break; |
735 |
|
case (6): |
736 |
|
ty = ".pdf"; |
737 |
|
break; |
738 |
|
case (7): |
739 |
|
ty = ".xml"; |
740 |
|
break; |
741 |
|
case (8): |
742 |
|
ty = ".png"; |
743 |
|
break; |
744 |
|
case (9): |
745 |
|
ty = ".svg"; |
746 |
|
break; |
747 |
|
case (10): |
748 |
|
ty = ".root"; |
749 |
|
break; |
750 |
|
case (11): |
751 |
|
ty = ".C"; |
752 |
|
break; |
753 |
|
}; |
754 |
|
if ( sel == 0 ) ty = ".ps"; |
755 |
|
stringstream name; |
756 |
|
if ( strcmp(text.Data(),"") ){ |
757 |
|
name.str(""); |
758 |
|
name << text.Data(); |
759 |
|
name << ty.Data(); |
760 |
|
thefigure->SaveAs(name.str().c_str()); |
761 |
|
name.str(""); |
762 |
|
name << " Saved as "; |
763 |
|
name << text.Data(); |
764 |
|
name << ty.Data(); |
765 |
|
DIALOG(0,name.str().c_str()); |
766 |
|
printf(" Saved as %s%s \n",text.Data(),ty.Data()); |
767 |
|
}; |
768 |
|
} |
769 |
|
|
770 |
|
void PAMevcontrol::increment(float val) { |
771 |
|
fHProg1->SetPosition(val); |
772 |
|
fHProg1->DoRedraw(); |
773 |
|
gSystem->ProcessEvents(); |
774 |
|
} |
775 |
|
|
776 |
|
void PAMevcontrol::forcel0() { |
777 |
|
if ( cvar->fl0 ) { |
778 |
|
cvar->fl0 = false; |
779 |
|
} else { |
780 |
|
cvar->fl0 = true; |
781 |
|
}; |
782 |
|
cvar->alrforc = false; |
783 |
|
cvar->i--; |
784 |
|
cvar->nevents = 0; |
785 |
|
cvar->firstevno = 0; |
786 |
|
cvar->lastevno = 0; |
787 |
|
cvar->refresh = true; |
788 |
|
} |
789 |
|
|
790 |
|
void PAMevcontrol::clearselfi(){ |
791 |
|
fText2->SetText(""); |
792 |
|
} |
793 |
|
|
794 |
|
void PAMevcontrol::upgrnamfi(){ |
795 |
|
fText4->SetText(cvar->svas.Data()); |
796 |
|
fText4->SetCursorPosition(fText4->GetMaxLength()); |
797 |
|
} |
798 |
|
|
799 |
|
void PAMevcontrol::jumpto() { |
800 |
|
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
801 |
|
TString text = entry->GetText(); |
802 |
|
Int_t j; |
803 |
|
j = atoi(text.Data()); |
804 |
|
if ( cvar->jumprog ){ |
805 |
|
if ( j < 1 || j > cvar->nevents ) { |
806 |
|
printf("\n You can choose between 1 and %i \n",(int)cvar->nevents); |
807 |
|
stringstream warning; |
808 |
|
warning.str(""); |
809 |
|
warning << "You can choose between 1 and "; |
810 |
|
warning << (int)cvar->nevents; |
811 |
|
DIALOG(1,warning.str().c_str()); |
812 |
|
} else { |
813 |
|
stringstream warning; |
814 |
|
warning.str(""); |
815 |
|
warning << "Jumping to progressive number "; |
816 |
|
warning << j; |
817 |
|
DIALOG(0,warning.str().c_str()); |
818 |
|
printf("\n Jumping to progressive number %i\n\n",j); |
819 |
|
cvar->i = j-2; |
820 |
|
cvar->goon = true; |
821 |
|
}; |
822 |
|
} else { |
823 |
|
if ( j < cvar->firstevno || j > cvar->lastevno ) { |
824 |
|
printf("\n You can choose between %i and %i \n",cvar->firstevno,cvar->lastevno); |
825 |
|
stringstream warning; |
826 |
|
warning.str(""); |
827 |
|
warning << "You can choose between "; |
828 |
|
warning << cvar->firstevno; |
829 |
|
warning << " and "; |
830 |
|
warning << cvar->lastevno; |
831 |
|
DIALOG(1,warning.str().c_str()); |
832 |
|
} else { |
833 |
|
stringstream warning; |
834 |
|
warning.str(""); |
835 |
|
warning << "Jumping to event number "; |
836 |
|
warning << j; |
837 |
|
DIALOG(0,warning.str().c_str()); |
838 |
|
printf("\n Jumping to event number %i\n\n",j); |
839 |
|
cvar->jumpto = j; |
840 |
|
cvar->jumpen = true; |
841 |
|
cvar->goon = true; |
842 |
|
}; |
843 |
|
}; |
844 |
|
entry->SetText(""); |
845 |
|
} |
846 |
|
|
847 |
|
void PAMevcontrol::radioevent() { |
848 |
|
cvar->jumprog = false; |
849 |
|
} |
850 |
|
|
851 |
|
void PAMevcontrol::radioprog() { |
852 |
|
cvar->jumprog = true; |
853 |
|
} |
854 |
|
|
855 |
|
void PAMevcontrol::radiocolor() { |
856 |
|
if ( !cvar->goon ){ |
857 |
|
if ( cvar->bw ) { |
858 |
|
cvar->bw = 0; |
859 |
|
cvar->i--; |
860 |
|
cvar->goon = true; |
861 |
|
}; |
862 |
|
}; |
863 |
|
} |
864 |
|
|
865 |
|
void PAMevcontrol::radiobw() { |
866 |
|
if ( !cvar->goon ){ |
867 |
|
if ( !cvar->bw ) { |
868 |
|
cvar->bw = 1; |
869 |
|
cvar->i--; |
870 |
|
cvar->goon = true; |
871 |
|
}; |
872 |
|
}; |
873 |
|
} |
874 |
|
|
875 |
|
void PAMevcontrol::radiotrack() { |
876 |
|
if ( cvar->tracknds4 ) { |
877 |
|
cvar->tracknds4 = 0; |
878 |
|
} else { |
879 |
|
cvar->tracknds4 = 1; |
880 |
|
}; |
881 |
|
cvar->i--; |
882 |
|
cvar->goon = true; |
883 |
|
} |
884 |
|
|
885 |
|
void PAMevcontrol::chktof() { |
886 |
|
if ( cvar->TOF ) { |
887 |
|
cvar->TOF = 0; |
888 |
|
} else { |
889 |
|
cvar->TOF = 1; |
890 |
|
}; |
891 |
|
cvar->i--; |
892 |
|
cvar->nevents = 0; |
893 |
|
cvar->firstevno = 0; |
894 |
|
cvar->lastevno = 0; |
895 |
|
cvar->refresh = true; |
896 |
|
} |
897 |
|
|
898 |
|
void PAMevcontrol::chkac() { |
899 |
|
if ( cvar->AC ) { |
900 |
|
cvar->AC = 0; |
901 |
|
} else { |
902 |
|
cvar->AC = 1; |
903 |
|
}; |
904 |
|
cvar->i--; |
905 |
|
cvar->nevents = 0; |
906 |
|
cvar->firstevno = 0; |
907 |
|
cvar->lastevno = 0; |
908 |
|
cvar->refresh = true; |
909 |
|
} |
910 |
|
|
911 |
|
void PAMevcontrol::chktrk() { |
912 |
|
if ( cvar->TRK ) { |
913 |
|
cvar->TRK = 0; |
914 |
|
} else { |
915 |
|
cvar->TRK = 1; |
916 |
|
}; |
917 |
|
cvar->i--; |
918 |
|
cvar->nevents = 0; |
919 |
|
cvar->firstevno = 0; |
920 |
|
cvar->lastevno = 0; |
921 |
|
cvar->refresh = true; |
922 |
|
} |
923 |
|
|
924 |
|
void PAMevcontrol::chkcalo() { |
925 |
|
if ( cvar->CALO ) { |
926 |
|
cvar->CALO = 0; |
927 |
|
} else { |
928 |
|
cvar->CALO = 1; |
929 |
|
}; |
930 |
|
cvar->i--; |
931 |
|
cvar->nevents = 0; |
932 |
|
cvar->firstevno = 0; |
933 |
|
cvar->lastevno = 0; |
934 |
|
cvar->refresh = true; |
935 |
|
} |
936 |
|
|
937 |
|
void PAMevcontrol::chks4() { |
938 |
|
if ( cvar->S4 ) { |
939 |
|
cvar->S4 = 0; |
940 |
|
} else { |
941 |
|
cvar->S4 = 1; |
942 |
|
}; |
943 |
|
cvar->i--; |
944 |
|
cvar->nevents = 0; |
945 |
|
cvar->firstevno = 0; |
946 |
|
cvar->lastevno = 0; |
947 |
|
cvar->refresh = true; |
948 |
|
} |
949 |
|
|
950 |
|
void PAMevcontrol::chknd() { |
951 |
|
if ( cvar->ND ) { |
952 |
|
cvar->ND = 0; |
953 |
|
} else { |
954 |
|
cvar->ND = 1; |
955 |
|
}; |
956 |
|
cvar->i--; |
957 |
|
cvar->nevents = 0; |
958 |
|
cvar->firstevno = 0; |
959 |
|
cvar->lastevno = 0; |
960 |
|
cvar->refresh = true; |
961 |
|
} |
962 |
|
|
963 |
|
void PAMevcontrol::chkinfo() { |
964 |
|
if ( cvar->INFOS ) { |
965 |
|
cvar->INFOS = 0; |
966 |
|
} else { |
967 |
|
cvar->INFOS = 1; |
968 |
|
}; |
969 |
|
cvar->i--; |
970 |
|
cvar->goon = true; |
971 |
|
} |
972 |
|
|
973 |
|
void PAMevcontrol::chknames() { |
974 |
|
if ( cvar->VINFOS ) { |
975 |
|
cvar->VINFOS = 0; |
976 |
|
} else { |
977 |
|
cvar->VINFOS = 1; |
978 |
|
}; |
979 |
|
cvar->i--; |
980 |
|
cvar->goon = true; |
981 |
|
} |
982 |
|
|
983 |
|
void PAMevcontrol::chkpalette() { |
984 |
|
if ( cvar->PALETTE ) { |
985 |
|
cvar->PALETTE = 0; |
986 |
|
} else { |
987 |
|
cvar->PALETTE = 1; |
988 |
|
}; |
989 |
|
cvar->i--; |
990 |
|
cvar->goon = true; |
991 |
|
} |
992 |
|
|
993 |
|
void PAMevcontrol::next() { |
994 |
|
if ( cvar->i == cvar->nevents-1 ) { |
995 |
|
printf("This is the last event, you can't go forward! \n"); |
996 |
|
DIALOG(1,"This is the last event!"); |
997 |
|
} else { |
998 |
|
cvar->goon = true; |
999 |
|
cvar->doflag = 1; |
1000 |
|
}; |
1001 |
|
} |
1002 |
|
|
1003 |
|
void PAMevcontrol::stop() { |
1004 |
|
DIALOG(1,"Stop searching"); |
1005 |
|
cvar->doflag = 3; |
1006 |
|
} |
1007 |
|
|
1008 |
|
void PAMevcontrol::prev() { |
1009 |
|
if ( cvar->i > 0 ) { |
1010 |
|
printf("WARNING: going backward!\n\n"); |
1011 |
|
cvar->doflag = 2; |
1012 |
|
cvar->goon = true; |
1013 |
|
} else { |
1014 |
|
printf("This is the first event, you can't go backward! \n"); |
1015 |
|
DIALOG(1,"This is the first event!"); |
1016 |
|
}; |
1017 |
|
} |
1018 |
|
|
1019 |
|
void PAMevcontrol::Close() { |
1020 |
|
Cleanup(); |
1021 |
|
CloseWindow(); |
1022 |
|
} |
1023 |
|
|
1024 |
|
void PAMevcontrol::Terminate() { |
1025 |
|
Close(); |
1026 |
|
gApplication->Terminate(0); |
1027 |
|
} |
1028 |
|
|
1029 |
|
PAMevcontrol::~PAMevcontrol() { |
1030 |
|
// Clean up used widgets: frames, buttons, layouthints |
1031 |
|
Cleanup(); |
1032 |
|
delete this; |
1033 |
|
} |
1034 |
|
|
1035 |
//********************************************************************************** |
//********************************************************************************** |
1036 |
// LEVEL0 SUBROUTINES // |
// LEVEL0 SUBROUTINES // |
1037 |
//********************************************************************************** |
//********************************************************************************** |
1147 |
gDirectory->Delete(yevent.str().c_str()); |
gDirectory->Delete(yevent.str().c_str()); |
1148 |
TH2F *Xview = new TH2F(xevent.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Xview = new TH2F(xevent.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
1149 |
TH2F *Yview = new TH2F(yevent.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Yview = new TH2F(yevent.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
1150 |
Int_t colo = 38; |
Int_t colo; |
1151 |
|
if ( var.bw ){ |
1152 |
|
colo = 17; |
1153 |
|
} else { |
1154 |
|
colo = 38; |
1155 |
|
}; |
1156 |
Xview->SetFillColor(colo); |
Xview->SetFillColor(colo); |
1157 |
Yview->SetFillColor(colo); |
Yview->SetFillColor(colo); |
1158 |
if ( l == 0 ) { |
if ( l == 0 ) { |
1177 |
} |
} |
1178 |
|
|
1179 |
void ShowND(Int_t evno, TTree *otr, Variables & var){ |
void ShowND(Int_t evno, TTree *otr, Variables & var){ |
1180 |
Int_t tmpSize; |
Int_t tmpSize; |
1181 |
Int_t yUpperTrig = 0; |
Int_t yUpperTrig = 0; |
1182 |
Int_t yUpperBk = 0; |
Int_t yUpperBk = 0; |
1183 |
Int_t yBottomBk = 0; |
Int_t yBottomBk = 0; |
1565 |
}; |
}; |
1566 |
// |
// |
1567 |
// Draw crosses |
// Draw crosses |
1568 |
// |
// |
1569 |
if ( ncro ) { |
if ( ncro && var.AC ) { |
1570 |
trplv->cd(); |
trplv->cd(); |
1571 |
trplv->Range(0.,0.,2076.,3100.); |
trplv->Range(0.,0.,2076.,3100.); |
1572 |
for ( Int_t i = 0; i<ncro; i++){ |
for ( Int_t i = 0; i<ncro; i++){ |
3722 |
var.nstrip=(int)calo->nstrip; |
var.nstrip=(int)calo->nstrip; |
3723 |
} |
} |
3724 |
|
|
3725 |
void ShowTRKL1(Int_t evno, TTree *ttr1, Variables & var){ |
void ShowTRKL1(Int_t evno, TTree *ttr1, Variables & var, PAMevcontrol *pamgui){ |
3726 |
// |
// |
3727 |
Int_t syncro = 1; |
Int_t syncro = 1; |
3728 |
Int_t itr = evno; |
Int_t itr = evno; |
3735 |
settrklev1(ttr1,trk); |
settrklev1(ttr1,trk); |
3736 |
if ( itr >= trnevents ){ |
if ( itr >= trnevents ){ |
3737 |
printf(" WARNING: no more tracker level1 data.\n"); |
printf(" WARNING: no more tracker level1 data.\n"); |
3738 |
|
pamgui->DIALOG(1," No more tracker level1 data "); |
3739 |
nodata = 1; |
nodata = 1; |
3740 |
goto goon; |
goto goon; |
3741 |
}; |
}; |
3746 |
if ( pktnum != ev2.pkt_num1 || obt != ev2.obt1 ){ |
if ( pktnum != ev2.pkt_num1 || obt != ev2.obt1 ){ |
3747 |
if ( pktnum > ev2.pkt_num1 || obt > ev2.obt1 ){ |
if ( pktnum > ev2.pkt_num1 || obt > ev2.obt1 ){ |
3748 |
itr++; |
itr++; |
3749 |
if ( syncro ) printf(" WARNING: lost sync! try to recover... \n"); |
if ( syncro ){ |
3750 |
|
printf(" WARNING: lost sync! try to recover... \n"); |
3751 |
|
pamgui->DIALOG(1," Lost sync! try to recover "); |
3752 |
|
}; |
3753 |
syncro = 0; |
syncro = 0; |
3754 |
goto trkcalosync; |
goto trkcalosync; |
3755 |
}; |
}; |
3756 |
if ( pktnum < ev2.pkt_num1 || obt < ev2.obt1 ){ |
if ( pktnum < ev2.pkt_num1 || obt < ev2.obt1 ){ |
3757 |
printf(" WARNING: no tracker level2 data. \n"); |
printf(" WARNING: no tracker level2 data. \n"); |
3758 |
|
pamgui->DIALOG(1," No more tracker level2 data "); |
3759 |
nodata = 1; |
nodata = 1; |
3760 |
goto goon; |
goto goon; |
3761 |
}; |
}; |
3762 |
}; |
}; |
3763 |
// |
// |
3764 |
if ( !syncro ) printf(" ...synchronization recovered! \n"); |
if ( !syncro ) { |
3765 |
|
printf(" ...synchronization recovered! \n"); |
3766 |
|
pamgui->DIALOG(0," Synchronization recovered! "); |
3767 |
|
}; |
3768 |
syncro = 1; |
syncro = 1; |
3769 |
// |
// |
3770 |
goon: struct Trklev1 ev; |
goon: struct Trklev1 ev; |
3771 |
ev.good1 = (Bool_t)ev2.good1; |
ev.good1 = (Bool_t)ev2.good1; |
3772 |
ev.nev1 = ev2.nev1; |
ev.nev1 = ev2.nev1; |
3773 |
|
ev.whic_calib1 = ev2.whic_calib1; |
3774 |
|
ev.swcode1 = ev2.swcode1; |
3775 |
ev.pkt_type1 = ev2.pkt_type1; |
ev.pkt_type1 = ev2.pkt_type1; |
3776 |
ev.pkt_num1 = ev2.pkt_num1; |
ev.pkt_num1 = ev2.pkt_num1; |
3777 |
ev.obt1 = ev2.obt1; |
ev.obt1 = ev2.obt1; |
3778 |
ev.which_calib1 = ev2.which_calib1; |
ev.cpu_crc1 = (Bool_t)ev2.cpu_crc1; |
3779 |
ev.nclstr1 = ev2.nclstr1; |
ev.nclstr1 = ev2.nclstr1; |
3780 |
ev.totcllength = ev2.totcllength; |
ev.totcllength = ev2.totcllength; |
3781 |
for ( Int_t ii = 0 ; ii<8500; ii++){ |
for ( Int_t ii = 0 ; ii<8500; ii++){ |
3791 |
ev.indmax[ii] = (Int_t)ev2.indmax[ii]; |
ev.indmax[ii] = (Int_t)ev2.indmax[ii]; |
3792 |
}; |
}; |
3793 |
for ( Int_t ii = 0 ; ii<12 ; ii++){ |
for ( Int_t ii = 0 ; ii<12 ; ii++){ |
3794 |
|
ev.crc1[ii] = ev2.crc1[ii]; |
3795 |
for ( Int_t ij = 0 ; ij<24 ; ij++){ |
for ( Int_t ij = 0 ; ij<24 ; ij++){ |
3796 |
ev.cnev[ij][ii] = ev2.cnev[ii][ij]; |
ev.cnev[ij][ii] = ev2.cnev[ii][ij]; |
3797 |
}; |
}; |
4082 |
// |
// |
4083 |
// Draw crosses |
// Draw crosses |
4084 |
// |
// |
4085 |
trplv->cd(); |
if ( var.AC ) { |
4086 |
trplv->Range(-7.05,-8.1,7.05,8.1); |
trplv->cd(); |
4087 |
for ( Int_t i = 0; i<6; i++){ |
trplv->Range(-7.05,-8.1,7.05,8.1); |
4088 |
if ( mask[i] ){ |
for ( Int_t i = 0; i<6; i++){ |
4089 |
// |
if ( mask[i] ){ |
4090 |
Float_t cdx = (0.55/mag[i])*var.sfx; |
// |
4091 |
Float_t cdy = (0.55/mag[i])*var.sfy; |
Float_t cdx = (0.55/mag[i])*var.sfx; |
4092 |
Float_t lwx = (0.019)*var.sfy; |
Float_t cdy = (0.55/mag[i])*var.sfy; |
4093 |
Float_t lwy = (0.019)*var.sfx; |
Float_t lwx = (0.019)*var.sfy; |
4094 |
// |
Float_t lwy = (0.019)*var.sfx; |
4095 |
linea = new TLine(yh1[i]-lwx/2.,xh[i]-cdy,yh1[i]-lwx/2.,xh[i]+cdy); |
// |
4096 |
linea->SetLineWidth((int)lwx); |
linea = new TLine(yh1[i]-lwx/2.,xh[i]-cdy,yh1[i]-lwx/2.,xh[i]+cdy); |
4097 |
linea->SetLineColor(sigcol1); |
linea->SetLineWidth((int)lwx); |
4098 |
linea->Draw(); |
linea->SetLineColor(sigcol1); |
4099 |
linea = new TLine(yh1[i]-cdx,xh[i]-lwy/2.,yh1[i]+cdx,xh[i]-lwy/2.); |
linea->Draw(); |
4100 |
linea->SetLineWidth((int)lwy); |
linea = new TLine(yh1[i]-cdx,xh[i]-lwy/2.,yh1[i]+cdx,xh[i]-lwy/2.); |
4101 |
linea->SetLineColor(sigcol1); |
linea->SetLineWidth((int)lwy); |
4102 |
linea->Draw(); |
linea->SetLineColor(sigcol1); |
4103 |
// |
linea->Draw(); |
4104 |
linea = new TLine(yh2[i]-lwx/2.,xh[i]-cdy,yh2[i]-lwx/2.,xh[i]+cdy); |
// |
4105 |
linea->SetLineWidth((int)lwx); |
linea = new TLine(yh2[i]-lwx/2.,xh[i]-cdy,yh2[i]-lwx/2.,xh[i]+cdy); |
4106 |
linea->SetLineColor(sigcol2); |
linea->SetLineWidth((int)lwx); |
4107 |
linea->Draw(); |
linea->SetLineColor(sigcol2); |
4108 |
linea = new TLine(yh2[i]-cdy,xh[i]-lwy/2.,yh2[i]+cdx,xh[i]-lwy/2.); |
linea->Draw(); |
4109 |
linea->SetLineWidth((int)lwy); |
linea = new TLine(yh2[i]-cdy,xh[i]-lwy/2.,yh2[i]+cdx,xh[i]-lwy/2.); |
4110 |
linea->SetLineColor(sigcol2); |
linea->SetLineWidth((int)lwy); |
4111 |
linea->Draw(); |
linea->SetLineColor(sigcol2); |
4112 |
|
linea->Draw(); |
4113 |
|
}; |
4114 |
}; |
}; |
4115 |
}; |
}; |
4116 |
} |
} |
4796 |
// |
// |
4797 |
} |
} |
4798 |
|
|
4799 |
void ShowTOFL1(Int_t j, TTree *toftr, Variables & var){ |
void ShowTOFL1(Int_t j, TTree *toftr, Variables & var, PAMevcontrol *pamgui){ |
4800 |
// |
// |
4801 |
for (Int_t i=0 ; i<5; i++){ |
for (Int_t i=0 ; i<5; i++){ |
4802 |
var.beta[i] = 0.; |
var.beta[i] = 0.; |
4812 |
Int_t obt = 0; |
Int_t obt = 0; |
4813 |
trkcalosync: if ( itr >= trnevents ){ |
trkcalosync: if ( itr >= trnevents ){ |
4814 |
printf(" WARNING: no more tof level1 data.\n"); |
printf(" WARNING: no more tof level1 data.\n"); |
4815 |
|
pamgui->DIALOG(1," No more tof level1 data "); |
4816 |
return; |
return; |
4817 |
|
} else { |
4818 |
|
if ( !var.nosig ) toftr->GetEntry(itr); |
4819 |
}; |
}; |
|
if ( !var.nosig ) toftr->GetEntry(itr); |
|
4820 |
pktnum = var.headc; |
pktnum = var.headc; |
4821 |
obt = var.etime; |
obt = var.etime; |
4822 |
if ( pktnum != ntof.pkt_num || obt != ntof.obt ){ |
if ( pktnum != ntof.pkt_num || obt != ntof.obt ){ |
4823 |
if ( pktnum > ntof.pkt_num || obt > ntof.obt ){ |
if ( pktnum > ntof.pkt_num || obt > ntof.obt ){ |
4824 |
itr++; |
itr++; |
4825 |
if ( syncro ) printf(" WARNING: lost sync! try to recover... \n"); |
if ( syncro ){ |
4826 |
|
printf(" WARNING: lost sync! try to recover... \n"); |
4827 |
|
pamgui->DIALOG(1," Lost sync! try to recover "); |
4828 |
|
}; |
4829 |
syncro = 0; |
syncro = 0; |
4830 |
goto trkcalosync; |
goto trkcalosync; |
4831 |
}; |
}; |
4832 |
if ( pktnum < ntof.pkt_num || obt < ntof.obt ){ |
if ( pktnum < ntof.pkt_num || obt < ntof.obt ){ |
4833 |
printf(" WARNING: no tof level1 data. \n"); |
printf(" WARNING: no tof level1 data. \n"); |
4834 |
|
pamgui->DIALOG(1," No more tof level1 data "); |
4835 |
return; |
return; |
4836 |
}; |
}; |
4837 |
}; |
}; |
4838 |
// |
// |
4839 |
if ( !syncro ) printf(" ...synchronization recovered! \n"); |
if ( !syncro ){ |
4840 |
|
printf(" ...synchronization recovered! \n"); |
4841 |
|
pamgui->DIALOG(0," Synchronization recovered! "); |
4842 |
|
}; |
4843 |
syncro = 1; |
syncro = 1; |
4844 |
// |
// |
4845 |
if ( !var.nosig ) { |
if ( !var.nosig ) { |
5436 |
// LEVEL2 SUBROUTINES // |
// LEVEL2 SUBROUTINES // |
5437 |
//********************************************************************************** |
//********************************************************************************** |
5438 |
|
|
5439 |
void ShowTRACK(Int_t evno, TTree *ttr, Variables & var){ |
void ShowTRACK(Int_t evno, TTree *ttr, Variables & var, PAMevcontrol *pamgui){ |
5440 |
// |
// |
5441 |
var.rig = 0.; |
var.rig = 0.; |
5442 |
var.chi2 = 0.; |
var.chi2 = 0.; |
5451 |
Int_t obt = 0; |
Int_t obt = 0; |
5452 |
trkcalosync: if ( itr >= trnevents ){ |
trkcalosync: if ( itr >= trnevents ){ |
5453 |
printf(" WARNING: no more tracker level2 data.\n"); |
printf(" WARNING: no more tracker level2 data.\n"); |
5454 |
|
pamgui->DIALOG(1," No more tracker level2 data "); |
5455 |
return; |
return; |
5456 |
}; |
}; |
5457 |
if ( !var.nosig ) ttr->GetEntry(itr); |
if ( !var.nosig ) ttr->GetEntry(itr); |
5460 |
if ( pktnum != trk.pkt_num || obt != trk.obt ){ |
if ( pktnum != trk.pkt_num || obt != trk.obt ){ |
5461 |
if ( pktnum > trk.pkt_num || obt > trk.obt ){ |
if ( pktnum > trk.pkt_num || obt > trk.obt ){ |
5462 |
itr++; |
itr++; |
5463 |
if ( syncro ) printf(" WARNING: lost sync! try to recover... \n"); |
if ( syncro ) { |
5464 |
|
printf(" WARNING: lost sync! try to recover... \n"); |
5465 |
|
pamgui->DIALOG(1," Lost sync! try to recover "); |
5466 |
|
}; |
5467 |
syncro = 0; |
syncro = 0; |
5468 |
goto trkcalosync; |
goto trkcalosync; |
5469 |
}; |
}; |
5470 |
if ( pktnum < trk.pkt_num || obt < trk.obt ){ |
if ( pktnum < trk.pkt_num || obt < trk.obt ){ |
5471 |
printf(" WARNING: no tracker level2 data. \n"); |
printf(" WARNING: no tracker level2 data. \n"); |
5472 |
|
pamgui->DIALOG(1," No more tracker level2 data "); |
5473 |
return; |
return; |
5474 |
}; |
}; |
5475 |
}; |
}; |
5476 |
// |
// |
5477 |
if ( !syncro ) printf(" ...synchronization recovered! \n"); |
if ( !syncro ){ |
5478 |
|
printf(" ...synchronization recovered! \n"); |
5479 |
|
pamgui->DIALOG(0," Synchronization recovered! "); |
5480 |
|
}; |
5481 |
// |
// |
5482 |
if ( trk.ntrk > 0 ){ |
if ( trk.ntrk > 0 ){ |
5483 |
Int_t l = 0; |
Int_t l = 0; |
5611 |
// |
// |
5612 |
// Plane View |
// Plane View |
5613 |
// |
// |
5614 |
TPolyLine *trackp1 = new TPolyLine(50,ptx1,pty1); |
if ( var.AC ){ |
5615 |
trackp1->SetLineColor(trcol); |
TPolyLine *trackp1 = new TPolyLine(50,ptx1,pty1); |
5616 |
trackp1->SetLineWidth(1); |
trackp1->SetLineColor(trcol); |
5617 |
trackp1->Draw(); |
trackp1->SetLineWidth(1); |
5618 |
TPolyLine *trackp2 = new TPolyLine(50,ptx2,pty2); |
trackp1->Draw(); |
5619 |
trackp2->SetLineColor(trcol); |
TPolyLine *trackp2 = new TPolyLine(50,ptx2,pty2); |
5620 |
trackp2->SetLineWidth(1); |
trackp2->SetLineColor(trcol); |
5621 |
trackp2->SetLineStyle(3); |
trackp2->SetLineWidth(1); |
5622 |
trackp2->Draw(); |
trackp2->SetLineStyle(3); |
5623 |
|
trackp2->Draw(); |
5624 |
|
}; |
5625 |
// |
// |
5626 |
// Dots on measured points |
// Dots on measured points |
5627 |
// |
// |
5630 |
Float_t y; |
Float_t y; |
5631 |
Float_t z1; |
Float_t z1; |
5632 |
Float_t z2; |
Float_t z2; |
5633 |
|
Int_t dcol; |
5634 |
|
if ( var.bw ){ |
5635 |
|
dcol = 12; |
5636 |
|
} else { |
5637 |
|
dcol = 2; |
5638 |
|
}; |
5639 |
for (Int_t g = 0; g<6; g++){ |
for (Int_t g = 0; g<6; g++){ |
5640 |
x = trk.xm[l][g]*var.sfx/100. + var.xxvc; |
if ( trk.xgood[l][g] ) { |
5641 |
y = trk.ym[l][g]*var.sfx/100. + var.xyvc; |
x = trk.xm[l][g]*var.sfx/100. + var.xxvc; |
5642 |
z1 = (trk.zm[l][g]+11.2)*var.sfy/100. + var.yxvc; |
z1 = (trk.zm[l][g]+11.2)*var.sfy/100. + var.yxvc; |
5643 |
z2 = (trk.zm[l][g]+11.2)*var.sfy/100. + var.yyvc; |
elli = new TEllipse(x,z1,0.004,0.004,0.,-180.); |
5644 |
elli = new TEllipse(x,z1,0.004,0.004,0.,-180.); |
elli->SetFillStyle(1001); |
5645 |
elli->SetFillStyle(1001); |
elli->SetFillColor(dcol); |
5646 |
elli->SetFillColor(2); |
elli->Draw(); |
5647 |
elli->Draw(); |
}; |
5648 |
elli = new TEllipse(y,z2,0.004,0.004,0.,-180.); |
if ( trk.ygood[l][g] ) { |
5649 |
elli->SetFillStyle(1001); |
y = trk.ym[l][g]*var.sfx/100. + var.xyvc; |
5650 |
elli->SetFillColor(2); |
z2 = (trk.zm[l][g]+11.2)*var.sfy/100. + var.yyvc; |
5651 |
elli->Draw(); |
elli = new TEllipse(y,z2,0.004,0.004,0.,-180.); |
5652 |
|
elli->SetFillStyle(1001); |
5653 |
|
elli->SetFillColor(dcol); |
5654 |
|
elli->Draw(); |
5655 |
|
}; |
5656 |
}; |
}; |
5657 |
// |
// |
5658 |
// |
// |
5659 |
} else { |
} else { |
5660 |
|
pamgui->DIALOG(1," Failed in determining the track! "); |
5661 |
printf(" WARNING: failed in determining the track! \n"); |
printf(" WARNING: failed in determining the track! \n"); |
5662 |
}; |
}; |
5663 |
l++; |
l++; |
5919 |
|
|
5920 |
|
|
5921 |
void ShowPalette(Int_t bw){ |
void ShowPalette(Int_t bw){ |
5922 |
Float_t xp = 0.33; |
Float_t xp = 0.40; |
5923 |
Float_t yp = 0.02; |
Float_t yp = 0.02; |
5924 |
Float_t xw = 0.35; |
Float_t xw = 0.2325; |
5925 |
Float_t yh = 0.19; |
Float_t yh = 0.19; |
5926 |
|
// Float_t xp = 0.33; |
5927 |
|
//Float_t yp = 0.02; |
5928 |
|
//Float_t xw = 0.35; |
5929 |
|
//Float_t yh = 0.19; |
5930 |
Double_t xx[5] = {xp, xp+xw, xp+xw, xp, xp}; |
Double_t xx[5] = {xp, xp+xw, xp+xw, xp, xp}; |
5931 |
Double_t yy[5] = {yp, yp, yp+yh, yp+yh, yp}; |
Double_t yy[5] = {yp, yp, yp+yh, yp+yh, yp}; |
5932 |
TPolyLine *fpale = new TPolyLine(5,xx,yy); |
TPolyLine *fpale = new TPolyLine(5,xx,yy); |
5937 |
txt->SetTextSize(0.01); |
txt->SetTextSize(0.01); |
5938 |
txt->DrawLatex(xp+0.005,yp+yh-0.015,"PALETTE"); |
txt->DrawLatex(xp+0.005,yp+yh-0.015,"PALETTE"); |
5939 |
txt->DrawLatex(xp+0.005,yp+yh-0.04,"TOF, CALO, S4 [MIP]:"); |
txt->DrawLatex(xp+0.005,yp+yh-0.04,"TOF, CALO, S4 [MIP]:"); |
5940 |
Float_t xwc = (xp+0.01)/6.; |
// Float_t xwc = (xp+0.01)/6.; |
5941 |
|
Float_t xwc = (xw-0.01)/6.; |
5942 |
|
Float_t axwc = xwc+0.02; |
5943 |
Float_t yhc = 0.03; |
Float_t yhc = 0.03; |
5944 |
Int_t colo = 0; |
Int_t colo = 0; |
5945 |
Float_t yc = 0.135; |
Float_t yc = 0.135; |
5946 |
TPolyLine *fc1[6]; |
TPolyLine *fc1[6]; |
5947 |
if ( bw ){ |
if ( bw ){ |
5948 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
5949 |
Float_t xc = 0.335+(j*xwc); |
// Float_t xc = 0.335+(j*xwc); |
5950 |
|
Float_t xc = 0.005+xp+(j*xwc); |
5951 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
5952 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
5953 |
fc1[j] = new TPolyLine(5,xx,yy); |
fc1[j] = new TPolyLine(5,xx,yy); |
5998 |
Float_t yc = 0.08; |
Float_t yc = 0.08; |
5999 |
TPolyLine *fc2[6]; |
TPolyLine *fc2[6]; |
6000 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
6001 |
Float_t xc = 0.335+(j*xwc); |
Float_t xc = 0.005+xp+(j*xwc); |
6002 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
6003 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
6004 |
fc2[j] = new TPolyLine(5,xx,yy); |
fc2[j] = new TPolyLine(5,xx,yy); |
6049 |
yc = 0.025; |
yc = 0.025; |
6050 |
TPolyLine *fc3[3]; |
TPolyLine *fc3[3]; |
6051 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
6052 |
Float_t xc = 0.335+(j*xwc); |
Float_t xc = 0.005+xp+(j*axwc); |
6053 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+axwc, xc+axwc, xc, xc}; |
6054 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
6055 |
fc3[j] = new TPolyLine(5,xx,yy); |
fc3[j] = new TPolyLine(5,xx,yy); |
6056 |
fc3[j]->SetLineColor(1); |
fc3[j]->SetLineColor(1); |
6081 |
}; |
}; |
6082 |
} else { |
} else { |
6083 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
6084 |
Float_t xc = 0.335+(j*xwc); |
Float_t xc = 0.005+xp+(j*xwc); |
6085 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
6086 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
6087 |
fc1[j] = new TPolyLine(5,xx,yy); |
fc1[j] = new TPolyLine(5,xx,yy); |
6132 |
Float_t yc = 0.08; |
Float_t yc = 0.08; |
6133 |
TPolyLine *fc2[6]; |
TPolyLine *fc2[6]; |
6134 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
6135 |
Float_t xc = 0.335+(j*xwc); |
Float_t xc = 0.005+xp+(j*xwc); |
6136 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
6137 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
6138 |
fc2[j] = new TPolyLine(5,xx,yy); |
fc2[j] = new TPolyLine(5,xx,yy); |
6183 |
yc = 0.025; |
yc = 0.025; |
6184 |
TPolyLine *fc3[3]; |
TPolyLine *fc3[3]; |
6185 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
6186 |
Float_t xc = 0.335+(j*xwc); |
Float_t xc = 0.005+xp+(j*axwc); |
6187 |
Double_t xx[5] = {xc, xc+xwc, xc+xwc, xc, xc}; |
Double_t xx[5] = {xc, xc+axwc, xc+axwc, xc, xc}; |
6188 |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
Double_t yy[5] = {yc, yc, yc+yhc, yc+yhc, yc}; |
6189 |
fc3[j] = new TPolyLine(5,xx,yy); |
fc3[j] = new TPolyLine(5,xx,yy); |
6190 |
fc3[j]->SetLineColor(1); |
fc3[j]->SetLineColor(1); |
6246 |
x1->Draw(); |
x1->Draw(); |
6247 |
}; |
}; |
6248 |
} |
} |
|
// |
|
|
// |
|
|
// |
|
|
void ShowHelp(){ |
|
|
char input[256]; |
|
|
printf("\n USE:\n\n The only input needed is the path to the directory (\"filename\") created by YODA\n for the data file you want to analyze.\n Standard use:\n root[0] .L ShowEvent.c\n root[1] ShowEvent(\"/home/dati/filesFromYoda/DW_050112_00600/\");\n \n\n\n\n\n\n"); |
|
|
printf("Press <enter> to continue\n"); |
|
|
cin.getline(input,256); |
|
|
printf(" FEATURES:\n\n ShowEvent(TString filename, Int_t fromevent = 0, Int_t toevent = 0,\n TString selfile = \"\", Int_t FORCELEVEL = -1,\n Int_t ctrlword = 509, Int_t BW=0, TString outDir = \"\",\n TString calcalibfile = \"\")\n Input variables\n * fromevent = the first event to be shown (0 means \"show all\")\n"); |
|
|
printf(" * toevent = the last event to be shown (NB: if fromevent differs from zero\n and toevent is equal zero only one event will be shown,\n number \"fromevent\")\n\n\n\n"); |
|
|
printf("Press <enter> to continue\n"); |
|
|
cin.getline(input,256); |
|
|
printf(" * ctrword is an integer which can be used as a mask to customize the figure:\n ctrword bit: 10 9 8 7 6 5 4 3 2 1 \n detector : special TOF AC TRK CALO S4 ND infos names legenda\n Examples:\n ctrword = 509 = 0111111101 : all detectors+infos are printed(DEFAULT)\n ctrword = 511 = 0111111111 : show all\n ctrword = 505 = 0111111001 : don't print infos on figure\n ctrword = 507 = 0111111011 : show detector names+legenda (no infos)\n ctrword = 8 = 0000001000 : show only ND\n ctrword = 1019 = 1111111011 : show all but infos without signals\n\n"); |
|
|
printf("Press <enter> to continue\n"); |
|
|
cin.getline(input,256); |
|
|
printf("\n\n When the \"special\" bit is set NO SIGNAL will be shown in the detectors.\n It can be used to draw a draft of the PAMELA apparatus without any event.\n "); |
|
|
printf(" * selfile = selection file. Can be used to select events.\n Default is \"\" that is no selection applied.\n"); |
|
|
printf(" * FORCELEVEL = to force a certain level visualization.\n For the moment only level0 can be forced.\n"); |
|
|
printf(" * BW = 0 flag to display black and white figures.\n Default is 0, colours, set it to 1 to have BW visualization.\n"); |
|
|
printf(" * outDir = directory where to place figures (if you want to print them).\n Default is \"filename\".\n\n"); |
|
|
printf("Press <enter> to continue\n"); |
|
|
cin.getline(input,256); |
|
|
printf(" * calcalibfile = the calorimeter needs a calibration to display events. If a\n calibration is not in the file you want to analylze put \n here the path to a directory created by YODA for a data \n file with calorimeter calibration. Default is \"filename\".\n"); |
|
|
printf("\n\n For further informations read the README.ShowEvent file.\n"); |
|
|
return; |
|
|
} |
|
6249 |
|
|
6250 |
// |
// |
6251 |
// MAIN ROUTINE |
// MAIN ROUTINE |
6252 |
// |
// |
6253 |
void ShowEvent(TString filename="help", TString selfile="", Int_t ctrlword = 509, Int_t FORCELEV = -1, Int_t fromevent = 0, Int_t toevent = 0, TString outDir = ""){ |
void ShowEvent(TString filename="help", TString selfile="", Int_t ctrlword = 509, Int_t FORCELEV = -1, Int_t fromevent = 0, Int_t toevent = 0, TString outDir = ""){ |
|
gROOT->GetListOfCanvases()->Delete(); |
|
|
gDirectory->GetList()->Delete(); |
|
6254 |
TString calcalibfile = ""; |
TString calcalibfile = ""; |
6255 |
TString startingdir = gSystem->WorkingDirectory(); |
TString startingdir = gSystem->WorkingDirectory(); |
6256 |
const char* startingdir2 = gSystem->WorkingDirectory(); |
const char* startingdir2 = gSystem->WorkingDirectory(); |
6257 |
TString path; |
TString path; |
6258 |
stringcopy(path,startingdir2); |
stringcopy(path,startingdir2); |
|
Int_t BW = 0; |
|
6259 |
#if defined (__CINT__) |
#if defined (__CINT__) |
6260 |
emicheckLib(); |
emicheckLib(); |
6261 |
const char *pamlib=gSystem->Getenv("PAM_LIB"); |
const char *pamlib=gSystem->Getenv("PAM_LIB"); |
6279 |
stringstream calfile; |
stringstream calfile; |
6280 |
calfile.str(""); |
calfile.str(""); |
6281 |
calfile << pam_calib << "/CaloADC2MIP.root"; |
calfile << pam_calib << "/CaloADC2MIP.root"; |
6282 |
|
Int_t selection = 0; |
6283 |
|
Bool_t firsttime = true; |
6284 |
|
// |
6285 |
|
// |
6286 |
|
restart: |
6287 |
|
gROOT->GetListOfCanvases()->Delete(); |
6288 |
|
gDirectory->GetList()->Delete(); |
6289 |
|
// |
6290 |
|
struct Variables var; |
6291 |
|
Bool_t loadselfs = true; |
6292 |
|
Bool_t popup = false; |
6293 |
|
PAMevcontrol *pamgui = 0; |
6294 |
|
var.restart = false; |
6295 |
|
var.waitforever = false; |
6296 |
|
var.jumprog = true; |
6297 |
|
var.jumpen = false; |
6298 |
|
// Int_t njumpen = 0; |
6299 |
struct Levels level; |
struct Levels level; |
6300 |
// |
// |
6301 |
const char *name= filename; |
const char *name= filename; |
6302 |
if ( filename == "" || !strcmp(name,"help") ){ |
if ( filename == "" || !strcmp(name,"help") ){ |
6303 |
ShowHelp(); |
// ShowHelp(); |
6304 |
return; |
// return; |
6305 |
|
var.waitforever = true; |
6306 |
}; |
}; |
6307 |
// |
// |
6308 |
|
Float_t mip[2][22][96]; |
6309 |
|
Int_t okcalo = 0; |
6310 |
|
TTree *ctree = 0; |
6311 |
|
TFile *chfile; |
6312 |
|
CalorimeterCalibration *ccalo = 0; |
6313 |
|
Long64_t cnevents = 0; |
6314 |
// |
// |
6315 |
|
var.goon = false; |
6316 |
|
var.refresh = false; |
6317 |
|
var.fl0 = false; |
6318 |
|
|
6319 |
|
if ( FORCELEV == 0 ) var.fl0 = true; |
6320 |
// |
// |
6321 |
if ( FORCELEV != -1 ) printf("\n WARNING: FORCING LEVEL%i DATA \n\n",FORCELEV); |
// Define some variables |
6322 |
// |
// |
6323 |
// LOAD SELECTION FILE |
Int_t OBT = 0; |
6324 |
|
Int_t DOBT = 0; |
6325 |
|
Int_t ifout = 0; |
6326 |
|
Int_t OOBT = 0; |
6327 |
// |
// |
6328 |
Int_t selection = 0; |
// here windows dimension (based on the computer screen size) and position and dimension of figures |
6329 |
|
// |
6330 |
|
Int_t xw, yw; |
6331 |
|
UInt_t ww, hw; |
6332 |
|
gVirtualX->GetWindowSize(gClient->GetRoot()->GetId(),xw,yw,ww,hw); |
6333 |
|
Float_t winx = (float)ww*0.80; |
6334 |
|
Float_t winy = (float)hw*0.80; // 95 |
6335 |
|
Float_t winrap = winx/winy; |
6336 |
|
TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy); |
6337 |
|
// GetCanvas->SetBit(kNotEditable); |
6338 |
|
// |
6339 |
|
var.bw = 0; |
6340 |
|
// var.xxvc = 0.17; |
6341 |
|
var.xxvc = 0.20; |
6342 |
|
var.yxvc = 0.44; |
6343 |
|
// var.xyvc = 0.83; |
6344 |
|
var.xyvc = 0.815; |
6345 |
|
var.yyvc = 0.44; |
6346 |
|
// |
6347 |
|
var.sfx = 0.81/winrap; |
6348 |
|
var.sfy = 0.81; |
6349 |
|
// |
6350 |
|
//var.nds4 = 0.4; |
6351 |
|
var.nds4 = var.sfx; |
6352 |
|
var.xcat = 0.515; |
6353 |
|
//var.xcat = 0.56; |
6354 |
|
var.ycat = 0.74; |
6355 |
|
// |
6356 |
|
var.tracknds4 = 1; |
6357 |
|
// |
6358 |
|
var.thefilename = filename.Data(); |
6359 |
|
var.thefilter = selfile.Data(); |
6360 |
|
// |
6361 |
|
// book the canvas |
6362 |
|
// |
6363 |
|
TLatex *text=new TLatex(); |
6364 |
|
stringstream testo; |
6365 |
|
stringstream testo2; |
6366 |
|
stringstream testo3; |
6367 |
|
figure->Range(0.,0.,1.,1.); |
6368 |
|
gStyle->SetOptDate(0); |
6369 |
|
gStyle->SetOptStat(0); |
6370 |
|
gStyle->SetLabelSize(0); |
6371 |
|
gStyle->SetNdivisions(1,"X"); |
6372 |
|
gStyle->SetNdivisions(1,"Y"); |
6373 |
|
// |
6374 |
|
stringstream libload; |
6375 |
|
Int_t doflag = 1; |
6376 |
|
Int_t thefirst = 1; |
6377 |
|
Int_t trackdone1 = 0; |
6378 |
|
Int_t trackdone2 = 0; |
6379 |
|
Int_t seldone = 0; |
6380 |
|
Float_t headc = 0.; |
6381 |
|
Float_t headcold = 0.; |
6382 |
|
Int_t i = 0; |
6383 |
|
Int_t isOK = 0; |
6384 |
|
Int_t jumpto = 0; |
6385 |
|
struct Calib calib; |
6386 |
|
Int_t b[4]; |
6387 |
|
Int_t si = 0; |
6388 |
|
var.selex = false; |
6389 |
|
var.alrforc = false; |
6390 |
|
// |
6391 |
|
// from here to refresh |
6392 |
|
// |
6393 |
|
refresh: |
6394 |
|
// |
6395 |
|
selfile = var.thefilter.Data(); |
6396 |
|
if ( calcalibfile == "" ) calcalibfile = filename; |
6397 |
|
if ( outDir == "" ) outDir = filename; |
6398 |
|
// |
6399 |
|
if ( var.fl0 == true ) { |
6400 |
|
FORCELEV = 0; |
6401 |
|
} else { |
6402 |
|
if ( var.refresh ) FORCELEV = -1; |
6403 |
|
}; |
6404 |
|
// |
6405 |
|
// clear levels! |
6406 |
|
// |
6407 |
|
level.calo = -10; |
6408 |
|
level.calol2 = -10; |
6409 |
|
level.tof = -10; |
6410 |
|
level.track = -10; |
6411 |
|
level.track2 = -10; |
6412 |
|
level.s4 = -10; |
6413 |
|
level.ac = -10; |
6414 |
|
level.nd = -10; |
6415 |
|
// |
6416 |
|
TString fififile = getFilename(filename); |
6417 |
|
const char *file = fififile; |
6418 |
|
// |
6419 |
|
// |
6420 |
|
// |
6421 |
|
if ( !var.refresh ){ |
6422 |
|
var.SHOWDEC = 0; |
6423 |
|
var.TOF = 0; |
6424 |
|
var.AC = 0; |
6425 |
|
var.TRK = 0; |
6426 |
|
var.CALO = 0; |
6427 |
|
var.S4 = 0; |
6428 |
|
var.ND = 0; |
6429 |
|
var.INFOS = 0; |
6430 |
|
var.VINFOS = 0; |
6431 |
|
var.PALETTE = 0; |
6432 |
|
if ( ctrlword & (1<<0) ) { |
6433 |
|
var.PALETTE = 1; |
6434 |
|
printf("Show Palette\n"); |
6435 |
|
}; |
6436 |
|
if ( ctrlword & (1<<1) ) { |
6437 |
|
var.VINFOS = 1; |
6438 |
|
printf("Show Verbose Text Informations\n"); |
6439 |
|
}; |
6440 |
|
if ( ctrlword & (1<<2) ) { |
6441 |
|
var.INFOS = 1; |
6442 |
|
printf("Show Text Informations\n"); |
6443 |
|
}; |
6444 |
|
if ( ctrlword & (1<<3) ) { |
6445 |
|
var.ND = 1; |
6446 |
|
}; |
6447 |
|
if ( ctrlword & (1<<4) ) { |
6448 |
|
var.S4 = 1; |
6449 |
|
}; |
6450 |
|
if ( ctrlword & (1<<5) ) { |
6451 |
|
var.CALO = 1; |
6452 |
|
}; |
6453 |
|
if ( ctrlword & (1<<6) ) { |
6454 |
|
var.TRK = 1; |
6455 |
|
}; |
6456 |
|
if ( ctrlword & (1<<7) ) { |
6457 |
|
var.AC = 1; |
6458 |
|
}; |
6459 |
|
if ( ctrlword & (1<<8) ) { |
6460 |
|
var.TOF = 1; |
6461 |
|
}; |
6462 |
|
if ( ctrlword & (1<<9) ) { |
6463 |
|
var.SHOWDEC = 1; |
6464 |
|
fromevent = 1; |
6465 |
|
toevent = 1; |
6466 |
|
printf("\n ** WARNING! YOU HAVE CHOSEN TO SHOW ONLY DETECTORS AND NO SIGNALS! **\n\n"); |
6467 |
|
gSystem->Exec("sleep 5"); |
6468 |
|
}; |
6469 |
|
}; |
6470 |
|
// |
6471 |
|
// Pop up the GUI |
6472 |
|
// |
6473 |
|
if ( !popup ) { |
6474 |
|
pamgui = new PAMevcontrol(gClient->GetRoot(),400,800,var,*figure); |
6475 |
|
popup = true; |
6476 |
|
}; |
6477 |
|
if ( firsttime ){ |
6478 |
|
firsttime = false; |
6479 |
|
if ( filename == "" ) pamgui->DIALOG(0," Insert the filename and press load to start "); |
6480 |
|
}; |
6481 |
|
// |
6482 |
|
while( var.waitforever ) { |
6483 |
|
if ( !gROOT->GetListOfCanvases()->FindObject(figure) ) { |
6484 |
|
pamgui->Close(); |
6485 |
|
gSystem->ProcessEvents(); |
6486 |
|
gApplication->Terminate(0); |
6487 |
|
}; |
6488 |
|
gSystem->ProcessEvents(); |
6489 |
|
}; |
6490 |
|
if ( var.restart ){ |
6491 |
|
filename = var.thefilename.Data(); |
6492 |
|
pamgui->Close(); |
6493 |
|
goto restart; |
6494 |
|
}; |
6495 |
|
// |
6496 |
|
// |
6497 |
|
// |
6498 |
|
if ( FORCELEV != -1 ) { |
6499 |
|
printf("\n WARNING: FORCING LEVEL%i DATA \n\n",FORCELEV); |
6500 |
|
if ( !var.alrforc ) { |
6501 |
|
pamgui->DIALOG(1," Forcing LEVEL0 data "); |
6502 |
|
var.alrforc = true; |
6503 |
|
}; |
6504 |
|
}; |
6505 |
|
// |
6506 |
|
// LOAD SELECTION FILE |
6507 |
|
// |
6508 |
if ( selfile == "" ){ |
if ( selfile == "" ){ |
6509 |
|
if ( !var.selex && selection ) pamgui->DIALOG(0," Selection file unloaded "); |
6510 |
|
var.selex = true; |
6511 |
selection = 0; |
selection = 0; |
6512 |
|
#if !defined (__CINT__) |
6513 |
|
if ( !var.refresh ) { |
6514 |
|
gROOT->Reset(); |
6515 |
|
stringstream paminc; |
6516 |
|
paminc.str(""); |
6517 |
|
const char *testinc = gSystem->Getenv("PAM_INC"); |
6518 |
|
if ( !testinc ) { |
6519 |
|
const char *pam_calib = pathtocalibration(); |
6520 |
|
paminc << pam_calib << "../include/"; |
6521 |
|
} else { |
6522 |
|
paminc << testinc; |
6523 |
|
}; |
6524 |
|
stringstream carica; |
6525 |
|
carica.str(""); |
6526 |
|
carica << paminc.str().c_str() << "/eventviewer.h"; |
6527 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6528 |
|
}; |
6529 |
|
#endif |
6530 |
} else { |
} else { |
6531 |
#if !defined (__CINT__) |
#if !defined (__CINT__) |
6532 |
// |
// |
6533 |
// if running the compiled program we must load header files for the selection macros! |
// if running the compiled program we must load header files for the selection macros! |
6534 |
// |
// |
6535 |
gROOT->Reset(); |
// if ( !var.refresh ) { |
6536 |
stringstream paminc; |
if ( loadselfs ) { |
6537 |
paminc.str(""); |
loadselfs = false; |
6538 |
const char *testinc = gSystem->Getenv("PAM_INC"); |
gROOT->Reset(); |
6539 |
if ( testinc == "" ){ |
stringstream paminc; |
6540 |
|
paminc.str(""); |
6541 |
|
const char *testinc = gSystem->Getenv("PAM_INC"); |
6542 |
|
if ( !testinc ){ |
6543 |
const char *pam_calib = pathtocalibration(); |
const char *pam_calib = pathtocalibration(); |
6544 |
paminc << pam_calib << "../include/"; |
paminc << pam_calib << "../include/"; |
6545 |
} else { |
} else { |
6546 |
paminc << testinc; |
paminc << testinc; |
6547 |
|
}; |
6548 |
|
stringstream carica; |
6549 |
|
carica.str(""); |
6550 |
|
carica << paminc.str().c_str() << "/eventviewer.h"; |
6551 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6552 |
|
carica.str(""); |
6553 |
|
carica << paminc.str().c_str() << "/trklev1struct.h"; |
6554 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6555 |
|
carica.str(""); |
6556 |
|
carica << paminc.str().c_str() << "/ctrkstruct.h"; |
6557 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6558 |
|
carica.str(""); |
6559 |
|
carica << paminc.str().c_str() << "/ctrkinclude.h"; |
6560 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6561 |
|
carica.str(""); |
6562 |
|
carica << paminc.str().c_str() << "/ctofstruct.h"; |
6563 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6564 |
|
carica.str(""); |
6565 |
|
carica << paminc.str().c_str() << "/ctofinclude.h"; |
6566 |
|
gROOT->LoadMacro(carica.str().c_str()); |
6567 |
}; |
}; |
|
stringstream carica; |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/eventviewer.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/trklev1struct.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/ctrkstruct.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/ctrkinclude.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/ctofstruct.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
|
carica.str(""); |
|
|
carica << paminc.str().c_str() << "/ctofinclude.h"; |
|
|
gROOT->LoadMacro(carica.str().c_str()); |
|
6568 |
#endif |
#endif |
6569 |
// |
// |
6570 |
// load the selection macro |
// load the selection macro |
6571 |
// |
// |
6572 |
selection = gROOT->LoadMacro(selfile); |
selection = gROOT->LoadMacro(selfile); |
6573 |
if ( selection ){ |
if ( selection ){ |
6574 |
|
stringstream dialog; |
6575 |
|
dialog.str(""); |
6576 |
|
dialog << var.thefilter.Data(); |
6577 |
|
dialog << " : no such file!"; |
6578 |
|
pamgui->DIALOG(2,dialog.str().c_str()); |
6579 |
printf("\n\n ERROR! cannot read the selection file you give me as input! \n"); |
printf("\n\n ERROR! cannot read the selection file you give me as input! \n"); |
6580 |
selection = 0; |
selection = 0; |
6581 |
printf("\n WARNING! no selection file loaded! \n\n"); |
printf("\n WARNING! no selection file loaded! \n\n"); |
6582 |
|
pamgui->DIALOG(1," No selection file loaded! "); |
6583 |
|
pamgui->clearselfi(); |
6584 |
} else { |
} else { |
6585 |
printf("\n\n Selection file loaded \n\n The first event will be shown anyway. \n\n"); |
printf("\n\n Selection file loaded \n\n The first event will be shown anyway. \n\n"); |
6586 |
|
if ( !var.selex ) pamgui->DIALOG(0," Selection file successfully loaded "); |
6587 |
|
var.selex = true; |
6588 |
selection = 1; |
selection = 1; |
6589 |
}; |
}; |
6590 |
}; |
}; |
6591 |
// |
// |
6592 |
|
// LOAD FILES |
6593 |
// |
// |
|
// LOAD FILES |
|
|
// |
|
|
Int_t SHOWDEC = 0; |
|
|
Int_t TOF = 0; |
|
|
Int_t AC = 0; |
|
|
Int_t TRK = 0; |
|
|
Int_t CALO = 0; |
|
|
Int_t S4 = 0; |
|
|
Int_t ND = 0; |
|
|
Int_t INFOS = 0; |
|
|
Int_t VINFOS = 0; |
|
|
Int_t PALETTE = 0; |
|
|
// |
|
|
if ( ctrlword & (1<<0) ) { |
|
|
PALETTE = 1; |
|
|
printf("Show Palette\n"); |
|
|
}; |
|
|
if ( BW ) printf(" --> Black and White visualization! \n"); |
|
|
if ( ctrlword & (1<<1) ) { |
|
|
VINFOS = 1; |
|
|
printf("Show Verbose Text Informations\n"); |
|
|
}; |
|
|
if ( ctrlword & (1<<2) ) { |
|
|
INFOS = 1; |
|
|
printf("Show Text Informations\n"); |
|
|
}; |
|
|
if ( ctrlword & (1<<3) ) { |
|
|
ND = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<4) ) { |
|
|
S4 = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<5) ) { |
|
|
CALO = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<6) ) { |
|
|
TRK = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<7) ) { |
|
|
AC = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<8) ) { |
|
|
TOF = 1; |
|
|
}; |
|
|
if ( ctrlword & (1<<9) ) { |
|
|
SHOWDEC = 1; |
|
|
fromevent = 1; |
|
|
toevent = 1; |
|
|
printf("\n ** WARNING! YOU HAVE CHOSEN TO SHOW ONLY DETECTORS AND NO SIGNALS! **\n\n"); |
|
|
gSystem->Exec("sleep 5"); |
|
|
}; |
|
|
// |
|
|
TString fififile = getFilename(filename); |
|
|
const char *file = fififile; |
|
6594 |
// |
// |
6595 |
Int_t trk1noev = 0; |
Int_t trk1noev = 0; |
6596 |
Int_t trk2noev = 0; |
Int_t trk2noev = 0; |
6608 |
TFile *tofFileL1 = 0; |
TFile *tofFileL1 = 0; |
6609 |
TTree *toftr = 0; |
TTree *toftr = 0; |
6610 |
// |
// |
6611 |
|
// check if user has given as input a correct path |
6612 |
|
// |
6613 |
|
ifstream myfile; |
6614 |
|
stringstream hfile; |
6615 |
|
TString textslash; |
6616 |
|
Int_t minus = 0; |
6617 |
|
stringcopy(textslash,filename,filename.Length()-1,filename.Length()); |
6618 |
|
if ( !strcmp(textslash.Data(),"/") ){ |
6619 |
|
minus = 1; |
6620 |
|
} else { |
6621 |
|
minus = 0; |
6622 |
|
}; |
6623 |
|
TString textrem; |
6624 |
|
stringcopy(textrem,filename,filename.Length()-minus-15,filename.Length()-minus); |
6625 |
|
hfile.str(""); |
6626 |
|
hfile << filename.Data(); |
6627 |
|
hfile << "/Physics/"; |
6628 |
|
hfile << textrem.Data(); |
6629 |
|
hfile << ".Physics.Header.root"; |
6630 |
|
myfile.open(hfile.str().c_str()); |
6631 |
|
if ( !myfile ){ |
6632 |
|
printf("ERROR: no Header file, exiting...\n"); |
6633 |
|
hfile << " - No header file! "; |
6634 |
|
pamgui->DIALOG(2,hfile.str().c_str()); |
6635 |
|
var.waitforever = true; |
6636 |
|
goto refresh; |
6637 |
|
}; |
6638 |
|
myfile.close(); |
6639 |
|
// |
6640 |
|
// ok, open header file |
6641 |
|
// |
6642 |
headerFile = emigetFile(filename, "Physics", "Header"); |
headerFile = emigetFile(filename, "Physics", "Header"); |
6643 |
if ( !headerFile ){ |
if ( !headerFile ){ |
6644 |
printf("ERROR: no Header file, exiting...\n"); |
printf("ERROR: no Header file, exiting...\n"); |
6645 |
return; |
pamgui->DIALOG(2," No header file! "); |
6646 |
|
var.waitforever = true; |
6647 |
|
goto refresh; |
6648 |
}; |
}; |
6649 |
TTree *otr = (TTree*)headerFile->Get("Pscu"); |
TTree *otr = (TTree*)headerFile->Get("Pscu"); |
6650 |
printf("Get the Header informations\n"); |
printf("Get the Header informations\n"); |
6652 |
triggerFile = emigetFile(filename, "Trigger"); |
triggerFile = emigetFile(filename, "Trigger"); |
6653 |
if ( !triggerFile ){ |
if ( !triggerFile ){ |
6654 |
printf("ERROR: no Trigger file, exiting...\n"); |
printf("ERROR: no Trigger file, exiting...\n"); |
6655 |
return; |
pamgui->DIALOG(2," No trigger file! "); |
6656 |
|
var.waitforever = true; |
6657 |
|
goto refresh; |
6658 |
}; |
}; |
6659 |
otr->AddFriend("Trigger", triggerFile); |
otr->AddFriend("Trigger", triggerFile); |
6660 |
printf("Get the Trigger informations\n"); |
printf("Get the Trigger informations\n"); |
6669 |
TTree *ctrk = 0; |
TTree *ctrk = 0; |
6670 |
TFile *trackcalibFile2 = 0; |
TFile *trackcalibFile2 = 0; |
6671 |
TFile *trackerFile2b = 0; |
TFile *trackerFile2b = 0; |
6672 |
if ( TRK ) { |
if ( var.TRK ) { |
6673 |
if ( FORCELEV == 0 ){ |
if ( FORCELEV == 0 ){ |
6674 |
trackerFile2 = emigetFile(filename, "Tracker"); |
trackerFile2 = emigetFile(filename, "Tracker"); |
6675 |
if ( !trackerFile2 ){ |
if ( !trackerFile2 ){ |
6676 |
printf("WARNING: no Tracker file! \n"); |
printf("WARNING: no Tracker file! \n"); |
6677 |
TRK = 0; |
pamgui->DIALOG(1," No tracker file! "); |
6678 |
} else { |
var.TRK = 0; |
6679 |
otr->AddFriend("Tracker", trackerFile2); |
} else { |
6680 |
printf("Show the Tracker detector, LEVEL0 data \n"); |
otr->AddFriend("Tracker", trackerFile2); |
6681 |
TRKLEV = 0; |
printf("Show the Tracker detector, LEVEL0 data \n"); |
6682 |
}; |
TRKLEV = 0; |
6683 |
} else { |
}; |
6684 |
trackerFile = emigetFile(filename, "Physics.Level2", "Tracker"); |
} else { |
6685 |
|
trackerFile = emigetFile(filename, "Physics.Level2", "Tracker"); |
6686 |
|
if ( !trackerFile ){ |
6687 |
|
// |
6688 |
|
trackhead = emigetFile(filename, "CalibTrk1", "Header"); |
6689 |
|
ctrk = (TTree*)trackhead->Get("Pscu"); |
6690 |
|
// |
6691 |
|
trackerFile = emigetFile(filename, "Physics.Level1", "Tracker"); |
6692 |
|
trackcalibFile1 = emigetFile(filename, "CalibTrk1"); |
6693 |
|
trackcalibFile2 = emigetFile(filename, "CalibTrk2"); |
6694 |
|
// |
6695 |
|
if ( !trackerFile || !trackcalibFile1 || !trackcalibFile2 || !trackhead ){ |
6696 |
|
trackerFile = emigetFile(filename, "Tracker"); |
6697 |
if ( !trackerFile ){ |
if ( !trackerFile ){ |
6698 |
// |
printf("WARNING: no Tracker file! \n"); |
6699 |
trackhead = emigetFile(filename, "CalibTrk1", "Header"); |
pamgui->DIALOG(1," No tracker file! "); |
6700 |
ctrk = (TTree*)trackhead->Get("Pscu"); |
var.TRK = 0; |
|
// |
|
|
trackerFile = emigetFile(filename, "Physics.Level1", "Tracker"); |
|
|
trackcalibFile1 = emigetFile(filename, "CalibTrk1"); |
|
|
trackcalibFile2 = emigetFile(filename, "CalibTrk2"); |
|
|
// |
|
|
if ( !trackerFile || !trackcalibFile1 || !trackcalibFile2 || !trackhead ){ |
|
|
trackerFile = emigetFile(filename, "Tracker"); |
|
|
if ( !trackerFile ){ |
|
|
printf("WARNING: no Tracker file! \n"); |
|
|
TRK = 0; |
|
|
} else { |
|
|
otr->AddFriend("Tracker", trackerFile); |
|
|
printf("Show the Tracker detector, LEVEL0 data \n"); |
|
|
TRKLEV = 0; |
|
|
}; |
|
|
} else { |
|
|
ttr1 = (TTree*)trackerFile->Get("TrkLevel1"); |
|
|
ctrk->AddFriend("CalibTrk1", trackcalibFile1); |
|
|
ctrk->AddFriend("CalibTrk2", trackcalibFile2); |
|
|
printf("Show the Tracker detector, LEVEL1 data \n"); |
|
|
TRKLEV = 1; |
|
|
trk1noev = ttr1->GetEntries(); |
|
|
}; |
|
6701 |
} else { |
} else { |
6702 |
ttr = (TTree*)trackerFile->Get("TrkLevel2"); |
otr->AddFriend("Tracker", trackerFile); |
6703 |
trk2noev = ttr->GetEntries(); |
printf("Show the Tracker detector, LEVEL0 data \n"); |
6704 |
printf("Get the track informations (LEVEL2 Tracker data!)\n"); |
TRKLEV = 0; |
6705 |
STRACK = 1; |
}; |
6706 |
// |
} else { |
6707 |
trackhead = emigetFile(filename, "CalibTrk2", "Header"); |
ttr1 = (TTree*)trackerFile->Get("TrkLevel1"); |
6708 |
ctrk = (TTree*)trackhead->Get("Pscu"); |
ctrk->AddFriend("CalibTrk1", trackcalibFile1); |
6709 |
// |
ctrk->AddFriend("CalibTrk2", trackcalibFile2); |
6710 |
trackerFile2b = emigetFile(filename, "Physics.Level1", "Tracker"); |
printf("Show the Tracker detector, LEVEL1 data \n"); |
6711 |
trackcalibFile1 = emigetFile(filename, "CalibTrk1"); |
TRKLEV = 1; |
6712 |
trackcalibFile2 = emigetFile(filename, "CalibTrk2"); |
trk1noev = ttr1->GetEntries(); |
6713 |
// |
}; |
6714 |
if ( !trackerFile2b || !trackcalibFile1 || !trackcalibFile2 || !trackhead ){ |
} else { |
6715 |
printf(" WARNING: no LEVEL1 Tracker data, load LEVEL0 data \n"); |
ttr = (TTree*)trackerFile->Get("TrkLevel2"); |
6716 |
trackerFile2b = emigetFile(filename, "Tracker"); |
trk2noev = ttr->GetEntries(); |
6717 |
if ( !trackerFile2b ){ |
printf("Get the track informations (LEVEL2 Tracker data!)\n"); |
6718 |
printf("WARNING: no Tracker file! \n"); |
STRACK = 1; |
6719 |
TRK = 0; |
// |
6720 |
} else { |
trackhead = emigetFile(filename, "CalibTrk2", "Header"); |
6721 |
otr->AddFriend("Tracker", trackerFile2b); |
ctrk = (TTree*)trackhead->Get("Pscu"); |
6722 |
printf("Show the Tracker detector, LEVEL0 data \n"); |
// |
6723 |
TRKLEV = 0; |
trackerFile2b = emigetFile(filename, "Physics.Level1", "Tracker"); |
6724 |
}; |
trackcalibFile1 = emigetFile(filename, "CalibTrk1"); |
6725 |
} else { |
trackcalibFile2 = emigetFile(filename, "CalibTrk2"); |
6726 |
ttr1 = (TTree*)trackerFile2b->Get("TrkLevel1"); |
// |
6727 |
ctrk->AddFriend("CalibTrk1", trackcalibFile1); |
if ( !trackerFile2b || !trackcalibFile1 || !trackcalibFile2 || !trackhead ){ |
6728 |
ctrk->AddFriend("CalibTrk2", trackcalibFile2); |
printf(" WARNING: no LEVEL1 Tracker data, load LEVEL0 data \n"); |
6729 |
printf("Show the Tracker detector, LEVEL1 data \n"); |
trackerFile2b = emigetFile(filename, "Tracker"); |
6730 |
TRKLEV = 1; |
if ( !trackerFile2b ){ |
6731 |
trk1noev = ttr1->GetEntries(); |
printf("WARNING: no Tracker file! \n"); |
6732 |
}; |
pamgui->DIALOG(1," No tracker file! "); |
6733 |
}; |
var.TRK = 0; |
6734 |
}; |
} else { |
6735 |
|
otr->AddFriend("Tracker", trackerFile2b); |
6736 |
|
printf("Show the Tracker detector, LEVEL0 data \n"); |
6737 |
|
TRKLEV = 0; |
6738 |
|
}; |
6739 |
|
} else { |
6740 |
|
ttr1 = (TTree*)trackerFile2b->Get("TrkLevel1"); |
6741 |
|
ctrk->AddFriend("CalibTrk1", trackcalibFile1); |
6742 |
|
ctrk->AddFriend("CalibTrk2", trackcalibFile2); |
6743 |
|
printf("Show the Tracker detector, LEVEL1 data \n"); |
6744 |
|
TRKLEV = 1; |
6745 |
|
trk1noev = ttr1->GetEntries(); |
6746 |
|
}; |
6747 |
|
}; |
6748 |
|
}; |
6749 |
|
level.track = TRKLEV; |
6750 |
|
level.track2 = STRACK; |
6751 |
|
} else { |
6752 |
|
level.track = -10; |
6753 |
|
level.track2 = -10; |
6754 |
}; |
}; |
6755 |
// |
// |
6756 |
Int_t CALOLEV = 0; |
Int_t CALOLEV = 0; |
6757 |
if ( CALO ) { |
if ( var.CALO ) { |
6758 |
if ( FORCELEV == 0 ){ |
if ( FORCELEV == 0 ){ |
6759 |
caloFile = emigetFile(filename, "Calorimeter"); |
caloFile = emigetFile(filename, "Calorimeter"); |
6760 |
if ( !caloFile ){ |
if ( !caloFile ){ |
6761 |
printf("WARNING: no calorimeter file! \n"); |
printf("WARNING: no calorimeter file! \n"); |
6762 |
CALO = 0; |
pamgui->DIALOG(1," No calorimeter file! "); |
6763 |
|
var.CALO = 0; |
6764 |
} else { |
} else { |
6765 |
otr->AddFriend("Calorimeter", caloFile); |
otr->AddFriend("Calorimeter", caloFile); |
6766 |
printf("Show the Calorimeter detector, LEVEL0 data \n"); |
printf("Show the Calorimeter detector, LEVEL0 data \n"); |
6772 |
caloFile = emigetFile(filename, "Calorimeter"); |
caloFile = emigetFile(filename, "Calorimeter"); |
6773 |
if ( !caloFile ){ |
if ( !caloFile ){ |
6774 |
printf("WARNING: no calorimeter file! \n"); |
printf("WARNING: no calorimeter file! \n"); |
6775 |
CALO = 0; |
pamgui->DIALOG(1," No calorimeter file! "); |
6776 |
|
var.CALO = 0; |
6777 |
} else { |
} else { |
6778 |
otr->AddFriend("Calorimeter", caloFile); |
otr->AddFriend("Calorimeter", caloFile); |
6779 |
printf("Show the Calorimeter detector, try to generate LEVEL1 data \n"); |
printf("Show the Calorimeter detector, try to generate LEVEL1 data \n"); |
6785 |
CALOLEV = 1; |
CALOLEV = 1; |
6786 |
}; |
}; |
6787 |
}; |
}; |
6788 |
|
level.calo = CALOLEV; |
6789 |
|
level.calol2 = -10; |
6790 |
|
} else { |
6791 |
|
level.calo = -10; |
6792 |
|
level.calol2 = -10; |
6793 |
}; |
}; |
6794 |
// |
// |
6795 |
if ( ND ) { |
if ( var.ND ) { |
6796 |
neutronFile = emigetFile(filename, "Neutron"); |
neutronFile = emigetFile(filename, "Neutron"); |
6797 |
if ( !neutronFile ){ |
if ( !neutronFile ){ |
6798 |
printf("WARNING: no neutron detector file! \n"); |
printf("WARNING: no neutron detector file! \n"); |
6799 |
ND = 0; |
pamgui->DIALOG(1," No neutron detector file! "); |
6800 |
|
var.ND = 0; |
6801 |
} else { |
} else { |
6802 |
otr->AddFriend("Neutron", neutronFile); |
otr->AddFriend("Neutron", neutronFile); |
6803 |
printf("Show the Neutron detector, LEVEL0 data \n"); |
printf("Show the Neutron detector, LEVEL0 data \n"); |
6804 |
}; |
}; |
6805 |
|
level.nd = 0; |
6806 |
|
} else { |
6807 |
|
level.nd = -10; |
6808 |
}; |
}; |
6809 |
// |
// |
6810 |
if ( AC ) { |
if ( var.AC ) { |
6811 |
if ( FORCELEV == 0 ){ |
if ( FORCELEV == 0 ){ |
6812 |
acFile = emigetFile(filename, "Anticounter"); |
acFile = emigetFile(filename, "Anticounter"); |
6813 |
if ( !acFile ){ |
if ( !acFile ){ |
6814 |
printf("WARNING: no AC file! \n"); |
printf("WARNING: no AC file! \n"); |
6815 |
AC = 0; |
pamgui->DIALOG(1," No anticounters file! "); |
6816 |
|
var.AC = 0; |
6817 |
} else { |
} else { |
6818 |
otr->AddFriend("Anticounter", acFile); |
otr->AddFriend("Anticounter", acFile); |
6819 |
printf("Show the Anticoincidence detector, LEVEL 0 data\n"); |
printf("Show the Anticoincidence detector, LEVEL 0 data\n"); |
6825 |
acFile = emigetFile(filename, "Anticounter"); |
acFile = emigetFile(filename, "Anticounter"); |
6826 |
if ( !acFile ){ |
if ( !acFile ){ |
6827 |
printf("WARNING: no AC file! \n"); |
printf("WARNING: no AC file! \n"); |
6828 |
AC = 0; |
pamgui->DIALOG(1," No anticounters file! "); |
6829 |
|
var.AC = 0; |
6830 |
} else { |
} else { |
6831 |
otr->AddFriend("Anticounter", acFile); |
otr->AddFriend("Anticounter", acFile); |
6832 |
printf("Show the Anticoincidence detector, LEVEL 0 data\n"); |
printf("Show the Anticoincidence detector, LEVEL 0 data\n"); |
6838 |
ACLEV = 1; |
ACLEV = 1; |
6839 |
}; |
}; |
6840 |
}; |
}; |
6841 |
|
level.ac = ACLEV; |
6842 |
|
} else { |
6843 |
|
level.ac = -10; |
6844 |
}; |
}; |
6845 |
Int_t S4LEV = 0; |
Int_t S4LEV = 0; |
6846 |
if ( S4 ) { |
if ( var.S4 ) { |
6847 |
s4File = emigetFile(filename, "S4"); |
s4File = emigetFile(filename, "S4"); |
6848 |
if ( !s4File ){ |
if ( !s4File ){ |
6849 |
printf("WARNING: no S4 file! \n"); |
printf("WARNING: no S4 file! \n"); |
6850 |
S4 = 0; |
pamgui->DIALOG(1," No S4 file! "); |
6851 |
|
var.S4 = 0; |
6852 |
} else { |
} else { |
6853 |
otr->AddFriend("S4", s4File); |
otr->AddFriend("S4", s4File); |
6854 |
if ( FORCELEV != 0 ){ |
if ( FORCELEV != 0 ){ |
6859 |
S4LEV = 0; |
S4LEV = 0; |
6860 |
}; |
}; |
6861 |
}; |
}; |
6862 |
|
level.s4 = S4LEV; |
6863 |
|
} else { |
6864 |
|
level.s4 = -10; |
6865 |
}; |
}; |
6866 |
// |
// |
6867 |
Int_t TOFLEV = 0; |
Int_t TOFLEV = 0; |
6868 |
if ( TOF ) { |
if ( var.TOF ) { |
6869 |
if ( FORCELEV != 0 ){ |
if ( FORCELEV != 0 ){ |
6870 |
tofFileL1 = emigetFile(filename, "Physics.Level1","TofTrigger"); |
tofFileL1 = emigetFile(filename, "Physics.Level1","TofTrigger"); |
6871 |
if ( !tofFileL1 ){ |
if ( !tofFileL1 ){ |
6872 |
tofFile = emigetFile(filename, "Tof"); |
tofFile = emigetFile(filename, "Tof"); |
6873 |
if ( !tofFile ){ |
if ( !tofFile ){ |
6874 |
printf("WARNING: no TOF file! \n"); |
printf("WARNING: no TOF file! \n"); |
6875 |
|
pamgui->DIALOG(1," No TOF file! "); |
6876 |
printf("Show the Time of Flight detector, LEVEL0 (trigger board) data\n"); |
printf("Show the Time of Flight detector, LEVEL0 (trigger board) data\n"); |
6877 |
// TOF = 0; |
// var.TOF = 0; |
6878 |
TOFLEV = 0; |
TOFLEV = 0; |
6879 |
} else { |
} else { |
6880 |
otr->AddFriend("Tof", tofFile); |
otr->AddFriend("Tof", tofFile); |
6891 |
printf("Show the Time of Flight detector, LEVEL0 data\n"); |
printf("Show the Time of Flight detector, LEVEL0 data\n"); |
6892 |
TOFLEV = 0; |
TOFLEV = 0; |
6893 |
}; |
}; |
6894 |
|
level.tof = TOFLEV; |
6895 |
|
} else { |
6896 |
|
level.tof = -10; |
6897 |
}; |
}; |
6898 |
// |
// |
6899 |
printf("\n"); |
printf("\n"); |
6908 |
if (nevents<=0) { |
if (nevents<=0) { |
6909 |
headerFile->Close(); |
headerFile->Close(); |
6910 |
triggerFile->Close(); |
triggerFile->Close(); |
6911 |
if ( TRK ) trackerFile->Close(); |
if ( var.TRK ) trackerFile->Close(); |
6912 |
if ( CALO )caloFile->Close(); |
if ( var.CALO )caloFile->Close(); |
6913 |
if ( ND ) neutronFile->Close(); |
if ( var.ND ) neutronFile->Close(); |
6914 |
if ( AC ) acFile->Close(); |
if ( var.AC ) acFile->Close(); |
6915 |
if ( TOF ) tofFile->Close(); |
if ( var.TOF ) tofFile->Close(); |
6916 |
if ( S4 ) s4File->Close(); |
if ( var.S4 ) s4File->Close(); |
6917 |
printf("The file is empty, exiting...\n"); |
printf("The file is empty, exiting...\n"); |
6918 |
return; |
pamgui->DIALOG(0," The file contains no physics data! "); |
6919 |
|
var.waitforever = true; |
6920 |
|
goto refresh; |
6921 |
} |
} |
6922 |
// |
// |
6923 |
// Define some variables |
if ( var.SHOWDEC ){ |
|
// |
|
|
Int_t OBT = 0; |
|
|
Int_t DOBT = 0; |
|
|
Int_t ifout = 0; |
|
|
Int_t OOBT = 0; |
|
|
// |
|
|
if ( calcalibfile == "" ) calcalibfile = filename; |
|
|
if ( outDir == "" ) outDir = filename; |
|
|
// |
|
|
struct Variables var; |
|
|
// |
|
|
if ( SHOWDEC ){ |
|
6924 |
var.nosig = 1; |
var.nosig = 1; |
6925 |
} else { |
} else { |
6926 |
var.nosig = 0; |
var.nosig = 0; |
6927 |
}; |
}; |
6928 |
// |
// |
|
// here windows dimension (based on the computer screen size) and position and dimension of figures |
|
|
// |
|
|
Int_t xw, yw; |
|
|
UInt_t ww, hw; |
|
|
gVirtualX->GetWindowSize(gClient->GetRoot()->GetId(),xw,yw,ww,hw); |
|
|
Float_t winx = (float)ww*0.95; |
|
|
Float_t winy = (float)hw*0.95; |
|
|
Float_t winrap = winx/winy; |
|
|
var.bw = 0; |
|
|
if ( BW ) var.bw = 1; |
|
|
var.xxvc = 0.17; |
|
|
var.yxvc = 0.44; |
|
|
var.xyvc = 0.83; |
|
|
var.yyvc = 0.44; |
|
|
// |
|
|
var.sfx = 0.82/winrap; |
|
|
var.sfy = 0.82; |
|
|
// |
|
|
var.nds4 = 0.4; |
|
|
//var.nds4 = 0.85/winrap; |
|
|
var.xcat = 0.5; |
|
|
var.ycat = 0.74; |
|
|
// |
|
|
var.tracknds4 = 1; |
|
|
// |
|
6929 |
// READ the CALORIMETER ADC to MIP conversion table (if trying to generate level1 data) |
// READ the CALORIMETER ADC to MIP conversion table (if trying to generate level1 data) |
6930 |
// |
// |
6931 |
Float_t mip[2][22][96]; |
if ( !var.refresh ){ |
6932 |
Int_t okcalo = 0; |
if ( !CALOLEV && var.CALO ){ |
|
TTree *ctree = 0; |
|
|
TFile *chfile; |
|
|
CalorimeterCalibration *ccalo = 0; |
|
|
Long64_t cnevents = 0; |
|
|
if ( !CALOLEV && CALO ){ |
|
6933 |
chfile = new TFile(calfile.str().c_str(),"READ","Calorimeter CALIBRATION data"); |
chfile = new TFile(calfile.str().c_str(),"READ","Calorimeter CALIBRATION data"); |
6934 |
if ( chfile->IsZombie() ){ |
if ( chfile->IsZombie() ){ |
6935 |
printf(" WARNING: no calorimeter calibration file! \n Using 26 as conversion factor for all strips. \n"); |
printf(" WARNING: no calorimeter calibration file! \n Using 26 as conversion factor for all strips. \n"); |
6936 |
okcalo = 0; |
okcalo = 0; |
6937 |
} else { |
} else { |
6938 |
okcalo = 1; |
okcalo = 1; |
6939 |
ctree = (TTree*)chfile->Get("CaloADC"); |
ctree = (TTree*)chfile->Get("CaloADC"); |
6940 |
ctree->SetBranchAddress("Event", &ccalo); |
ctree->SetBranchAddress("Event", &ccalo); |
6941 |
// |
// |
6942 |
cnevents = ctree->GetEntries(); |
cnevents = ctree->GetEntries(); |
6943 |
ctree->GetEntry(cnevents-1); |
ctree->GetEntry(cnevents-1); |
6944 |
}; |
}; |
6945 |
// |
// |
6946 |
if ( okcalo ) { |
if ( okcalo ) { |
6947 |
for (Int_t m = 0; m < 2 ; m++ ){ |
for (Int_t m = 0; m < 2 ; m++ ){ |
6948 |
for (Int_t k = 0; k < 22; k++ ){ |
for (Int_t k = 0; k < 22; k++ ){ |
6949 |
for (Int_t l = 0; l < 96; l++ ){ |
for (Int_t l = 0; l < 96; l++ ){ |
6950 |
if ( (ccalo->fp[1][m][k][l] > 20. && ccalo->fp[1][m][k][l] < 32.) || ccalo->mask[m][k][l] == 1. ) { |
if ( (ccalo->fp[1][m][k][l] > 20. && ccalo->fp[1][m][k][l] < 32.) || ccalo->mask[m][k][l] == 1. ) { |
6951 |
if ( ccalo->mip[m][k][l] != 0. ){ |
if ( ccalo->mip[m][k][l] != 0. ){ |
6952 |
mip[m][k][l] = ccalo->mip[m][k][l]; |
mip[m][k][l] = ccalo->mip[m][k][l]; |
6953 |
} else { |
} else { |
6954 |
mip[m][k][l] = 26. ; |
mip[m][k][l] = 26. ; |
6955 |
}; |
}; |
6956 |
} else { |
} else { |
6957 |
mip[m][k][l] = 26. ; |
mip[m][k][l] = 26. ; |
|
}; |
|
|
}; |
|
6958 |
}; |
}; |
6959 |
|
}; |
6960 |
}; |
}; |
6961 |
|
}; |
6962 |
} else { |
} else { |
6963 |
for (Int_t m = 0; m < 2 ; m++ ){ |
for (Int_t m = 0; m < 2 ; m++ ){ |
6964 |
for (Int_t k = 0; k < 22; k++ ){ |
for (Int_t k = 0; k < 22; k++ ){ |
6965 |
for (Int_t l = 0; l < 96; l++ ){ |
for (Int_t l = 0; l < 96; l++ ){ |
6966 |
mip[m][k][l] = 26. ; |
mip[m][k][l] = 26. ; |
6967 |
}; |
}; |
6968 |
}; |
}; |
6969 |
}; |
}; |
6970 |
}; |
}; |
6971 |
chfile->Close(); |
chfile->Close(); |
6972 |
|
}; |
6973 |
}; |
}; |
6974 |
// |
// |
6975 |
// Check that given input are inside the boundary conditions |
// Check that given input are inside the boundary conditions |
6976 |
// |
// |
6977 |
if ( fromevent > toevent && toevent ){ |
if ( fromevent > toevent && toevent ){ |
6978 |
printf("It must be fromevent < toevent \n"); |
printf("It must be fromevent < toevent \n"); |
6979 |
return; |
return; |
6980 |
}; |
}; |
7000 |
}; |
}; |
7001 |
}; |
}; |
7002 |
// |
// |
|
// book the canvas |
|
|
// |
|
|
TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy); |
|
|
TLatex *text=new TLatex(); |
|
|
stringstream testo; |
|
|
stringstream testo2; |
|
|
stringstream testo3; |
|
|
figure->Range(0.,0.,1.,1.); |
|
|
gStyle->SetOptDate(0); |
|
|
gStyle->SetOptStat(0); |
|
|
gStyle->SetLabelSize(0); |
|
|
gStyle->SetNdivisions(1,"X"); |
|
|
gStyle->SetNdivisions(1,"Y"); |
|
|
// |
|
|
stringstream libload; |
|
|
Int_t doflag = 1; |
|
|
Int_t thefirst = 1; |
|
|
Int_t trackdone1 = 0; |
|
|
Int_t trackdone2 = 0; |
|
|
Int_t seldone = 0; |
|
|
Float_t headc = 0.; |
|
|
Float_t headcold = 0.; |
|
|
Int_t i = minevent; |
|
|
Int_t OK = 0; |
|
|
Int_t jumpto = 0; |
|
7003 |
// |
// |
7004 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
7005 |
otr->GetEntry(maxevent); |
otr->GetEntry(maxevent); |
7008 |
otr->GetEntry(minevent); |
otr->GetEntry(minevent); |
7009 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
7010 |
Int_t firstevno = (int)ph->GetCounter(); |
Int_t firstevno = (int)ph->GetCounter(); |
7011 |
struct Calib calib; |
if ( !var.refresh ) i = minevent; |
7012 |
Int_t b[4]; |
var.refresh = false; |
|
Int_t si = 0; |
|
7013 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
7014 |
// MAIN LOOP STARTS HERE: run over all the events |
// MAIN LOOP STARTS HERE: run over all the events |
7015 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
7016 |
while ( i < maxevent+1 ){ |
// while ( i < maxevent+1 ){ |
7017 |
|
while ( 1 ){ |
7018 |
|
// |
7019 |
|
// update progress bar |
7020 |
|
// |
7021 |
|
if ( popup ) pamgui->increment((float)(i+1)*100./(float)nevents); |
7022 |
// |
// |
7023 |
// clear canvas and variables |
// clear canvas and variables |
7024 |
// |
// |
7047 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
7048 |
Int_t cjumpto = (int)ph->GetCounter(); |
Int_t cjumpto = (int)ph->GetCounter(); |
7049 |
if ( cjumpto == jumpto ) jumpto = 0; |
if ( cjumpto == jumpto ) jumpto = 0; |
7050 |
if ( jumpto && i == maxevent ) { |
if ( jumpto && (i == maxevent || i == si) ) { |
7051 |
i = si; |
if ( var.jumpen && i == maxevent ) { |
7052 |
printf(" WARNING: NO EVENT WITH EVENT NUMBER %i \n",jumpto); |
i = -1; |
7053 |
jumpto = 0; |
var.jumpen = false; |
7054 |
|
} else { |
7055 |
|
i = si; |
7056 |
|
printf(" WARNING: NO EVENT WITH EVENT NUMBER %i \n",jumpto); |
7057 |
|
stringstream dialog; |
7058 |
|
dialog.str(""); |
7059 |
|
dialog << " No event with event number "; |
7060 |
|
dialog << jumpto; |
7061 |
|
pamgui->DIALOG(1,dialog.str().c_str()); |
7062 |
|
jumpto = 0; |
7063 |
|
}; |
7064 |
}; |
}; |
7065 |
}; |
}; |
7066 |
// |
// |
7067 |
OK = 0; |
isOK = 0; |
7068 |
if ( !selection || ( i == minevent && !seldone) ){ |
if ( !selection || ( i == minevent && !seldone) || ( i == minevent || i == maxevent )){ |
7069 |
OK = 1; |
if ( i == minevent && selection && seldone && doflag==2) pamgui->DIALOG(1," Stop searching, first event reached "); |
7070 |
|
if ( i == maxevent && selection ) pamgui->DIALOG(1," Stop searching, last event reached "); |
7071 |
|
isOK = 1; |
7072 |
seldone = 1; |
seldone = 1; |
7073 |
} else { |
} else { |
7074 |
OK = 0; |
isOK = 0; |
7075 |
#if defined (__CINT__) |
#if defined (__CINT__) |
7076 |
OK = filter(i,otr,ttr,level); |
isOK = filter(i,otr,ttr,level); |
7077 |
#endif |
#endif |
7078 |
#if !defined (__CINT__) |
#if !defined (__CINT__) |
7079 |
stringstream cintcom; |
stringstream cintcom; |
7094 |
cintcom << "struct Levels &level = (struct Levels &)0x" << hex; |
cintcom << "struct Levels &level = (struct Levels &)0x" << hex; |
7095 |
cintcom << &level; |
cintcom << &level; |
7096 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
7097 |
OK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level);"); |
isOK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level);"); |
7098 |
#endif |
#endif |
7099 |
seldone = 1; |
seldone = 1; |
7100 |
printf("Scanning data: %d%c done",100*(i-minevent)/(maxevent-minevent),37); |
printf("Scanning data: %d%c done",100*(i-minevent)/(maxevent-minevent),37); |
7103 |
// |
// |
7104 |
// if the event is selected go on |
// if the event is selected go on |
7105 |
// |
// |
7106 |
if ( OK && !jumpto ) { |
if ( isOK && !jumpto ) { |
7107 |
|
if ( var.doflag == 3 ) selection = 1; |
7108 |
printf("\n"); |
printf("\n"); |
7109 |
figure->Clear(); |
figure->Clear(); |
7110 |
figure->SetFillColor(10); |
figure->SetFillColor(10); |
7157 |
// |
// |
7158 |
// show TOF |
// show TOF |
7159 |
// |
// |
7160 |
if ( TOF ){ |
if ( var.TOF ){ |
7161 |
figure->cd(); |
figure->cd(); |
7162 |
if ( TOFLEV == 0 ){ |
if ( TOFLEV == 0 ){ |
7163 |
ShowTOF(i,otr,var); |
ShowTOF(i,otr,var); |
7168 |
level.tof = 0; |
level.tof = 0; |
7169 |
}; |
}; |
7170 |
if ( TOFLEV == 1 ){ |
if ( TOFLEV == 1 ){ |
7171 |
ShowTOFL1(i,toftr,var); |
ShowTOFL1(i,toftr,var,pamgui); |
7172 |
level.tof = 1; |
level.tof = 1; |
7173 |
}; |
}; |
7174 |
}; |
}; |
7175 |
// |
// |
7176 |
// show anticounters |
// show anticounters |
7177 |
// |
// |
7178 |
if ( AC ){ |
if ( var.AC ){ |
7179 |
figure->cd(); |
figure->cd(); |
7180 |
if ( ACLEV == 0 ){ |
if ( ACLEV == 0 ){ |
7181 |
ShowAC(i,otr,var,0); |
ShowAC(i,otr,var,0); |
7189 |
// |
// |
7190 |
// show S4 |
// show S4 |
7191 |
// |
// |
7192 |
if ( S4 ){ |
if ( var.S4 ){ |
7193 |
figure->cd(); |
figure->cd(); |
7194 |
if ( S4LEV == 0 ){ |
if ( S4LEV == 0 ){ |
7195 |
ShowS4L0(i,otr,var); |
ShowS4L0(i,otr,var); |
7204 |
// |
// |
7205 |
// show neutron detector |
// show neutron detector |
7206 |
// |
// |
7207 |
if ( ND ){ |
if ( var.ND ){ |
7208 |
figure->cd(); |
figure->cd(); |
7209 |
ShowND(i,otr,var); |
ShowND(i,otr,var); |
7210 |
level.nd = 0; |
level.nd = 0; |
7212 |
// |
// |
7213 |
// show tracker |
// show tracker |
7214 |
// |
// |
7215 |
if ( TRK ){ |
if ( var.TRK ){ |
7216 |
// |
// |
7217 |
// if we have level2 data show the track |
// if we have level2 data show the track |
7218 |
// |
// |
7254 |
}; |
}; |
7255 |
level.track2 = 1; |
level.track2 = 1; |
7256 |
figure->cd(); |
figure->cd(); |
7257 |
ShowTRACK(i,ttr,var); |
ShowTRACK(i,ttr,var,pamgui); |
7258 |
|
} else { |
7259 |
|
level.track2 = 0; |
7260 |
}; |
}; |
7261 |
// |
// |
7262 |
// show level1 data |
// show level1 data |
7307 |
}; |
}; |
7308 |
}; |
}; |
7309 |
}; |
}; |
7310 |
ShowTRKL1(i,ttr1,var); |
ShowTRKL1(i,ttr1,var,pamgui); |
7311 |
}; |
}; |
7312 |
// |
// |
7313 |
// if everything fails, show at least level0 data |
// if everything fails, show at least level0 data |
7320 |
// |
// |
7321 |
// show calorimeter |
// show calorimeter |
7322 |
// |
// |
7323 |
if ( CALO ){ |
if ( var.CALO ){ |
7324 |
figure->cd(); |
figure->cd(); |
7325 |
// |
// |
7326 |
// if we have LEVEL1 data |
// if we have LEVEL1 data |
7380 |
// |
// |
7381 |
// SHOW INFOS |
// SHOW INFOS |
7382 |
// |
// |
7383 |
if ( INFOS ){ |
if ( var.INFOS ){ |
7384 |
figure->cd(); |
figure->cd(); |
7385 |
text->SetTextAngle(0); |
text->SetTextAngle(0); |
7386 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7440 |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
7441 |
txthi -= 0.03; |
txthi -= 0.03; |
7442 |
testo3.str(""); |
testo3.str(""); |
7443 |
testo3 << "S4: " << setprecision(2); |
testo3 << "S4: ";// << setprecision(2); |
7444 |
testo3 << var.s4sig << " [MIP] TOF: #beta(1,...,5) = ("; |
testo3 << var.s4sig << " [MIP] TOF: #beta(1,...,5) = ("; |
7445 |
testo3 << setprecision(3) << var.beta[0]; |
testo3 << setprecision(3) << var.beta[0]; |
7446 |
testo3 << ","; |
testo3 << ","; |
7455 |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
7456 |
txthi -= 0.03; |
txthi -= 0.03; |
7457 |
testo3.str(""); |
testo3.str(""); |
7458 |
testo3 << "ND: Trigger: neutrons = " << var.trup; |
testo3 << "ND: Trig: " << var.trup; |
7459 |
testo3 << " - Background: upper = " << var.bkup; |
testo3 << " - Bckgr: upper = " << var.bkup; |
7460 |
testo3 << " lower = " << var.bkbo; |
testo3 << " lower = " << var.bkbo; |
7461 |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
7462 |
txthi -= 0.03; |
txthi -= 0.03; |
7465 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7466 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc+0.075*var.sfy,"CPU SIDE"); |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc+0.075*var.sfy,"CPU SIDE"); |
7467 |
text->DrawLatex(var.xyvc-0.17*var.sfx,var.yyvc+0.075*var.sfy,"VME SIDE"); |
text->DrawLatex(var.xyvc-0.17*var.sfx,var.yyvc+0.075*var.sfy,"VME SIDE"); |
7468 |
if ( AC || TRK ){ |
if ( var.AC ){ |
7469 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7470 |
text->DrawLatex(var.xcat-0.235*var.sfx,var.ycat-0.025*var.sfy,"VME SIDE"); |
text->DrawLatex(var.xcat-0.235*var.sfx,var.ycat-0.025*var.sfy,"VME SIDE"); |
7471 |
text->DrawLatex(var.xcat+0.235*var.sfx,var.ycat-0.025*var.sfy,"CPU SIDE"); |
text->DrawLatex(var.xcat+0.235*var.sfx,var.ycat-0.025*var.sfy,"CPU SIDE"); |
7500 |
// |
// |
7501 |
text->SetTextSize(0.015); |
text->SetTextSize(0.015); |
7502 |
text->SetTextFont(2); |
text->SetTextFont(2); |
7503 |
DrawX(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,0.005,var); |
DrawX(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,0.005,var); //508 |
7504 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7505 |
text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.508*var.sfy,"y"); |
text->DrawLatex(var.xxvc-0.266*var.sfx,var.yxvc-0.328*var.sfy,"y"); |
7506 |
TArrow *arr; |
TArrow *arr; |
7507 |
arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.19*var.sfx,var.yxvc-0.508*var.sfy); |
arr = new TArrow(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,var.xxvc-0.21*var.sfx,var.yxvc-0.328*var.sfy); |
7508 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7509 |
arr->Draw(); |
arr->Draw(); |
7510 |
text->DrawLatex(var.xxvc-0.19*var.sfx,var.yxvc-0.515*var.sfy,"x"); |
text->DrawLatex(var.xxvc-0.21*var.sfx,var.yxvc-0.335*var.sfy,"x"); |
7511 |
arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.23*var.sfx,var.yxvc-0.468*var.sfy); |
arr = new TArrow(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,var.xxvc-0.25*var.sfx,var.yxvc-0.288*var.sfy); |
7512 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7513 |
arr->Draw(); |
arr->Draw(); |
7514 |
text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.468*var.sfy,"z"); |
text->DrawLatex(var.xxvc-0.266*var.sfx,var.yxvc-0.288*var.sfy,"z"); |
7515 |
// |
// |
7516 |
text->SetTextSize(0.015); |
text->SetTextSize(0.015); |
7517 |
text->SetTextFont(2); |
text->SetTextFont(2); |
7518 |
DrawX(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,0.005,var); |
DrawX(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,0.005,var); |
7519 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7520 |
text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.508*var.sfy,"x"); |
text->DrawLatex(var.xyvc+0.25*var.sfx,var.yyvc-0.328*var.sfy,"x"); |
7521 |
arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.18*var.sfx,var.yyvc-0.508*var.sfy); |
arr = new TArrow(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,var.xyvc+0.2*var.sfx,var.yyvc-0.328*var.sfy); |
7522 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7523 |
arr->Draw(); |
arr->Draw(); |
7524 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.511*var.sfy,"y"); |
text->DrawLatex(var.xyvc+0.19*var.sfx,var.yyvc-0.335*var.sfy,"y"); |
7525 |
arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.22*var.sfx,var.yyvc-0.468*var.sfy); |
arr = new TArrow(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,var.xyvc+0.24*var.sfx,var.yyvc-0.288*var.sfy); |
7526 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7527 |
arr->Draw(); |
arr->Draw(); |
7528 |
text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.468*var.sfy,"z"); |
text->DrawLatex(var.xyvc+0.25*var.sfx,var.yyvc-0.288*var.sfy,"z"); |
7529 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7530 |
|
// |
7531 |
|
/* text->SetTextSize(0.015); */ |
7532 |
|
/* text->SetTextFont(2); */ |
7533 |
|
/* DrawX(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,0.005,var); */ |
7534 |
|
/* text->SetTextFont(32); */ |
7535 |
|
/* text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.508*var.sfy,"y"); */ |
7536 |
|
/* TArrow *arr; */ |
7537 |
|
/* arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.19*var.sfx,var.yxvc-0.508*var.sfy); */ |
7538 |
|
/* arr->SetArrowSize(0.005); */ |
7539 |
|
/* arr->Draw(); */ |
7540 |
|
/* text->DrawLatex(var.xxvc-0.19*var.sfx,var.yxvc-0.515*var.sfy,"x"); */ |
7541 |
|
/* arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.23*var.sfx,var.yxvc-0.468*var.sfy); */ |
7542 |
|
/* arr->SetArrowSize(0.005); */ |
7543 |
|
/* arr->Draw(); */ |
7544 |
|
/* text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.468*var.sfy,"z"); */ |
7545 |
|
/* // */ |
7546 |
|
/* text->SetTextSize(0.015); */ |
7547 |
|
/* text->SetTextFont(2); */ |
7548 |
|
/* DrawX(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,0.005,var); */ |
7549 |
|
/* text->SetTextFont(32); */ |
7550 |
|
/* text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.508*var.sfy,"x"); */ |
7551 |
|
/* arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.18*var.sfx,var.yyvc-0.508*var.sfy); */ |
7552 |
|
/* arr->SetArrowSize(0.005); */ |
7553 |
|
/* arr->Draw(); */ |
7554 |
|
/* text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.511*var.sfy,"y"); */ |
7555 |
|
/* arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.22*var.sfx,var.yyvc-0.468*var.sfy); */ |
7556 |
|
/* arr->SetArrowSize(0.005); */ |
7557 |
|
/* arr->Draw(); */ |
7558 |
|
/* text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.468*var.sfy,"z"); */ |
7559 |
|
/* text->SetTextSize(0.01); */ |
7560 |
}; |
}; |
7561 |
// |
// |
7562 |
// SHOW PALETTE |
// SHOW PALETTE |
7563 |
// |
// |
7564 |
if ( PALETTE ) ShowPalette(var.bw); |
if ( var.PALETTE ) ShowPalette(var.bw); |
7565 |
// |
// |
7566 |
// SHOW VERBOSE INFOS |
// SHOW VERBOSE INFOS |
7567 |
// |
// |
7568 |
if ( VINFOS ){ |
if ( var.VINFOS ){ |
7569 |
figure->cd(); |
figure->cd(); |
7570 |
text->SetTextAngle(0); |
text->SetTextAngle(0); |
7571 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7572 |
text->SetTextColor(1); |
text->SetTextColor(1); |
7573 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7574 |
text->SetTextAlign(12); |
text->SetTextAlign(12); |
7575 |
if ( AC ){ |
if ( var.AC ){ |
7576 |
// |
// |
7577 |
// Plane view |
// Plane view |
7578 |
// |
// |
7610 |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
7611 |
text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.39*var.sfy,"CAT1"); |
text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.39*var.sfy,"CAT1"); |
7612 |
}; |
}; |
7613 |
if ( CALO ){ |
if ( var.CALO ){ |
7614 |
text->SetTextSize(0.020); |
text->SetTextSize(0.020); |
7615 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7616 |
text->DrawLatex(var.xxvc-0.22*var.sfx,var.yxvc-0.290*var.sfy,"Calorimeter"); |
text->DrawLatex(var.xxvc-0.22*var.sfx,var.yxvc-0.290*var.sfy,"Calorimeter"); |
7618 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7619 |
text->SetTextAngle(0); |
text->SetTextAngle(0); |
7620 |
}; |
}; |
7621 |
if ( TRK ){ |
if ( var.TRK ){ |
7622 |
text->SetTextSize(0.020); |
text->SetTextSize(0.020); |
7623 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7624 |
text->DrawLatex(var.xxvc-0.22*var.sfx,var.yxvc+0.080*var.sfy,"Tracker"); |
text->DrawLatex(var.xxvc-0.22*var.sfx,var.yxvc+0.080*var.sfy,"Tracker"); |
7626 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7627 |
text->SetTextAngle(0); |
text->SetTextAngle(0); |
7628 |
}; |
}; |
7629 |
if ( ND ){ |
if ( var.ND ){ |
7630 |
text->SetTextSize(0.020); |
text->SetTextSize(0.020); |
7631 |
text->SetTextAngle(90); |
// text->SetTextAngle(90); |
7632 |
text->DrawLatex(var.xxvc-0.22*var.sfx,var.yxvc-0.430*var.sfy,"ND"); |
text->DrawLatex(var.xxvc-0.25*var.sfx,var.yxvc-0.530*var.sfy,"ND"); |
7633 |
text->DrawLatex(var.xyvc+0.22*var.sfx,var.yyvc-0.430*var.sfy,"ND"); |
text->DrawLatex(var.xyvc+0.22*var.sfx,var.yyvc-0.530*var.sfy,"ND"); |
7634 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7635 |
text->SetTextAngle(0); |
text->SetTextAngle(0); |
7636 |
}; |
}; |
7637 |
if ( TOF ){ |
if ( var.TOF ){ |
7638 |
text->SetTextSize(0.020); |
text->SetTextSize(0.020); |
7639 |
text->DrawLatex(var.xxvc-0.24*var.sfx,var.yxvc-0.130*var.sfy,"S3"); |
text->DrawLatex(var.xxvc-0.24*var.sfx,var.yxvc-0.130*var.sfy,"S3"); |
7640 |
text->DrawLatex(var.xxvc-0.24*var.sfx,var.yxvc+0.350*var.sfy,"S2"); |
text->DrawLatex(var.xxvc-0.24*var.sfx,var.yxvc+0.350*var.sfy,"S2"); |
7644 |
text->DrawLatex(var.xyvc+0.21*var.sfx,var.yyvc+0.653*var.sfy,"S1"); |
text->DrawLatex(var.xyvc+0.21*var.sfx,var.yyvc+0.653*var.sfy,"S1"); |
7645 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7646 |
}; |
}; |
7647 |
if ( S4 ){ |
if ( var.S4 ){ |
7648 |
text->SetTextSize(0.020); |
text->SetTextSize(0.020); |
7649 |
text->DrawLatex(var.xxvc-0.24*var.sfx,var.yxvc-0.350*var.sfy,"S4"); |
text->DrawLatex(var.xxvc-0.28*var.sfx,var.yxvc-0.350*var.sfy,"S4"); |
7650 |
text->DrawLatex(var.xyvc+0.21*var.sfx,var.yyvc-0.350*var.sfy,"S4"); |
text->DrawLatex(var.xyvc+0.25*var.sfx,var.yyvc-0.350*var.sfy,"S4"); |
7651 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7652 |
}; |
}; |
7653 |
if ( !INFOS ){ |
if ( !var.INFOS ){ |
7654 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7655 |
text->DrawLatex(var.xxvc-0.025*var.sfx,var.yxvc-0.520*var.sfy,"CPU SIDE"); |
text->DrawLatex(var.xxvc-0.025*var.sfx,var.yxvc-0.520*var.sfy,"CPU SIDE"); |
7656 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7657 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc+0.075*var.sfy,"CPU SIDE"); |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc+0.075*var.sfy,"CPU SIDE"); |
7658 |
text->DrawLatex(var.xyvc-0.17*var.sfx,var.yyvc+0.075*var.sfy,"VME SIDE"); |
text->DrawLatex(var.xyvc-0.17*var.sfx,var.yyvc+0.075*var.sfy,"VME SIDE"); |
7659 |
if ( AC || TRK ){ |
if ( var.AC ){ |
7660 |
text->SetTextAngle(90); |
text->SetTextAngle(90); |
7661 |
text->DrawLatex(var.xcat-0.235*var.sfx,var.ycat-0.025*var.sfy,"VME SIDE"); |
text->DrawLatex(var.xcat-0.235*var.sfx,var.ycat-0.025*var.sfy,"VME SIDE"); |
7662 |
text->DrawLatex(var.xcat+0.235*var.sfx,var.ycat-0.025*var.sfy,"CPU SIDE"); |
text->DrawLatex(var.xcat+0.235*var.sfx,var.ycat-0.025*var.sfy,"CPU SIDE"); |
7691 |
// |
// |
7692 |
text->SetTextSize(0.015); |
text->SetTextSize(0.015); |
7693 |
text->SetTextFont(2); |
text->SetTextFont(2); |
7694 |
DrawX(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,0.005,var); |
DrawX(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,0.005,var); //508 |
7695 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7696 |
text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.508*var.sfy,"y"); |
text->DrawLatex(var.xxvc-0.266*var.sfx,var.yxvc-0.328*var.sfy,"y"); |
7697 |
TArrow *arr; |
TArrow *arr; |
7698 |
arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.19*var.sfx,var.yxvc-0.508*var.sfy); |
arr = new TArrow(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,var.xxvc-0.21*var.sfx,var.yxvc-0.328*var.sfy); |
7699 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7700 |
arr->Draw(); |
arr->Draw(); |
7701 |
text->DrawLatex(var.xxvc-0.19*var.sfx,var.yxvc-0.515*var.sfy,"x"); |
text->DrawLatex(var.xxvc-0.21*var.sfx,var.yxvc-0.335*var.sfy,"x"); |
7702 |
arr = new TArrow(var.xxvc-0.23*var.sfx,var.yxvc-0.508*var.sfy,var.xxvc-0.23*var.sfx,var.yxvc-0.468*var.sfy); |
arr = new TArrow(var.xxvc-0.25*var.sfx,var.yxvc-0.328*var.sfy,var.xxvc-0.25*var.sfx,var.yxvc-0.288*var.sfy); |
7703 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7704 |
arr->Draw(); |
arr->Draw(); |
7705 |
text->DrawLatex(var.xxvc-0.246*var.sfx,var.yxvc-0.468*var.sfy,"z"); |
text->DrawLatex(var.xxvc-0.266*var.sfx,var.yxvc-0.288*var.sfy,"z"); |
7706 |
// |
// |
7707 |
text->SetTextSize(0.015); |
text->SetTextSize(0.015); |
7708 |
text->SetTextFont(2); |
text->SetTextFont(2); |
7709 |
DrawX(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,0.005,var); |
DrawX(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,0.005,var); |
7710 |
text->SetTextFont(32); |
text->SetTextFont(32); |
7711 |
text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.508*var.sfy,"x"); |
text->DrawLatex(var.xyvc+0.25*var.sfx,var.yyvc-0.328*var.sfy,"x"); |
7712 |
arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.18*var.sfx,var.yyvc-0.508*var.sfy); |
arr = new TArrow(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,var.xyvc+0.2*var.sfx,var.yyvc-0.328*var.sfy); |
7713 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7714 |
arr->Draw(); |
arr->Draw(); |
7715 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.511*var.sfy,"y"); |
text->DrawLatex(var.xyvc+0.19*var.sfx,var.yyvc-0.335*var.sfy,"y"); |
7716 |
arr = new TArrow(var.xyvc+0.22*var.sfx,var.yyvc-0.508*var.sfy,var.xyvc+0.22*var.sfx,var.yyvc-0.468*var.sfy); |
arr = new TArrow(var.xyvc+0.24*var.sfx,var.yyvc-0.328*var.sfy,var.xyvc+0.24*var.sfx,var.yyvc-0.288*var.sfy); |
7717 |
arr->SetArrowSize(0.005); |
arr->SetArrowSize(0.005); |
7718 |
arr->Draw(); |
arr->Draw(); |
7719 |
text->DrawLatex(var.xyvc+0.23*var.sfx,var.yyvc-0.468*var.sfy,"z"); |
text->DrawLatex(var.xyvc+0.25*var.sfx,var.yyvc-0.288*var.sfy,"z"); |
7720 |
text->SetTextSize(0.01); |
text->SetTextSize(0.01); |
7721 |
}; |
}; |
7722 |
}; |
}; |
7755 |
// Interact with user: do you want to continue, go backward, exit or print the figure? |
// Interact with user: do you want to continue, go backward, exit or print the figure? |
7756 |
// |
// |
7757 |
printf("\n\n\n\n\n\n\n\n\n\n"); |
printf("\n\n\n\n\n\n\n\n\n\n"); |
7758 |
if ( i != maxevent ) { |
si = i; |
7759 |
si = i; |
doflag = 1; |
7760 |
doflag = 1; |
jumpto = 0; |
7761 |
jumpto = 0; |
var.i = i; |
7762 |
TString figty = "ev"; |
var.doflag = doflag; |
7763 |
var.i = i; |
var.jumpto = jumpto; |
7764 |
var.doflag = doflag; |
var.nevents = nevents; |
7765 |
var.jumpto = jumpto; |
var.lastevno = lastevno; |
7766 |
var.nevents = nevents; |
var.firstevno = firstevno; |
7767 |
var.lastevno = lastevno; |
// |
7768 |
var.firstevno = firstevno; |
char *bw; |
7769 |
Int_t ifout = WhatToDoEV(var,file,outDir,figty,*figure); |
if ( var.bw ){ |
7770 |
i = var.i; |
bw = "_bw"; |
|
doflag = var.doflag; |
|
|
jumpto = var.jumpto; |
|
|
if ( i != si ) OOBT = 1000000000; |
|
|
if ( maxevent < i+1 ) { |
|
|
maxevent = nevents; |
|
|
printf("WARNING: you have chosen an event number out of the starting range.\n Range extended to %i\n\n",maxevent); |
|
|
}; |
|
|
if ( ifout ) goto theend; |
|
7771 |
} else { |
} else { |
7772 |
printf("\n\n"); |
bw = ""; |
7773 |
|
}; |
7774 |
|
TString filenm = file; |
7775 |
|
const string fil = (const char*)filenm; |
7776 |
|
Int_t posiz = fil.find("dw_"); |
7777 |
|
if ( posiz == -1 ) posiz = fil.find("DW_"); |
7778 |
|
Int_t posiz2 = posiz+13; |
7779 |
|
TString file2; |
7780 |
|
stringcopy(file2,filenm,posiz,posiz2); |
7781 |
|
const char *figrec = file2; |
7782 |
|
const char *outdir = outDir; |
7783 |
|
stringstream figsave; |
7784 |
|
figsave.str(""); |
7785 |
|
figsave << outdir << "/"; |
7786 |
|
figsave << figrec; |
7787 |
|
figsave << "_ev_"; |
7788 |
|
figsave << (var.i+1); |
7789 |
|
figsave << bw; |
7790 |
|
var.svas=figsave.str().c_str(); |
7791 |
|
pamgui->upgrnamfi(); |
7792 |
|
// |
7793 |
|
var.jumpen = false; |
7794 |
|
// njumpen = 0; |
7795 |
|
Int_t ifout = 0; |
7796 |
|
figure->SetEditable(kFALSE); |
7797 |
|
while( !var.goon && !var.refresh && !var.restart ) { |
7798 |
|
if ( !gROOT->GetListOfCanvases()->FindObject(figure) ) { |
7799 |
|
pamgui->Close(); |
7800 |
|
gSystem->ProcessEvents(); |
7801 |
|
gApplication->Terminate(0); |
7802 |
|
}; |
7803 |
|
gSystem->ProcessEvents(); |
7804 |
|
}; |
7805 |
|
figure->SetEditable(kTRUE); |
7806 |
|
var.goon = false; |
7807 |
|
if ( var.refresh || var.restart ){ |
7808 |
|
headerFile->Close(); |
7809 |
|
triggerFile->Close(); |
7810 |
|
if ( trackerFile ) trackerFile->Close(); |
7811 |
|
if ( trackerFile2 ) trackerFile2->Close(); |
7812 |
|
if ( caloFile )caloFile->Close(); |
7813 |
|
if ( neutronFile ) neutronFile->Close(); |
7814 |
|
if ( acFile ) acFile->Close(); |
7815 |
|
if ( tofFile ) tofFile->Close(); |
7816 |
|
if ( tofFileL1 ) tofFileL1->Close(); |
7817 |
|
if ( s4File ) s4File->Close(); |
7818 |
|
if ( trackhead ) trackhead->Close(); |
7819 |
|
if ( trackcalibFile1 ) trackcalibFile1->Close(); |
7820 |
|
if ( trackcalibFile2 ) trackcalibFile2->Close(); |
7821 |
|
if ( trackerFile2b ) trackerFile2b->Close(); |
7822 |
|
if ( var.refresh ) goto refresh; |
7823 |
|
if ( var.restart ){ |
7824 |
|
filename = var.thefilename.Data(); |
7825 |
|
pamgui->Close(); |
7826 |
|
goto restart; |
7827 |
|
}; |
7828 |
|
}; |
7829 |
|
// |
7830 |
|
i = var.i; |
7831 |
|
doflag = var.doflag; |
7832 |
|
jumpto = var.jumpto; |
7833 |
|
if ( i != si ) OOBT = 1000000000; |
7834 |
|
if ( maxevent < i ) { |
7835 |
|
maxevent = nevents; |
7836 |
|
printf("WARNING: you have chosen an event number out of the starting range.\n Range extended to %i\n\n",maxevent); |
7837 |
}; |
}; |
7838 |
|
if ( ifout ) goto theend; |
7839 |
}; |
}; |
7840 |
if ( doflag == 2 && i == 0 ) { |
if ( doflag == 2 && i == 0 ) { |
7841 |
printf("\n WARNING: Cannot go backward! Going forward. \n"); |
printf("\n WARNING: Cannot go backward! Going forward. \n"); |
7843 |
}; |
}; |
7844 |
if ( doflag == 2 && i>0 ) i--; |
if ( doflag == 2 && i>0 ) i--; |
7845 |
if ( doflag == 1 ) i++; |
if ( doflag == 1 ) i++; |
7846 |
|
if ( var.doflag == 3 ) selection = 0; |
7847 |
// |
// |
7848 |
// if in selection mode, print out a event progress bar: |
// if in selection mode, print out a event progress bar: |
7849 |
// |
// |