4 #include <TEveElement.h>
5 #include <TEveGeoNode.h>
11 const char*
get_name(
const TEveElement * element ) {
13 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element ))
14 return node->GetName();
15 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element ))
16 return shape->GetName();
19 if (
const TNamed * named = dynamic_cast<const TNamed *>( element ))
20 return named->GetName();
29 if (TEveGeoNode *
node = dynamic_cast<TEveGeoNode *>( element )) {
30 if (
node->NumChildren() == 0 &&
node->GetNode()->GetVolume()->GetNdaughters() > 0) {
31 TIter next(
node->GetNode()->GetVolume()->GetNodes());
33 while ((dnode = (TGeoNode*) next()) != 0) {
34 TEveGeoNode* node_re =
new TEveGeoNode(dnode);
35 node->AddElement(node_re);
49 const TGeoShape *
get_shape(
const TEveElement * element ) {
51 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element )) {
52 return node->GetNode()->GetVolume()->GetShape();
55 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element )) {
56 TEveGeoShape * nc_shape =
const_cast<TEveGeoShape *
>( shape );
57 return const_cast<const TGeoShape *
>( nc_shape->GetShape() );
70 if (TEveGeoShape * shape = dynamic_cast<TEveGeoShape *>( element )) {
71 return shape->GetShape();
77 void set_color( TEveElement * element, Color_t color,
float alpha,
unsigned int levels )
83 element->SetMainColor( color );
84 if (alpha > 1.) alpha = 1.;
85 if (alpha < 0.) alpha = 0.;
86 unsigned char transparency = (
unsigned char) roundf(100. - (alpha * 100.));
87 element->SetMainTransparency( transparency );
92 for (std::list<TEveElement*>::iterator
i = element->BeginChildren();
i != element->EndChildren(); ++
i)
96 element->ElementChanged(
true,
true);
103 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element )) {
104 return ((
node->NumChildren() == 0) and (
node->GetNode()->GetVolume()->GetNdaughters() == 0));
107 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element )) {
108 return (shape->NumChildren() == 0);
111 return (element->NumChildren() == 0);
116 void set_children_visibility( TEveElement * element,
const std::string & node_name,
const std::vector<std::string> & children_name,
bool visibility )
120 if (not name
or strncmp(name, node_name.c_str(), node_name.size()))
124 for (std::list<TEveElement *>::iterator
j = element->BeginChildren();
j != element->EndChildren(); ++
j) {
131 for (
unsigned int i = 0;
i < children_name.size(); ++
i)
132 if (not strncmp(name, children_name[
i].c_str(), children_name[
i].
size())) {
135 child->SetRnrSelf( visibility );
136 child->SetRnrChildren(
false );
138 child->SetRnrSelf(
false );
139 child->SetRnrChildren( visibility );
145 element->ElementChanged(
true,
true);
151 std::vector<std::string>
endcap;
152 endcap.push_back(
"tec:TEC");
153 endcap.push_back(
"tidf:TIDF");
154 endcap.push_back(
"tidb:TIDB");
155 endcap.push_back(
"pixfwd:PixelForwardZPlus");
156 endcap.push_back(
"pixfwd:PixelForwardZMinus");
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void set_children_visibility(TEveElement *element, const std::string &node_name, const std::vector< std::string > &children_name, bool visibility)
const char * get_name(const TEveElement *element)
void set_tracker_endcap_visibility(TEveElement *tracker, bool visibility)
void show_tracker_endcap(TEveElement *tracker)
bool is_leaf_node(const TEveElement *element)
void expand_node(TEveElement *element)
const TGeoShape * get_shape(const TEveElement *element)
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
void hide_tracker_endcap(TEveElement *tracker)
tuple size
Write out results.