Message: Problems with GetCopyNo() and russian dolls volumes!!! Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problems with GetCopyNo() and russian dolls volumes!!! 

Forum: Geometry
Date: 26 Sep, 2008
From: Florian ITARD <Florian ITARD>

Hello dear all,

I have a little problem that I hope someone could help me to solve it. I have constructed in my geometry a 208 blocks PbF2 calorimeter (16 rows and 13 columns), all worked well until the day when I decided to continuous my simulation with photons Cerenkov. So to respect the real geometry of the experiment, I defined two new mother volume, one volume of tyvek and one volume of air, where I have inserted a volume of PbF2, as the way of russian dolls. But now, I realize in my SteppingAction when I ask aStep->GetPreStepPoint()->GetPhysicalVolume()->GetCopyNo(), that the given copy number of the current physical volume are almost always the same. It's not normal. Someone, have he ever had a same trouble?

I let you here the interesting part of my geometry.

///////////////////////////////////////////////////

G4double epaisseur_bloc=3.*cm; G4double epaisseur_air_bloc=50.*um; G4double epaisseur_tyvek=100.*um; G4double profondeur_bloc=18.*cm;

G4double epaisseur_unite_x=epaisseur_bloc+2*epaisseur_air_bloc+2*epaisseur_tyvek
                           +2*epaisseur_cuivre+epaisseur_air_interstice_bloc;
G4double epaisseur_unite_y=epaisseur_bloc+2*epaisseur_air_bloc+2*epaisseur_tyvek
                           +epaisseur_air_interstice_bloc;
G4double epaisseur_unite_z=profondeur_bloc;

///tyvek

G4double U_tyvek_x=(epaisseur_bloc+2*epaisseur_air_bloc+2*epaisseur_tyvek)*0.5; G4double U_tyvek_y=(epaisseur_bloc+2*epaisseur_air_bloc+2*epaisseur_tyvek)*0.5; G4double U_tyvek_z=profondeur_bloc*0.5;

G4Box* unite_tyvek = new G4Box("U_tyvek",U_tyvek_x,U_tyvek_y,U_tyvek_z); unite_tyvek_log = new G4LogicalVolume(unite_tyvek,tyvek,"U_tyvek");

///air_in

G4double U_air_in_x=(epaisseur_bloc+2*epaisseur_air_bloc)*0.5; G4double U_air_in_y=(epaisseur_bloc+2*epaisseur_air_bloc)*0.5; G4double U_air_in_z=profondeur_bloc*0.5;

G4Box* unite_air_in = new G4Box("U_air_in",U_air_in_x,U_air_in_y,U_air_in_z); unite_air_in_log = new G4LogicalVolume(unite_air_in,air,"U_air_in");

///PbF2

G4double U_PbF2_x=epaisseur_bloc*0.5; G4double U_PbF2_y=epaisseur_bloc*0.5; G4double U_PbF2_z=(profondeur_bloc/decoupe_bloc_z)*0.5;

G4Box* unite_PbF2 = new G4Box("U_PbF2",U_PbF2_x,U_PbF2_y,U_PbF2_z); unite_PbF2_log = new G4LogicalVolume(unite_PbF2,PbF2,"U_PbF2");

nb_rangee=16; nb_colonne=13;

for (i_rangee=1;i_rangee<(nb_rangee+1);i_rangee++){
     for (j_colonne=1;j_colonne<(nb_colonne+1);j_colonne++){

          xpos=x_calo-epaisseur_beamside_shielding-U_x-2*(j_colonne-1)*U_x;
          ypos=y_calo-epaisseur_top_shielding-U_y-2*(i_rangee-1)*U_y;
          zpos=z_calo-U_z;

          unite_tyvek_phys = new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),unite_tyvek_log,
                                               "U_tyvek",
                                               calo_volume_mobile_log,
                                               false,
                                               i_rangee*100+j_colonne,
                                               false
                                               //0
                                               );

          xpos=0.;
          ypos=0.;
          zpos=0.;

          unite_air_in_phys = new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),unite_air_in_log,
                                                "U_air_in",
                                                unite_tyvek_log,
                                                false,
                                                i_rangee*100+j_colonne,
                                                false
                                                //0
                                                );

          xpos=0.;
          ypos=0.;
          zpos=0.; 

          unite_PbF2_phys = new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),unite_PbF2_log,
                                              "U_PbF2",
                                              unite_air_in_log,
                                              false,
                                              i_rangee*100+j_colonne,
                                              false
                                              //0
                                              );}}

///////////////////////////////////////////////////

And here I let you my SteppingAction.

///////////////////////////////////////////////////

     if (PreVolume == "U_tyvek"){

         G4int num_bloc;
         num_bloc=aStep->GetPreStepPoint()->GetPhysicalVolume()->GetCopyNo();
         G4cout<<"num_bloc_tyvek= "<<num_bloc<<G4endl;

         G4int i_i;
         G4int j_j;

         j_j=num_bloc%100;

         G4cout<<"j_j_tyvek= " <<j_j<<G4endl;
         num_bloc=(num_bloc-j_j)/100;
         i_i=num_bloc;
         G4cout<<"i_i_tyvek= " <<i_i<<G4endl<<G4endl;
}

     if (PreVolume == "U_air_in"){

         G4int num_bloc;

         num_bloc=aStep->GetPreStepPoint()->GetPhysicalVolume()->GetCopyNo();
         G4cout<<"num_bloc_air= "<<num_bloc<<G4endl;

         G4int i_i;
         G4int j_j;

         j_j=num_bloc%100;

         G4cout<<"j_j_air= " <<j_j<<G4endl;
         num_bloc=(num_bloc-j_j)/100;
         i_i=num_bloc;
         G4cout<<"i_i_air= " <<i_i<<G4endl<<G4endl;
}

     if (PreVolume == "U_PbF2"){

         G4int num_bloc;

         num_bloc=aStep->GetPreStepPoint()->GetPhysicalVolume()->GetCopyNo();
         G4int i_i;
         G4int j_j;

         j_j=num_bloc%100;

         G4cout<<"num_bloc_PbF2= "<<num_bloc<<G4endl;
         G4cout<<"j_j_PbF2= " <<j_j<<G4endl;

         num_bloc=(num_bloc-j_j)/100;
         i_i=num_bloc;

         G4cout<<"i_i_PbF2= " <<i_i<<G4endl;}

////////////////////////////////////////////////////

Here, you can see the different effects if just one "U-tyvek" are defined. There are many different block touched.

////////////////////////////////////////////////////

evt= 1 num_bloc_tyvek= 107 j_j_tyvek= 7 i_i_tyvek= 1

evt= 2 num_bloc_tyvek= 303 j_j_tyvek= 3 i_i_tyvek= 3

evt= 15 num_bloc_tyvek= 702 j_j_tyvek= 2 i_i_tyvek= 7

evt= 21 num_bloc_tyvek= 313 j_j_tyvek= 13 i_i_tyvek= 3

evt= 24 num_bloc_tyvek= 1403 j_j_tyvek= 3 i_i_tyvek= 14

evt= 32 num_bloc_tyvek= 607 j_j_tyvek= 7 i_i_tyvek= 6

evt= 36 num_bloc_tyvek= 1007 j_j_tyvek= 7 i_i_tyvek= 10

evt= 37 num_bloc_tyvek= 206 j_j_tyvek= 6 i_i_tyvek= 2

evt= 45 num_bloc_tyvek= 302 j_j_tyvek= 2 i_i_tyvek= 3

num_bloc_tyvek= 412 j_j_tyvek= 12 i_i_tyvek= 4

evt= 58 num_bloc_tyvek= 207 j_j_tyvek= 7 i_i_tyvek= 2

num_bloc_tyvek= 1108 j_j_tyvek= 8 i_i_tyvek= 11

evt= 92 num_bloc_tyvek= 406 j_j_tyvek= 6 i_i_tyvek= 4

evt= 94 num_bloc_tyvek= 1210 j_j_tyvek= 10 i_i_tyvek= 12

///////////////////////////////////////////////

but when the "U_air_in" is defined inside each "U_tyvek", just three different blocks are touched, whereas one could wait a same difference between the touched blocks.

///////////////////////////////////////////////

evt= 1 num_bloc_air= 1613 j_j_air= 13 i_i_air= 16

evt= 11 num_bloc_air= 1613 j_j_air= 13 i_i_air= 16

evt= 12 num_bloc_air= 1613 j_j_air= 13 i_i_air= 16

evt= 16 num_bloc_air= 1613 j_j_air= 13 i_i_air= 16

evt= 18 num_bloc_air= 1613 j_j_air= 13 i_i_air= 16

..........and so forth!!!

/////////////////////////////////////////////////

When the "U_PbF2" is defined in each "U_air_in", it's exactly the same thing than two volume. Only one volume defined allow me to have a good differenciation between blocks. Can you help me to understand this situation.

All help will be very appreciate.

Thank you, Florian.

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

1 None: Re: Problems with GetCopyNo() and russian dolls volumes!!!   (michel maire - 26 Sep, 2008)
 Add Message Add Message
to: "Problems with GetCopyNo() and russian dolls volumes!!!"

 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 ]