BLGroup Class Reference

#include <BLGroup.hh>

Inheritance diagram for BLGroup:

BLGroupElement BLElement BLCommand

List of all members.


Detailed Description

BLGroup - define one group (container for BLElement-s).

NOTE: the class for the group command is BLGroup, not BLCMDgroup. This class is too intertwinded between command and infrastructure, so a single class was used.

Implements the group command, which begins defining the contents of the group; the endgroup command ends the group's definition, and computes the size of the group (if it wasn't specified via arguments). The group expands to hold its contents, unless its size is specified in arguments to the group command. The World is a expandable group.

If radius is set to 0, uses a Tubs with radius equal to the larger of the widest or highest element placed into the group; if radius is set >0 that is the fixed radius of the Tubs. If radius is not set then uses a Box.

Public Member Functions

 BLGroup ()
 Default Constructor. registers the command and provides help text.
 BLGroup (BLGroup &r)
 Copy Constructor for a real BLGroup.
 ~BLGroup ()
 Destructor.
BLElementclone ()
 clone() - invalid.
virtual G4String commandName ()
 commandName() returns "group";
int command (BLArgumentVector &argv, BLArgumentMap &namedArgs)
 command() implements the group command.
void defineNamedArgs ()
 defineNamedArgs() defines the arguments to the command.
virtual void construct (G4RotationMatrix *relativeRotation, G4ThreeVector relativePosition, G4LogicalVolume *parent, G4String parentName, G4RotationMatrix *parentRotation, G4ThreeVector parentPosition)
 construct() will construct an instance of this group, and construct its contents recursively.
G4double getLength ()
 getLength() returns this group's Length along the Z axis.
G4double getWidth ()
 getWidth() returns this group's Width along the X axis.
G4double getHeight ()
 getHeight() returns this group's height along the Y axis.
void setMinWidth (G4double minWidth)
 setMinWidth() will increase the width, if necessary.
void setMinHeight (G4double minHeight)
 setMinHeight() will increase the height, if necessary.
void setMinLength (G4double minLength)
 setMinLength() will increase the length, if necessary.
void setMaterial (G4String mat)
 setMaterial() sets the name of the group's material.
G4bool isOK ()
 isOK() returns true; individual elements are responsible for their own status.
bool isOutside (G4ThreeVector &local, G4double tolerance)
 isOutside() from BLElement.
void generatePoints (int npoints, std::vector< G4ThreeVector > &v)
 generatePoints from BLElement.
bool isWithin (G4ThreeVector &local, G4double tolerance)
 isWithin() from BLGroupElement.
virtual void placeElement (BLElement *element, G4RotationMatrix *rot, G4ThreeVector &offset, G4String rename, G4bool global=false)
 placeElement() will place an element within this group. With a rotation, an offset must be given, and the length of the group must have been specified via an argument. Called by the place command. The object being placed is rotated wrt the fixed axes of the group's local coordinates. global=true means use global coordinates for the world group, not centerline coords.
virtual void placeElement (BLElement *element, G4ThreeVector &offset, G4String rename, G4bool global=false)
 placeElement() will place an element within this group. With an offset, the length of the group must have been specified via an argument. Called by the place command.
virtual void placeElement (BLElement *element, G4String rename, G4bool global=false)
 placeElement() will place an element within this group. With no offset, this element is placed immediately downstream of the previous element. If necessary, the endgroup command will compute the size of the group and readjust offsets so they are relative to the center of the group. Called by the place command.
void end ()
 end() will compute the size of the group, if necessary, and pop the current group.
G4ThreeVector & getOffset ()
 getOffset() returns the offset for the place command.
void setOffset (G4ThreeVector &offset)
 setOffset() sets the offset for the place command.

Static Public Member Functions

static BLGroupgetCurrent ()
 getCurrent() returns a pointer to the current group (innermost active group command). Creates current and world if necessary. Used by the place command.
static BLGroupgetWorld ()
 getWorld() returns a pointer to the World group. Creates current and world if necessary.
static G4VPhysicalVolume * constructWorld ()
 constructWorld() constructs the beamline and returns a pointer to its world PhysicalVolume.

Private Member Functions

BLGroupoperator= (const BLGroup &)

Private Attributes

BLGroupprevCurrent
G4double highZ
G4double lastZ
G4double length
G4double width
G4double height
G4double radius
G4String material
G4String color
G4double maxStep
G4bool fixedLength
G4bool fixedWidth
G4bool fixedHeight
G4ThreeVector offset

Static Private Attributes

static BLGroupcurrent = 0
static BLGroupworld = 0
static G4VPhysicalVolume * worldPhysVol = 0

Friends

class BLCMDendgroup

Classes

struct  Child


Constructor & Destructor Documentation

BLGroup::BLGroup (  ) 

Default Constructor. registers the command and provides help text.

References BLCMDTYPE_CONTROL, color, fixedHeight, fixedLength, fixedWidth, height, highZ, lastZ, length, material, maxStep, prevCurrent, radius, BLCommand::registerCommand(), BLCommand::setDescription(), BLCommand::setSynopsis(), and width.

Referenced by command(), and getWorld().

00036                  : BLGroupElement(), offset(0,0,0)
00037 {
00038         registerCommand(BLCMDTYPE_CONTROL);
00039         setSynopsis("begins definition of a group.");
00040         setDescription("A group is a collection of elements that can be placed\n"
00041                 "together, preserving their relative positions. The group\n"
00042                 "is a LogicalVolume in the geant4 geometry -- this means that "
00043                 "a group cannot overlap any other group or object, even if the "
00044                 "overlapping portion of the group is empty. If you need to "
00045                 "permit overlaps, consider using a macro instead (the define "
00046                 "command).\n\n"
00047                 "If the group is\n"
00048                 "given a length, then children can be placed at specific\n"
00049                 "z offsets relative to the center of the group. If the group\n"
00050                 "is not given a length, then children can only be placed\n"
00051                 "sequentially along z, and the length will be computed by\n"
00052                 "the endgroup command. Width and height are computed\n"
00053                 "from the largest child or the argument.\n"
00054                 "If radius is set to 0, the group will be a cylinder with\n"
00055                 "radius determined by the largest width or height placed\n"
00056                 "into it; if >0 then that is the fixed radius. If radius\n"
00057                 "is not set then a box is used.\n\n"
00058                 "Note: when placing objects into a group, if the rename "
00059                 "argument is used, it should begin with a '+' to include the "
00060                 "group's name in the object's name; otherwise there may be "
00061                 "multiple objects with the same name -- this is only a major "
00062                 "problem for virtualdetector-s and other output objects. The "
00063                 "group's name is included by default if no rename is used on "
00064                 "the place command.");
00065 
00066         prevCurrent = 0;
00067         highZ = 0.0;
00068         lastZ = 0.0;
00069         length = 0.0;
00070         width = 0.0;
00071         height = 0.0;
00072         radius = -1.0;
00073         material = "Vacuum";
00074         color = "";
00075         maxStep = -1.0;
00076         fixedLength = false;
00077         fixedWidth = false;
00078         fixedHeight = false;
00079 }

BLGroup::BLGroup ( BLGroup r  )  [inline]

Copy Constructor for a real BLGroup.

References color, fixedHeight, fixedLength, fixedWidth, height, highZ, lastZ, length, material, maxStep, prevCurrent, radius, and width.

00072                             : BLGroupElement(r), offset(0,0,0)
00073                 { prevCurrent=0; highZ=0.0; lastZ=0.0; length=r.length;
00074                   width=r.width; height=r.height; material=r.material;
00075                   radius=r.radius; color = r.color; maxStep = r.maxStep; 
00076                   fixedLength = r.fixedLength;
00077                   fixedWidth = r.fixedWidth;
00078                   fixedHeight = r.fixedHeight; }

BLGroup::~BLGroup (  ) 

Destructor.

00082 {
00083 }


Member Function Documentation

BLElement* BLGroup::clone (  )  [inline, virtual]

clone() - invalid.

Implements BLElement.

00084 { return 0; }

virtual G4String BLGroup::commandName (  )  [inline, virtual]

commandName() returns "group";

Implements BLCommand.

00087 { return "group"; }

int BLGroup::command ( BLArgumentVector argv,
BLArgumentMap namedArgs 
) [virtual]

command() implements the group command.

Implements BLCommand.

References BLGroup(), current, fixedHeight, fixedLength, fixedWidth, getCurrent(), BLParam::getDouble(), BLCommand::getMaterial(), BLCommand::handleNamedArgs(), height, highZ, lastZ, length, material, maxStep, Param, prevCurrent, BLCommand::print(), BLCommand::printError(), radius, BLGroupElement::setName(), and width.

00086 {
00087         if(argv.size() != 1) {
00088                 printError("invalid group command -- requires name");
00089                 argv.clear();
00090                 argv.push_back("UnnamedGroup");
00091         }
00092 
00093         BLGroup *c = new BLGroup(defaultGroup);
00094         c->setName(argv[0]);
00095         c->handleNamedArgs(namedArgs);
00096         if(c->length > 0.0)
00097                 c->lastZ = c->highZ = -c->length/2.0;
00098 
00099         if(c->maxStep < 0.0) c->maxStep = Param.getDouble("maxStep");
00100 
00101         if(c->radius > 0.0)
00102                 c->width = c->height = 2.0*c->radius;
00103         c->fixedLength = (c->length > 0.0);
00104         c->fixedWidth = (c->width > 0.0);
00105         c->fixedHeight = (c->height > 0.0);
00106 
00107         c->prevCurrent = getCurrent();  // (current could be 0)
00108         current = c;
00109 
00110         // check material exists
00111         if(c->material.size() > 0) getMaterial(c->material,false);
00112 
00113         c->print(argv[0]);
00114 
00115         return 0;
00116 }

void BLGroup::defineNamedArgs (  )  [virtual]

defineNamedArgs() defines the arguments to the command.

Reimplemented from BLCommand.

References BLCommand::argDouble(), BLCommand::argString(), color, height, length, material, maxStep, radius, and width.

00119 {
00120         argDouble(length,"length","Overall group length along z (mm)",mm,"",false);
00121         argDouble(width,"width","Overall group width (mm)",mm,"",false);
00122         argDouble(height,"height","Overall group height (mm)",mm,"",false);
00123         argDouble(radius,"radius","Radius for a cylindrical group (mm)",mm,"",false);
00124         argString(material,"material","Material of the volume outside children");
00125         argString(color,"color","Color of the volume of the group");
00126         argDouble(maxStep,"maxStep","The maximum stepsize in the volume (mm)");
00127 }

void BLGroup::construct ( G4RotationMatrix *  relativeRotation,
G4ThreeVector  relativePosition,
G4LogicalVolume *  parent,
G4String  parentName,
G4RotationMatrix *  parentRotation,
G4ThreeVector  parentPosition 
) [virtual]

construct() will construct an instance of this group, and construct its contents recursively.

Implements BLElement.

References color, BLGroupElement::constructChildren(), BLParam::getDouble(), getHeight(), getLength(), BLCommand::getMaterial(), BLElement::getName(), BLCommand::getVisAttrib(), getWidth(), height, length, material, maxStep, Param, radius, width, world, and worldPhysVol.

Referenced by constructWorld().

00135 {
00136         if(radius == 0.0) radius = std::max<double>(width,height)/2.0;
00137         bool silent = (getName() == "World");
00138         if(radius > 0.0 && !silent)
00139             printf("BLGroup::Construct %s parent=%s relZ=%.1f globZ=%.1f length=%.1f\n"
00140                         "\tzmin=%.1f zmax=%.1f radius=%.1f\n",
00141                 getName().c_str(),parentName.c_str(),relativePosition[2],
00142                 parentPosition[2],getLength(),
00143                 parentPosition.z()-getLength()/2.0,
00144                 parentPosition.z()+getLength()/2.0,
00145                 radius);
00146         else if(!silent)
00147             printf("BLGroup::Construct %s parent=%s relZ=%.1f globZ=%.1f length=%.1f\n"
00148                         "\tzmin=%.1f zmax=%.1f width=%.1f Height=%.1f\n",
00149                 getName().c_str(),parentName.c_str(),relativePosition[2],
00150                 parentPosition[2],getLength(),
00151                 parentPosition.z()-getLength()/2.0,
00152                 parentPosition.z()+getLength()/2.0,
00153                 getWidth(),getHeight());
00154         
00155         if(maxStep <= 0.0) maxStep = Param.getDouble("maxStep");
00156 
00157         // add safety region to the world volume, so steps are guaranteed
00158         // to remain inside the world volume. Double it to be sure.
00159         G4double safety = 0.0;
00160         if(this == world) safety = maxStep * 2.0;
00161 
00162         G4VSolid *solid=0;
00163         if(radius > 0.0)
00164                 solid = new G4Tubs(getName()+"Tubs", 0.0, radius+safety,
00165                         length/2.0+safety, 0.0, 2.0*pi);
00166         else
00167                 solid = new G4Box(getName()+"Box",getWidth()/2.0+safety,
00168                                 getHeight()/2.0+safety,getLength()/2.0+safety);
00169         G4Material *mat = getMaterial(material);
00170         G4LogicalVolume *lv = new G4LogicalVolume(solid,mat,getName()+"LogVol");
00171         lv->SetVisAttributes(getVisAttrib(color));
00172         lv->SetUserLimits(new G4UserLimits(maxStep));
00173 
00174         // geant4 rotation convention is backwards from g4beamline
00175         G4RotationMatrix *g4rot = 0;
00176         if(relativeRotation)
00177                 g4rot = new G4RotationMatrix(relativeRotation->inverse());
00178 
00179         G4VPhysicalVolume *phys = new G4PVPlacement(g4rot, relativePosition,lv,
00180                                         parentName+getName(),parent, false,0);
00181 
00182         G4String xname = parentName + getName();
00183         if(this == world) {
00184                 worldPhysVol = phys;
00185                 xname = "";     // omit "World" from the start of every name
00186         }
00187 
00188         // get globalRotation and globalPosition
00189         G4RotationMatrix *globalRotation = 0;
00190         if(relativeRotation && parentRotation) {
00191                 globalRotation = 
00192                     new G4RotationMatrix(*parentRotation * *relativeRotation);
00193         } else if(relativeRotation) {
00194                 globalRotation = relativeRotation;
00195         } else if(parentRotation) {
00196                 globalRotation = parentRotation;
00197         }
00198         G4ThreeVector globalPosition(relativePosition + parentPosition);
00199         if(parentRotation)
00200                 globalPosition = *parentRotation * relativePosition +
00201                                 parentPosition;
00202 
00203         if(!silent) printf("\tParent pos=%.1f,%.1f,%.1f Relative pos=%.1f,%.1f,%.1f Global pos=%.1f,%.1f,%.1f\n",
00204                 parentPosition[0],parentPosition[1],parentPosition[2],
00205                 relativePosition[0],relativePosition[1],relativePosition[2],
00206                 globalPosition[0],globalPosition[1],globalPosition[2]);
00207 
00208         constructChildren(lv,xname,globalRotation,globalPosition);
00209 }

G4double BLGroup::getLength (  )  [inline, virtual]

getLength() returns this group's Length along the Z axis.

Implements BLElement.

References length.

Referenced by BLCMDfieldlines::callback(), and construct().

00105 { return length; }

G4double BLGroup::getWidth (  )  [inline, virtual]

getWidth() returns this group's Width along the X axis.

Implements BLElement.

References width.

Referenced by BLCMDfieldlines::callback(), and construct().

00108 { return width; }

G4double BLGroup::getHeight (  )  [inline, virtual]

getHeight() returns this group's height along the Y axis.

Implements BLElement.

References height.

Referenced by BLCMDfieldlines::callback(), and construct().

00111 { return height; }

void BLGroup::setMinWidth ( G4double  minWidth  )  [inline]

setMinWidth() will increase the width, if necessary.

References width.

Referenced by BLCMDreference::command(), BLCMDcosmicraybeam::command(), BLCMDbeam::command(), and placeElement().

00115                 { if(width < minWidth) width = minWidth; }

void BLGroup::setMinHeight ( G4double  minHeight  )  [inline]

setMinHeight() will increase the height, if necessary.

References height.

Referenced by BLCMDreference::command(), BLCMDcosmicraybeam::command(), BLCMDbeam::command(), and placeElement().

00119                 { if(height < minHeight) height = minHeight; }

void BLGroup::setMinLength ( G4double  minLength  )  [inline]

setMinLength() will increase the length, if necessary.

References highZ.

Referenced by BLCMDreference::command(), BLCMDcosmicraybeam::command(), BLCMDbeam::command(), and placeElement().

00123                 { if(highZ < minLength) highZ = minLength; }

void BLGroup::setMaterial ( G4String  mat  )  [inline]

setMaterial() sets the name of the group's material.

References material.

Referenced by main().

00126 { material = mat; }

G4bool BLGroup::isOK (  )  [inline, virtual]

isOK() returns true; individual elements are responsible for their own status.

Implements BLElement.

00130 { return true; }

G4bool BLGroup::isOutside ( G4ThreeVector &  local,
G4double  tolerance 
) [virtual]

isOutside() from BLElement.

Implements BLElement.

References height, length, radius, and width.

00191 {
00192         if(radius > 0.0)
00193                 return sqrt(local[0]*local[0]+local[1]*local[1]) > radius-tolerance ||
00194                         fabs(local[2]) > length/2.0-tolerance;
00195         else
00196                 return fabs(local[0]) > width/2.0-tolerance ||
00197                         fabs(local[1]) > height/2.0-tolerance ||
00198                         fabs(local[2]) > length/2.0-tolerance;
00199 }

void BLGroup::generatePoints ( int  npoints,
std::vector< G4ThreeVector > &  v 
) [virtual]

generatePoints from BLElement.

Implements BLElement.

References BLElement::generateBox(), BLElement::generateTubs(), height, length, radius, and width.

00202 {
00203         if(radius > 0.0)
00204                 generateTubs(npoints, 0.0, radius, 0.0, 2.0*pi, length, v);
00205         else
00206                 generateBox(npoints,width,height,length,v);
00207 }

G4bool BLGroup::isWithin ( G4ThreeVector &  local,
G4double  tolerance 
) [virtual]

isWithin() from BLGroupElement.

Implements BLGroupElement.

References height, length, radius, and width.

00210 {
00211         if(radius > 0.0)
00212                 return sqrt(local[0]*local[0]+local[1]*local[1]) < radius+tolerance ||
00213                         fabs(local[2]) < length/2.0+tolerance;
00214         else
00215                 return fabs(local[0]) < width/2.0+tolerance &&
00216                         fabs(local[1]) < height/2.0+tolerance &&
00217                         fabs(local[2]) < length/2.0+tolerance;
00218 }

void BLGroup::placeElement ( BLElement element,
G4RotationMatrix *  rot,
G4ThreeVector &  offset,
G4String  rename,
G4bool  global = false 
) [virtual]

placeElement() will place an element within this group. With a rotation, an offset must be given, and the length of the group must have been specified via an argument. Called by the place command. The object being placed is rotated wrt the fixed axes of the group's local coordinates. global=true means use global coordinates for the world group, not centerline coords.

References BLGroupElement::child, BLGroupElement::Child::element, fixedHeight, fixedLength, fixedWidth, BLCoordinates::getCurrentGlobal(), BLCoordinates::getCurrentRotation(), BLElement::getHeight(), BLElement::getLength(), BLElement::getName(), BLElement::getWidth(), height, highZ, lastZ, length, NO_RENAME(), BLGroupElement::Child::offset, Param, BLCommand::printError(), BLGroupElement::Child::rename, BLGroupElement::Child::rot, setMinHeight(), setMinLength(), setMinWidth(), BLParam::setParam(), width, and world.

Referenced by BLCMDplace::command(), BLCMDcorner::command(), and placeElement().

00042 {
00043         BLGroupElement::Child c;
00044         c.element = element;
00045         c.rename = rename;
00046 
00047         // convert centerline coordinates to global coordinates, if world
00048         if(this == world && !global) {
00049                 BLCoordinates::getCurrentGlobal(offset,c.offset);
00050                 if(rot)
00051                         c.rot = *BLCoordinates::getCurrentRotation() * *rot;
00052                 else
00053                         c.rot = *BLCoordinates::getCurrentRotation();
00054         } else {
00055                 if(rot) c.rot = *rot;
00056                 c.offset = offset;
00057         }
00058 
00059         // add this child
00060         child.push_back(c);
00061 
00062         // handle renamme
00063         if(rename == NO_RENAME)
00064                 c.rename = element->getName();
00065         else if(rename.find('+') == 0)
00066                 c.rename = getName()+rename.substr(1);
00067 
00068         // expand group to element's size.
00069         G4ThreeVector corner(element->getWidth()/2.0,element->getHeight()/2.0,
00070                                                 element->getLength()/2.0);
00071         G4ThreeVector parent;
00072         // loop over all 8 corners of the bounding box of the element.
00073         for(int i=0; i<2; ++i) {
00074             corner[0] = -corner[0];
00075             for(int j=0; j<2; ++j) {
00076                 corner[1] = -corner[1];
00077                 for(int k=0; k<2; ++k) {
00078                         corner[2] = -corner[2];
00079                         if(rot)
00080                                 parent = *rot * corner;
00081                         else
00082                                 parent = corner;
00083                         G4double x = offset[0]+parent[0];
00084                         if(!fixedWidth)
00085                                 setMinWidth(2.0*fabs(x));
00086                         else if(fabs(x) > width/2.0)
00087                             printError("Element '%s' extends outside '%s' in x",
00088                                 c.rename.c_str(),getName().c_str());
00089                         G4double y = offset[1]+parent[1];
00090                         if(!fixedHeight)
00091                                 setMinHeight(2.0*fabs(y));
00092                         else if(fabs(y) > height/2.0)
00093                             printError("Element '%s' extends outside '%s' in y",
00094                                 c.rename.c_str(),getName().c_str());
00095                         G4double z = offset[2]+parent[2];
00096                         if(!fixedLength)
00097                                 setMinLength(this==world ? fabs(z) : z);
00098                         else if(fabs(z) > length/2.0)
00099                             printError("Element '%s' extends outside '%s' in z",
00100                                 c.rename.c_str(),getName().c_str());
00101                         if(i+j+k == 0 || z > lastZ)
00102                                 lastZ = z;
00103                         if(this == world && !global) {
00104                                 G4ThreeVector gp;
00105                                 BLCoordinates::getCurrentGlobal(offset+parent,gp);
00106                                 setMinWidth(2.0*fabs(gp[0]));
00107                                 setMinHeight(2.0*fabs(gp[1]));
00108                                 setMinLength(gp[2]);
00109                         }
00110                 }
00111             }
00112         }
00113 
00114         // update z positions used
00115         if(lastZ > highZ)
00116                 highZ = lastZ;
00117         if(this == world && !global)
00118                 Param.setParam("Zcl",lastZ);
00119 }

void BLGroup::placeElement ( BLElement element,
G4ThreeVector &  offset,
G4String  rename,
G4bool  global = false 
) [virtual]

placeElement() will place an element within this group. With an offset, the length of the group must have been specified via an argument. Called by the place command.

References placeElement().

00123 {
00124         placeElement(element,0,offset,rename,global);
00125 }

void BLGroup::placeElement ( BLElement element,
G4String  rename,
G4bool  global = false 
) [virtual]

placeElement() will place an element within this group. With no offset, this element is placed immediately downstream of the previous element. If necessary, the endgroup command will compute the size of the group and readjust offsets so they are relative to the center of the group. Called by the place command.

References BLElement::getLength(), lastZ, offset, and placeElement().

00128 {
00129         G4double l = element->getLength();
00130         G4ThreeVector offset(0.0,0.0,lastZ + l/2.0);
00131         placeElement(element,0,offset,rename,global);
00132 }

void BLGroup::end (  ) 

end() will compute the size of the group, if necessary, and pop the current group.

References BLGroupElement::child, current, height, highZ, length, prevCurrent, width, and world.

Referenced by BLCMDendgroup::command(), and main().

00135 {
00136         // compute length if not set by argument, and adjust child offsets
00137         if(length == 0.0) {
00138                 if(this == world) {
00139                         // z=0 is center
00140                         length = highZ * 2.0;
00141                 } else {
00142                         // z=0 is where we started
00143                         length = highZ;
00144                         std::vector<BLGroupElement::Child>::iterator i;
00145                         for(i=child.begin(); i!=child.end(); ++i) {
00146                                 i->offset[2] -= length/2.0;
00147                         }
00148                 }
00149         }
00150 
00151         // expand world by 20.1357 cm
00152         if(this == world) {
00153                 printf("\nWorld size (before incrementing by 201.357 mm): "
00154                     "%.1f H  %.1f W  %.1f L\n",height/mm,width/mm,length/mm);
00155                 width += 20.1357*cm;
00156                 height += 20.1357*cm;
00157                 length += 20.1357*cm;
00158         }
00159 
00160         // pop current group
00161         if(current != world && prevCurrent != 0)
00162                 current = prevCurrent;
00163         prevCurrent = 0;
00164 }

G4ThreeVector& BLGroup::getOffset (  )  [inline]

getOffset() returns the offset for the place command.

References offset.

Referenced by BLCMDplace::command().

00173 { return offset; }

void BLGroup::setOffset ( G4ThreeVector &  offset  )  [inline]

setOffset() sets the offset for the place command.

Referenced by BLCMDplace::command().

00176 { this->offset = offset; }

BLGroup * BLGroup::getCurrent (  )  [static]

getCurrent() returns a pointer to the current group (innermost active group command). Creates current and world if necessary. Used by the place command.

References current, and getWorld().

Referenced by BLCMDplace::command(), command(), BLCMDendgroup::command(), BLCMDcornerarc::command(), and BLCMDcorner::command().

00167 {
00168         if(!current) current = getWorld();
00169         return current;
00170 }

BLGroup * BLGroup::getWorld (  )  [static]

getWorld() returns a pointer to the World group. Creates current and world if necessary.

References BLGroup(), BLGroupElement::setName(), and world.

Referenced by BLCMDgeometry::callback(), BLCMDfieldlines::callback(), BLCMDreference::command(), BLCMDplace::command(), BLCMDendgroup::command(), BLCMDcosmicraybeam::command(), BLCMDcornerarc::command(), BLCMDcorner::command(), BLCMDbeam::command(), constructWorld(), getCurrent(), and main().

00173 {
00174         if(!world) {
00175                 world = new BLGroup(defaultGroup);
00176                 world->setName("World");
00177         }
00178         return world;
00179 }

G4VPhysicalVolume * BLGroup::constructWorld (  )  [static]

constructWorld() constructs the beamline and returns a pointer to its world PhysicalVolume.

References construct(), getWorld(), and worldPhysVol.

Referenced by BLManager::Construct().

00182 {
00183         G4ThreeVector abs;
00184         getWorld()->construct(0,abs,0,"",0,abs);
00185         worldPhysVol->GetLogicalVolume()->
00186                         SetVisAttributes(G4VisAttributes::GetInvisible());
00187         return worldPhysVol;
00188 }

BLGroup& BLGroup::operator= ( const BLGroup  )  [private]


Friends And Related Function Documentation

friend class BLCMDendgroup [friend]


Member Data Documentation

BLGroup * BLGroup::current = 0 [static, private]

Referenced by command(), end(), and getCurrent().

BLGroup * BLGroup::world = 0 [static, private]

Referenced by construct(), end(), getWorld(), and placeElement().

G4VPhysicalVolume * BLGroup::worldPhysVol = 0 [static, private]

Referenced by construct(), and constructWorld().

Referenced by BLGroup(), command(), and end().

G4double BLGroup::highZ [private]

G4double BLGroup::lastZ [private]

Referenced by BLGroup(), command(), and placeElement().

G4double BLGroup::length [private]

G4double BLGroup::width [private]

G4double BLGroup::height [private]

G4double BLGroup::radius [private]

G4String BLGroup::material [private]

G4String BLGroup::color [private]

Referenced by BLGroup(), construct(), and defineNamedArgs().

G4double BLGroup::maxStep [private]

G4bool BLGroup::fixedLength [private]

Referenced by BLGroup(), command(), and placeElement().

G4bool BLGroup::fixedWidth [private]

Referenced by BLGroup(), command(), and placeElement().

G4bool BLGroup::fixedHeight [private]

Referenced by BLGroup(), command(), and placeElement().

G4ThreeVector BLGroup::offset [private]

Referenced by getOffset(), and placeElement().


The documentation for this class was generated from the following files:
g4beamline