Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/hadrontherapy/src/HadrontherapyModulator.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/hadrontherapy/src/HadrontherapyModulator.cc (Version 11.3.0) and /examples/advanced/hadrontherapy/src/HadrontherapyModulator.cc (Version 9.4.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // This is the *BASIC* version of Hadrontherap     26 // This is the *BASIC* version of Hadrontherapy, a Geant4-based application
 27 // See more at: http://g4advancedexamples.lngs     27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
 28 //                                                 28 //
 29 // Visit the Hadrontherapy web site (http://ww     29 // Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request 
 30 // the *COMPLETE* version of this program, tog     30 // the *COMPLETE* version of this program, together with its documentation;
 31 // Hadrontherapy (both basic and full version)     31 // Hadrontherapy (both basic and full version) are supported by the Italian INFN
 32 // Institute in the framework of the MC-INFN G     32 // Institute in the framework of the MC-INFN Group
 33 //                                                 33 //
 34                                                    34 
 35 #include <fstream>                             << 
 36                                                << 
 37 #include "globals.hh"                          << 
 38 #include "G4SystemOfUnits.hh"                  << 
 39 #include "G4Material.hh"                           35 #include "G4Material.hh"
 40 #include "G4Tubs.hh"                               36 #include "G4Tubs.hh"
 41 #include "G4Box.hh"                                37 #include "G4Box.hh"
 42 #include "G4LogicalVolume.hh"                      38 #include "G4LogicalVolume.hh"
 43 #include "G4VPhysicalVolume.hh"                    39 #include "G4VPhysicalVolume.hh"
 44 #include "G4ThreeVector.hh"                        40 #include "G4ThreeVector.hh"
 45 #include "G4PVPlacement.hh"                        41 #include "G4PVPlacement.hh"
                                                   >>  42 #include "globals.hh"
 46 #include "G4Transform3D.hh"                        43 #include "G4Transform3D.hh"
 47 #include "G4RotationMatrix.hh"                     44 #include "G4RotationMatrix.hh"
 48 #include "G4VisAttributes.hh"                      45 #include "G4VisAttributes.hh"
 49 #include "G4Colour.hh"                             46 #include "G4Colour.hh"
 50 #include "HadrontherapyModulator.hh"               47 #include "HadrontherapyModulator.hh"
 51 #include "G4Transform3D.hh"                        48 #include "G4Transform3D.hh"
 52 #include "G4ios.hh"                                49 #include "G4ios.hh"
                                                   >>  50 #include <fstream>
 53 #include "G4RunManager.hh"                         51 #include "G4RunManager.hh"
 54 #include "G4NistManager.hh"                        52 #include "G4NistManager.hh"
 55 #include <iostream>                            << 
 56                                                    53 
 57 HadrontherapyModulator::HadrontherapyModulator <<  54 HadrontherapyModulator::HadrontherapyModulator():physiMotherMod(0),
                                                   >>  55              solidMod0(0),         logicMod0(0),          physiMod0(0),
 58              solidMod1(0),         logicMod1(0     56              solidMod1(0),         logicMod1(0),          physiMod1(0),
 59              solidMod2(0),         logicMod2(0     57              solidMod2(0),         logicMod2(0),          physiMod2(0),
 60              solidMod3(0),         logicMod3(0     58              solidMod3(0),         logicMod3(0),          physiMod3(0),
 61              solidMod4(0),         logicMod4(0     59              solidMod4(0),         logicMod4(0),          physiMod4(0),
 62              FileName("Modulators/Modulator010 <<  60              solidMod5(0),         logicMod5(0),          physiMod5(0),
 63 {                                              <<  61              solidMod6(0),         logicMod6(0),          physiMod6(0),
 64    pi=4*std::atan(1.);                         <<  62              solidMod7(0),         logicMod7(0),          physiMod7(0),
 65    StepNumbers=22;                             <<  63              solidMod8(0),         logicMod8(0),          physiMod8(0),
 66    Weight=new G4double[StepNumbers];           <<  64              solidMod9(0),         logicMod9(0),          physiMod9(0),
 67    StepThickness=new G4double[StepNumbers];    <<  65              solidMod10(0),        logicMod10(0),         physiMod10(0),
 68    StartingAngle=new G4double[StepNumbers];    <<  66              solidMod11(0),        logicMod11(0),         physiMod11(0),
 69    SpanningAngle=new G4double[StepNumbers];    <<  67              solidMod12(0),        logicMod12(0),         physiMod12(0),
 70    PositionMod=new G4ThreeVector[StepNumbers]; <<  68              solidMod13(0),        logicMod13(0),         physiMod13(0),
 71                                                <<  69              solidMod14(0),        logicMod14(0),         physiMod14(0),
 72                                                <<  70              solidMod15(0),        logicMod15(0),         physiMod15(0),
 73    solidMod=new G4Tubs *[StepNumbers];         <<  71              solidMod16(0),        logicMod16(0),         physiMod16(0),
 74    logicMod=new G4LogicalVolume *[StepNumbers] <<  72              solidMod17(0),        logicMod17(0),         physiMod17(0),
 75    physiMod=new G4VPhysicalVolume *[(4*(StepNu <<  73              solidMod18(0),        logicMod18(0),         physiMod18(0),
 76                                                <<  74              solidMod20(0),        logicMod20(0),         physiMod20(0),
 77    for (G4int i=0;i<StepNumbers;i++)           <<  75              solidMod21(0),        logicMod21(0),         physiMod21(0),
 78   {                                            <<  76              solidMod22(0),        logicMod22(0),         physiMod22(0),
 79   Weight[i]=0;                                 <<  77              solidMod23(0),        logicMod23(0),         physiMod23(0),
 80   StepThickness[i]=0;                          <<  78              solidMod24(0),        logicMod24(0),         physiMod24(0),
 81   StartingAngle[i]=0;                          <<  79              solidMod25(0),        logicMod25(0),         physiMod25(0),
 82   SpanningAngle[i]=0;                          <<  80              solidMod26(0),        logicMod26(0),         physiMod26(0),
 83   PositionMod[i]=G4ThreeVector(0,0,0);         <<  81              solidMod27(0),        logicMod27(0),         physiMod27(0),
 84   solidMod[i]=0;                               <<  82              solidMod28(0),        logicMod28(0),         physiMod28(0),
 85   logicMod[i]=0;                               <<  83              solidMod29(0),        logicMod29(0),         physiMod29(0),
 86                                                <<  84              solidMod30(0),        logicMod30(0),         physiMod30(0),
 87   }                                            <<  85              solidMod31(0),        logicMod31(0),         physiMod31(0),
 88                                                <<  86              solidMod32(0),        logicMod32(0),         physiMod32(0),
 89   for (G4int i=0;i<4*(StepNumbers-1)+1;i++)    <<  87              solidMod33(0),        logicMod33(0),         physiMod33(0),
 90   {                                            <<  88              solidMod34(0),        logicMod34(0),         physiMod34(0),
 91   physiMod[i]=0;                               <<  89              solidMod35(0),        logicMod35(0),         physiMod35(0),
 92   }                                            <<  90              solidMod36(0),        logicMod36(0),         physiMod36(0),
 93                                                <<  91              solidMod37(0),        logicMod37(0),         physiMod37(0),
 94                                                <<  92              solidMod38(0),        logicMod38(0),         physiMod38(0),
 95   ModulatorMessenger = new  HadrontherapyModul <<  93              solidMod40(0),        logicMod40(0),         physiMod40(0),
 96   ModulatorDefaultProperties();                <<  94              solidMod41(0),        logicMod41(0),         physiMod41(0),
                                                   >>  95              solidMod42(0),        logicMod42(0),         physiMod42(0),
                                                   >>  96              solidMod43(0),        logicMod43(0),         physiMod43(0),
                                                   >>  97              solidMod44(0),        logicMod44(0),         physiMod44(0),
                                                   >>  98              solidMod45(0),        logicMod45(0),         physiMod45(0),
                                                   >>  99              solidMod46(0),        logicMod46(0),         physiMod46(0),
                                                   >> 100              solidMod47(0),        logicMod47(0),         physiMod47(0),
                                                   >> 101              solidMod48(0),        logicMod48(0),         physiMod48(0),
                                                   >> 102              solidMod49(0),        logicMod49(0),         physiMod49(0),
                                                   >> 103              solidMod50(0),        logicMod50(0),         physiMod50(0),
                                                   >> 104              solidMod51(0),        logicMod51(0),         physiMod51(0),
                                                   >> 105              solidMod52(0),        logicMod52(0),         physiMod52(0),
                                                   >> 106              solidMod53(0),        logicMod53(0),         physiMod53(0),
                                                   >> 107              solidMod54(0),        logicMod54(0),         physiMod54(0),
                                                   >> 108              solidMod55(0),        logicMod55(0),         physiMod55(0),
                                                   >> 109              solidMod56(0),        logicMod56(0),         physiMod56(0),
                                                   >> 110              solidMod57(0),        logicMod57(0),         physiMod57(0),
                                                   >> 111              solidMod58(0),        logicMod58(0),         physiMod58(0),
                                                   >> 112              solidMod60(0),        logicMod60(0),         physiMod60(0),
                                                   >> 113              solidMod61(0),        logicMod61(0),         physiMod61(0),
                                                   >> 114              solidMod62(0),        logicMod62(0),         physiMod62(0),
                                                   >> 115              solidMod63(0),        logicMod63(0),         physiMod63(0),
                                                   >> 116              solidMod64(0),        logicMod64(0),         physiMod64(0),
                                                   >> 117              solidMod65(0),        logicMod65(0),         physiMod65(0),
                                                   >> 118              solidMod66(0),        logicMod66(0),         physiMod66(0),
                                                   >> 119              solidMod67(0),        logicMod67(0),         physiMod67(0),
                                                   >> 120              solidMod68(0),        logicMod68(0),         physiMod68(0),
                                                   >> 121              solidMod69(0),        logicMod69(0),         physiMod69(0),
                                                   >> 122              solidMod70(0),        logicMod70(0),         physiMod70(0),
                                                   >> 123              solidMod71(0),        logicMod71(0),         physiMod71(0),
                                                   >> 124              solidMod72(0),        logicMod72(0),         physiMod72(0),
                                                   >> 125              solidMod73(0),        logicMod73(0),         physiMod73(0),
                                                   >> 126              solidMod74(0),        logicMod74(0),         physiMod74(0),
                                                   >> 127              solidMod75(0),        logicMod75(0),         physiMod75(0),
                                                   >> 128              solidMod76(0),        logicMod76(0),         physiMod76(0),
                                                   >> 129              solidMod77(0),        logicMod77(0),         physiMod77(0),
                                                   >> 130              solidMod78(0),        logicMod78(0),         physiMod78(0) 
                                                   >> 131 {
 97   rm = new G4RotationMatrix();                    132   rm = new G4RotationMatrix(); 
 98   G4double phi = 270. *deg;                       133   G4double phi = 270. *deg;     
 99   rm -> rotateY(phi);                             134   rm -> rotateY(phi); 
100 }                                                 135 }
101 //////////////////////////////////////////////    136 /////////////////////////////////////////////////////////////////////////////
102 HadrontherapyModulator::~HadrontherapyModulato    137 HadrontherapyModulator::~HadrontherapyModulator() 
103 {                                                 138 {
104   delete rm;                                      139   delete rm;
105   delete [] Weight;                            << 
106   delete [] StepThickness;                     << 
107   delete [] StartingAngle;                     << 
108   delete [] SpanningAngle;                     << 
109   delete [] PositionMod;                       << 
110   delete [] solidMod;                          << 
111   delete [] logicMod;                          << 
112   delete []    physiMod;                       << 
113   delete ModulatorMessenger;                   << 
114 }                                                 140 }
115                                                << 
116 //////////////////////////////////////////////    141 /////////////////////////////////////////////////////////////////////////////
117 void HadrontherapyModulator::ModulatorDefaultP << 
118 {                                              << 
119 /* Here we initialize the step properties of M << 
120 specific modulator by changing the values in t << 
121 file and activate reading from file via a macr << 
122                                                << 
123  StepThickness[0]=0; Weight[0]=.14445;         << 
124  StepThickness[1]=.8; Weight[1]=.05665;        << 
125  StepThickness[2]=1.6; Weight[2]=.05049;       << 
126  StepThickness[3]=2.4; Weight[3]=.04239;       << 
127  StepThickness[4]=3.2; Weight[4]=.04313;       << 
128  StepThickness[5]=4.0; Weight[5]=.03879;       << 
129  StepThickness[6]=4.8; Weight[6]=.04182;       << 
130  StepThickness[7]=5.6; Weight[7]=.03422;       << 
131  StepThickness[8]=6.4; Weight[8]=.03469;       << 
132  StepThickness[9]=7.2; Weight[9]=.03589;       << 
133  StepThickness[10]=8.0; Weight[10]=.03633;     << 
134  StepThickness[11]=8.8; Weight[11]=.03842;     << 
135  StepThickness[12]=9.6; Weight[12]=.03688;     << 
136  StepThickness[13]=10.4; Weight[13]=.03705;    << 
137  StepThickness[14]=11.2; Weight[14]=.03773;    << 
138  StepThickness[15]=12.0; Weight[15]=.03968;    << 
139  StepThickness[16]=12.8; Weight[16]=.04058;    << 
140  StepThickness[17]=13.6; Weight[17]=.03903;    << 
141  StepThickness[18]=14.4; Weight[18]=.04370;    << 
142  StepThickness[19]=15.2; Weight[19]=.03981;    << 
143  StepThickness[20]=16.0; Weight[20]=.05226;    << 
144  StepThickness[21]=16.8; Weight[21]=.03603;    << 
145  GetStepInformation();                         << 
146                                                << 
147 }                                              << 
148 ////////////////////////////////////////////// << 
149 void HadrontherapyModulator:: ModulatorPropert << 
150 {                                              << 
151   delete [] Weight;                            << 
152   delete [] StepThickness;                     << 
153   delete [] StartingAngle;                     << 
154   delete [] SpanningAngle;                     << 
155   delete [] PositionMod;                       << 
156   delete [] solidMod;                          << 
157   delete [] logicMod;                          << 
158   delete []    physiMod;                       << 
159   delete    solidMod1;                         << 
160   delete    logicMod1;                         << 
161   delete    physiMod1;                         << 
162   delete    solidMod2;                         << 
163   delete    logicMod2;                         << 
164   delete    physiMod2;                         << 
165   delete    solidMod3;                         << 
166   delete    logicMod3;                         << 
167   delete    physiMod3;                         << 
168   delete    solidMod4;                         << 
169   delete    logicMod4;                         << 
170   delete    physiMod4;                         << 
171 // The Modulator wheel properties is getting f << 
172   File.open(Name,  std::ios::in);              << 
173   if(!File.is_open())                          << 
174   {                                            << 
175   G4cout<<" WARNING: The File with name of "<< << 
176  " doesn't exist to get modulator step propert << 
177                                                << 
178  G4Exception("HadrontherapyModulator::Modulato << 
179  , FatalException, "Error: No available extern << 
180     }                                          << 
181                                                << 
182   G4String string;                             << 
183   File >>string>> StepNumbers;                 << 
184   File >>string>>string>>string;               << 
185                                                << 
186                                                << 
187    Weight=new G4double[StepNumbers];           << 
188    StepThickness=new G4double[StepNumbers];    << 
189    StartingAngle=new G4double[StepNumbers];    << 
190    SpanningAngle=new G4double[StepNumbers];    << 
191    PositionMod=new G4ThreeVector[StepNumbers]; << 
192                                                << 
193                                                << 
194    solidMod=new G4Tubs *[StepNumbers];         << 
195    logicMod=new G4LogicalVolume *[StepNumbers] << 
196    physiMod=new G4VPhysicalVolume *[(4*(StepNu << 
197                                                << 
198   for(G4int i=0;i<StepNumbers;i++)             << 
199    {                                           << 
200    G4String stringX;                           << 
201    File>>stringX>> StepThickness[i]>>Weight[i] << 
202    }                                           << 
203                                                << 
204    GetStepInformation();                       << 
205    BuildSteps();                               << 
206                                                << 
207                                                << 
208                                                << 
209 }                                              << 
210 ////////////////////////////////////////////// << 
211 void HadrontherapyModulator::GetStepInformatio << 
212 {                                              << 
213                                                << 
214  G4double TotalWeight=0;                       << 
215  // convert the absolute weight values to rela << 
216  for(G4int i=0;i<StepNumbers;i++)              << 
217   {                                            << 
218    TotalWeight+=Weight[i];                     << 
219   }                                            << 
220                                                << 
221  for(G4int i=0;i<StepNumbers;i++)              << 
222  {                                             << 
223    Weight[i]=Weight[i]/TotalWeight;            << 
224  }                                             << 
225                                                << 
226  // To build the RMW step layers will be put o << 
227                                                << 
228   StartingAngle[0]=0 *deg;                     << 
229   SpanningAngle[0]=90 *deg;                    << 
230   G4double PositionModx;                       << 
231   G4double WholeStartingAngle=0 *deg;          << 
232   G4double WholeThickness=0;                   << 
233   for(G4int i=1;i<StepNumbers;i++)             << 
234   {                                            << 
235     StartingAngle[i]=WholeStartingAngle+(Weigh << 
236     SpanningAngle[i]=90* deg -2*StartingAngle[ << 
237     StepThickness[i]=StepThickness[i]-WholeThi << 
238     PositionModx=WholeThickness+StepThickness[ << 
239     PositionMod[i]=G4ThreeVector(0,0,PositionM << 
240     WholeThickness+=StepThickness[i];          << 
241     WholeStartingAngle=StartingAngle[i];       << 
242   }                                            << 
243                                                << 
244                                                << 
245 }                                              << 
246 ////////////////////////////////////////////// << 
247 void HadrontherapyModulator::BuildModulator(G4    142 void HadrontherapyModulator::BuildModulator(G4VPhysicalVolume* motherVolume)
248 {                                                 143 {
249   G4bool isotopes = false;                        144   G4bool isotopes = false;
250   G4Material* airNist =  G4NistManager::Instan    145   G4Material* airNist =  G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
251                                                   146 
                                                   >> 147   // You have to uncomment the following line if you want to define a PMMA material
                                                   >> 148   //  G4Material* PMMANist = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
252                                                   149 
253    Mod0Mater = airNist;                        << 150   G4Material* Mod0Mater = airNist;
254    ModMater = airNist; // You have to change m << 151   G4Material* ModMater = airNist; // You have to set ModMater to PMMANist if you want to change modulator material (default is air)
255                                                   152  
256   innerRadiusOfTheTube = 2.5 *cm;              << 153   G4double innerRadiusOfTheTube = 2.5 *cm;
257   outerRadiusOfTheTube = 9.5 *cm;              << 154   G4double outerRadiusOfTheTube = 9.5 *cm;
                                                   >> 155   G4double hightOfTheTube = 0.03*cm;
258                                                   156 
259   // Mother of the modulator wheel                157   // Mother of the modulator wheel  
260   G4ThreeVector positionMotherMod = G4ThreeVec    158   G4ThreeVector positionMotherMod = G4ThreeVector(-2160.50 *mm, 30 *mm, 50 *mm);
261                                                   159  
262   G4Box* solidMotherMod = new G4Box("MotherMod    160   G4Box* solidMotherMod = new G4Box("MotherMod", 12 *cm, 12 *cm, 12 *cm);
263                                                   161  
264   logicMotherMod = new G4LogicalVolume(solidMo << 162   G4LogicalVolume * logicMotherMod = new G4LogicalVolume(solidMotherMod, Mod0Mater,"MotherMod",0,0,0);
265                                                   163 
266   physiMotherMod = new G4PVPlacement(rm,positi    164   physiMotherMod = new G4PVPlacement(rm,positionMotherMod,  "MotherMod", 
267              logicMotherMod,                      165              logicMotherMod,              
268              motherVolume,                        166              motherVolume,      
269              false,                               167              false,           
270              0);                               << 168              0);              
271   BuildSteps();                                << 169  
272                                                << 
273                                                << 
274                                                << 
275          }                                     << 
276  ///////////////////////////////////////////// << 
277  void HadrontherapyModulator::BuildSteps()     << 
278  {                                             << 
279   //------------------------------------------    170   //----------------------------------------------------------
280   // Mother volume of first quarter of the mod    171   // Mother volume of first quarter of the modulator
281   //------------------------------------------    172   //----------------------------------------------------------
282                                                   173 
283   G4double hightOfTheTube0 = 10.0 *cm;         << 174   G4double hightOfTheTube0 = 5.0 *cm;
284   G4double startAngleOfTheTube0 = 0 *deg;      << 175   G4double startAngleOfTheTube0 = 45 *deg;
285   G4double spanningAngleOfTheTube0 = 90 *deg;     176   G4double spanningAngleOfTheTube0 = 90 *deg;
286                                                   177   
287   G4RotationMatrix rm1;                        << 178   G4RotationMatrix rm2;
288   rm1.rotateZ(0 *deg);                         << 179   rm2.rotateZ(0 *deg);
289                                                   180  
290   G4ThreeVector positionMod1 = G4ThreeVector(0 << 181   G4ThreeVector positionMod0 = G4ThreeVector(0*cm,0*cm,0*cm);
291                                                   182   
292   solidMod1 = new G4Tubs("Mod1",               << 183   solidMod0 = new G4Tubs("Mod0",
293        innerRadiusOfTheTube,                      184        innerRadiusOfTheTube, 
294        outerRadiusOfTheTube,                      185        outerRadiusOfTheTube,
295        hightOfTheTube0/2.,                     << 186        hightOfTheTube0,
296        startAngleOfTheTube0,                      187        startAngleOfTheTube0, 
297        spanningAngleOfTheTube0);                  188        spanningAngleOfTheTube0);
298                                                   189   
299   logicMod1 = new G4LogicalVolume(solidMod1, M << 190   logicMod0 = new G4LogicalVolume(solidMod0, Mod0Mater, "Mod0",0,0,0);
300                                                   191   
301   physiMod1 = new G4PVPlacement(G4Transform3D( << 192   physiMod0 = new G4PVPlacement(G4Transform3D(rm2, positionMod0), 
302         logicMod1,                             << 193         logicMod0,    
303         "Mod1",                                << 194         "Mod0",       
304         logicMotherMod,                           195         logicMotherMod,  
305         false,                                    196         false,         
306         0);                                       197         0);            
307                                                   198   
308                                                   199  
309   //------------------------------------------    200   //----------------------------------------------------------
310   //  modulator steps                          << 201   // First modulator sclice
311   //------------------------------------------    202   //----------------------------------------------------------
312   for (G4int i=1;i<StepNumbers;i++)            << 203  
313   {                                            << 204   G4double startAngleOfTheTube1 = 54.267*deg;
                                                   >> 205   G4double spanningAngleOfTheTube1 = 71.466*deg;
314                                                   206 
315   solidMod[i] = new G4Tubs("Modstep",          << 207  
                                                   >> 208   G4ThreeVector positionMod1 = G4ThreeVector(0*cm,0*cm,0.51*cm);
                                                   >> 209   solidMod1 = new G4Tubs("Mod1",
316        innerRadiusOfTheTube,                      210        innerRadiusOfTheTube, 
317        outerRadiusOfTheTube,                      211        outerRadiusOfTheTube,
318        StepThickness[i]/2.,                    << 212        hightOfTheTube,
319        StartingAngle[i],                       << 213        startAngleOfTheTube1, 
320        SpanningAngle[i]);                      << 214        spanningAngleOfTheTube1);
321                                                   215              
322   logicMod[i] = new G4LogicalVolume(solidMod[i << 216   logicMod1 = new G4LogicalVolume(solidMod1, ModMater, "Mod1",0,0,0);
323                                    ModMater, " << 217   physiMod1 = new G4PVPlacement(0,               
324                                                << 218         positionMod1,  
325   physiMod[i] = new G4PVPlacement(0,           << 
326         PositionMod[i],                        << 
327         logicMod[i],                           << 
328         "Modstep",                             << 
329         logicMod1,                                219         logicMod1,     
                                                   >> 220         "Mod1",        
                                                   >> 221         logicMod0,     
330         false,                                    222         false,         
331         0);                                    << 223         0);            
332                                                << 224               
333                                                << 225               
334   }                                            << 226   //----------------------------------------------------------
                                                   >> 227   // Second modulator slice
                                                   >> 228   //----------------------------------------------------------
                                                   >> 229   
                                                   >> 230   G4double startAngleOfTheTube2 = 57.714*deg;
                                                   >> 231   G4double spanningAngleOfTheTube2 = 64.572*deg;
                                                   >> 232 
                                                   >> 233    
                                                   >> 234    
                                                   >> 235   G4ThreeVector positionMod2 = G4ThreeVector(0*cm,0*cm,0.45*cm);
                                                   >> 236   solidMod2 = new G4Tubs("Mod2",
                                                   >> 237        innerRadiusOfTheTube, 
                                                   >> 238        outerRadiusOfTheTube,
                                                   >> 239        hightOfTheTube,
                                                   >> 240        startAngleOfTheTube2, 
                                                   >> 241        spanningAngleOfTheTube2);
                                                   >> 242 
                                                   >> 243   logicMod2 = new G4LogicalVolume(solidMod2, ModMater, "Mod2",0,0,0);
                                                   >> 244   physiMod2 = new G4PVPlacement(0,             
                                                   >> 245         positionMod2,  
                                                   >> 246         logicMod2,     
                                                   >> 247         "Mod2",        
                                                   >> 248         logicMod0,     
                                                   >> 249         false,         
                                                   >> 250         0);            
                                                   >> 251 
                                                   >> 252 
                                                   >> 253   //----------------------------------------------------------
                                                   >> 254   // 3th modulator slice
                                                   >> 255   //----------------------------------------------------------
                                                   >> 256  
                                                   >> 257   G4double startAngleOfTheTube3 = 60.478*deg;
                                                   >> 258   G4double spanningAngleOfTheTube3 = 59.044*deg;
                                                   >> 259 
                                                   >> 260    
                                                   >> 261    
                                                   >> 262   G4ThreeVector positionMod3 = G4ThreeVector(0*cm,0*cm,0.39*cm);
                                                   >> 263   solidMod3 = new G4Tubs("Mod3",
                                                   >> 264        innerRadiusOfTheTube, 
                                                   >> 265        outerRadiusOfTheTube,
                                                   >> 266        hightOfTheTube,
                                                   >> 267        startAngleOfTheTube3, 
                                                   >> 268        spanningAngleOfTheTube3);
                                                   >> 269 
                                                   >> 270   logicMod3 = new G4LogicalVolume(solidMod3, ModMater, "Mod3",0,0,0);
                                                   >> 271   physiMod3 = new G4PVPlacement(0,                  
                                                   >> 272         positionMod3,  
                                                   >> 273         logicMod3,     
                                                   >> 274         "Mod3",        
                                                   >> 275         logicMod0,     
                                                   >> 276         false,         
                                                   >> 277         0);            
                                                   >> 278 
                                                   >> 279  
                                                   >> 280   //----------------------------------------------------------
                                                   >> 281   //
                                                   >> 282   //----------------------------------------------------------
                                                   >> 283  
                                                   >> 284   G4double startAngleOfTheTube4 = 62.668*deg;
                                                   >> 285   G4double spanningAngleOfTheTube4 = 54.664*deg;
                                                   >> 286    
                                                   >> 287    
                                                   >> 288   G4ThreeVector positionMod4 = G4ThreeVector(0*cm,0*cm,0.33*cm);
                                                   >> 289   solidMod4 = new G4Tubs("Mod4",
                                                   >> 290        innerRadiusOfTheTube, 
                                                   >> 291        outerRadiusOfTheTube,
                                                   >> 292        hightOfTheTube,
                                                   >> 293        startAngleOfTheTube4, 
                                                   >> 294        spanningAngleOfTheTube4);
                                                   >> 295 
                                                   >> 296   logicMod4 = new G4LogicalVolume(solidMod4, ModMater, "Mod4",0,0,0);
                                                   >> 297   physiMod4 = new G4PVPlacement(0,                   // no rotation
                                                   >> 298         positionMod4,  // at (x,y,z)
                                                   >> 299         logicMod4,     // its logical volume          
                                                   >> 300         "Mod4",        // its name
                                                   >> 301         logicMod0,      // its mother  volume
                                                   >> 302         false,           // no boolean operations
                                                   >> 303         0);              // no particular field
                                                   >> 304 
                                                   >> 305 
                                                   >> 306   //----------------------------------------------------------
                                                   >> 307   //Quinta fetta Modulatore
                                                   >> 308   //----------------------------------------------------------
                                                   >> 309  
                                                   >> 310   G4double startAngleOfTheTube5 = 64.814*deg;
                                                   >> 311   G4double spanningAngleOfTheTube5 = 50.372*deg;
                                                   >> 312    
                                                   >> 313    
                                                   >> 314   G4ThreeVector positionMod5 = G4ThreeVector(0*cm,0*cm,0.27*cm);
                                                   >> 315   solidMod5 = new G4Tubs("Mod5",
                                                   >> 316        innerRadiusOfTheTube, 
                                                   >> 317        outerRadiusOfTheTube,
                                                   >> 318        hightOfTheTube,
                                                   >> 319        startAngleOfTheTube5, 
                                                   >> 320        spanningAngleOfTheTube5);
                                                   >> 321 
                                                   >> 322   logicMod5 = new G4LogicalVolume(solidMod5, ModMater, "Mod5",0,0,0);
                                                   >> 323   physiMod5 = new G4PVPlacement(0,                   // no rotation
                                                   >> 324         positionMod5,  // at (x,y,z)
                                                   >> 325         logicMod5,     // its logical volume          
                                                   >> 326         "Mod5",        // its name
                                                   >> 327         logicMod0,      // its mother  volume
                                                   >> 328         false,           // no boolean operations
                                                   >> 329         0);              // no particular field
                                                   >> 330 
                                                   >> 331   
                                                   >> 332   //----------------------------------------------------------
                                                   >> 333   //Sesta fetta Modulatore
                                                   >> 334   //----------------------------------------------------------
                                                   >> 335  
                                                   >> 336   G4double startAngleOfTheTube6 = 66.706*deg;
                                                   >> 337   G4double spanningAngleOfTheTube6 = 46.588*deg;
                                                   >> 338    
                                                   >> 339    
                                                   >> 340   G4ThreeVector positionMod6 = G4ThreeVector(0*cm,0*cm,0.21*cm);
                                                   >> 341   solidMod6 = new G4Tubs("Mod6",
                                                   >> 342        innerRadiusOfTheTube, 
                                                   >> 343        outerRadiusOfTheTube,
                                                   >> 344        hightOfTheTube,
                                                   >> 345        startAngleOfTheTube6, 
                                                   >> 346        spanningAngleOfTheTube6);
                                                   >> 347 
                                                   >> 348   logicMod6 = new G4LogicalVolume(solidMod6, ModMater, "Mod6",0,0,0);
                                                   >> 349   physiMod6 = new G4PVPlacement(0,                   // no rotation
                                                   >> 350         positionMod6,  // at (x,y,z)
                                                   >> 351         logicMod6,     // its logical volume          
                                                   >> 352         "Mod6",        // its name
                                                   >> 353         logicMod0,      // its mother  volume
                                                   >> 354         false,           // no boolean operations
                                                   >> 355         0);              // no particular field
                                                   >> 356 
                                                   >> 357 
                                                   >> 358   //----------------------------------------------------------
                                                   >> 359   //Settima fetta Modulatore
                                                   >> 360   //----------------------------------------------------------
                                                   >> 361  
                                                   >> 362   G4double startAngleOfTheTube7 = 68.648*deg;
                                                   >> 363   G4double spanningAngleOfTheTube7 = 42.704*deg;
                                                   >> 364 
                                                   >> 365    
                                                   >> 366    
                                                   >> 367   G4ThreeVector positionMod7 = G4ThreeVector(0*cm,0*cm,0.15*cm);
                                                   >> 368   solidMod7 = new G4Tubs("Mod7",
                                                   >> 369        innerRadiusOfTheTube, 
                                                   >> 370        outerRadiusOfTheTube,
                                                   >> 371        hightOfTheTube,
                                                   >> 372        startAngleOfTheTube7, 
                                                   >> 373        spanningAngleOfTheTube7);
                                                   >> 374 
                                                   >> 375   logicMod7 = new G4LogicalVolume(solidMod7, ModMater, "Mod7",0,0,0);
                                                   >> 376   physiMod7 = new G4PVPlacement(0,                   // no rotation
                                                   >> 377         positionMod7,  // at (x,y,z)
                                                   >> 378         logicMod7,     // its logical volume          
                                                   >> 379         "Mod7",        // its name
                                                   >> 380         logicMod0,      // its mother  volume
                                                   >> 381         false,           // no boolean operations
                                                   >> 382         0);              // no particular field
                                                   >> 383 
                                                   >> 384 
                                                   >> 385 
                                                   >> 386   //----------------------------------------------------------
                                                   >> 387   //Ottava fetta Modulatore
                                                   >> 388   //----------------------------------------------------------
                                                   >> 389    
                                                   >> 390   G4double startAngleOfTheTube8 = 70.472*deg;
                                                   >> 391   G4double spanningAngleOfTheTube8 = 39.056*deg;
                                                   >> 392 
                                                   >> 393    
                                                   >> 394   G4ThreeVector positionMod8 = G4ThreeVector(0*cm,0*cm,0.09*cm);
                                                   >> 395   solidMod8 = new G4Tubs("Mod8",
                                                   >> 396        innerRadiusOfTheTube, 
                                                   >> 397        outerRadiusOfTheTube,
                                                   >> 398        hightOfTheTube,
                                                   >> 399        startAngleOfTheTube8, 
                                                   >> 400        spanningAngleOfTheTube8);
                                                   >> 401 
                                                   >> 402   logicMod8 = new G4LogicalVolume(solidMod8, ModMater, "Mod8",0,0,0);
                                                   >> 403   physiMod8 = new G4PVPlacement(0,                   // no rotation
                                                   >> 404         positionMod8,  // at (x,y,z)
                                                   >> 405         logicMod8,     // its logical volume          
                                                   >> 406         "Mod8",        // its name
                                                   >> 407         logicMod0,      // its mother  volume
                                                   >> 408         false,           // no boolean operations
                                                   >> 409         0);              // no particular field
                                                   >> 410 
                                                   >> 411 
                                                   >> 412 
                                                   >> 413 
                                                   >> 414   //----------------------------------------------------------
                                                   >> 415   //Nona fetta Modulatore
                                                   >> 416   //----------------------------------------------------------
                                                   >> 417  
                                                   >> 418   G4double startAngleOfTheTube9 = 72.288*deg;
                                                   >> 419   G4double spanningAngleOfTheTube9 = 35.424*deg;
                                                   >> 420 
                                                   >> 421    
                                                   >> 422   G4ThreeVector positionMod9 = G4ThreeVector(0*cm,0*cm,0.03*cm);
                                                   >> 423   solidMod9 = new G4Tubs("Mod9",
                                                   >> 424        innerRadiusOfTheTube, 
                                                   >> 425        outerRadiusOfTheTube,
                                                   >> 426        hightOfTheTube,
                                                   >> 427        startAngleOfTheTube9, 
                                                   >> 428        spanningAngleOfTheTube9);
                                                   >> 429 
                                                   >> 430   logicMod9 = new G4LogicalVolume(solidMod9, ModMater, "Mod9",0,0,0);
                                                   >> 431   physiMod9 = new G4PVPlacement(0,                   // no rotation
                                                   >> 432         positionMod9,  // at (x,y,z)
                                                   >> 433         logicMod9,     // its logical volume          
                                                   >> 434         "Mod9",        // its name
                                                   >> 435         logicMod0,      // its mother  volume
                                                   >> 436         false,           // no boolean operations
                                                   >> 437         0);              // no particular field
                                                   >> 438 
                                                   >> 439 
                                                   >> 440   //----------------------------------------------------------
                                                   >> 441   //Decima fetta Modulatore
                                                   >> 442   //----------------------------------------------------------
                                                   >> 443  
                                                   >> 444   G4double startAngleOfTheTube10 = 74.061*deg;
                                                   >> 445   G4double spanningAngleOfTheTube10 = 31.878*deg;
                                                   >> 446 
                                                   >> 447   
                                                   >> 448   G4ThreeVector positionMod10 = G4ThreeVector(0*cm,0*cm,-0.03*cm);
                                                   >> 449   solidMod10 = new G4Tubs("Mod10",
                                                   >> 450         innerRadiusOfTheTube, 
                                                   >> 451         outerRadiusOfTheTube,
                                                   >> 452         hightOfTheTube,
                                                   >> 453         startAngleOfTheTube10, 
                                                   >> 454         spanningAngleOfTheTube10);
                                                   >> 455 
                                                   >> 456   logicMod10 = new G4LogicalVolume(solidMod10, ModMater, "Mod10",0,0,0);
                                                   >> 457   physiMod10 = new G4PVPlacement(0,                   // no rotation
                                                   >> 458          positionMod10,  // at (x,y,z)
                                                   >> 459          logicMod10,     // its logical volume          
                                                   >> 460          "Mod10",        // its name
                                                   >> 461          logicMod0,      // its mother  volume
                                                   >> 462          false,           // no boolean operations
                                                   >> 463          0);              // no particular field
                                                   >> 464 
                                                   >> 465   //----------------------------------------------------------
                                                   >> 466   // Undicesima fetta Modulatore
                                                   >> 467   //----------------------------------------------------------
                                                   >> 468 
                                                   >> 469   G4double startAngleOfTheTube11 = 75.793*deg;
                                                   >> 470   G4double spanningAngleOfTheTube11 = 28.414*deg;
                                                   >> 471    
                                                   >> 472    
                                                   >> 473   G4ThreeVector positionMod11 = G4ThreeVector(0*cm,0*cm,-0.09*cm);
                                                   >> 474   solidMod11 = new G4Tubs("Mod11",
                                                   >> 475         innerRadiusOfTheTube, 
                                                   >> 476         outerRadiusOfTheTube,
                                                   >> 477         hightOfTheTube,
                                                   >> 478         startAngleOfTheTube11, 
                                                   >> 479         spanningAngleOfTheTube11);
                                                   >> 480 
                                                   >> 481   logicMod11 = new G4LogicalVolume(solidMod11, ModMater, "Mod11",0,0,0);
                                                   >> 482   physiMod11 = new G4PVPlacement(0,                   // no rotation
                                                   >> 483          positionMod11,  // at (x,y,z)
                                                   >> 484          logicMod11,     // its logical volume          
                                                   >> 485          "Mod11",        // its name
                                                   >> 486          logicMod0,      // its mother  volume
                                                   >> 487          false,           // no boolean operations
                                                   >> 488          0);              // no particular field
                                                   >> 489 
                                                   >> 490   //----------------------------------------------------------
                                                   >> 491   //Dodicesima fetta Modulatore
                                                   >> 492   //----------------------------------------------------------
                                                   >> 493 
                                                   >> 494   G4double startAngleOfTheTube12 = 77.579*deg;
                                                   >> 495   G4double spanningAngleOfTheTube12 = 24.842*deg;
                                                   >> 496 
                                                   >> 497    
                                                   >> 498    
                                                   >> 499   G4ThreeVector positionMod12 = G4ThreeVector(0*cm,0*cm,-0.15*cm);
                                                   >> 500   solidMod12 = new G4Tubs("Mod12",
                                                   >> 501         innerRadiusOfTheTube, 
                                                   >> 502         outerRadiusOfTheTube,
                                                   >> 503         hightOfTheTube,
                                                   >> 504         startAngleOfTheTube12, 
                                                   >> 505         spanningAngleOfTheTube12);
                                                   >> 506 
                                                   >> 507   logicMod12 = new G4LogicalVolume(solidMod12, ModMater, "Mod12",0,0,0);
                                                   >> 508   physiMod12 = new G4PVPlacement(0,                   // no rotation
                                                   >> 509          positionMod12,  // at (x,y,z)
                                                   >> 510          logicMod12,     // its logical volume          
                                                   >> 511          "Mod12",        // its name
                                                   >> 512          logicMod0,      // its mother  volume
                                                   >> 513          false,           // no boolean operations
                                                   >> 514          0);              // no particular field
                                                   >> 515   
                                                   >> 516 
                                                   >> 517   //----------------------------------------------------------
                                                   >> 518   //Tredicesima fetta Modulatore
                                                   >> 519   //----------------------------------------------------------
                                                   >> 520  
                                                   >> 521   G4double startAngleOfTheTube13 = 79.273*deg;
                                                   >> 522   G4double spanningAngleOfTheTube13 = 21.454*deg;
                                                   >> 523    
                                                   >> 524   
                                                   >> 525   G4ThreeVector positionMod13 = G4ThreeVector(0*cm,0*cm,-0.21*cm);
                                                   >> 526   solidMod13 = new G4Tubs("Mod13",
                                                   >> 527         innerRadiusOfTheTube, 
                                                   >> 528         outerRadiusOfTheTube,
                                                   >> 529         hightOfTheTube,
                                                   >> 530         startAngleOfTheTube13, 
                                                   >> 531         spanningAngleOfTheTube13);
                                                   >> 532 
                                                   >> 533   logicMod13 = new G4LogicalVolume(solidMod13, ModMater, "Mod13",0,0,0);
                                                   >> 534   physiMod13 = new G4PVPlacement(0,                   // no rotation
                                                   >> 535          positionMod13,  // at (x,y,z)
                                                   >> 536          logicMod13,     // its logical volume          
                                                   >> 537          "Mod13",        // its name
                                                   >> 538          logicMod0,      // its mother  volume
                                                   >> 539          false,           // no boolean operations
                                                   >> 540          0);              // no particular field
                                                   >> 541 
                                                   >> 542   //----------------------------------------------------------
                                                   >> 543   //Quat. fetta Modulatore
                                                   >> 544   //----------------------------------------------------------
                                                   >> 545  
                                                   >> 546   G4double startAngleOfTheTube14 = 81.014*deg;
                                                   >> 547   G4double spanningAngleOfTheTube14 = 17.972*deg;
                                                   >> 548 
                                                   >> 549       
                                                   >> 550   G4ThreeVector positionMod14 = G4ThreeVector(0*cm,0*cm,-0.27*cm);
                                                   >> 551   solidMod14 = new G4Tubs("Mod14",
                                                   >> 552         innerRadiusOfTheTube, 
                                                   >> 553         outerRadiusOfTheTube,
                                                   >> 554         hightOfTheTube,
                                                   >> 555         startAngleOfTheTube14, 
                                                   >> 556         spanningAngleOfTheTube14);
                                                   >> 557 
                                                   >> 558   logicMod14 = new G4LogicalVolume(solidMod14, ModMater, "Mod14",0,0,0);
                                                   >> 559   physiMod14 = new G4PVPlacement(0,                   // no rotation
                                                   >> 560          positionMod14,  // at (x,y,z)
                                                   >> 561          logicMod14,     // its logical volume          
                                                   >> 562          "Mod14",        // its name
                                                   >> 563          logicMod0,      // its mother  volume
                                                   >> 564          false,           // no boolean operations
                                                   >> 565          0);              // no particular field
                                                   >> 566 
                                                   >> 567   
                                                   >> 568   //----------------------------------------------------------
                                                   >> 569   //Quindicesima fetta Modulatore
                                                   >> 570   //----------------------------------------------------------
335                                                   571  
336  ///////////////////////////////////////////// << 572   G4double startAngleOfTheTube15 = 82.695*deg;
                                                   >> 573   G4double spanningAngleOfTheTube15 = 14.61*deg;
                                                   >> 574 
                                                   >> 575       
                                                   >> 576   G4ThreeVector positionMod15 = G4ThreeVector(0*cm,0*cm,-0.33*cm);
                                                   >> 577   solidMod15 = new G4Tubs("Mod15",
                                                   >> 578         innerRadiusOfTheTube, 
                                                   >> 579         outerRadiusOfTheTube,
                                                   >> 580         hightOfTheTube,
                                                   >> 581         startAngleOfTheTube15, 
                                                   >> 582         spanningAngleOfTheTube15);
                                                   >> 583 
                                                   >> 584   logicMod15 = new G4LogicalVolume(solidMod15, ModMater, "Mod15",0,0,0);
                                                   >> 585   physiMod15 = new G4PVPlacement(0,                   // no rotation
                                                   >> 586          positionMod15,  // at (x,y,z)
                                                   >> 587          logicMod15,     // its logical volume          
                                                   >> 588          "Mod15",        // its name
                                                   >> 589          logicMod0,      // its mother  volume
                                                   >> 590          false,           // no boolean operations
                                                   >> 591          0);              // no particular field
                                                   >> 592 
                                                   >> 593   //----------------------------------------------------------
                                                   >> 594   //Sedic. fetta Modulatore
                                                   >> 595   //----------------------------------------------------------
                                                   >> 596  
                                                   >> 597   G4double startAngleOfTheTube16 = 84.425*deg;
                                                   >> 598   G4double spanningAngleOfTheTube16 = 11.15*deg;
                                                   >> 599 
                                                   >> 600    
                                                   >> 601   G4ThreeVector positionMod16 = G4ThreeVector(0*cm,0*cm,-0.39*cm);
                                                   >> 602   solidMod16 = new G4Tubs("Mod16",
                                                   >> 603         innerRadiusOfTheTube, 
                                                   >> 604         outerRadiusOfTheTube,
                                                   >> 605         hightOfTheTube,
                                                   >> 606         startAngleOfTheTube16, 
                                                   >> 607         spanningAngleOfTheTube16);
                                                   >> 608 
                                                   >> 609   logicMod16 = new G4LogicalVolume(solidMod16, ModMater, "Mod16",0,0,0);
                                                   >> 610   physiMod16 = new G4PVPlacement(0,                   // no rotation
                                                   >> 611          positionMod16,  // at (x,y,z)
                                                   >> 612          logicMod16,     // its logical volume          
                                                   >> 613          "Mod16",        // its name
                                                   >> 614          logicMod0,      // its mother  volume
                                                   >> 615          false,           // no boolean operations
                                                   >> 616          0);              // no particular field
                                                   >> 617 
                                                   >> 618   //----------------------------------------------------------
                                                   >> 619   //Dicias. fetta Modulatore
                                                   >> 620   //----------------------------------------------------------
                                                   >> 621  
                                                   >> 622   G4double startAngleOfTheTube17 = 86.203*deg;
                                                   >> 623   G4double spanningAngleOfTheTube17 = 7.594*deg;
                                                   >> 624 
                                                   >> 625    
                                                   >> 626    
                                                   >> 627   G4ThreeVector positionMod17 = G4ThreeVector(0*cm,0*cm,-0.45*cm);
                                                   >> 628   solidMod17 = new G4Tubs("Mod17",
                                                   >> 629         innerRadiusOfTheTube, 
                                                   >> 630         outerRadiusOfTheTube,
                                                   >> 631         hightOfTheTube,
                                                   >> 632         startAngleOfTheTube17, 
                                                   >> 633         spanningAngleOfTheTube17);
                                                   >> 634 
                                                   >> 635   logicMod17 = new G4LogicalVolume(solidMod17, ModMater, "Mod17",0,0,0);
                                                   >> 636   physiMod17 = new G4PVPlacement(0,                   // no rotation
                                                   >> 637          positionMod17,  // at (x,y,z)
                                                   >> 638          logicMod17,     // its logical volume          
                                                   >> 639          "Mod17",        // its name
                                                   >> 640          logicMod0,      // its mother  volume
                                                   >> 641          false,           // no boolean operations
                                                   >> 642          0);              // no particular field
                                                   >> 643   //----------------------------------------------------------
                                                   >> 644   //Diciot. fetta Modulatore
                                                   >> 645   //----------------------------------------------------------
                                                   >> 646  
                                                   >> 647   G4double startAngleOfTheTube18 = 87.910*deg;
                                                   >> 648   G4double spanningAngleOfTheTube18 = 4.18*deg;
                                                   >> 649 
                                                   >> 650    
                                                   >> 651    
                                                   >> 652   G4ThreeVector positionMod18 = G4ThreeVector(0*cm,0*cm,-0.51*cm);
                                                   >> 653   solidMod18 = new G4Tubs("Mod18",
                                                   >> 654         innerRadiusOfTheTube, 
                                                   >> 655         outerRadiusOfTheTube,
                                                   >> 656         hightOfTheTube,
                                                   >> 657         startAngleOfTheTube18, 
                                                   >> 658         spanningAngleOfTheTube18);
                                                   >> 659 
                                                   >> 660   logicMod18 = new G4LogicalVolume(solidMod18, ModMater, "Mod18",0,0,0);
                                                   >> 661   physiMod18 = new G4PVPlacement(0,                   // no rotation
                                                   >> 662          positionMod18,  // at (x,y,z)
                                                   >> 663          logicMod18,     // its logical volume          
                                                   >> 664          "Mod18",        // its name
                                                   >> 665          logicMod0,      // its mother  volume
                                                   >> 666          false,           // no boolean operations
                                                   >> 667          0);              // no particular field
                                                   >> 668 
                                                   >> 669 
                                                   >> 670 
337   //------------------------------------------    671   //----------------------------------------------------------
338   // Mother volume of the second modulator qua    672   // Mother volume of the second modulator quarter
339   //------------------------------------------    673   //----------------------------------------------------------
340                                                   674   
341                                                   675     
342   G4RotationMatrix rm2;                        << 676   G4RotationMatrix rm20;
343   rm2.rotateZ(90 *deg);                        << 677   rm20.rotateZ(90 *deg);
344                                                   678   
345   G4ThreeVector positionMod2 = G4ThreeVector(0 << 679   G4ThreeVector positionMod20 = G4ThreeVector(0*cm,0*cm,0*cm);
346                                                   680   
347   solidMod2 = new G4Tubs("Mod2",               << 681   solidMod20 = new G4Tubs("Mod20",
348         innerRadiusOfTheTube,                     682         innerRadiusOfTheTube, 
349         outerRadiusOfTheTube,                     683         outerRadiusOfTheTube,
350         hightOfTheTube0/2.,                    << 684         hightOfTheTube0,
351         startAngleOfTheTube0,                     685         startAngleOfTheTube0, 
352         spanningAngleOfTheTube0);                 686         spanningAngleOfTheTube0);
353                                                   687   
354   logicMod2 = new G4LogicalVolume(solidMod2,   << 688   logicMod20 = new G4LogicalVolume(solidMod20, Mod0Mater, "Mod0",0,0,0);
355                                   Mod0Mater, " << 
356                                                   689   
357                                                   690   
358   physiMod2 = new G4PVPlacement(G4Transform3D( << 691   physiMod20 = new G4PVPlacement(G4Transform3D(rm20, positionMod20), 
359          logicMod2,                            << 692          logicMod20,    
360          "Mod2",                               << 693          "Mod20",       
361          logicMotherMod,                          694          logicMotherMod, 
362          false,                                   695          false,         
363          0);                                      696          0);            
                                                   >> 697   
                                                   >> 698 
                                                   >> 699     
                                                   >> 700 
                                                   >> 701   //----------------------------------------------------------
                                                   >> 702   // 1st modulator slice (2nd quarter)
                                                   >> 703   //----------------------------------------------------------
364                                                   704  
                                                   >> 705   G4ThreeVector positionMod21 = G4ThreeVector(0*cm,0*cm,0.51*cm);
                                                   >> 706   solidMod21 = new G4Tubs("Mod21",
                                                   >> 707         innerRadiusOfTheTube, 
                                                   >> 708         outerRadiusOfTheTube,
                                                   >> 709         hightOfTheTube,
                                                   >> 710         startAngleOfTheTube1, 
                                                   >> 711         spanningAngleOfTheTube1);
                                                   >> 712   
                                                   >> 713   logicMod21 = new G4LogicalVolume(solidMod21, ModMater, "Mod21",0,0,0);
                                                   >> 714   
                                                   >> 715   physiMod21 = new G4PVPlacement(0,               // no rotation
                                                   >> 716          positionMod21,  // at (x,y,z)
                                                   >> 717          logicMod21,     // its logical volume          
                                                   >> 718          "Mod21",        // its name
                                                   >> 719          logicMod20,      // its mother  volume
                                                   >> 720          false,           // no boolean operations
                                                   >> 721          0);              // no particular field
                                                   >> 722   
                                                   >> 723   
                                                   >> 724   //----------------------------------------------------------
                                                   >> 725   // 2nd modulator slice (2nd quarter)
                                                   >> 726   //----------------------------------------------------------
                                                   >> 727   
                                                   >> 728   G4ThreeVector positionMod22 = G4ThreeVector(0*cm,0*cm,0.45*cm);
                                                   >> 729   
                                                   >> 730   solidMod22 = new G4Tubs("Mod22",
                                                   >> 731         innerRadiusOfTheTube, 
                                                   >> 732         outerRadiusOfTheTube,
                                                   >> 733         hightOfTheTube,
                                                   >> 734         startAngleOfTheTube2, 
                                                   >> 735         spanningAngleOfTheTube2);
                                                   >> 736   
                                                   >> 737   logicMod22 = new G4LogicalVolume(solidMod22, ModMater, "Mod22",0,0,0);
                                                   >> 738   
                                                   >> 739   physiMod22 = new G4PVPlacement(0,               // no rotation
                                                   >> 740          positionMod22,  // at (x,y,z)
                                                   >> 741          logicMod22,     // its logical volume          
                                                   >> 742          "Mod22",        // its name
                                                   >> 743          logicMod20,      // its mother  volume
                                                   >> 744          false,           // no boolean operations
                                                   >> 745          0);              // no particular field
                                                   >> 746   
                                                   >> 747   
                                                   >> 748   //----------------------------------------------------------
                                                   >> 749   // 3rd modulator slice (2nd quarter)
                                                   >> 750   //----------------------------------------------------------
                                                   >> 751  
                                                   >> 752   G4ThreeVector positionMod23 = G4ThreeVector(0*cm,0*cm,0.39*cm);
                                                   >> 753 
                                                   >> 754   solidMod23 = new G4Tubs("Mod23",
                                                   >> 755         innerRadiusOfTheTube, 
                                                   >> 756         outerRadiusOfTheTube,
                                                   >> 757         hightOfTheTube,
                                                   >> 758         startAngleOfTheTube3, 
                                                   >> 759         spanningAngleOfTheTube3);
                                                   >> 760 
                                                   >> 761   logicMod23 = new G4LogicalVolume(solidMod23, ModMater, "Mod23",0,0,0);
                                                   >> 762   physiMod23 = new G4PVPlacement(0,                   // no rotation
                                                   >> 763          positionMod23,  // at (x,y,z)
                                                   >> 764          logicMod23,     // its logical volume          
                                                   >> 765          "Mod23",        // its name
                                                   >> 766          logicMod20,      // its mother  volume
                                                   >> 767          false,           // no boolean operations
                                                   >> 768          0);              // no particular field
                                                   >> 769 
                                                   >> 770  
                                                   >> 771   //----------------------------------------------------------
                                                   >> 772   // 4th modulator slice (2nd quarter)
                                                   >> 773   //----------------------------------------------------------
                                                   >> 774    
                                                   >> 775    
                                                   >> 776   G4ThreeVector positionMod24 = G4ThreeVector(0*cm,0*cm,0.33*cm);
                                                   >> 777 
                                                   >> 778   solidMod24 = new G4Tubs("Mod24",
                                                   >> 779         innerRadiusOfTheTube, 
                                                   >> 780         outerRadiusOfTheTube,
                                                   >> 781         hightOfTheTube,
                                                   >> 782         startAngleOfTheTube4, 
                                                   >> 783         spanningAngleOfTheTube4);
                                                   >> 784 
                                                   >> 785   logicMod24 = new G4LogicalVolume(solidMod24, ModMater, "Mod24",0,0,0);
                                                   >> 786  
                                                   >> 787   physiMod24 = new G4PVPlacement(0,                   // no rotation
                                                   >> 788          positionMod24,  // at (x,y,z)
                                                   >> 789          logicMod24,     // its logical volume          
                                                   >> 790          "Mod24",        // its name
                                                   >> 791          logicMod20,      // its mother  volume
                                                   >> 792          false,           // no boolean operations
                                                   >> 793          0);              // no particular field
                                                   >> 794 
                                                   >> 795 
                                                   >> 796   //----------------------------------------------------------
                                                   >> 797   //Quinta fetta Modulatore 2
                                                   >> 798   //----------------------------------------------------------
                                                   >> 799  
                                                   >> 800    
                                                   >> 801    
                                                   >> 802   G4ThreeVector positionMod25 = G4ThreeVector(0*cm,0*cm,0.27*cm);
                                                   >> 803 
                                                   >> 804   solidMod25 = new G4Tubs("Mod25",
                                                   >> 805         innerRadiusOfTheTube, 
                                                   >> 806         outerRadiusOfTheTube,
                                                   >> 807         hightOfTheTube,
                                                   >> 808         startAngleOfTheTube5, 
                                                   >> 809         spanningAngleOfTheTube5);
                                                   >> 810   
                                                   >> 811   logicMod25 = new G4LogicalVolume(solidMod25, ModMater, "Mod25",0,0,0);
                                                   >> 812   physiMod25 = new G4PVPlacement(0,                   // no rotation
                                                   >> 813          positionMod25,  // at (x,y,z)
                                                   >> 814          logicMod25,     // its logical volume          
                                                   >> 815          "Mod25",        // its name
                                                   >> 816          logicMod20,      // its mother  volume
                                                   >> 817          false,           // no boolean operations
                                                   >> 818          0);              // no particular field
                                                   >> 819 
                                                   >> 820   
                                                   >> 821   //----------------------------------------------------------
                                                   >> 822   //Sesta fetta Modulatore 2
                                                   >> 823   //----------------------------------------------------------
                                                   >> 824  
                                                   >> 825    
                                                   >> 826   G4ThreeVector positionMod26 = G4ThreeVector(0*cm,0*cm,0.21*cm);
                                                   >> 827   solidMod26 = new G4Tubs("Mod26",
                                                   >> 828         innerRadiusOfTheTube, 
                                                   >> 829         outerRadiusOfTheTube,
                                                   >> 830         hightOfTheTube,
                                                   >> 831         startAngleOfTheTube6, 
                                                   >> 832         spanningAngleOfTheTube6);
                                                   >> 833 
                                                   >> 834   logicMod26 = new G4LogicalVolume(solidMod26, ModMater, "Mod26",0,0,0);
                                                   >> 835   physiMod26 = new G4PVPlacement(0,                   // no rotation
                                                   >> 836          positionMod26,  // at (x,y,z)
                                                   >> 837          logicMod26,     // its logical volume          
                                                   >> 838          "Mod26",        // its name
                                                   >> 839          logicMod20,      // its mother  volume
                                                   >> 840          false,           // no boolean operations
                                                   >> 841          0);              // no particular field
365                                                   842 
366     for (G4int i=1;i<StepNumbers;i++)          << 
367   {                                            << 
368                                                << 
369   physiMod[StepNumbers+i-1] = new G4PVPlacemen << 
370         PositionMod[i],                        << 
371         logicMod[i],                           << 
372         "Modstep",                             << 
373         logicMod2,                             << 
374         false,                                 << 
375         0);                                    << 
376                                                << 
377       }                                        << 
378                                                   843 
                                                   >> 844   //----------------------------------------------------------
                                                   >> 845   //Settima fetta Modulatore 2
                                                   >> 846   //----------------------------------------------------------
379                                                   847  
                                                   >> 848       
                                                   >> 849   G4ThreeVector positionMod27 = G4ThreeVector(0*cm,0*cm,0.15*cm);
                                                   >> 850   
                                                   >> 851   solidMod27 = new G4Tubs("Mod27",
                                                   >> 852         innerRadiusOfTheTube, 
                                                   >> 853         outerRadiusOfTheTube,
                                                   >> 854         hightOfTheTube,
                                                   >> 855         startAngleOfTheTube7, 
                                                   >> 856         spanningAngleOfTheTube7);
                                                   >> 857 
                                                   >> 858   logicMod27 = new G4LogicalVolume(solidMod27, ModMater, "Mod27",0,0,0);
                                                   >> 859   physiMod27 = new G4PVPlacement(0,                   // no rotation
                                                   >> 860          positionMod27,  // at (x,y,z)
                                                   >> 861          logicMod27,     // its logical volume          
                                                   >> 862          "Mod27",        // its name
                                                   >> 863          logicMod20,      // its mother  volume
                                                   >> 864          false,           // no boolean operations
                                                   >> 865          0);              // no particular field
                                                   >> 866 
                                                   >> 867 
380                                                   868 
381   //------------------------------------------    869   //----------------------------------------------------------
382   // Mother volume of the third modulator quar << 870   //Ottava fetta Modulatore 2
383   //------------------------------------------    871   //----------------------------------------------------------
                                                   >> 872    
384                                                   873   
                                                   >> 874 
                                                   >> 875    
                                                   >> 876   G4ThreeVector positionMod28 = G4ThreeVector(0*cm,0*cm,0.09*cm);
                                                   >> 877   solidMod28 = new G4Tubs("Mod28",
                                                   >> 878         innerRadiusOfTheTube, 
                                                   >> 879         outerRadiusOfTheTube,
                                                   >> 880         hightOfTheTube,
                                                   >> 881         startAngleOfTheTube8, 
                                                   >> 882         spanningAngleOfTheTube8);
                                                   >> 883 
                                                   >> 884   logicMod28 = new G4LogicalVolume(solidMod28, ModMater, "Mod28",0,0,0);
                                                   >> 885   physiMod28 = new G4PVPlacement(0,                   // no rotation
                                                   >> 886          positionMod28,  // at (x,y,z)
                                                   >> 887          logicMod28,     // its logical volume          
                                                   >> 888          "Mod28",        // its name
                                                   >> 889          logicMod20,      // its mother  volume
                                                   >> 890          false,           // no boolean operations
                                                   >> 891          0);              // no particular field
                                                   >> 892 
                                                   >> 893 
                                                   >> 894 
                                                   >> 895 
                                                   >> 896   //----------------------------------------------------------
                                                   >> 897   //Nona fetta Modulatore 3
                                                   >> 898   //----------------------------------------------------------
                                                   >> 899  
                                                   >> 900 
                                                   >> 901      
                                                   >> 902   G4ThreeVector positionMod29 = G4ThreeVector(0*cm,0*cm,0.03*cm);
                                                   >> 903   solidMod29 = new G4Tubs("Mod29",
                                                   >> 904         innerRadiusOfTheTube, 
                                                   >> 905         outerRadiusOfTheTube,
                                                   >> 906         hightOfTheTube,
                                                   >> 907         startAngleOfTheTube9, 
                                                   >> 908         spanningAngleOfTheTube9);
                                                   >> 909 
                                                   >> 910   logicMod29 = new G4LogicalVolume(solidMod29, ModMater, "Mod29",0,0,0);
                                                   >> 911   physiMod29 = new G4PVPlacement(0,                   // no rotation
                                                   >> 912          positionMod29,  // at (x,y,z)
                                                   >> 913          logicMod29,     // its logical volume          
                                                   >> 914          "Mod29",        // its name
                                                   >> 915          logicMod20,      // its mother  volume
                                                   >> 916          false,           // no boolean operations
                                                   >> 917          0);              // no particular field
                                                   >> 918 
                                                   >> 919 
                                                   >> 920   //----------------------------------------------------------
                                                   >> 921   //Decima fetta Modulatore 3
                                                   >> 922   //----------------------------------------------------------
                                                   >> 923  
                                                   >> 924    
                                                   >> 925   G4ThreeVector positionMod30 = G4ThreeVector(0*cm,0*cm,-0.03*cm);
                                                   >> 926   solidMod30 = new G4Tubs("Mod30",
                                                   >> 927         innerRadiusOfTheTube, 
                                                   >> 928         outerRadiusOfTheTube,
                                                   >> 929         hightOfTheTube,
                                                   >> 930         startAngleOfTheTube10, 
                                                   >> 931         spanningAngleOfTheTube10);
                                                   >> 932 
                                                   >> 933   logicMod30 = new G4LogicalVolume(solidMod30, ModMater, "Mod30",0,0,0);
                                                   >> 934   physiMod30 = new G4PVPlacement(0,                   // no rotation
                                                   >> 935          positionMod30,  // at (x,y,z)
                                                   >> 936          logicMod30,     // its logical volume          
                                                   >> 937          "Mod30",        // its name
                                                   >> 938          logicMod20,      // its mother  volume
                                                   >> 939          false,           // no boolean operations
                                                   >> 940          0);              // no particular field
                                                   >> 941 
                                                   >> 942   //----------------------------------------------------------
                                                   >> 943   // Undicesima fetta Modulatore 3
                                                   >> 944   //----------------------------------------------------------
                                                   >> 945 
                                                   >> 946   G4ThreeVector positionMod31 = G4ThreeVector(0*cm,0*cm,-0.09*cm);
                                                   >> 947   solidMod31 = new G4Tubs("Mod31",
                                                   >> 948         innerRadiusOfTheTube, 
                                                   >> 949         outerRadiusOfTheTube,
                                                   >> 950         hightOfTheTube,
                                                   >> 951         startAngleOfTheTube11, 
                                                   >> 952         spanningAngleOfTheTube11);
                                                   >> 953 
                                                   >> 954   logicMod31 = new G4LogicalVolume(solidMod31, ModMater, "Mod31",0,0,0);
                                                   >> 955   physiMod31 = new G4PVPlacement(0,                   // no rotation
                                                   >> 956          positionMod31,  // at (x,y,z)
                                                   >> 957          logicMod31,     // its logical volume          
                                                   >> 958          "Mod31",        // its name
                                                   >> 959          logicMod20,      // its mother  volume
                                                   >> 960          false,           // no boolean operations
                                                   >> 961          0);              // no particular field
                                                   >> 962 
                                                   >> 963   //----------------------------------------------------------
                                                   >> 964   //Dodicesima fetta Modulatore 3
                                                   >> 965   //----------------------------------------------------------
                                                   >> 966 
                                                   >> 967   G4ThreeVector positionMod32 = G4ThreeVector(0*cm,0*cm,-0.15*cm);
                                                   >> 968   solidMod32 = new G4Tubs("Mod32",
                                                   >> 969         innerRadiusOfTheTube, 
                                                   >> 970         outerRadiusOfTheTube,
                                                   >> 971         hightOfTheTube,
                                                   >> 972         startAngleOfTheTube12, 
                                                   >> 973         spanningAngleOfTheTube12);
                                                   >> 974 
                                                   >> 975   logicMod32 = new G4LogicalVolume(solidMod32, ModMater, "Mod32",0,0,0);
                                                   >> 976   physiMod32 = new G4PVPlacement(0,                   // no rotation
                                                   >> 977          positionMod32,  // at (x,y,z)
                                                   >> 978          logicMod32,     // its logical volume          
                                                   >> 979          "Mod32",        // its name
                                                   >> 980          logicMod20,      // its mother  volume
                                                   >> 981          false,           // no boolean operations
                                                   >> 982          0);              // no particular field
                                                   >> 983   
                                                   >> 984 
                                                   >> 985   //----------------------------------------------------------
                                                   >> 986   //Tredicesima fetta Modulatore 3
                                                   >> 987   //----------------------------------------------------------
                                                   >> 988  
                                                   >> 989   G4ThreeVector positionMod33 = G4ThreeVector(0*cm,0*cm,-0.21*cm);
                                                   >> 990   solidMod33 = new G4Tubs("Mod33",
                                                   >> 991         innerRadiusOfTheTube, 
                                                   >> 992         outerRadiusOfTheTube,
                                                   >> 993         hightOfTheTube,
                                                   >> 994         startAngleOfTheTube13, 
                                                   >> 995         spanningAngleOfTheTube13);
                                                   >> 996 
                                                   >> 997   logicMod33 = new G4LogicalVolume(solidMod33, ModMater, "Mod33",0,0,0);
                                                   >> 998   physiMod33 = new G4PVPlacement(0,                   // no rotation
                                                   >> 999          positionMod33,  // at (x,y,z)
                                                   >> 1000          logicMod33,     // its logical volume          
                                                   >> 1001          "Mod33",        // its name
                                                   >> 1002          logicMod20,      // its mother  volume
                                                   >> 1003          false,           // no boolean operations
                                                   >> 1004          0);              // no particular field
                                                   >> 1005 
                                                   >> 1006   //----------------------------------------------------------
                                                   >> 1007   //Quat. fetta Modulatore 3
                                                   >> 1008   //----------------------------------------------------------
                                                   >> 1009  
                                                   >> 1010        
                                                   >> 1011   G4ThreeVector positionMod34 = G4ThreeVector(0*cm,0*cm,-0.27*cm);
                                                   >> 1012   solidMod34 = new G4Tubs("Mod34",
                                                   >> 1013         innerRadiusOfTheTube, 
                                                   >> 1014         outerRadiusOfTheTube,
                                                   >> 1015         hightOfTheTube,
                                                   >> 1016         startAngleOfTheTube14, 
                                                   >> 1017         spanningAngleOfTheTube14);
                                                   >> 1018 
                                                   >> 1019   logicMod34 = new G4LogicalVolume(solidMod34, ModMater, "Mod34",0,0,0);
                                                   >> 1020   physiMod34 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1021          positionMod34,  // at (x,y,z)
                                                   >> 1022          logicMod34,     // its logical volume          
                                                   >> 1023          "Mod134",        // its name
                                                   >> 1024          logicMod20,      // its mother  volume
                                                   >> 1025          false,           // no boolean operations
                                                   >> 1026          0);              // no particular field
                                                   >> 1027 
                                                   >> 1028   
                                                   >> 1029   //----------------------------------------------------------
                                                   >> 1030   //Quindicesima fetta Modulatore 2
                                                   >> 1031   //----------------------------------------------------------
                                                   >> 1032  
                                                   >> 1033        
                                                   >> 1034   G4ThreeVector positionMod35 = G4ThreeVector(0*cm,0*cm,-0.33*cm);
                                                   >> 1035   solidMod35 = new G4Tubs("Mod35",
                                                   >> 1036         innerRadiusOfTheTube, 
                                                   >> 1037         outerRadiusOfTheTube,
                                                   >> 1038         hightOfTheTube,
                                                   >> 1039         startAngleOfTheTube15, 
                                                   >> 1040         spanningAngleOfTheTube15);
                                                   >> 1041 
                                                   >> 1042   logicMod35 = new G4LogicalVolume(solidMod35, ModMater, "Mod35",0,0,0);
                                                   >> 1043   physiMod35 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1044          positionMod35,  // at (x,y,z)
                                                   >> 1045          logicMod35,     // its logical volume          
                                                   >> 1046          "Mod35",        // its name
                                                   >> 1047          logicMod20,      // its mother  volume
                                                   >> 1048          false,           // no boolean operations
                                                   >> 1049          0);              // no particular field
                                                   >> 1050 
                                                   >> 1051   //----------------------------------------------------------
                                                   >> 1052   //Sedic. fetta Modulatore 2
                                                   >> 1053   //----------------------------------------------------------
                                                   >> 1054  
                                                   >> 1055    
                                                   >> 1056   G4ThreeVector positionMod36 = G4ThreeVector(0*cm,0*cm,-0.39*cm);
                                                   >> 1057   solidMod36 = new G4Tubs("Mod36",
                                                   >> 1058         innerRadiusOfTheTube, 
                                                   >> 1059         outerRadiusOfTheTube,
                                                   >> 1060         hightOfTheTube,
                                                   >> 1061         startAngleOfTheTube16, 
                                                   >> 1062         spanningAngleOfTheTube16);
                                                   >> 1063 
                                                   >> 1064   logicMod36 = new G4LogicalVolume(solidMod36, ModMater, "Mod36",0,0,0);
                                                   >> 1065   physiMod36 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1066          positionMod36,  // at (x,y,z)
                                                   >> 1067          logicMod36,     // its logical volume          
                                                   >> 1068          "Mod36",        // its name
                                                   >> 1069          logicMod20,      // its mother  volume
                                                   >> 1070          false,           // no boolean operations
                                                   >> 1071          0);              // no particular field
                                                   >> 1072 
                                                   >> 1073   //----------------------------------------------------------
                                                   >> 1074   //Dicias. fetta Modulatore 2
                                                   >> 1075   //----------------------------------------------------------
385                                                   1076     
386   G4RotationMatrix rm3;                        << 1077   G4ThreeVector positionMod37 = G4ThreeVector(0*cm,0*cm,-0.45*cm);
387   rm3.rotateZ(180 *deg);                       << 1078   solidMod37 = new G4Tubs("Mod37",
                                                   >> 1079         innerRadiusOfTheTube, 
                                                   >> 1080         outerRadiusOfTheTube,
                                                   >> 1081         hightOfTheTube,
                                                   >> 1082         startAngleOfTheTube17, 
                                                   >> 1083         spanningAngleOfTheTube17);
                                                   >> 1084 
                                                   >> 1085   logicMod37 = new G4LogicalVolume(solidMod37, ModMater, "Mod37",0,0,0);
                                                   >> 1086   physiMod37 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1087          positionMod37,  // at (x,y,z)
                                                   >> 1088          logicMod37,     // its logical volume          
                                                   >> 1089          "Mod37",        // its name
                                                   >> 1090          logicMod20,      // its mother  volume
                                                   >> 1091          false,           // no boolean operations
                                                   >> 1092          0);              // no particular field
                                                   >> 1093   //----------------------------------------------------------
                                                   >> 1094   //Diciot. fetta Modulatore 2
                                                   >> 1095   //----------------------------------------------------------
                                                   >> 1096     
                                                   >> 1097    
                                                   >> 1098   G4ThreeVector positionMod38 = G4ThreeVector(0*cm,0*cm,-0.51*cm);
                                                   >> 1099   solidMod38 = new G4Tubs("Mod38",
                                                   >> 1100         innerRadiusOfTheTube, 
                                                   >> 1101         outerRadiusOfTheTube,
                                                   >> 1102         hightOfTheTube,
                                                   >> 1103         startAngleOfTheTube18, 
                                                   >> 1104         spanningAngleOfTheTube18);
                                                   >> 1105 
                                                   >> 1106   logicMod38 = new G4LogicalVolume(solidMod38, ModMater, "Mod38",0,0,0);
                                                   >> 1107   physiMod38 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1108          positionMod38,  // at (x,y,z)
                                                   >> 1109          logicMod38,     // its logical volume          
                                                   >> 1110          "Mod38",        // its name
                                                   >> 1111          logicMod20,      // its mother  volume
                                                   >> 1112          false,           // no boolean operations
                                                   >> 1113          0);              // no particular field
                                                   >> 1114 
                                                   >> 1115 
                                                   >> 1116 
                                                   >> 1117   //----------------------------------------------------------
                                                   >> 1118   //Volume Madre  3/4 del Modulatore  Mod 40
                                                   >> 1119   //----------------------------------------------------------
388                                                   1120   
389   G4ThreeVector positionMod3 = G4ThreeVector(0 << 1121     
                                                   >> 1122   G4RotationMatrix rm40;
                                                   >> 1123   rm40.rotateZ(180 *deg);
390                                                   1124   
391   solidMod3 = new G4Tubs("Mod3",               << 1125   G4ThreeVector positionMod40 = G4ThreeVector(0*cm,0*cm,0*cm);
                                                   >> 1126   
                                                   >> 1127   solidMod40 = new G4Tubs("Mod40",
392         innerRadiusOfTheTube,                     1128         innerRadiusOfTheTube, 
393         outerRadiusOfTheTube,                     1129         outerRadiusOfTheTube,
394         hightOfTheTube0,                          1130         hightOfTheTube0,
395         startAngleOfTheTube0/2.,               << 1131         startAngleOfTheTube0, 
396         spanningAngleOfTheTube0);                 1132         spanningAngleOfTheTube0);
397                                                   1133   
398   logicMod3 = new G4LogicalVolume(solidMod3,   << 1134   logicMod40 = new G4LogicalVolume(solidMod40, Mod0Mater, "Mod40",0,0,0);
399                                   Mod0Mater, " << 
400                                                   1135   
401                                                   1136   
402   physiMod3 = new G4PVPlacement(G4Transform3D( << 1137   physiMod40 = new G4PVPlacement(G4Transform3D(rm40, positionMod40), 
403          logicMod3,    // its logical volume   << 1138          logicMod40,    // its logical volume       
404          "Mod3",        // its name            << 1139          "Mod40",        // its name
405          logicMotherMod,  // its mother  volum    1140          logicMotherMod,  // its mother  volume
406          false,         // no boolean operatio    1141          false,         // no boolean operations
407          0);            // no particular field    1142          0);            // no particular field
408                                                   1143   
409                                                   1144 
410                                                   1145 
411                                                   1146 
412  for (G4int i=1;i<StepNumbers;i++)             << 
413   {                                            << 
414                                                   1147 
415   physiMod[2*(StepNumbers-1)+i] = new G4PVPlac << 1148   //----------------------------------------------------------
416         PositionMod[i],                        << 1149   //Prima fetta Modulatore 3
417         logicMod[i],                           << 1150   //----------------------------------------------------------
418         "Modstep",                             << 1151  
419         logicMod3,                             << 1152   G4ThreeVector positionMod41 = G4ThreeVector(0*cm,0*cm,0.51*cm);
420         false,                                 << 1153   solidMod41 = new G4Tubs("Mod41",
421         0);                                    << 1154         innerRadiusOfTheTube, 
422                                                << 1155         outerRadiusOfTheTube,
423   }                                            << 1156         hightOfTheTube,
                                                   >> 1157         startAngleOfTheTube1, 
                                                   >> 1158         spanningAngleOfTheTube1);
                                                   >> 1159   
                                                   >> 1160   logicMod41 = new G4LogicalVolume(solidMod41, ModMater, "Mod41",0,0,0);
                                                   >> 1161   
                                                   >> 1162   physiMod41 = new G4PVPlacement(0,               // no rotation
                                                   >> 1163          positionMod41,  // at (x,y,z)
                                                   >> 1164          logicMod41,     // its logical volume          
                                                   >> 1165          "Mod41",        // its name
                                                   >> 1166          logicMod40,      // its mother  volume
                                                   >> 1167          false,           // no boolean operations
                                                   >> 1168          0);              // no particular field
                                                   >> 1169   
                                                   >> 1170   
                                                   >> 1171   //----------------------------------------------------------
                                                   >> 1172   //Seconda fetta Modulatore 3
                                                   >> 1173   //----------------------------------------------------------
                                                   >> 1174   
                                                   >> 1175   G4ThreeVector positionMod42 = G4ThreeVector(0*cm,0*cm,0.45*cm);
                                                   >> 1176   
                                                   >> 1177   solidMod42 = new G4Tubs("Mod42",
                                                   >> 1178         innerRadiusOfTheTube, 
                                                   >> 1179         outerRadiusOfTheTube,
                                                   >> 1180         hightOfTheTube,
                                                   >> 1181         startAngleOfTheTube2, 
                                                   >> 1182         spanningAngleOfTheTube2);
                                                   >> 1183   
                                                   >> 1184   logicMod42 = new G4LogicalVolume(solidMod42, ModMater, "Mod42",0,0,0);
                                                   >> 1185   
                                                   >> 1186   physiMod42 = new G4PVPlacement(0,               // no rotation
                                                   >> 1187          positionMod42,  // at (x,y,z)
                                                   >> 1188          logicMod42,     // its logical volume          
                                                   >> 1189          "Mod42",        // its name
                                                   >> 1190          logicMod40,      // its mother  volume
                                                   >> 1191          false,           // no boolean operations
                                                   >> 1192          0);              // no particular field
                                                   >> 1193   
                                                   >> 1194   
                                                   >> 1195   //----------------------------------------------------------
                                                   >> 1196   //Terza fetta Modulatore 3
                                                   >> 1197   //----------------------------------------------------------
                                                   >> 1198  
                                                   >> 1199   G4ThreeVector positionMod43 = G4ThreeVector(0*cm,0*cm,0.39*cm);
                                                   >> 1200 
                                                   >> 1201   solidMod43 = new G4Tubs("Mod43",
                                                   >> 1202         innerRadiusOfTheTube, 
                                                   >> 1203         outerRadiusOfTheTube,
                                                   >> 1204         hightOfTheTube,
                                                   >> 1205         startAngleOfTheTube3, 
                                                   >> 1206         spanningAngleOfTheTube3);
                                                   >> 1207 
                                                   >> 1208   logicMod43 = new G4LogicalVolume(solidMod43, ModMater, "Mod43",0,0,0);
                                                   >> 1209   physiMod43 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1210          positionMod43,  // at (x,y,z)
                                                   >> 1211          logicMod43,     // its logical volume          
                                                   >> 1212          "Mod43",        // its name
                                                   >> 1213          logicMod40,      // its mother  volume
                                                   >> 1214          false,           // no boolean operations
                                                   >> 1215          0);              // no particular field
                                                   >> 1216 
                                                   >> 1217  
                                                   >> 1218   //----------------------------------------------------------
                                                   >> 1219   //Quarta fetta Modulatore 3
                                                   >> 1220   //----------------------------------------------------------
                                                   >> 1221    
                                                   >> 1222    
                                                   >> 1223   G4ThreeVector positionMod44 = G4ThreeVector(0*cm,0*cm,0.33*cm);
                                                   >> 1224 
                                                   >> 1225   solidMod44 = new G4Tubs("Mod44",
                                                   >> 1226         innerRadiusOfTheTube, 
                                                   >> 1227         outerRadiusOfTheTube,
                                                   >> 1228         hightOfTheTube,
                                                   >> 1229         startAngleOfTheTube4, 
                                                   >> 1230         spanningAngleOfTheTube4);
                                                   >> 1231 
                                                   >> 1232   logicMod44 = new G4LogicalVolume(solidMod44, ModMater, "Mod44",0,0,0);
                                                   >> 1233  
                                                   >> 1234   physiMod44 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1235          positionMod44,  // at (x,y,z)
                                                   >> 1236          logicMod44,     // its logical volume          
                                                   >> 1237          "Mod44",        // its name
                                                   >> 1238          logicMod40,      // its mother  volume
                                                   >> 1239          false,           // no boolean operations
                                                   >> 1240          0);              // no particular field
                                                   >> 1241 
                                                   >> 1242 
                                                   >> 1243   //----------------------------------------------------------
                                                   >> 1244   //Quinta fetta Modulatore 3
                                                   >> 1245   //----------------------------------------------------------
                                                   >> 1246  
                                                   >> 1247    
                                                   >> 1248    
                                                   >> 1249   G4ThreeVector positionMod45 = G4ThreeVector(0*cm,0*cm,0.27*cm);
                                                   >> 1250 
                                                   >> 1251   solidMod45 = new G4Tubs("Mod45",
                                                   >> 1252         innerRadiusOfTheTube, 
                                                   >> 1253         outerRadiusOfTheTube,
                                                   >> 1254         hightOfTheTube,
                                                   >> 1255         startAngleOfTheTube5, 
                                                   >> 1256         spanningAngleOfTheTube5);
                                                   >> 1257   
                                                   >> 1258   logicMod45 = new G4LogicalVolume(solidMod45, ModMater, "Mod45",0,0,0);
                                                   >> 1259   physiMod45 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1260          positionMod45,  // at (x,y,z)
                                                   >> 1261          logicMod45,     // its logical volume          
                                                   >> 1262          "Mod45",        // its name
                                                   >> 1263          logicMod40,      // its mother  volume
                                                   >> 1264          false,           // no boolean operations
                                                   >> 1265          0);              // no particular field
                                                   >> 1266 
                                                   >> 1267   
                                                   >> 1268   //----------------------------------------------------------
                                                   >> 1269   //Sesta fetta Modulatore 3
                                                   >> 1270   //----------------------------------------------------------
                                                   >> 1271  
                                                   >> 1272    
                                                   >> 1273   G4ThreeVector positionMod46 = G4ThreeVector(0*cm,0*cm,0.21*cm);
                                                   >> 1274   solidMod46 = new G4Tubs("Mod46",
                                                   >> 1275         innerRadiusOfTheTube, 
                                                   >> 1276         outerRadiusOfTheTube,
                                                   >> 1277         hightOfTheTube,
                                                   >> 1278         startAngleOfTheTube6, 
                                                   >> 1279         spanningAngleOfTheTube6);
                                                   >> 1280 
                                                   >> 1281   logicMod46 = new G4LogicalVolume(solidMod46, ModMater, "Mod46",0,0,0);
                                                   >> 1282   physiMod46 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1283          positionMod46,  // at (x,y,z)
                                                   >> 1284          logicMod46,     // its logical volume          
                                                   >> 1285          "Mod46",        // its name
                                                   >> 1286          logicMod40,      // its mother  volume
                                                   >> 1287          false,           // no boolean operations
                                                   >> 1288          0);              // no particular field
                                                   >> 1289 
                                                   >> 1290 
                                                   >> 1291   //----------------------------------------------------------
                                                   >> 1292   //Settima fetta Modulatore 3
                                                   >> 1293   //----------------------------------------------------------
                                                   >> 1294  
                                                   >> 1295       
                                                   >> 1296   G4ThreeVector positionMod47 = G4ThreeVector(0*cm,0*cm,0.15*cm);
                                                   >> 1297   
                                                   >> 1298   solidMod47 = new G4Tubs("Mod47",
                                                   >> 1299         innerRadiusOfTheTube, 
                                                   >> 1300         outerRadiusOfTheTube,
                                                   >> 1301         hightOfTheTube,
                                                   >> 1302         startAngleOfTheTube7, 
                                                   >> 1303         spanningAngleOfTheTube7);
                                                   >> 1304 
                                                   >> 1305   logicMod47 = new G4LogicalVolume(solidMod47, ModMater, "Mod47",0,0,0);
                                                   >> 1306   physiMod47 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1307          positionMod47,  // at (x,y,z)
                                                   >> 1308          logicMod47,     // its logical volume          
                                                   >> 1309          "Mod47",        // its name
                                                   >> 1310          logicMod40,      // its mother  volume
                                                   >> 1311          false,           // no boolean operations
                                                   >> 1312          0);              // no particular field
                                                   >> 1313 
                                                   >> 1314 
                                                   >> 1315 
                                                   >> 1316   //----------------------------------------------------------
                                                   >> 1317   //Ottava fetta Modulatore 3
                                                   >> 1318   //----------------------------------------------------------
                                                   >> 1319    
                                                   >> 1320      
                                                   >> 1321   G4ThreeVector positionMod48 = G4ThreeVector(0*cm,0*cm,0.09*cm);
                                                   >> 1322   solidMod48 = new G4Tubs("Mod48",
                                                   >> 1323         innerRadiusOfTheTube, 
                                                   >> 1324         outerRadiusOfTheTube,
                                                   >> 1325         hightOfTheTube,
                                                   >> 1326         startAngleOfTheTube8, 
                                                   >> 1327         spanningAngleOfTheTube8);
                                                   >> 1328 
                                                   >> 1329   logicMod48 = new G4LogicalVolume(solidMod48, ModMater, "Mod48",0,0,0);
                                                   >> 1330   physiMod48 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1331          positionMod48,  // at (x,y,z)
                                                   >> 1332          logicMod48,     // its logical volume          
                                                   >> 1333          "Mod48",        // its name
                                                   >> 1334          logicMod40,      // its mother  volume
                                                   >> 1335          false,           // no boolean operations
                                                   >> 1336          0);              // no particular field
                                                   >> 1337 
                                                   >> 1338 
                                                   >> 1339 
424                                                   1340 
425   //------------------------------------------    1341   //----------------------------------------------------------
426   // Mother volume of the fourth modulator qua << 1342   //Nona fetta Modulatore 2
                                                   >> 1343   //----------------------------------------------------------
                                                   >> 1344  
                                                   >> 1345 
                                                   >> 1346      
                                                   >> 1347   G4ThreeVector positionMod49 = G4ThreeVector(0*cm,0*cm,0.03*cm);
                                                   >> 1348   solidMod49 = new G4Tubs("Mod49",
                                                   >> 1349         innerRadiusOfTheTube, 
                                                   >> 1350         outerRadiusOfTheTube,
                                                   >> 1351         hightOfTheTube,
                                                   >> 1352         startAngleOfTheTube9, 
                                                   >> 1353         spanningAngleOfTheTube9);
                                                   >> 1354 
                                                   >> 1355   logicMod49 = new G4LogicalVolume(solidMod49, ModMater, "Mod49",0,0,0);
                                                   >> 1356   physiMod49 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1357          positionMod49,  // at (x,y,z)
                                                   >> 1358          logicMod49,     // its logical volume          
                                                   >> 1359          "Mod49",        // its name
                                                   >> 1360          logicMod40,      // its mother  volume
                                                   >> 1361          false,           // no boolean operations
                                                   >> 1362          0);              // no particular field
                                                   >> 1363 
                                                   >> 1364 
                                                   >> 1365   //----------------------------------------------------------
                                                   >> 1366   //Decima fetta Modulatore 3
                                                   >> 1367   //----------------------------------------------------------
                                                   >> 1368  
                                                   >> 1369    
                                                   >> 1370   G4ThreeVector positionMod50 = G4ThreeVector(0*cm,0*cm,-0.03*cm);
                                                   >> 1371   solidMod50 = new G4Tubs("Mod50",
                                                   >> 1372         innerRadiusOfTheTube, 
                                                   >> 1373         outerRadiusOfTheTube,
                                                   >> 1374         hightOfTheTube,
                                                   >> 1375         startAngleOfTheTube10, 
                                                   >> 1376         spanningAngleOfTheTube10);
                                                   >> 1377 
                                                   >> 1378   logicMod50 = new G4LogicalVolume(solidMod50, ModMater, "Mod50",0,0,0);
                                                   >> 1379   physiMod50 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1380          positionMod50,  // at (x,y,z)
                                                   >> 1381          logicMod50,     // its logical volume          
                                                   >> 1382          "Mod50",        // its name
                                                   >> 1383          logicMod40,      // its mother  volume
                                                   >> 1384          false,           // no boolean operations
                                                   >> 1385          0);              // no particular field
                                                   >> 1386 
                                                   >> 1387   //----------------------------------------------------------
                                                   >> 1388   // Undicesima fetta Modulatore 3
                                                   >> 1389   //----------------------------------------------------------
                                                   >> 1390 
                                                   >> 1391   G4ThreeVector positionMod51 = G4ThreeVector(0*cm,0*cm,-0.09*cm);
                                                   >> 1392   solidMod51 = new G4Tubs("Mod51",
                                                   >> 1393         innerRadiusOfTheTube, 
                                                   >> 1394         outerRadiusOfTheTube,
                                                   >> 1395         hightOfTheTube,
                                                   >> 1396         startAngleOfTheTube11, 
                                                   >> 1397         spanningAngleOfTheTube11);
                                                   >> 1398 
                                                   >> 1399   logicMod51 = new G4LogicalVolume(solidMod51, ModMater, "Mod51",0,0,0);
                                                   >> 1400   physiMod51 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1401          positionMod51,  // at (x,y,z)
                                                   >> 1402          logicMod51,     // its logical volume          
                                                   >> 1403          "Mod51",        // its name
                                                   >> 1404          logicMod40,      // its mother  volume
                                                   >> 1405          false,           // no boolean operations
                                                   >> 1406          0);              // no particular field
                                                   >> 1407 
                                                   >> 1408   //----------------------------------------------------------
                                                   >> 1409   //Dodicesima fetta Modulatore 3
                                                   >> 1410   //----------------------------------------------------------
                                                   >> 1411 
                                                   >> 1412   G4ThreeVector positionMod52 = G4ThreeVector(0*cm,0*cm,-0.15*cm);
                                                   >> 1413   solidMod52 = new G4Tubs("Mod52",
                                                   >> 1414         innerRadiusOfTheTube, 
                                                   >> 1415         outerRadiusOfTheTube,
                                                   >> 1416         hightOfTheTube,
                                                   >> 1417         startAngleOfTheTube12, 
                                                   >> 1418         spanningAngleOfTheTube12);
                                                   >> 1419 
                                                   >> 1420   logicMod52 = new G4LogicalVolume(solidMod52, ModMater, "Mod52",0,0,0);
                                                   >> 1421   physiMod52 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1422          positionMod52,  // at (x,y,z)
                                                   >> 1423          logicMod52,     // its logical volume          
                                                   >> 1424          "Mod52",        // its name
                                                   >> 1425          logicMod40,      // its mother  volume
                                                   >> 1426          false,           // no boolean operations
                                                   >> 1427          0);              // no particular field
                                                   >> 1428   
                                                   >> 1429 
                                                   >> 1430   //----------------------------------------------------------
                                                   >> 1431   //Tredicesima fetta Modulatore 3
                                                   >> 1432   //----------------------------------------------------------
                                                   >> 1433  
                                                   >> 1434   G4ThreeVector positionMod53 = G4ThreeVector(0*cm,0*cm,-0.21*cm);
                                                   >> 1435   solidMod53 = new G4Tubs("Mod53",
                                                   >> 1436         innerRadiusOfTheTube, 
                                                   >> 1437         outerRadiusOfTheTube,
                                                   >> 1438         hightOfTheTube,
                                                   >> 1439         startAngleOfTheTube13, 
                                                   >> 1440         spanningAngleOfTheTube13);
                                                   >> 1441 
                                                   >> 1442   logicMod53 = new G4LogicalVolume(solidMod53, ModMater, "Mod53",0,0,0);
                                                   >> 1443   physiMod53 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1444          positionMod53,  // at (x,y,z)
                                                   >> 1445          logicMod53,     // its logical volume          
                                                   >> 1446          "Mod53",        // its name
                                                   >> 1447          logicMod40,      // its mother  volume
                                                   >> 1448          false,           // no boolean operations
                                                   >> 1449          0);              // no particular field
                                                   >> 1450 
                                                   >> 1451   //----------------------------------------------------------
                                                   >> 1452   //Quat. fetta Modulatore 3
                                                   >> 1453   //----------------------------------------------------------
                                                   >> 1454  
                                                   >> 1455        
                                                   >> 1456   G4ThreeVector positionMod54 = G4ThreeVector(0*cm,0*cm,-0.27*cm);
                                                   >> 1457   solidMod54 = new G4Tubs("Mod54",
                                                   >> 1458         innerRadiusOfTheTube, 
                                                   >> 1459         outerRadiusOfTheTube,
                                                   >> 1460         hightOfTheTube,
                                                   >> 1461         startAngleOfTheTube14, 
                                                   >> 1462         spanningAngleOfTheTube14);
                                                   >> 1463 
                                                   >> 1464   logicMod54 = new G4LogicalVolume(solidMod54, ModMater, "Mod54",0,0,0);
                                                   >> 1465   physiMod54 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1466          positionMod54,  // at (x,y,z)
                                                   >> 1467          logicMod54,     // its logical volume          
                                                   >> 1468          "Mod154",        // its name
                                                   >> 1469          logicMod40,      // its mother  volume
                                                   >> 1470          false,           // no boolean operations
                                                   >> 1471          0);              // no particular field
                                                   >> 1472 
                                                   >> 1473   
                                                   >> 1474   //----------------------------------------------------------
                                                   >> 1475   //Quindicesima fetta Modulatore 3
                                                   >> 1476   //----------------------------------------------------------
                                                   >> 1477  
                                                   >> 1478        
                                                   >> 1479   G4ThreeVector positionMod55 = G4ThreeVector(0*cm,0*cm,-0.33*cm);
                                                   >> 1480   solidMod55 = new G4Tubs("Mod35",
                                                   >> 1481         innerRadiusOfTheTube, 
                                                   >> 1482         outerRadiusOfTheTube,
                                                   >> 1483         hightOfTheTube,
                                                   >> 1484         startAngleOfTheTube15, 
                                                   >> 1485         spanningAngleOfTheTube15);
                                                   >> 1486 
                                                   >> 1487   logicMod55 = new G4LogicalVolume(solidMod55, ModMater, "Mod55",0,0,0);
                                                   >> 1488   physiMod55 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1489          positionMod55,  // at (x,y,z)
                                                   >> 1490          logicMod55,     // its logical volume          
                                                   >> 1491          "Mod55",        // its name
                                                   >> 1492          logicMod40,      // its mother  volume
                                                   >> 1493          false,           // no boolean operations
                                                   >> 1494          0);              // no particular field
                                                   >> 1495 
                                                   >> 1496   //----------------------------------------------------------
                                                   >> 1497   //Sedic. fetta Modulatore 3
                                                   >> 1498   //----------------------------------------------------------
                                                   >> 1499  
                                                   >> 1500    
                                                   >> 1501   G4ThreeVector positionMod56 = G4ThreeVector(0*cm,0*cm,-0.39*cm);
                                                   >> 1502   solidMod56 = new G4Tubs("Mod56",
                                                   >> 1503         innerRadiusOfTheTube, 
                                                   >> 1504         outerRadiusOfTheTube,
                                                   >> 1505         hightOfTheTube,
                                                   >> 1506         startAngleOfTheTube16, 
                                                   >> 1507         spanningAngleOfTheTube16);
                                                   >> 1508 
                                                   >> 1509   logicMod56 = new G4LogicalVolume(solidMod56, ModMater, "Mod56",0,0,0);
                                                   >> 1510   physiMod56 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1511          positionMod56,  // at (x,y,z)
                                                   >> 1512          logicMod56,     // its logical volume          
                                                   >> 1513          "Mod56",        // its name
                                                   >> 1514          logicMod40,      // its mother  volume
                                                   >> 1515          false,           // no boolean operations
                                                   >> 1516          0);              // no particular field
                                                   >> 1517 
                                                   >> 1518   //----------------------------------------------------------
                                                   >> 1519   //Dicias. fetta Modulatore 3
                                                   >> 1520   //----------------------------------------------------------
                                                   >> 1521     
                                                   >> 1522   G4ThreeVector positionMod57 = G4ThreeVector(0*cm,0*cm,-0.45*cm);
                                                   >> 1523   solidMod57 = new G4Tubs("Mod57",
                                                   >> 1524         innerRadiusOfTheTube, 
                                                   >> 1525         outerRadiusOfTheTube,
                                                   >> 1526         hightOfTheTube,
                                                   >> 1527         startAngleOfTheTube17, 
                                                   >> 1528         spanningAngleOfTheTube17);
                                                   >> 1529 
                                                   >> 1530   logicMod57 = new G4LogicalVolume(solidMod57, ModMater, "Mod57",0,0,0);
                                                   >> 1531   physiMod57 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1532          positionMod57,  // at (x,y,z)
                                                   >> 1533          logicMod57,     // its logical volume          
                                                   >> 1534          "Mod57",        // its name
                                                   >> 1535          logicMod40,      // its mother  volume
                                                   >> 1536          false,           // no boolean operations
                                                   >> 1537          0);              // no particular field
                                                   >> 1538 
                                                   >> 1539   //----------------------------------------------------------
                                                   >> 1540   //Diciot. fetta Modulatore 3
                                                   >> 1541   //----------------------------------------------------------
                                                   >> 1542     
                                                   >> 1543    
                                                   >> 1544   G4ThreeVector positionMod58 = G4ThreeVector(0*cm,0*cm,-0.51*cm);
                                                   >> 1545   solidMod58 = new G4Tubs("Mod58",
                                                   >> 1546         innerRadiusOfTheTube, 
                                                   >> 1547         outerRadiusOfTheTube,
                                                   >> 1548         hightOfTheTube,
                                                   >> 1549         startAngleOfTheTube18, 
                                                   >> 1550         spanningAngleOfTheTube18);
                                                   >> 1551 
                                                   >> 1552   logicMod58 = new G4LogicalVolume(solidMod58, ModMater, "Mod58",0,0,0);
                                                   >> 1553   physiMod58 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1554          positionMod58,  // at (x,y,z)
                                                   >> 1555          logicMod58,     // its logical volume          
                                                   >> 1556          "Mod58",        // its name
                                                   >> 1557          logicMod40,      // its mother  volume
                                                   >> 1558          false,           // no boolean operations
                                                   >> 1559          0);              // no particular field
                                                   >> 1560 
                                                   >> 1561 
                                                   >> 1562 
                                                   >> 1563   //----------------------------------------------------------
                                                   >> 1564   //Volume Madre  4/4 del Modulatore  Mod 60
427   //------------------------------------------    1565   //----------------------------------------------------------
428                                                   1566   
429                                                   1567     
430   G4RotationMatrix rm4;                        << 1568   G4RotationMatrix rm60;
431   rm4.rotateZ(270 *deg);                       << 1569   rm60.rotateZ(270 *deg);
432                                                   1570   
433   G4ThreeVector positionMod4 = G4ThreeVector(0 << 1571   G4ThreeVector positionMod60 = G4ThreeVector(0*cm,0*cm,0*cm);
434                                                   1572   
435   solidMod4 = new G4Tubs("Mod4",               << 1573   solidMod60 = new G4Tubs("Mod60",
436         innerRadiusOfTheTube,                     1574         innerRadiusOfTheTube, 
437         outerRadiusOfTheTube,                     1575         outerRadiusOfTheTube,
438         hightOfTheTube0,                          1576         hightOfTheTube0,
439         startAngleOfTheTube0/2.,               << 1577         startAngleOfTheTube0, 
440         spanningAngleOfTheTube0);                 1578         spanningAngleOfTheTube0);
441                                                   1579   
442   logicMod4 = new G4LogicalVolume(solidMod4,   << 1580   logicMod60 = new G4LogicalVolume(solidMod60, Mod0Mater, "Mod60",0,0,0);
443                                   Mod0Mater, " << 
444                                                   1581   
445                                                   1582   
446   physiMod4 = new G4PVPlacement(G4Transform3D( << 1583   physiMod60 = new G4PVPlacement(G4Transform3D(rm60, positionMod60), 
447          logicMod4,                            << 1584          logicMod60,    // its logical volume       
448          "Mod4",                               << 1585          "Mod60",        // its name
449          logicMotherMod,                       << 1586          logicMotherMod,  // its mother  volume
450          false,                                << 1587          false,         // no boolean operations
451          0);                                   << 1588          0);            // no particular field
452                                                   1589   
453                                                   1590 
454 for (G4int i=1;i<StepNumbers;i++)              << 1591 
455   {                                            << 1592   //----------------------------------------------------------
456   physiMod[3*(StepNumbers-1)+i] = new G4PVPlac << 1593   //Prima fetta Modulatore 4
457         PositionMod[i],                        << 1594   //----------------------------------------------------------
458         logicMod[i],                           << 1595  
459         "Modstep",                             << 1596   G4ThreeVector positionMod61 = G4ThreeVector(0*cm,0*cm,0.51*cm);
460         logicMod4,                             << 1597   solidMod61 = new G4Tubs("Mod61",
461         false,                                 << 1598         innerRadiusOfTheTube, 
462         0);                                    << 1599         outerRadiusOfTheTube,
463   }                                            << 1600         hightOfTheTube,
464   // Inform the kernel about the new geometry  << 1601         startAngleOfTheTube1, 
465     G4RunManager::GetRunManager() -> GeometryH << 1602         spanningAngleOfTheTube1);
466     G4RunManager::GetRunManager() -> PhysicsHa << 1603   
                                                   >> 1604   logicMod61 = new G4LogicalVolume(solidMod61, ModMater, "Mod61",0,0,0);
                                                   >> 1605   
                                                   >> 1606   physiMod61 = new G4PVPlacement(0,               // no rotation
                                                   >> 1607          positionMod61,  // at (x,y,z)
                                                   >> 1608          logicMod61,     // its logical volume          
                                                   >> 1609          "Mod61",        // its name
                                                   >> 1610          logicMod60,      // its mother  volume
                                                   >> 1611          false,           // no boolean operations
                                                   >> 1612          0);              // no particular field
                                                   >> 1613   
                                                   >> 1614   
                                                   >> 1615   //----------------------------------------------------------
                                                   >> 1616   //Seconda fetta Modulatore 4
                                                   >> 1617   //----------------------------------------------------------
                                                   >> 1618   
                                                   >> 1619   G4ThreeVector positionMod62 = G4ThreeVector(0*cm,0*cm,0.45*cm);
                                                   >> 1620   
                                                   >> 1621   solidMod62 = new G4Tubs("Mod62",
                                                   >> 1622         innerRadiusOfTheTube, 
                                                   >> 1623         outerRadiusOfTheTube,
                                                   >> 1624         hightOfTheTube,
                                                   >> 1625         startAngleOfTheTube2, 
                                                   >> 1626         spanningAngleOfTheTube2);
                                                   >> 1627   
                                                   >> 1628   logicMod62 = new G4LogicalVolume(solidMod62, ModMater, "Mod62",0,0,0);
                                                   >> 1629   
                                                   >> 1630   physiMod62 = new G4PVPlacement(0,               // no rotation
                                                   >> 1631          positionMod62,  // at (x,y,z)
                                                   >> 1632          logicMod62,     // its logical volume          
                                                   >> 1633          "Mod62",        // its name
                                                   >> 1634          logicMod60,      // its mother  volume
                                                   >> 1635          false,           // no boolean operations
                                                   >> 1636          0);              // no particular field
                                                   >> 1637   
                                                   >> 1638   
                                                   >> 1639   //----------------------------------------------------------
                                                   >> 1640   //Terza fetta Modulatore 4
                                                   >> 1641   //----------------------------------------------------------
                                                   >> 1642  
                                                   >> 1643   G4ThreeVector positionMod63 = G4ThreeVector(0*cm,0*cm,0.39*cm);
                                                   >> 1644 
                                                   >> 1645   solidMod63 = new G4Tubs("Mod63",
                                                   >> 1646         innerRadiusOfTheTube, 
                                                   >> 1647         outerRadiusOfTheTube,
                                                   >> 1648         hightOfTheTube,
                                                   >> 1649         startAngleOfTheTube3, 
                                                   >> 1650         spanningAngleOfTheTube3);
                                                   >> 1651 
                                                   >> 1652   logicMod63 = new G4LogicalVolume(solidMod63, ModMater, "Mod63",0,0,0);
                                                   >> 1653   physiMod63 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1654          positionMod63,  // at (x,y,z)
                                                   >> 1655          logicMod63,     // its logical volume          
                                                   >> 1656          "Mod63",        // its name
                                                   >> 1657          logicMod60,      // its mother  volume
                                                   >> 1658          false,           // no boolean operations
                                                   >> 1659          0);              // no particular field
                                                   >> 1660 
                                                   >> 1661  
                                                   >> 1662   //----------------------------------------------------------
                                                   >> 1663   //Quarta fetta Modulatore 4
                                                   >> 1664   //----------------------------------------------------------
                                                   >> 1665    
                                                   >> 1666    
                                                   >> 1667   G4ThreeVector positionMod64 = G4ThreeVector(0*cm,0*cm,0.33*cm);
                                                   >> 1668 
                                                   >> 1669   solidMod64 = new G4Tubs("Mod64",
                                                   >> 1670         innerRadiusOfTheTube, 
                                                   >> 1671         outerRadiusOfTheTube,
                                                   >> 1672         hightOfTheTube,
                                                   >> 1673         startAngleOfTheTube4, 
                                                   >> 1674         spanningAngleOfTheTube4);
                                                   >> 1675 
                                                   >> 1676   logicMod64 = new G4LogicalVolume(solidMod64, ModMater, "Mod64",0,0,0);
                                                   >> 1677  
                                                   >> 1678   physiMod64 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1679          positionMod64,  // at (x,y,z)
                                                   >> 1680          logicMod64,     // its logical volume          
                                                   >> 1681          "Mod64",        // its name
                                                   >> 1682          logicMod60,      // its mother  volume
                                                   >> 1683          false,           // no boolean operations
                                                   >> 1684          0);              // no particular field
                                                   >> 1685 
                                                   >> 1686 
                                                   >> 1687   //----------------------------------------------------------
                                                   >> 1688   //Quinta fetta Modulatore 3
                                                   >> 1689   //----------------------------------------------------------
                                                   >> 1690  
                                                   >> 1691    
                                                   >> 1692    
                                                   >> 1693   G4ThreeVector positionMod65 = G4ThreeVector(0*cm,0*cm,0.27*cm);
                                                   >> 1694 
                                                   >> 1695   solidMod65 = new G4Tubs("Mod65",
                                                   >> 1696         innerRadiusOfTheTube, 
                                                   >> 1697         outerRadiusOfTheTube,
                                                   >> 1698         hightOfTheTube,
                                                   >> 1699         startAngleOfTheTube5, 
                                                   >> 1700         spanningAngleOfTheTube5);
                                                   >> 1701   
                                                   >> 1702   logicMod65 = new G4LogicalVolume(solidMod65, ModMater, "Mod65",0,0,0);
                                                   >> 1703   physiMod65 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1704          positionMod65,  // at (x,y,z)
                                                   >> 1705          logicMod65,     // its logical volume          
                                                   >> 1706          "Mod65",        // its name
                                                   >> 1707          logicMod60,      // its mother  volume
                                                   >> 1708          false,           // no boolean operations
                                                   >> 1709          0);              // no particular field
                                                   >> 1710 
                                                   >> 1711   
                                                   >> 1712   //----------------------------------------------------------
                                                   >> 1713   //Sesta fetta Modulatore 4
                                                   >> 1714   //----------------------------------------------------------
                                                   >> 1715  
                                                   >> 1716    
                                                   >> 1717   G4ThreeVector positionMod66 = G4ThreeVector(0*cm,0*cm,0.21*cm);
                                                   >> 1718   solidMod66 = new G4Tubs("Mod66",
                                                   >> 1719         innerRadiusOfTheTube, 
                                                   >> 1720         outerRadiusOfTheTube,
                                                   >> 1721         hightOfTheTube,
                                                   >> 1722         startAngleOfTheTube6, 
                                                   >> 1723         spanningAngleOfTheTube6);
                                                   >> 1724 
                                                   >> 1725   logicMod66 = new G4LogicalVolume(solidMod66, ModMater, "Mod66",0,0,0);
                                                   >> 1726   physiMod66 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1727          positionMod66,  // at (x,y,z)
                                                   >> 1728          logicMod66,     // its logical volume          
                                                   >> 1729          "Mod66",        // its name
                                                   >> 1730          logicMod60,      // its mother  volume
                                                   >> 1731          false,           // no boolean operations
                                                   >> 1732          0);              // no particular field
                                                   >> 1733 
                                                   >> 1734 
                                                   >> 1735   //----------------------------------------------------------
                                                   >> 1736   //Settima fetta Modulatore 4
                                                   >> 1737   //----------------------------------------------------------
                                                   >> 1738  
                                                   >> 1739       
                                                   >> 1740   G4ThreeVector positionMod67 = G4ThreeVector(0*cm,0*cm,0.15*cm);
                                                   >> 1741   
                                                   >> 1742   solidMod67 = new G4Tubs("Mod67",
                                                   >> 1743         innerRadiusOfTheTube, 
                                                   >> 1744         outerRadiusOfTheTube,
                                                   >> 1745         hightOfTheTube,
                                                   >> 1746         startAngleOfTheTube7, 
                                                   >> 1747         spanningAngleOfTheTube7);
                                                   >> 1748 
                                                   >> 1749   logicMod67 = new G4LogicalVolume(solidMod67, ModMater, "Mod67",0,0,0);
                                                   >> 1750   physiMod67 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1751          positionMod67,  // at (x,y,z)
                                                   >> 1752          logicMod67,     // its logical volume          
                                                   >> 1753          "Mod67",        // its name
                                                   >> 1754          logicMod60,      // its mother  volume
                                                   >> 1755          false,           // no boolean operations
                                                   >> 1756          0);              // no particular field
                                                   >> 1757 
                                                   >> 1758 
                                                   >> 1759 
                                                   >> 1760   //----------------------------------------------------------
                                                   >> 1761   //Ottava fetta Modulatore 4
                                                   >> 1762   //----------------------------------------------------------
                                                   >> 1763    
                                                   >> 1764      
                                                   >> 1765   G4ThreeVector positionMod68 = G4ThreeVector(0*cm,0*cm,0.09*cm);
                                                   >> 1766   solidMod68 = new G4Tubs("Mod68",
                                                   >> 1767         innerRadiusOfTheTube, 
                                                   >> 1768         outerRadiusOfTheTube,
                                                   >> 1769         hightOfTheTube,
                                                   >> 1770         startAngleOfTheTube8, 
                                                   >> 1771         spanningAngleOfTheTube8);
                                                   >> 1772 
                                                   >> 1773   logicMod68 = new G4LogicalVolume(solidMod68, ModMater, "Mod68",0,0,0);
                                                   >> 1774   physiMod68 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1775          positionMod68,  // at (x,y,z)
                                                   >> 1776          logicMod68,     // its logical volume          
                                                   >> 1777          "Mod68",        // its name
                                                   >> 1778          logicMod60,      // its mother  volume
                                                   >> 1779          false,           // no boolean operations
                                                   >> 1780          0);              // no particular field
                                                   >> 1781 
                                                   >> 1782 
                                                   >> 1783 
                                                   >> 1784 
                                                   >> 1785   //----------------------------------------------------------
                                                   >> 1786   //Nona fetta Modulatore 4
                                                   >> 1787   //----------------------------------------------------------
                                                   >> 1788  
                                                   >> 1789 
                                                   >> 1790      
                                                   >> 1791   G4ThreeVector positionMod69 = G4ThreeVector(0*cm,0*cm,0.03*cm);
                                                   >> 1792   solidMod69 = new G4Tubs("Mod69",
                                                   >> 1793         innerRadiusOfTheTube, 
                                                   >> 1794         outerRadiusOfTheTube,
                                                   >> 1795         hightOfTheTube,
                                                   >> 1796         startAngleOfTheTube9, 
                                                   >> 1797         spanningAngleOfTheTube9);
                                                   >> 1798 
                                                   >> 1799   logicMod69 = new G4LogicalVolume(solidMod69, ModMater, "Mod69",0,0,0);
                                                   >> 1800   physiMod69 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1801          positionMod69,  // at (x,y,z)
                                                   >> 1802          logicMod69,     // its logical volume          
                                                   >> 1803          "Mod69",        // its name
                                                   >> 1804          logicMod60,      // its mother  volume
                                                   >> 1805          false,           // no boolean operations
                                                   >> 1806          0);              // no particular field
                                                   >> 1807 
                                                   >> 1808 
                                                   >> 1809   //----------------------------------------------------------
                                                   >> 1810   //Decima fetta Modulatore 4
                                                   >> 1811   //----------------------------------------------------------
                                                   >> 1812  
                                                   >> 1813    
                                                   >> 1814   G4ThreeVector positionMod70 = G4ThreeVector(0*cm,0*cm,-0.03*cm);
                                                   >> 1815   solidMod70 = new G4Tubs("Mod70",
                                                   >> 1816         innerRadiusOfTheTube, 
                                                   >> 1817         outerRadiusOfTheTube,
                                                   >> 1818         hightOfTheTube,
                                                   >> 1819         startAngleOfTheTube10, 
                                                   >> 1820         spanningAngleOfTheTube10);
                                                   >> 1821 
                                                   >> 1822   logicMod70 = new G4LogicalVolume(solidMod70, ModMater, "Mod70",0,0,0);
                                                   >> 1823   physiMod70 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1824          positionMod70,  // at (x,y,z)
                                                   >> 1825          logicMod70,     // its logical volume          
                                                   >> 1826          "Mod70",        // its name
                                                   >> 1827          logicMod60,      // its mother  volume
                                                   >> 1828          false,           // no boolean operations
                                                   >> 1829          0);              // no particular field
                                                   >> 1830 
                                                   >> 1831   //----------------------------------------------------------
                                                   >> 1832   // Undicesima fetta Modulatore 4
                                                   >> 1833   //----------------------------------------------------------
                                                   >> 1834 
                                                   >> 1835   G4ThreeVector positionMod71 = G4ThreeVector(0*cm,0*cm,-0.09*cm);
                                                   >> 1836   solidMod71 = new G4Tubs("Mod71",
                                                   >> 1837         innerRadiusOfTheTube, 
                                                   >> 1838         outerRadiusOfTheTube,
                                                   >> 1839         hightOfTheTube,
                                                   >> 1840         startAngleOfTheTube11, 
                                                   >> 1841         spanningAngleOfTheTube11);
                                                   >> 1842 
                                                   >> 1843   logicMod71 = new G4LogicalVolume(solidMod71, ModMater, "Mod71",0,0,0);
                                                   >> 1844   physiMod71 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1845          positionMod71,  // at (x,y,z)
                                                   >> 1846          logicMod71,     // its logical volume          
                                                   >> 1847          "Mod71",        // its name
                                                   >> 1848          logicMod60,      // its mother  volume
                                                   >> 1849          false,           // no boolean operations
                                                   >> 1850          0);              // no particular field
                                                   >> 1851 
                                                   >> 1852   //----------------------------------------------------------
                                                   >> 1853   //Dodicesima fetta Modulatore 4
                                                   >> 1854   //----------------------------------------------------------
                                                   >> 1855 
                                                   >> 1856   G4ThreeVector positionMod72 = G4ThreeVector(0*cm,0*cm,-0.15*cm);
                                                   >> 1857   solidMod72 = new G4Tubs("Mod72",
                                                   >> 1858         innerRadiusOfTheTube, 
                                                   >> 1859         outerRadiusOfTheTube,
                                                   >> 1860         hightOfTheTube,
                                                   >> 1861         startAngleOfTheTube12, 
                                                   >> 1862         spanningAngleOfTheTube12);
                                                   >> 1863 
                                                   >> 1864   logicMod72 = new G4LogicalVolume(solidMod72, ModMater, "Mod72",0,0,0);
                                                   >> 1865   physiMod72 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1866          positionMod72,  // at (x,y,z)
                                                   >> 1867          logicMod72,     // its logical volume          
                                                   >> 1868          "Mod72",        // its name
                                                   >> 1869          logicMod60,      // its mother  volume
                                                   >> 1870          false,           // no boolean operations
                                                   >> 1871          0);              // no particular field
                                                   >> 1872   
                                                   >> 1873 
                                                   >> 1874   //----------------------------------------------------------
                                                   >> 1875   //Tredicesima fetta Modulatore 4
                                                   >> 1876   //----------------------------------------------------------
                                                   >> 1877  
                                                   >> 1878   G4ThreeVector positionMod73 = G4ThreeVector(0*cm,0*cm,-0.21*cm);
                                                   >> 1879   solidMod73 = new G4Tubs("Mod73",
                                                   >> 1880         innerRadiusOfTheTube, 
                                                   >> 1881         outerRadiusOfTheTube,
                                                   >> 1882         hightOfTheTube,
                                                   >> 1883         startAngleOfTheTube13, 
                                                   >> 1884         spanningAngleOfTheTube13);
                                                   >> 1885 
                                                   >> 1886   logicMod73 = new G4LogicalVolume(solidMod73, ModMater, "Mod73",0,0,0);
                                                   >> 1887   physiMod73 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1888          positionMod73,  // at (x,y,z)
                                                   >> 1889          logicMod73,     // its logical volume          
                                                   >> 1890          "Mod73",        // its name
                                                   >> 1891          logicMod60,      // its mother  volume
                                                   >> 1892          false,           // no boolean operations
                                                   >> 1893          0);              // no particular field
                                                   >> 1894 
                                                   >> 1895   //----------------------------------------------------------
                                                   >> 1896   //Quat. fetta Modulatore 4
                                                   >> 1897   //----------------------------------------------------------
                                                   >> 1898  
                                                   >> 1899        
                                                   >> 1900   G4ThreeVector positionMod74 = G4ThreeVector(0*cm,0*cm,-0.27*cm);
                                                   >> 1901   solidMod74 = new G4Tubs("Mod74",
                                                   >> 1902         innerRadiusOfTheTube, 
                                                   >> 1903         outerRadiusOfTheTube,
                                                   >> 1904         hightOfTheTube,
                                                   >> 1905         startAngleOfTheTube14, 
                                                   >> 1906         spanningAngleOfTheTube14);
                                                   >> 1907 
                                                   >> 1908   logicMod74 = new G4LogicalVolume(solidMod74, ModMater, "Mod74",0,0,0);
                                                   >> 1909   physiMod74 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1910          positionMod74,  // at (x,y,z)
                                                   >> 1911          logicMod74,     // its logical volume          
                                                   >> 1912          "Mod174",        // its name
                                                   >> 1913          logicMod60,      // its mother  volume
                                                   >> 1914          false,           // no boolean operations
                                                   >> 1915          0);              // no particular field
                                                   >> 1916 
                                                   >> 1917   
                                                   >> 1918   //----------------------------------------------------------
                                                   >> 1919   //Quindicesima fetta Modulatore 4
                                                   >> 1920   //----------------------------------------------------------
                                                   >> 1921  
                                                   >> 1922        
                                                   >> 1923   G4ThreeVector positionMod75 = G4ThreeVector(0*cm,0*cm,-0.33*cm);
                                                   >> 1924   solidMod75 = new G4Tubs("Mod75",
                                                   >> 1925         innerRadiusOfTheTube, 
                                                   >> 1926         outerRadiusOfTheTube,
                                                   >> 1927         hightOfTheTube,
                                                   >> 1928         startAngleOfTheTube15, 
                                                   >> 1929         spanningAngleOfTheTube15);
                                                   >> 1930 
                                                   >> 1931   logicMod75 = new G4LogicalVolume(solidMod75, ModMater, "Mod75",0,0,0);
                                                   >> 1932   physiMod75 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1933          positionMod75,  // at (x,y,z)
                                                   >> 1934          logicMod75,     // its logical volume          
                                                   >> 1935          "Mod75",        // its name
                                                   >> 1936          logicMod60,      // its mother  volume
                                                   >> 1937          false,           // no boolean operations
                                                   >> 1938          0);              // no particular field
                                                   >> 1939 
                                                   >> 1940   //----------------------------------------------------------
                                                   >> 1941   //Sedic. fetta Modulatore 4
                                                   >> 1942   //----------------------------------------------------------
                                                   >> 1943  
                                                   >> 1944    
                                                   >> 1945   G4ThreeVector positionMod76 = G4ThreeVector(0*cm,0*cm,-0.39*cm);
                                                   >> 1946   solidMod76 = new G4Tubs("Mod76",
                                                   >> 1947         innerRadiusOfTheTube, 
                                                   >> 1948         outerRadiusOfTheTube,
                                                   >> 1949         hightOfTheTube,
                                                   >> 1950         startAngleOfTheTube16, 
                                                   >> 1951         spanningAngleOfTheTube16);
                                                   >> 1952 
                                                   >> 1953   logicMod76 = new G4LogicalVolume(solidMod76, ModMater, "Mod76",0,0,0);
                                                   >> 1954   physiMod76 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1955          positionMod76,  // at (x,y,z)
                                                   >> 1956          logicMod76,     // its logical volume          
                                                   >> 1957          "Mod76",        // its name
                                                   >> 1958          logicMod60,      // its mother  volume
                                                   >> 1959          false,           // no boolean operations
                                                   >> 1960          0);              // no particular field
                                                   >> 1961 
                                                   >> 1962   //----------------------------------------------------------
                                                   >> 1963   //Dicias. fetta Modulatore 4
                                                   >> 1964   //----------------------------------------------------------
                                                   >> 1965     
                                                   >> 1966   G4ThreeVector positionMod77 = G4ThreeVector(0*cm,0*cm,-0.45*cm);
                                                   >> 1967   solidMod77 = new G4Tubs("Mod57",
                                                   >> 1968         innerRadiusOfTheTube, 
                                                   >> 1969         outerRadiusOfTheTube,
                                                   >> 1970         hightOfTheTube,
                                                   >> 1971         startAngleOfTheTube17, 
                                                   >> 1972         spanningAngleOfTheTube17);
                                                   >> 1973 
                                                   >> 1974   logicMod77 = new G4LogicalVolume(solidMod77, ModMater, "Mod77",0,0,0);
                                                   >> 1975   physiMod77 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1976          positionMod77,  // at (x,y,z)
                                                   >> 1977          logicMod77,     // its logical volume          
                                                   >> 1978          "Mod77",        // its name
                                                   >> 1979          logicMod60,      // its mother  volume
                                                   >> 1980          false,           // no boolean operations
                                                   >> 1981          0);              // no particular field
                                                   >> 1982 
                                                   >> 1983   //----------------------------------------------------------
                                                   >> 1984   //Diciot. fetta Modulatore 3
                                                   >> 1985   //----------------------------------------------------------
                                                   >> 1986     
                                                   >> 1987    
                                                   >> 1988   G4ThreeVector positionMod78 = G4ThreeVector(0*cm,0*cm,-0.51*cm);
                                                   >> 1989   solidMod78 = new G4Tubs("Mod78",
                                                   >> 1990         innerRadiusOfTheTube, 
                                                   >> 1991         outerRadiusOfTheTube,
                                                   >> 1992         hightOfTheTube,
                                                   >> 1993         startAngleOfTheTube18, 
                                                   >> 1994         spanningAngleOfTheTube18);
                                                   >> 1995 
                                                   >> 1996   logicMod78 = new G4LogicalVolume(solidMod78, ModMater, "Mod78",0,0,0);
                                                   >> 1997   physiMod78 = new G4PVPlacement(0,                   // no rotation
                                                   >> 1998          positionMod78,  // at (x,y,z)
                                                   >> 1999          logicMod78,     // its logical volume          
                                                   >> 2000          "Mod78",        // its name
                                                   >> 2001          logicMod60,      // its mother  volume
                                                   >> 2002          false,           // no boolean operations
                                                   >> 2003          0);              // no particular field
                                                   >> 2004 
467   G4VisAttributes * red = new G4VisAttributes(    2005   G4VisAttributes * red = new G4VisAttributes( G4Colour(1. ,0. ,0.));
468   red-> SetVisibility(true);                      2006   red-> SetVisibility(true);
469   red-> SetForceSolid(true);                      2007   red-> SetForceSolid(true);
470   logicMotherMod -> SetVisAttributes(G4VisAttr << 2008   logicMotherMod -> SetVisAttributes(G4VisAttributes::Invisible);
471                                                << 2009 
472   logicMod1 ->SetVisAttributes(G4VisAttributes << 2010   logicMod0 ->SetVisAttributes(G4VisAttributes::Invisible);
473   logicMod2 ->SetVisAttributes(G4VisAttributes << 2011   logicMod20 ->SetVisAttributes(G4VisAttributes::Invisible);
474   logicMod3 ->SetVisAttributes(G4VisAttributes << 2012   logicMod40 ->SetVisAttributes(G4VisAttributes::Invisible);
475   logicMod4 ->SetVisAttributes(G4VisAttributes << 2013   logicMod60 ->SetVisAttributes(G4VisAttributes::Invisible);
476                                                << 2014   logicMod1 -> SetVisAttributes(red);
477   for (G4int i=1;i<StepNumbers;i++)            << 2015   logicMod2 -> SetVisAttributes(red);
478   {                                            << 2016   logicMod3 -> SetVisAttributes(red);
479    logicMod[i] -> SetVisAttributes(red);       << 2017   logicMod4 -> SetVisAttributes(red);
480   }                                            << 2018   logicMod5 -> SetVisAttributes(red);
481                                                << 2019   logicMod6 -> SetVisAttributes(red);
482  }                                             << 2020   logicMod7 -> SetVisAttributes(red);
                                                   >> 2021   logicMod8 -> SetVisAttributes(red);
                                                   >> 2022   logicMod9 -> SetVisAttributes(red);
                                                   >> 2023   logicMod10 -> SetVisAttributes(red);
                                                   >> 2024   logicMod11 -> SetVisAttributes(red);
                                                   >> 2025   logicMod12 -> SetVisAttributes(red);
                                                   >> 2026   logicMod13 -> SetVisAttributes(red);
                                                   >> 2027   logicMod14 -> SetVisAttributes(red);
                                                   >> 2028   logicMod15 -> SetVisAttributes(red);
                                                   >> 2029   logicMod16 -> SetVisAttributes(red);
                                                   >> 2030   logicMod17 -> SetVisAttributes(red);
                                                   >> 2031   logicMod18 -> SetVisAttributes(red);
                                                   >> 2032   logicMod21 -> SetVisAttributes(red);
                                                   >> 2033   logicMod22 -> SetVisAttributes(red);
                                                   >> 2034   logicMod23 -> SetVisAttributes(red);
                                                   >> 2035   logicMod24 -> SetVisAttributes(red);
                                                   >> 2036   logicMod25 -> SetVisAttributes(red);
                                                   >> 2037   logicMod26 -> SetVisAttributes(red);
                                                   >> 2038   logicMod27 -> SetVisAttributes(red);
                                                   >> 2039   logicMod28 -> SetVisAttributes(red);
                                                   >> 2040   logicMod29 -> SetVisAttributes(red);
                                                   >> 2041   logicMod30 -> SetVisAttributes(red);
                                                   >> 2042   logicMod31 -> SetVisAttributes(red);
                                                   >> 2043   logicMod32 -> SetVisAttributes(red);
                                                   >> 2044   logicMod33 -> SetVisAttributes(red);
                                                   >> 2045   logicMod34 -> SetVisAttributes(red);
                                                   >> 2046   logicMod35 -> SetVisAttributes(red);
                                                   >> 2047   logicMod36 -> SetVisAttributes(red);
                                                   >> 2048   logicMod37 -> SetVisAttributes(red);
                                                   >> 2049   logicMod38 -> SetVisAttributes(red);
                                                   >> 2050   logicMod41 -> SetVisAttributes(red);
                                                   >> 2051   logicMod42 -> SetVisAttributes(red);
                                                   >> 2052   logicMod43 -> SetVisAttributes(red);
                                                   >> 2053   logicMod44 -> SetVisAttributes(red);
                                                   >> 2054   logicMod45 -> SetVisAttributes(red);
                                                   >> 2055   logicMod46 -> SetVisAttributes(red);
                                                   >> 2056   logicMod47 -> SetVisAttributes(red);
                                                   >> 2057   logicMod48 -> SetVisAttributes(red);
                                                   >> 2058   logicMod49 -> SetVisAttributes(red);
                                                   >> 2059   logicMod50 -> SetVisAttributes(red);
                                                   >> 2060   logicMod51 -> SetVisAttributes(red);
                                                   >> 2061   logicMod52 -> SetVisAttributes(red);
                                                   >> 2062   logicMod53 -> SetVisAttributes(red);
                                                   >> 2063   logicMod54 -> SetVisAttributes(red);
                                                   >> 2064   logicMod55 -> SetVisAttributes(red);
                                                   >> 2065   logicMod56 -> SetVisAttributes(red);
                                                   >> 2066   logicMod57 -> SetVisAttributes(red);
                                                   >> 2067   logicMod58 -> SetVisAttributes(red);
                                                   >> 2068   logicMod61 -> SetVisAttributes(red);
                                                   >> 2069   logicMod62 -> SetVisAttributes(red);
                                                   >> 2070   logicMod63 -> SetVisAttributes(red);
                                                   >> 2071   logicMod64 -> SetVisAttributes(red);
                                                   >> 2072   logicMod65 -> SetVisAttributes(red);
                                                   >> 2073   logicMod66 -> SetVisAttributes(red);
                                                   >> 2074   logicMod67 -> SetVisAttributes(red);
                                                   >> 2075   logicMod68 -> SetVisAttributes(red);
                                                   >> 2076   logicMod69 -> SetVisAttributes(red);
                                                   >> 2077   logicMod70 -> SetVisAttributes(red);
                                                   >> 2078   logicMod71 -> SetVisAttributes(red);
                                                   >> 2079   logicMod72 -> SetVisAttributes(red);
                                                   >> 2080   logicMod73 -> SetVisAttributes(red);
                                                   >> 2081   logicMod74 -> SetVisAttributes(red);
                                                   >> 2082   logicMod75 -> SetVisAttributes(red);
                                                   >> 2083   logicMod76 -> SetVisAttributes(red);
                                                   >> 2084   logicMod77 -> SetVisAttributes(red);
                                                   >> 2085   logicMod78 -> SetVisAttributes(red);
                                                   >> 2086 }
483                                                   2087 
484 ////////////////////////////////////////////// << 
485 // Messenger values                            << 
486 //////////////////////////////////////////////    2088 /////////////////////////////////////////////////////////////////////////////
487 void HadrontherapyModulator::SetModulatorAngle    2089 void HadrontherapyModulator::SetModulatorAngle(G4double angle)
488 {                                                 2090 {
489   G4double rotationAngle = angle;                 2091   G4double rotationAngle = angle;
490   rm -> rotateZ(rotationAngle);                   2092   rm -> rotateZ(rotationAngle);
                                                   >> 2093   G4cout << "!!!!!!!!!!!!! " << rotationAngle/deg << G4endl;
491   physiMotherMod -> SetRotation(rm);              2094   physiMotherMod -> SetRotation(rm);  
492   G4cout << "MODULATOR HAS BEEN ROTATED OF " <    2095   G4cout << "MODULATOR HAS BEEN ROTATED OF " << rotationAngle/deg 
493    << " deg" << G4endl;                           2096    << " deg" << G4endl;
494   G4RunManager::GetRunManager() -> GeometryHas    2097   G4RunManager::GetRunManager() -> GeometryHasBeenModified(); 
495 }                                                 2098 }
496 ////////////////////////////////////////////// << 
497 // Change modulator material                   << 
498 void HadrontherapyModulator::SetModulatorMater << 
499 {                                              << 
500     if (G4Material* NewMaterial = G4NistManage << 
501     {                                          << 
502   if (NewMaterial)                             << 
503   {                                            << 
504       for(G4int i=1;i<StepNumbers;i++)         << 
505       {                                        << 
506       logicMod[i] -> SetMaterial(NewMaterial); << 
507     //  G4RunManager::GetRunManager() -> Physi << 
508       G4RunManager::GetRunManager() -> Geometr << 
509                                                << 
510     //  G4cout<<(logicMod[i]->GetMaterial()->G << 
511   }                                            << 
512   G4cout << "The material of the Modulator whe << 
513   }                                            << 
514     }                                          << 
515     else                                       << 
516     {                                          << 
517   G4cout << "WARNING: material \"" << Material << 
518       " table [located in $G4INSTALL/source/ma << 
519   G4cout << "Use command \"/parameter/nist\" t << 
520                                                << 
521                                                << 
522     }                                          << 
523 }                                              << 
524                                                   2099 
525 ////////////////////////////////////////////// << 
526 // Change modulator position in the beam line  << 
527 void HadrontherapyModulator::SetModulatorPosit << 
528 {                                              << 
529   G4ThreeVector NewModulatorPos=Pos;           << 
530   physiMotherMod -> SetTranslation( NewModulat << 
531   G4RunManager::GetRunManager() -> GeometryHas << 
532   G4cout << "The modulator wheel is translated << 
533                                                << 
534 }                                              << 
535 ////////////////////////////////////////////// << 
536 //change modulator inner raduis                << 
537 void HadrontherapyModulator::SetModulatorInner << 
538 {                                              << 
539 solidMod1 -> SetInnerRadius(newvalue);         << 
540 solidMod2 -> SetInnerRadius(newvalue);         << 
541 solidMod3 -> SetInnerRadius(newvalue);         << 
542 solidMod4 -> SetInnerRadius(newvalue);         << 
543  for(G4int i=1;i<StepNumbers;i++)              << 
544  {                                             << 
545  solidMod[i] -> SetInnerRadius(newvalue);}     << 
546    G4RunManager::GetRunManager() -> GeometryHa << 
547   G4cout << "InnerRadius of the Modulator Whee << 
548    << newvalue/mm<<" mm"<< G4endl;             << 
549 }                                              << 
550 ////////////////////////////////////////////// << 
551 //change modulator outer raduis                << 
552 void HadrontherapyModulator::SetModulatorOuter << 
553 {                                              << 
554 solidMod1 -> SetOuterRadius(newvalue);         << 
555 solidMod2 -> SetOuterRadius(newvalue);         << 
556 solidMod3 -> SetOuterRadius(newvalue);         << 
557 solidMod4 -> SetOuterRadius(newvalue);         << 
558  for(G4int i=1;i<StepNumbers;i++)              << 
559  {                                             << 
560  solidMod[i] -> SetOuterRadius(newvalue);}     << 
561    G4RunManager::GetRunManager() -> GeometryHa << 
562   G4cout << "OuterRadius of the Modulator Whee << 
563    << newvalue/mm<<" mm"<<G4endl;              << 
564 }                                              << 
565 ////////////////////////////////////////////// << 
566 void HadrontherapyModulator:: GetDataFromFile( << 
567                                                   2100 
568 {                                              << 
569 G4String Name=value;                           << 
570 if(value=="default" )                          << 
571 {                                              << 
572 Name=FileName;                                 << 
573 }                                              << 
574 G4cout<<" Step properties of modulator will be << 
575  <<Name<<G4endl;                               << 
576 ModulatorPropertiesFromFile(Name);             << 
577 }                                              << 
578                                                   2101