ROOT  6.06/09
Reference Guide
TGeoScaledShape.cxx
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 26/09/05
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 #include "Riostream.h"
14 
15 #include "TGeoManager.h"
16 #include "TGeoMatrix.h"
17 #include "TGeoVolume.h"
18 #include "TGeoNode.h"
19 #include "TGeoScaledShape.h"
20 #include "TBuffer3D.h"
21 #include "TBuffer3DTypes.h"
22 #include "TMath.h"
23 
24 //_____________________________________________________________________________
25 // TGeoScaledShape - A shape scaled by a TGeoScale transformation
26 //
27 //Begin_Html
28 /*
29 <img src="gif/TGeoScaledShape.gif">
30 */
31 //End_Html
32 //_____________________________________________________________________________
33 
34 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Default constructor
39 
41 {
42  fShape = 0;
43  fScale = 0;
44 }
45 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// Constructor
49 
51  :TGeoBBox(name,0,0,0)
52 {
53  fShape = shape;
54  fScale = scale;
56  ComputeBBox();
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// Constructor
61 
63 {
64  fShape = shape;
65  fScale = scale;
67  ComputeBBox();
68 }
69 
70 ////////////////////////////////////////////////////////////////////////////////
71 /// destructor
72 
74 {
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Computes capacity of this shape [length^3]
79 
81 {
82  Double_t capacity = fShape->Capacity();
83  const Double_t *scale = fScale->GetScale();
84  capacity *= scale[0]*scale[1]*scale[2];
85  return capacity;
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// Compute bounding box of the scaled shape
90 
92 {
93  if (!fShape) {
94  Error("ComputeBBox", "Scaled shape %s without shape", GetName());
95  return;
96  }
99  const Double_t *orig = box->GetOrigin();
100  Double_t point[3], master[3];
101  point[0] = box->GetDX();
102  point[1] = box->GetDY();
103  point[2] = box->GetDZ();
104 
105  fScale->LocalToMaster(orig, fOrigin);
106  fScale->LocalToMaster(point, master);
107  fDX = TMath::Abs(master[0]);
108  fDY = TMath::Abs(master[1]);
109  fDZ = TMath::Abs(master[2]);
110 }
111 
112 ////////////////////////////////////////////////////////////////////////////////
113 /// Compute normal to closest surface from POINT.
114 
116 {
117  Double_t local[3], ldir[3], lnorm[3];
118  fScale->MasterToLocal(point,local);
119  fScale->MasterToLocalVect(dir,ldir);
120  TGeoMatrix::Normalize(ldir);
121  fShape->ComputeNormal(local,ldir,lnorm);
122 // fScale->LocalToMasterVect(lnorm, norm);
123  fScale->MasterToLocalVect(lnorm, norm);
124  TGeoMatrix::Normalize(norm);
125 }
126 
127 ////////////////////////////////////////////////////////////////////////////////
128 /// Test if point is inside the scaled shape
129 
131 {
132  Double_t local[3];
133  fScale->MasterToLocal(point,local);
134  return fShape->Contains(local);
135 }
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 /// compute closest distance from point px,py to each vertex. Should not be called.
139 
141 {
143  return ShapeDistancetoPrimitive(n, px, py);
144 }
145 
146 ////////////////////////////////////////////////////////////////////////////////
147 /// Compute distance from inside point to surface of the scaled shape.
148 
149 Double_t TGeoScaledShape::DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact, Double_t step, Double_t *safe) const
150 {
151  Double_t local[3], ldir[3];
152  Double_t lstep;
153  fScale->MasterToLocal(point,local);
154  lstep = fScale->MasterToLocal(step, dir);
155  fScale->MasterToLocalVect(dir,ldir);
156  TGeoMatrix::Normalize(ldir);
157  Double_t dist = fShape->DistFromInside(local,ldir, iact, lstep, safe);
158  if (iact<3 && safe) *safe = fScale->LocalToMaster(*safe);
159  dist = fScale->LocalToMaster(dist, ldir);
160  return dist;
161 }
162 
163 
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Compute distance from outside point to surface of the scaled shape.
166 
167 Double_t TGeoScaledShape::DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact, Double_t step, Double_t *safe) const
168 {
169  Double_t local[3], ldir[3];
170  Double_t lstep;
171 // printf("DistFromOutside(%f,%f,%f, %f,%f,%f)\n", point[0], point[1], point[2], dir[0], dir[1],dir[2]);
172  fScale->MasterToLocal(point,local);
173 // printf("local: %f,%f,%f\n", local[0],local[1], local[2]);
174  lstep = fScale->MasterToLocal(step, dir);
175  fScale->MasterToLocalVect(dir,ldir);
176  TGeoMatrix::Normalize(ldir);
177 // printf("localdir: %f,%f,%f\n",ldir[0],ldir[1],ldir[2]);
178  Double_t dist = fShape->DistFromOutside(local,ldir, iact, lstep, safe);
179 // printf("local distance: %f\n", dist);
180  if (safe) *safe = fScale->LocalToMaster(*safe);
181  dist = fScale->LocalToMaster(dist, ldir);
182 // printf("converted distance: %f\n",dist);
183  return dist;
184 }
185 
186 ////////////////////////////////////////////////////////////////////////////////
187 /// Cannot divide assemblies.
188 
189 TGeoVolume *TGeoScaledShape::Divide(TGeoVolume * /*voldiv*/, const char *divname, Int_t /*iaxis*/, Int_t /*ndiv*/,
190  Double_t /*start*/, Double_t /*step*/)
191 {
192  Error("Divide", "Scaled shapes cannot be divided. Division volume %s not created", divname);
193  return 0;
194 }
195 
196 ////////////////////////////////////////////////////////////////////////////////
197 /// Fills a static 3D buffer and returns a reference.
198 
199 const TBuffer3D & TGeoScaledShape::GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
200 {
201  TBuffer3D &buffer = (TBuffer3D &)fShape->GetBuffer3D(reqSections, localFrame);
202 
203 // TGeoBBox::FillBuffer3D(buffer, reqSections, localFrame);
204  Double_t halfLengths[3] = { fDX, fDY, fDZ };
205  buffer.SetAABoundingBox(fOrigin, halfLengths);
206  if (!buffer.fLocalFrame) {
207  TransformPoints(buffer.fBBVertex[0], 8);
208  }
209 
210  if ((reqSections & TBuffer3D::kRaw) && buffer.SectionsValid(TBuffer3D::kRawSizes)) {
211  SetPoints(buffer.fPnts);
212  if (!buffer.fLocalFrame) {
213  TransformPoints(buffer.fPnts, buffer.NbPnts());
214  }
215  }
216 
217  return buffer;
218 }
219 ////////////////////////////////////////////////////////////////////////////////
220 /// in case shape has some negative parameters, these has to be computed
221 /// in order to fit the mother
222 
224 {
225  Error("GetMakeRuntimeShape", "Scaled shapes cannot be parametrized.");
226  return NULL;
227 }
228 
229 ////////////////////////////////////////////////////////////////////////////////
230 /// Returns numbers of vertices, segments and polygons composing the shape mesh.
231 
232 void TGeoScaledShape::GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
233 {
234  fShape->GetMeshNumbers(nvert, nsegs, npols);
235 }
236 
237 ////////////////////////////////////////////////////////////////////////////////
238 /// print shape parameters
239 
241 {
242  printf("*** Shape %s: TGeoScaledShape ***\n", GetName());
243  fScale->Print();
244  fShape->InspectShape();
246 }
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 /// Returns true if the scaled shape is an assembly.
250 
252 {
253  return fShape->IsAssembly();
254 }
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// Check if the scale transformation is a reflection.
258 
260 {
261  return fScale->IsReflection();
262 }
263 
264 ////////////////////////////////////////////////////////////////////////////////
265 /// Creates a TBuffer3D describing *this* shape.
266 /// Coordinates are in local reference frame.
267 
269 {
270  TBuffer3D *buff = fShape->MakeBuffer3D();
271  if (buff) SetPoints(buff->fPnts);
272  return buff;
273 }
274 
275 ////////////////////////////////////////////////////////////////////////////////
276 /// Create a scaled shape starting from a non-scaled one.
277 
279 {
280  TGeoShape *new_shape;
281  if (shape->IsA() == TGeoScaledShape::Class()) {
282  TGeoScaledShape *sshape = (TGeoScaledShape*)shape;
283  TGeoScale *old_scale = sshape->GetScale();
284  TGeoShape *old_shape = sshape->GetShape();
285  scale->SetScale(scale->GetScale()[0]*old_scale->GetScale()[0],
286  scale->GetScale()[1]*old_scale->GetScale()[1],
287  scale->GetScale()[2]*old_scale->GetScale()[2]);
288  new_shape = new TGeoScaledShape(name, old_shape, scale);
289  return new_shape;
290  }
291  new_shape = new TGeoScaledShape(name, shape, scale);
292  return new_shape;
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Fill TBuffer3D structure for segments and polygons.
297 
299 {
300  fShape->SetSegsAndPols(buff);
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// computes the closest distance from given point to this shape, according
305 /// to option. The matching point on the shape is stored in spoint.
306 
308 {
309  Double_t local[3];
310  fScale->MasterToLocal(point,local);
311  Double_t safe = fShape->Safety(local,in);
312  safe = fScale->LocalToMaster(safe);
313  return safe;
314 }
315 
316 ////////////////////////////////////////////////////////////////////////////////
317 /// Save a primitive as a C++ statement(s) on output stream "out".
318 
319 void TGeoScaledShape::SavePrimitive(std::ostream &out, Option_t *option)
320 {
321  if (TObject::TestBit(kGeoSavePrimitive)) return;
322  out << " // Shape: " << GetName() << " type: " << ClassName() << std::endl;
323  if (!fShape || !fScale) {
324  out << "##### Invalid shape or scale !. Aborting. #####" << std::endl;
325  return;
326  }
327  fShape->SavePrimitive(out, option);
329  const Double_t *sc = fScale->GetScale();
330  out << " // Scale factor:" << std::endl;
331  out << " TGeoScale *pScale = new TGeoScale(\"" << fScale->GetName()
332  << "\"," << sc[0] << "," << sc[1] << "," << sc[2] << ");" << std::endl;
333  out << " TGeoScaledShape *" << GetPointerName() << " = new TGeoScaledShape(\""
334  << GetName() << "\"," << sname << ", pScale);" << std::endl;
335 }
336 
337 ////////////////////////////////////////////////////////////////////////////////
338 /// Mesh points for scaled shapes.
339 
341 {
342  Int_t npts = fShape->GetNmeshVertices();
343  fShape->SetPoints(points);
344  Double_t master[3];
345  for (Int_t i=0; i<npts; i++) {
346  fScale->LocalToMaster(&points[3*i], master);
347  memcpy(&points[3*i], master, 3*sizeof(Double_t));
348  }
349 }
350 
351 ////////////////////////////////////////////////////////////////////////////////
352 /// Mesh points for scaled shapes.
353 
355 {
356  Int_t npts = fShape->GetNmeshVertices();
357  fShape->SetPoints(points);
358  Double_t master[3];
359  Double_t local[3];
360  Int_t index;
361  for (Int_t i=0; i<npts; i++) {
362  index = 3*i;
363  local[0] = points[index];
364  local[1] = points[index+1];
365  local[2] = points[index+2];
366  fScale->LocalToMaster(local, master);
367  points[index] = master[0];
368  points[index+1] = master[1];
369  points[index+2] = master[2];
370  }
371 }
372 
373 ////////////////////////////////////////////////////////////////////////////////
374 /// Check the inside status for each of the points in the array.
375 /// Input: Array of point coordinates + vector size
376 /// Output: Array of Booleans for the inside of each point
377 
378 void TGeoScaledShape::Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
379 {
380  for (Int_t i=0; i<vecsize; i++) inside[i] = Contains(&points[3*i]);
381 }
382 
383 ////////////////////////////////////////////////////////////////////////////////
384 /// Compute the normal for an array o points so that norm.dot.dir is positive
385 /// Input: Arrays of point coordinates and directions + vector size
386 /// Output: Array of normal directions
387 
388 void TGeoScaledShape::ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
389 {
390  for (Int_t i=0; i<vecsize; i++) ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
391 }
392 
393 ////////////////////////////////////////////////////////////////////////////////
394 /// Compute distance from array of input points having directions specisied by dirs. Store output in dists
395 
396 void TGeoScaledShape::DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t* step) const
397 {
398  for (Int_t i=0; i<vecsize; i++) dists[i] = DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
399 }
400 
401 ////////////////////////////////////////////////////////////////////////////////
402 /// Compute distance from array of input points having directions specisied by dirs. Store output in dists
403 
404 void TGeoScaledShape::DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t* step) const
405 {
406  for (Int_t i=0; i<vecsize; i++) dists[i] = DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
407 }
408 
409 ////////////////////////////////////////////////////////////////////////////////
410 /// Compute safe distance from each of the points in the input array.
411 /// Input: Array of point coordinates, array of statuses for these points, size of the arrays
412 /// Output: Safety values
413 
414 void TGeoScaledShape::Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
415 {
416  for (Int_t i=0; i<vecsize; i++) safe[i] = Safety(&points[3*i], inside[i]);
417 }
TGeoShape * fShape
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
virtual Bool_t IsAssembly() const
Returns true if the scaled shape is an assembly.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)=0
float Float_t
Definition: RtypesCore.h:53
Double_t fBBVertex[8][3]
Definition: TBuffer3D.h:109
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t Contains(const Double_t *point) const
Test if point is inside the scaled shape.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each vertex. Should not be called.
Double_t fOrigin[3]
Definition: TGeoBBox.h:36
virtual void SetSegsAndPols(TBuffer3D &buffer) const
Fill TBuffer3D structure for segments and polygons.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
Convert a local point to the master frame.
virtual Double_t GetDY() const
Definition: TGeoBBox.h:83
Bool_t IsReflection() const
Definition: TGeoMatrix.h:80
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
virtual Double_t GetDZ() const
Definition: TGeoBBox.h:84
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
virtual Bool_t Contains(const Double_t *point) const =0
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specisied by dirs. Store output in dist...
ClassImp(TGeoScaledShape) TGeoScaledShape
Default constructor.
Double_t fDZ
Definition: TGeoBBox.h:35
void Class()
Definition: Class.C:29
virtual Double_t Capacity() const
Computes capacity of this shape [length^3].
virtual const Double_t * GetScale() const
Definition: TGeoMatrix.h:275
virtual void GetMeshNumbers(Int_t &, Int_t &, Int_t &) const
Definition: TGeoShape.h:135
Double_t * fPnts
Definition: TBuffer3D.h:114
virtual void SetSegsAndPols(TBuffer3D &buff) const =0
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
virtual void SetPoints(Double_t *points) const =0
char * out
Definition: TBase64.cxx:29
virtual const Double_t * GetOrigin() const
Definition: TGeoBBox.h:85
Bool_t fLocalFrame
Definition: TBuffer3D.h:92
point * points
Definition: X3DBuffer.c:20
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Cannot divide assemblies.
virtual Int_t GetNmeshVertices() const
Definition: TGeoShape.h:137
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
Definition: TGeoShape.cxx:550
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Double_t GetDX() const
Definition: TGeoBBox.h:82
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specisied by dirs. Store output in dist...
void SetAABoundingBox(const Double_t origin[3], const Double_t halfLengths[3])
Set fBBVertex in kBoundingBox section to a axis aligned (local) BB using supplied origin and box half...
Definition: TBuffer3D.cxx:318
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:187
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert a global point to local frame.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
TGeoShape * GetShape() const
virtual void InspectShape() const
print shape parameters
virtual TBuffer3D * MakeBuffer3D() const
Definition: TGeoShape.h:152
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
virtual void SetPoints(Double_t *points) const
Mesh points for scaled shapes.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:532
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the scaled shape.
static void Normalize(Double_t *vect)
Normalize a vector.
Definition: TGeoMatrix.cxx:480
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
const std::string sname
Definition: testIO.cxx:45
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const =0
virtual const char * GetName() const
Get the shape name.
Definition: TGeoShape.cxx:247
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const =0
virtual void InspectShape() const
Prints shape parameters.
Definition: TGeoBBox.cxx:749
double Double_t
Definition: RtypesCore.h:55
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Bool_t IsRegistered() const
Definition: TGeoMatrix.h:87
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
Definition: TGeoShape.cxx:258
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const
in case shape has some negative parameters, these has to be computed in order to fit the mother ...
TGeoScale * GetScale() const
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
virtual void ComputeBBox()=0
const char * GetPointerName() const
Provide a pointer name containing uid.
Definition: TGeoShape.cxx:697
Double_t fDY
Definition: TGeoBBox.h:34
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.h:268
void Print(Option_t *option="") const
print the matrix in 4x4 format
Definition: TGeoMatrix.cxx:493
virtual Double_t Capacity() const =0
TGeoScale * fScale
#define name(a, b)
Definition: linkTestLib0.cpp:5
static TGeoShape * MakeScaledShape(const char *name, TGeoShape *shape, TGeoScale *scale)
Create a scaled shape starting from a non-scaled one.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the scaled shape.
UInt_t NbPnts() const
Definition: TBuffer3D.h:82
virtual void InspectShape() const =0
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
#define NULL
Definition: Rtypes.h:82
Double_t fDX
Definition: TGeoBBox.h:33
void SetScale(Double_t sx, Double_t sy, Double_t sz)
scale setter
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Stub implementation to avoid forcing implementation at this stage.
Definition: TGeoShape.cxx:687
virtual ~TGeoScaledShape()
destructor
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
virtual Bool_t IsReflected() const
Check if the scale transformation is a reflection.
virtual Bool_t IsAssembly() const
Definition: TGeoShape.h:139
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40
virtual void ComputeBBox()
Compute bounding box of the scaled shape.
const Int_t n
Definition: legend1.C:16
Bool_t SectionsValid(UInt_t mask) const
Definition: TBuffer3D.h:69
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TObject.cxx:702