ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
VP1EtaCone::Imp Class Reference
Collaboration diagram for VP1EtaCone::Imp:

Public Member Functions

 Imp (VP1EtaCone *, SoMaterial *mat, SoSeparator *attachsep)
 
void updateFields ()
 
void ensureInit3DObjects ()
 

Public Attributes

VP1EtaConetheclass
 
SoMaterial * material
 
SoSeparator * attachSep
 
bool shown
 
double etaval
 
double extent
 
SoSeparator * sep
 
SoCone * cone1
 
SoTranslation * trans1
 
SoCone * innercone1
 
SoTranslation * innertrans1
 
SoCone * cone2
 
SoTranslation * trans2
 
SoCone * innercone2
 
SoTranslation * innertrans2
 

Detailed Description

Definition at line 33 of file VP1EtaCone.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1EtaCone::Imp::Imp ( VP1EtaCone tc,
SoMaterial *  mat,
SoSeparator *  attachsep 
)

Definition at line 79 of file VP1EtaCone.cxx.

80  : theclass(tc), material(mat), attachSep(as), shown(false),
81  etaval(1), extent(1), sep(0),
82  cone1(0), trans1(0), innercone1(0), innertrans1(0),
83  cone2(0), trans2(0), innercone2(0), innertrans2(0)
84 {
85  material->ref();
86  attachSep->ref();
87 }

Member Function Documentation

◆ ensureInit3DObjects()

void VP1EtaCone::Imp::ensureInit3DObjects ( )

Definition at line 90 of file VP1EtaCone.cxx.

91 {
92  if (sep)
93  return;
94  theclass->messageVerbose("Building 3D objects");
95  sep = new SoSeparator;
96  sep->ref();
97  sep->addChild(material);
98 
99  SoSeparator * sepfirst = new SoSeparator;
100  SoSeparator * sepsecond = new SoSeparator;
101 
102  for ( int i = 0;i<2;++i){
103  SoRotationXYZ * xf = new SoRotationXYZ();
104  xf->axis=SoRotationXYZ::X;
105  xf->angle = i==0 ? 90.0*SYSTEM_OF_UNITS::deg : -90*SYSTEM_OF_UNITS::deg;
106  SoTranslation * xl = new SoTranslation();
107  SoCone * cone = new SoCone();
108  SoTranslation * innerxl = new SoTranslation();
109  SoCone * innercone = new SoCone();
110 
111  if (i==0) {
112  cone1 = cone;
113  trans1 = xl;
114  innercone1 = innercone;
115  innertrans1 = innerxl;
116  } else {
117  cone2 = cone;
118  trans2 = xl;
119  innercone2 = innercone;
120  innertrans2 = innerxl;
121  }
122 
123  cone->removePart(SoCone::BOTTOM);
124  innercone->removePart(SoCone::BOTTOM);
125 
126  SoSeparator * s(i==0?sepfirst:sepsecond);
127  s->addChild(xf);
128  s->addChild(xl);
129  s->addChild(cone);
130  s->addChild(innerxl);
131  s->addChild(innercone);
132  sep->addChild(s);
133  }
134 }

◆ updateFields()

void VP1EtaCone::Imp::updateFields ( )

Definition at line 137 of file VP1EtaCone.cxx.

138 {
140  theclass->messageVerbose("Updating fields");
141 
142  double theta = 2*atan(exp(-fabs(etaval)));
143  double tanfact = tan(theta);
144  bool etaconeextentisz = (extent<0);
145  double absextent = fabs(extent);
146  double coneHeight,bottomRadius;
147  if (etaconeextentisz) {
148  coneHeight = absextent;
149  bottomRadius = coneHeight*tanfact;
150  } else {
151  bottomRadius = absextent;
152  coneHeight=bottomRadius/tanfact;
153  }
154 
155  theclass->messageVerbose("etaval = "+str(etaval));
156  theclass->messageVerbose("extent = "+str(extent));
157  theclass->messageVerbose("absextent = "+str(absextent));
158  theclass->messageVerbose("tanfact = "+str(tanfact));
159  theclass->messageVerbose("bottomRadius = "+str(bottomRadius));
160  theclass->messageVerbose("coneHeight = "+str(coneHeight));
161 
162  cone1->bottomRadius = bottomRadius;
163  cone1->height = coneHeight;
164  cone2->bottomRadius = bottomRadius;
165  cone2->height = coneHeight;
166  trans1->translation.setValue(0, -coneHeight/2, 0);
167  trans2->translation.setValue(0, -coneHeight/2, 0);
168 
169  innercone1->bottomRadius = bottomRadius;
170  innercone1->height = -coneHeight;
171  innercone2->bottomRadius = bottomRadius;
172  innercone2->height = -coneHeight;
173  //To avoid render flicker from the overlapping cones, we move the inner cone slightly away from origo:
174  const double epsilon = 0.50*SYSTEM_OF_UNITS::mm;
175  innertrans1->translation.setValue(0, coneHeight/2+1.001*coneHeight/2+epsilon, 0);
176  innertrans2->translation.setValue(0, coneHeight/2+1.001*coneHeight/2+epsilon, 0);
177 
178 }

Member Data Documentation

◆ attachSep

SoSeparator* VP1EtaCone::Imp::attachSep

Definition at line 40 of file VP1EtaCone.cxx.

◆ cone1

SoCone* VP1EtaCone::Imp::cone1

Definition at line 47 of file VP1EtaCone.cxx.

◆ cone2

SoCone* VP1EtaCone::Imp::cone2

Definition at line 51 of file VP1EtaCone.cxx.

◆ etaval

double VP1EtaCone::Imp::etaval

Definition at line 43 of file VP1EtaCone.cxx.

◆ extent

double VP1EtaCone::Imp::extent

Definition at line 44 of file VP1EtaCone.cxx.

◆ innercone1

SoCone* VP1EtaCone::Imp::innercone1

Definition at line 49 of file VP1EtaCone.cxx.

◆ innercone2

SoCone* VP1EtaCone::Imp::innercone2

Definition at line 53 of file VP1EtaCone.cxx.

◆ innertrans1

SoTranslation* VP1EtaCone::Imp::innertrans1

Definition at line 50 of file VP1EtaCone.cxx.

◆ innertrans2

SoTranslation* VP1EtaCone::Imp::innertrans2

Definition at line 54 of file VP1EtaCone.cxx.

◆ material

SoMaterial* VP1EtaCone::Imp::material

Definition at line 39 of file VP1EtaCone.cxx.

◆ sep

SoSeparator* VP1EtaCone::Imp::sep

Definition at line 46 of file VP1EtaCone.cxx.

◆ shown

bool VP1EtaCone::Imp::shown

Definition at line 42 of file VP1EtaCone.cxx.

◆ theclass

VP1EtaCone* VP1EtaCone::Imp::theclass

Definition at line 38 of file VP1EtaCone.cxx.

◆ trans1

SoTranslation* VP1EtaCone::Imp::trans1

Definition at line 48 of file VP1EtaCone.cxx.

◆ trans2

SoTranslation* VP1EtaCone::Imp::trans2

Definition at line 52 of file VP1EtaCone.cxx.


The documentation for this class was generated from the following file:
VP1EtaCone::Imp::innertrans1
SoTranslation * innertrans1
Definition: VP1EtaCone.cxx:50
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1EtaCone::Imp::trans1
SoTranslation * trans1
Definition: VP1EtaCone.cxx:48
VP1EtaCone::Imp::cone1
SoCone * cone1
Definition: VP1EtaCone.cxx:47
VP1EtaCone::Imp::innercone2
SoCone * innercone2
Definition: VP1EtaCone.cxx:53
VP1EtaCone::Imp::theclass
VP1EtaCone * theclass
Definition: VP1EtaCone.cxx:38
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
deg
#define deg
Definition: SbPolyhedron.cxx:17
VP1EtaCone::Imp::trans2
SoTranslation * trans2
Definition: VP1EtaCone.cxx:52
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
VP1EtaCone::Imp::material
SoMaterial * material
Definition: VP1EtaCone.cxx:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1EtaCone::Imp::cone2
SoCone * cone2
Definition: VP1EtaCone.cxx:51
VP1EtaCone::Imp::extent
double extent
Definition: VP1EtaCone.cxx:44
VP1EtaCone::Imp::ensureInit3DObjects
void ensureInit3DObjects()
Definition: VP1EtaCone.cxx:90
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
VP1EtaCone::Imp::innercone1
SoCone * innercone1
Definition: VP1EtaCone.cxx:49
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
VP1EtaCone::Imp::innertrans2
SoTranslation * innertrans2
Definition: VP1EtaCone.cxx:54
VP1EtaCone::Imp::shown
bool shown
Definition: VP1EtaCone.cxx:42
VP1EtaCone::Imp::attachSep
SoSeparator * attachSep
Definition: VP1EtaCone.cxx:40
VP1EtaCone::Imp::etaval
double etaval
Definition: VP1EtaCone.cxx:43
VP1EtaCone::Imp::sep
SoSeparator * sep
Definition: VP1EtaCone.cxx:46