Geant4 Cross Reference

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

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

Diff markup

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


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