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 8.0)


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