Message: Re: Editing TestEm11 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Editing TestEm11 

Forum: Documentation and Examples
Re: Question Editing TestEm11 (Antonio Magalhaes)
Re: None Re: Editing TestEm11 (michel maire)
Date: 26 Jun, 2018
From: <modest24>

Hey Michel et al.,

I ran into the same problem. Any suggestions on how to make the world volume different from that of the absorber. I have tried but it seems it always end up with the default geometry. Here is my modification. I added a calorimeter and made the it the mother of the absorber while the mother of the calorimeter is the world:

// World

  //

   G4double wall_sizeX = 20*mm;

   G4double wall_sizeYZ = 1.2*cm;

   // G4double world_sizeX=20*mm;

  // G4double word_sizeYZ=1*cm;

G4Box* solidWall =

    new G4Box("Wall",                                             //name

               wall_sizeX/2,wall_sizeYZ/2,wall_sizeYZ/2);       //size

  G4LogicalVolume* logicWall =

    new G4LogicalVolume(solidWall,              //solid

                        Air,        //material

                        "Wall");                //name

  fPhysiWall = 

    new G4PVPlacement(0,                        //no rotation

                        G4ThreeVector(),        //at (0,0,0)

                      logicWall,               //logical volume

                      "Wall",                  //name

                       0,                       //mother volume

                       false,                   //no boolean operation

                       0);                      //copy number

  //

  // Calorimeter

  //  

  G4VSolid* calorimeterS

    = new G4Box("Calorimeter",     // its name

                 fAbsorSizeX/2,fAbsorSizeYZ/2,fAbsorSizeYZ/2); // its size

  G4LogicalVolume* calorLV

    = new G4LogicalVolume(

                 calorimeterS,     // its solid

                 Air,  // its material

                 "Calorimeter");   // its name

  new G4PVPlacement(

                 0,                // no rotation

                 G4ThreeVector(),  // at (0,0,0)

                 calorLV,          // its logical volume                         

                 "Calorimeter",    // its name

                 logicWall,          // its mother  volume

                 false,            // no boolean operation

                 0);  

// Absorbers

  //

  fXfront[0] = -0.5*fAbsorSizeX;

  //

  for (G4int k=1; k<=fNbOfAbsor; k++) {

    G4Material* material = fAbsorMaterial[k];

    G4String matname;

    G4Box* solidAbsor =

      new G4Box(matname,fAbsorThickness[k]/2,fAbsorSizeYZ/2,fAbsorSizeYZ/2);

    G4LogicalVolume* logicAbsor=

      new G4LogicalVolume(solidAbsor,           // solid

                         SiC,             // material

                          matname);             // name

    fXfront[k] = fXfront[k-1] + fAbsorThickness[k-1];    

    G4double xcenter = fXfront[k]+0.5*fAbsorThickness[k];

    G4ThreeVector position = G4ThreeVector(xcenter,0.,0.);

      new G4PVPlacement(0,                     //no rotation

                        position,        //position

                        logicAbsor,            //logical volume        

                        matname,               //name

                        calorLV,            //mother

                        false,                 //no boulean operat

                        k);                    //copy number

    // divisions, if any

    //

    G4double LayerThickness = fAbsorThickness[k]/fNbOfDivisions[k];

    G4Box* solidLayer =   

      new G4Box(matname,LayerThickness/2,fAbsorSizeYZ/2,fAbsorSizeYZ/2);

    G4LogicalVolume* logicLayer =

      new G4LogicalVolume(solidLayer,      //solid

                          fAbsorberMaterial,        //material

                          matname);        //name

      new G4PVReplica(matname,             //name

                            logicLayer,    //logical volume

                            logicAbsor,    //mother

                      kXAxis,              //axis of replication

                      fNbOfDivisions[k],   //number of replica

                      LayerThickness);     //witdth of replica    

  }

  PrintParameters();

  //always return the physical World

  //

  return fPhysiWall;

}

 Add Message Add Message
to: "Re: Editing TestEm11"

 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 ]