-
Notifications
You must be signed in to change notification settings - Fork 31
/
Picker.C
57 lines (55 loc) · 1.43 KB
/
Picker.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "Picker.h"
#include <iostream>
#include <TEveManager.h>
#include <TEveBrowser.h>
#include <TGStatusBar.h>
#include "THKGamma.h"
using std::cout;
void Picker::Picked(TObject* obj)
{
if(obj==NULL)return;
/*
cout<<obj->ClassName()<<endl;
cout<<obj->GetName()<<endl;
cout<<obj->GetTitle()<<endl;
TEveElement *el = dynamic_cast<TEveElement*> (obj);
if(el){
cout<<" converted toTEveElement* "<<endl;
if(el->GetUserData() !=NULL){
cout<<" user data found "<<el->GetUserData()<<endl;
cout<<" user data is <"<<*((TString*)el->GetUserData())<<">"<<endl;
}
else
cout<<" no user data found "<<endl;
}
*/
THKCerenkov *C = dynamic_cast<THKCerenkov*> (obj);
if(C){
C->Describe();
return;
}
THKGamma *g = dynamic_cast<THKGamma*> (obj);
if(g){
g->Describe();
return;
}
THKMCTrack *mc = dynamic_cast<THKMCTrack*> (obj);
if(mc)
{
mc->Describe();
return;
}
THKCerenkov2D *c2 = dynamic_cast< THKCerenkov2D*> (obj);
if(c2)
{
c2->Describe();
return;
}
obj->ls();
cout<<Form("User clicked on: \"%s\"", obj->GetName())<<endl;
cout<<" of class "<<obj->ClassName()<<endl;
//if (obj)
// gEve->GetBrowser()->GetStatusBar()->SetText(Form("User clicked on: \"%s\"", obj->GetName()), 1);
//else
// gEve->GetBrowser()->GetStatusBar()->SetText("", 1);
}