Message: Concentric cylindrical shells Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Concentric cylindrical shells  

Keywords: concentric cylinders shells
Forum: Geometry
Date: 23 Jan, 2007
From: Gabriel Sawakuchi <Gabriel Sawakuchi>

Dear All,

I am struggling with the problem of creating thousands of
concentric cylindrical shells where the radius of each shell 
increases logarithmically.

I am using G4VPVParameterisation to create the concentric shells 
of a readout geometry to be used as a sensitive detector.

The problem is that when I use G4VPVParameterisation my run crashes
after certain number of events because (I guess) I run out of memory
during the geometry navigation. 
The crash message I get is: 'std::bad_alloc' what(): St9bad_alloc

I have tested creating concentric cylindrical shells where the 
radius of each shell increases linearly using
G4PVReplica against building the same geometry with 
G4VPVParameterisation. The geometry built with G4VPVParameterisation 
crashes but the one built with G4PVReplica does not.!?

I have no idea what I am doing wrong.
The way I am parameterizing is as follows:

-----------------------------------------------------------------
  G4VPVParameterisation* shellParam = 
    new ShellParameterisation(numberOfShells,       
			      detectorRMax,
			      detectorHeight);     
    
  pROSDetectorDivision = new G4PVParameterised("pROSDetectorDivision",     
					       lROSDetectorDivision,      
					       lROSDetector,   
     				               kZAxis,  
					       numberOfShells, 
					       shellParam); 
------------------------------------------------------------------

ShellParameterisation::ShellParameterisation(G4int    NoOfShells, 
					     G4double RMax,
					     G4double Height)
  : numberOfShells(NoOfShells),
    detectorRMax(RMax),
    detectorHeight(Height)
{
  if( numberOfShells > 0 )
    {
      RadiusIncr =  detectorRMax/numberOfShells;

    }
}

ShellParameterisation::~ShellParameterisation()
{}

void ShellParameterisation::ComputeTransformation
(const G4int, G4VPhysicalVolume* physVol) const
{
  G4RotationMatrix* Rotation = new G4RotationMatrix();
  Rotation->rotateY(0.*deg);
  G4ThreeVector origin(0,0,0);
  physVol->SetTranslation(origin);
  physVol->SetRotation(Rotation);
}

void ShellParameterisation::ComputeDimensions
      (G4Tubs& shellRadius, const G4int copyNo, 
      const G4VPhysicalVolume*) const
{
  G4double  newInnerRadius = (RadiusIncr * copyNo);
  G4double  newOuterRadius = (RadiusIncr * (copyNo+1));

  shellRadius.SetInnerRadius(newInnerRadius);
  shellRadius.SetOuterRadius(newOuterRadius);
  shellRadius.SetZHalfLength(detectorHeight/2);
  shellRadius.SetStartPhiAngle(0*deg);
  shellRadius.SetDeltaPhiAngle(360*deg);
}

------------------------------------------------------------------

I would appreciate if somebody could point out where is the problem.

Regards,

Gabriel


Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Concentric cylindrical shells   (Gabriele Cosmo - 24 Jan, 2007)
(_ Feedback: Re: Concentric cylindrical shells   (Gabriel Sawakuchi - 24 Jan, 2007)
 Add Message Add Message
to: "Concentric cylindrical shells "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]