#include <vector>
#include <list>
#include <string>
#include <cmath>
#include <TEveElement.h>
#include <TEveGeoNode.h>
#include <TGeoNode.h>
#include "eve_macros.h"
Go to the source code of this file.
TEveGeoShape* clone |
( |
const TEveElement * |
element, |
|
|
TEveElement * |
parent |
|
) |
| |
Definition at line 135 of file eve_macros.cc.
References clone(), extract(), get_name(), get_shape(), get_title(), and get_transform().
140 shape->SetTransMatrix( matrix.get() );
144 extract.SetShape( (TGeoShape *)
get_shape(element)->Clone() );
145 extract.SetTrans( trans.Array() );
146 extract.SetRnrSelf(
true );
147 extract.SetRnrElements(
true );
149 TEveGeoShape *
clone = TEveGeoShape::ImportShapeExtract( &extract,
parent );
const char * get_title(const TEveElement *element)
const char * get_name(const TEveElement *element)
TGeoMatrix * get_transform(const TEveElement *element)
int extract(std::vector< int > *output, const std::string &dati)
const TGeoShape * get_shape(const TEveElement *element)
void expand_node |
( |
TEveElement * |
element | ) |
|
Definition at line 43 of file eve_macros.cc.
References python.Node::node.
46 if (TEveGeoNode *
node = dynamic_cast<TEveGeoNode *>( element )) {
47 if (
node->GetNChildren() == 0 &&
node->GetNode()->GetVolume()->GetNdaughters() > 0) {
48 TIter next(
node->GetNode()->GetVolume()->GetNodes());
50 while ((dnode = (TGeoNode*) next()) != 0) {
51 TEveGeoNode* node_re =
new TEveGeoNode(dnode);
52 node->AddElement(node_re);
const char* get_name |
( |
const TEveElement * |
element | ) |
|
Definition at line 13 of file eve_macros.cc.
References python.Node::node.
15 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element ))
16 return node->GetName();
17 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element ))
18 return shape->GetName();
21 if (
const TNamed * named = dynamic_cast<const TNamed *>( element ))
22 return named->GetName();
const TGeoShape* get_shape |
( |
const TEveElement * |
element | ) |
|
Definition at line 66 of file eve_macros.cc.
References python.Node::node.
68 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element )) {
69 return node->GetNode()->GetVolume()->GetShape();
72 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element )) {
73 TEveGeoShape * nc_shape =
const_cast<TEveGeoShape *
>( shape );
74 return const_cast<const TGeoShape *
>( nc_shape->GetShape() );
TGeoShape* get_shape |
( |
TEveElement * |
element | ) |
|
Definition at line 81 of file eve_macros.cc.
87 if (TEveGeoShape * shape = dynamic_cast<TEveGeoShape *>( element )) {
88 return shape->GetShape();
const char* get_title |
( |
const TEveElement * |
element | ) |
|
Definition at line 28 of file eve_macros.cc.
References python.Node::node.
Referenced by clone().
30 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element ))
31 return node->GetTitle();
32 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element ))
33 return shape->GetTitle();
36 if (
const TNamed * named = dynamic_cast<const TNamed *>( element ))
37 return named->GetTitle();
TGeoMatrix* get_transform |
( |
const TEveElement * |
element | ) |
|
Definition at line 95 of file eve_macros.cc.
References i, and python.Node::node.
Referenced by clone().
96 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element )) {
99 std::vector< const TEveGeoNode * > nodes;
100 const TEveGeoTopNode * top = 0;
102 while ((top = dynamic_cast<const TEveGeoTopNode *>(
node )) == 0) {
104 nodes.push_back(
node);
107 TEveGeoNode * nc_node =
const_cast<TEveGeoNode *
>(
node );
108 if (nc_node->BeginParents() == nc_node->EndParents())
112 node =
dynamic_cast<const TEveGeoNode *
>( * nc_node->BeginParents() );
117 TGeoHMatrix * matrix =
new TGeoHMatrix();
118 (
const_cast<TEveGeoTopNode *
>(top))->RefGlobalTrans().SetGeoHMatrix( *matrix );
119 for (
unsigned int i = 0;
i < nodes.size(); ++
i)
120 *matrix *= *(nodes[
i]->GetNode()->GetMatrix());
124 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element )) {
126 TGeoHMatrix * matrix =
new TGeoHMatrix();
127 (
const_cast<TEveGeoShape *
>(shape))->RefHMTrans().SetGeoHMatrix( *matrix );
void hide_tracker_endcap |
( |
TEveElement * |
tracker | ) |
|
bool is_leaf_node |
( |
const TEveElement * |
element | ) |
|
Definition at line 177 of file eve_macros.cc.
References python.Node::node.
180 if (
const TEveGeoNode *
node = dynamic_cast<const TEveGeoNode *>( element )) {
181 return ((
node->GetNChildren() == 0) and (
node->GetNode()->GetVolume()->GetNdaughters() == 0));
184 if (
const TEveGeoShape * shape = dynamic_cast<const TEveGeoShape *>( element )) {
185 return (shape->GetNChildren() == 0);
188 return (element->GetNChildren() == 0);
void set_children_visibility |
( |
TEveElement * |
element, |
|
|
const std::string & |
node_name, |
|
|
const std::vector< std::string > & |
children_name, |
|
|
bool |
visibility |
|
) |
| |
Definition at line 193 of file eve_macros.cc.
References get_name(), i, is_leaf_node(), j, AlCaRecoCosmics_cfg::name, or, and findQualityFiles::size.
197 if (not name
or strncmp(name, node_name.c_str(), node_name.size()))
201 for (std::list<TEveElement *>::iterator
j = element->BeginChildren();
j != element->EndChildren(); ++
j) {
208 for (
unsigned int i = 0;
i < children_name.size(); ++
i)
209 if (not strncmp(name, children_name[
i].c_str(), children_name[
i].
size())) {
212 child->SetRnrSelf( visibility );
213 child->SetRnrChildren(
false );
215 child->SetRnrSelf(
false );
216 child->SetRnrChildren( visibility );
222 element->ElementChanged(
true,
true);
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
const char * get_name(const TEveElement *element)
bool is_leaf_node(const TEveElement *element)
tuple size
Write out results.
void set_color |
( |
TEveElement * |
element, |
|
|
Color_t |
color, |
|
|
float |
alpha, |
|
|
unsigned int |
levels |
|
) |
| |
Definition at line 154 of file eve_macros.cc.
References expand_node(), i, and set_color().
160 element->SetMainColor( color );
163 unsigned char transparency = (
unsigned char) roundf(100. - (
alpha * 100.));
164 element->SetMainTransparency( transparency );
169 for (std::list<TEveElement*>::iterator
i = element->BeginChildren();
i != element->EndChildren(); ++
i)
173 element->ElementChanged(
true,
true);
void expand_node(TEveElement *element)
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
void set_tracker_endcap_visibility |
( |
TEveElement * |
tracker, |
|
|
bool |
visibility |
|
) |
| |
Definition at line 226 of file eve_macros.cc.
References Reference_intrackfit_cff::endcap, and set_children_visibility().
228 std::vector<std::string>
endcap;
229 endcap.push_back(
"tec:TEC");
230 endcap.push_back(
"tidf:TIDF");
231 endcap.push_back(
"tidb:TIDB");
232 endcap.push_back(
"pixfwd:PixelForwardZPlus");
233 endcap.push_back(
"pixfwd:PixelForwardZMinus");
void set_children_visibility(TEveElement *element, const std::string &node_name, const std::vector< std::string > &children_name, bool visibility)
void show_tracker_endcap |
( |
TEveElement * |
tracker | ) |
|