Message: How to add importance to G4PVParameterised volumes Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to add importance to G4PVParameterised volumes 

Forum: Biasing and Scoring
Date: 02 Dec, 2014
From: Xiaosong Yan <Xiaosong Yan>

Hello everyone:
    I'm now simulating an X-ray imaging system. Because the the ~MeV X-ray penetrates thick (~1 m) concrete object and then deposites energy in the array detectors, I plan to implement geometry based importance biasing techniques to improve the statistics.
    However, I'm confronting with problems with AddImportanceGeometryCell() procedures.
    In my DetectorConstruction class, the following is added:

  G4VSolid* calorimeterSolid = new G4Box("Calorimeter_Solid", // Name
                              2.525*cm,                // x half length
                             0.025*cm,                // y half length
                              2.5*cm) ;              // z half length

  G4LogicalVolume* calorimeterLogical =
    new G4LogicalVolume(calorimeterSolid,       // Solid
                        si,                    // Material
                        "Calorimeter_Logical"); // Name
    fLogicalVolumeVector.push_back(calorimeterLogical);     

     std::ostringstream os;
    G4String name;     
    for (G4int i = 0; i < 20; i++)
        {
        os.str("");		
        G4double ypos=i*0.25*cm-2.575*cm;
        os << "si_layer_"<<i;
        name = os.str();

         G4VPhysicalVolume *calorimeterPhysical=   
       new G4PVPlacement(0,G4ThreeVector(0.025*cm,ypos,35*cm),
                                          calorimeterLogical,
                                          name, 
                                          fpWorldLogical
                                          ,false,i);
        fPhysicalVolumeVector.push_back(calorimeterPhysical);  	                                    
        }

  //1000 rectangular Si cells
  G4VSolid* cellSolid = new G4Box("Cell_Solid", // Name
                                  0.025*cm,         // x half length
                                  0.02*cm,         // y half length
                                  2.5*cm);      // z half length

  G4LogicalVolume* cellLogical
    = new G4LogicalVolume(cellSolid,       // Solid
                          si,             // Material
                          "Cell_Logical"); // Name 
    fLogicalVolumeVector.push_back(cellLogical);    

 G4VPVParameterisation* cellParam = new BeamTestCellParameterisation();     

    G4VPhysicalVolume *cellPhysical=  
  new G4PVParameterised("Cell_Physical",    // Name
                        cellLogical,        // Logical volume
                        calorimeterLogical, // Mother volume
                        kXAxis,             // Axis    
                        50,                // Number of replicas
                        cellParam);         // Parameterisation
 fPhysicalVolumeVector.push_back(cellPhysical);   

because cellPhysical is the last element pushed back in the PhysicalVolumeVector, so the importance is added as:
     istore->AddImportanceGeometryCell(imp, *(*(fPhysicalVolumeVector.end()-1)),0);                

    Though I succeeded compiling my program, the following errors displayed when run it.

      ERROR - G4IStore::GetImportance(gCell):Region does not exist

***G4Exception: FataException
     issued by : G4IStore::Error()
GetImportance(gCell): Region does not exist
*** Fata Exception *** core dump ***

*** G4Exception: Aborting execution ***

Besides, there are some other output as:
    PGeometryCell gCell: Volume name = Cell_Physical, Replica number = 25
Not found in: 
Volume name = concreteblock, Replica number = 0, importance = 1
...
Volume name = Cell_Physical, Replica number = 0, importance = 100
...

    It's deduced that failure in addimportance to all the G4VPhysicalVolume cellPhysical leads to error, but I don't know how to add importance to them.

    Anyone who have idea? 
    I appreciate all your help.

Best regards. Xiaosong Yan.

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

1 None: Re: How to add importance to G4PVParameterised volumes   (Xiaosong Yan - 08 Jan, 2015)
1 None: Re: How to add importance to G4PVParameterised volumes   (jiawei liu - 09 Sep, 2015)
2 None: Re: How to add importance to G4PVParameterised volumes   (jiawei liu - 09 Sep, 2015)
3 None: Re: How to add importance to G4PVParameterised volumes   (jiawei liu - 09 Sep, 2015)
 Add Message Add Message
to: "How to add importance to G4PVParameterised volumes"

 Subscribe Subscribe

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