Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:03

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This is the first version of Flash, a Geant4-based application
0027 //
0028 //
0029 //////////////////////////////////////////////////////////////////////////////////////////////
0030 
0031 #include "FlashApplicator.hh"
0032 #include "FlashDetectorConstruction.hh"
0033 #include "G4Box.hh"
0034 #include "G4Colour.hh"
0035 #include "G4Cons.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4NistElementBuilder.hh"
0038 #include "G4NistManager.hh"
0039 #include "G4PVPlacement.hh"
0040 #include "G4RotationMatrix.hh"
0041 #include "G4RunManager.hh"
0042 #include "G4SubtractionSolid.hh"
0043 #include "G4SystemOfUnits.hh"
0044 #include "G4Tubs.hh"
0045 #include "G4VisAttributes.hh"
0046 #include "globals.hh"
0047 
0048 FlashApplicator::FlashApplicator(G4VPhysicalVolume *physicalTreatmentRoom)
0049     : fMotherPhys(physicalTreatmentRoom),
0050 
0051       
0052       solidFTFlash(0), physiFTFlash(0) {
0053   ConstructCollimator(fMotherPhys);
0054 
0055 
0056   
0057 }
0058 
0059 FlashApplicator::~FlashApplicator() {}
0060 
0061 void FlashApplicator::ConstructCollimator(G4VPhysicalVolume *) {
0062   // Sets default geometry and materials
0063   SetDefaultDimensions();
0064    SetOuterRadius(55*mm);
0065    SetApplicatorLength(365*mm);
0066   // Construct the whole Applicator Beam Line
0067   ConstructApplicator();
0068 }
0069 
0070 void FlashApplicator::SetDefaultDimensions() {
0071 
0072   white = new G4VisAttributes(G4Colour());
0073   white->SetVisibility(true);
0074 
0075   blue = new G4VisAttributes(G4Colour(0., 0., 1.));
0076   blue->SetVisibility(true);
0077 
0078   gray = new G4VisAttributes(G4Colour(0.5, 0.5, 0.5));
0079   gray->SetVisibility(true);
0080 
0081   red = new G4VisAttributes(G4Colour(1., 0., 0.));
0082   red->SetVisibility(true);
0083 
0084   yellow = new G4VisAttributes(G4Colour(1., 1., 0.));
0085   yellow->SetVisibility(true);
0086 
0087   green = new G4VisAttributes(G4Colour(25 / 255., 255 / 255., 25 / 255.));
0088   green->SetVisibility(true);
0089 
0090   darkGreen = new G4VisAttributes(G4Colour(0 / 255., 100 / 255., 0 / 255.));
0091   darkGreen->SetVisibility(true);
0092 
0093   darkOrange3 =
0094       new G4VisAttributes(G4Colour(205 / 255., 102 / 255., 000 / 255.));
0095   darkOrange3->SetVisibility(true);
0096 
0097   skyBlue = new G4VisAttributes(G4Colour(135 / 255., 206 / 255., 235 / 255.));
0098   skyBlue->SetVisibility(true);
0099 
0100   magenta = new G4VisAttributes(G4Colour(255 / 255., 0 / 255., 255 / 255.));
0101   magenta->SetVisibility(true);
0102 
0103   
0104   fInitial_pos = -113*cm; //set the same position in FlashPrimaryGeneratorAction.cc
0105   // Geometry  APPLICATOR DEFAULTS
0106 
0107  
0108 
0109   G4double defaultinnerRadiusFirstApplicatorFlash =
0110       fOuterRadiusFirstApplicatorFlash - 5. * mm;
0111    fInnerRadiusFirstApplicatorFlash = defaultinnerRadiusFirstApplicatorFlash;
0112 
0113   // DEFAULT DEFINITION OF THE MATERIALS
0114 
0115   // ELEMENTS
0116   G4double density;
0117   G4int ncomponents;
0118   G4bool isotopes = false;
0119   aluminumNist =
0120       G4NistManager::Instance()->FindOrBuildMaterial("G4_Al", isotopes);
0121 
0122 
0123   Fe = G4NistManager::Instance()->FindOrBuildMaterial("G4_Fe");
0124     
0125   PVDF = new G4Material("PVDF",  density=1780 *kg/m3,  ncomponents=3);
0126   
0127   
0128   
0129   PVDF->AddElement(G4NistManager::Instance()->FindOrBuildElement("C"), 34 * perCent);
0130   PVDF->AddElement(G4NistManager::Instance()->FindOrBuildElement("H"), 33 * perCent);
0131   PVDF->AddElement(G4NistManager::Instance()->FindOrBuildElement("F"), 33 * perCent);
0132 
0133   
0134   
0135   FILM= new G4Material("FILM", density=1430 *kg/m3, ncomponents = 4);
0136     
0137   FILM->AddElement(G4NistManager::Instance()->FindOrBuildElement("C"), 69 * perCent);
0138   FILM->AddElement(G4NistManager::Instance()->FindOrBuildElement("H"), 3 * perCent);
0139   FILM->AddElement(G4NistManager::Instance()->FindOrBuildElement("N"), 7 * perCent);
0140   FILM->AddElement(G4NistManager::Instance()->FindOrBuildElement("O"), 21 * perCent);
0141     
0142 
0143 
0144 
0145   G4Material *galacticNist =
0146       G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic", isotopes);
0147   PMMA =
0148       G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
0149 
0150   G4Material *titanioNist =
0151       G4NistManager::Instance()->FindOrBuildMaterial("G4_Ti", isotopes);
0152 
0153 
0154   // MATERIAL ASSIGNMENT
0155 
0156   // Material of the APPLICATOR Flash
0157   fFirstApplicatorMaterialFlash = PMMA;
0158  
0159   // Titanium window
0160   FTFlashMaterialFlash = titanioNist;
0161 
0162   // Vacuum Source
0163   VSFlashMaterialFlash = galacticNist;
0164 }
0165 
0166 void FlashApplicator::ConstructApplicator() {
0167 
0168   // Components of the Applicator
0169 
0170   FlashBeamLineVacuumSource();
0171   FlashBeamLineTitaniumWindows();
0172   FlashVWAlcover();
0173   FlashAlCover2();
0174   FlashExitBit();
0175   FlashToroid();
0176   OverCover();
0177 
0178   MonitorChamber();
0179   Flash_connector();
0180   Bigconnector();
0181   Bigconnector2();
0182   FlashBeamLineApplicator();//modify this function for applicator lenght
0183 
0184 
0185  
0186 }
0187 
0188 void FlashApplicator::FlashBeamLineVacuumSource() {
0189   // ---------------------------------------------------------------//
0190   //                     Vacuum Source                             //
0191   // ---------------------------------------------------------------//
0192 
0193   G4double phi1 = 90. * deg;
0194 
0195   G4RotationMatrix rm1;
0196   rm1.rotateY(phi1);
0197 
0198   fOutRadiusVSFlash = 20 * mm;
0199   const G4double innRadiusVSFlash = 0. * mm;
0200    fHightVSFlash = 8 * mm;
0201   const G4double startAngleVSFlash = 0. * deg;
0202   const G4double spanningAngleVSFlash = 360. * deg;
0203   fXPositionVSFlash = fInitial_pos-fHightVSFlash-0.055/2*mm; //0.055 is titanium window
0204 
0205   solidVSFlash =
0206       new G4Tubs("VSFlash", innRadiusVSFlash, fOutRadiusVSFlash, fHightVSFlash,
0207                  startAngleVSFlash, spanningAngleVSFlash);
0208 
0209   G4LogicalVolume *logVSFlash = new G4LogicalVolume(
0210       solidVSFlash, VSFlashMaterialFlash, "VSFlash", 0, 0, 0);
0211 
0212   physiVSFlash = new G4PVPlacement(
0213       G4Transform3D(rm1, G4ThreeVector((fXPositionVSFlash), 0., 0.)), "VSFlash",
0214       logVSFlash, fMotherPhys, false, 0);
0215 
0216   logVSFlash->SetVisAttributes(green);
0217 }
0218 
0219 void FlashApplicator::FlashBeamLineTitaniumWindows() {
0220   // ---------------------------------------------------------------//
0221   //                     Titanium Window                        //
0222   // ---------------------------------------------------------------//
0223   // with just this piece ssd=1.6cm
0224   G4double phi2 = 90. * deg;
0225 
0226   G4RotationMatrix rm2;
0227   rm2.rotateY(phi2);
0228 
0229    fOutRadiusFTFlash = fOutRadiusVSFlash;
0230   const G4double innRadiusFTFlash = 19 * mm;
0231    fHightFTFlash = 0.055/2 * mm;
0232   const G4double startAngleFTFlash = 0. * deg;
0233   const G4double spanningAngleFTFlash = 360. * deg;
0234   const G4double XPositionFTFlash = fInitial_pos ;
0235 
0236   solidFTFlash =
0237       new G4Tubs("FTFlash", innRadiusFTFlash, fOutRadiusFTFlash, fHightFTFlash,
0238                  startAngleFTFlash, spanningAngleFTFlash);
0239 
0240   G4LogicalVolume *logFTFlash = new G4LogicalVolume(
0241       solidFTFlash, FTFlashMaterialFlash, "FTFlash", 0, 0, 0);
0242 
0243   physiFTFlash = new G4PVPlacement(
0244       G4Transform3D(rm2, G4ThreeVector((XPositionFTFlash), 0., 0.)), "FTFlash",
0245       logFTFlash, fMotherPhys, false, 0);
0246 
0247   logFTFlash->SetVisAttributes(yellow);
0248 }
0249 void FlashApplicator::FlashVWAlcover(){
0250 
0251  G4double phi2 = 90. * deg;
0252 
0253   G4RotationMatrix rm2;
0254   rm2.rotateY(phi2);
0255 
0256 
0257   const G4double innRadius = fOutRadiusVSFlash;
0258     fOutRadius = innRadius+8*mm;
0259   const G4double hight = fHightVSFlash;
0260   const G4double startAngle = 0. * deg;
0261   const G4double spanningAngle = 360. * deg;
0262   const G4double XPosition = fXPositionVSFlash ;
0263 
0264    G4VSolid * solid =
0265       new G4Tubs("cover1", innRadius, fOutRadius, hight,
0266                  startAngle, spanningAngle);
0267 
0268   G4LogicalVolume *log = new G4LogicalVolume(
0269       solid, aluminumNist, "cover1log", 0, 0, 0);
0270 
0271  new G4PVPlacement(
0272       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "cover1phys",
0273       log, fMotherPhys, false, 0);
0274 
0275   log->SetVisAttributes(white);
0276 
0277 
0278 }
0279 void FlashApplicator::FlashAlCover2(){
0280 
0281 G4double phi2 = 90. * deg;
0282 
0283   G4RotationMatrix rm2;
0284   rm2.rotateY(phi2);
0285 
0286   
0287   const G4double innRadius = fOutRadiusVSFlash;
0288 
0289   const G4double hight = fHightVSFlash+fHightFTFlash;
0290   const G4double startAngle = 0. * deg;
0291   const G4double spanningAngle = 360. * deg;
0292   const G4double XPosition = fInitial_pos+hight+fHightFTFlash;
0293 
0294    G4VSolid * solid =
0295       new G4Tubs("cover1", innRadius, fOutRadius, hight,
0296                  startAngle, spanningAngle);
0297 
0298   G4LogicalVolume *log = new G4LogicalVolume(
0299       solid, aluminumNist, "cover1log", 0, 0, 0);
0300 
0301 new G4PVPlacement(
0302       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "cover1phys",
0303       log, fMotherPhys, false, 0);
0304 
0305   log->SetVisAttributes(red);
0306   
0307   fInitial_pos=fInitial_pos + fHightFTFlash;
0308 }
0309 void FlashApplicator::FlashExitBit(){
0310 
0311 G4double phi2 = 90. * deg;
0312 
0313   G4RotationMatrix rm2;
0314   rm2.rotateY(phi2);
0315 
0316   
0317   const G4double innRadius = 0*mm;
0318   fOutRadius = fOutRadiusVSFlash;
0319   const G4double hight = 16/2*mm;
0320   const G4double startAngle = 0. * deg;
0321   const G4double spanningAngle = 360. * deg;
0322   const G4double XPosition = fInitial_pos+hight;
0323 
0324 
0325     G4VSolid *t1 = new G4Tubs("t1", innRadius, fOutRadius, hight,
0326                  startAngle, spanningAngle);
0327                              
0328     G4VSolid *t2 = new G4Cons("t2", 0*mm,13/2*mm, 0*mm,38/2*mm,16.1/2*mm, startAngle,spanningAngle);
0329     
0330     G4RotationMatrix rotm_t2 = G4RotationMatrix();
0331     rotm_t2.rotateX(0 * deg);
0332     G4ThreeVector zTrans(0, 0, 0);
0333 
0334     G4SubtractionSolid *hollowcover =
0335         new G4SubtractionSolid("hollowcover_log", t1, t2, 0, zTrans);
0336 
0337     
0338     G4LogicalVolume *logic =
0339         new G4LogicalVolume(hollowcover, aluminumNist, "hollowcover", 0, 0, 0);
0340         
0341     new G4PVPlacement(
0342       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "cover1phys",
0343       logic, fMotherPhys, false, 0);
0344 
0345   logic->SetVisAttributes(darkOrange3);
0346 fInitial_pos=XPosition+hight;
0347 }
0348 void FlashApplicator::FlashToroid(){
0349 
0350 G4double phi2 = 90. * deg;
0351 
0352   G4RotationMatrix rm2;
0353   rm2.rotateY(phi2);
0354 
0355   
0356   const G4double innRadius = 50.8/2*mm;
0357  fToroid_outRadius = innRadius + 45*mm;
0358   fToroid_hight = 50.8/2*mm;
0359   const G4double startAngle = 0. * deg;
0360   const G4double spanningAngle = 360. * deg;
0361   fToroid_XPosition = fInitial_pos+fToroid_hight + 8*mm;
0362 
0363    G4VSolid * solid =
0364       new G4Tubs("toroid", innRadius, fToroid_outRadius, fToroid_hight,
0365                  startAngle, spanningAngle);
0366 
0367   G4LogicalVolume *log = new G4LogicalVolume(
0368       solid, Fe, "toroidlog", 0, 0, 0);
0369 
0370   new G4PVPlacement(
0371       G4Transform3D(rm2, G4ThreeVector((fToroid_XPosition), 0., 0.)), "toroidphys",
0372       log, fMotherPhys, false, 0);
0373 
0374   log->SetVisAttributes(blue);
0375 
0376 fInitial_pos=fToroid_XPosition+fToroid_hight;
0377 }
0378 void FlashApplicator::OverCover(){
0379 
0380 G4double phi2 = 90. * deg;
0381 
0382   G4RotationMatrix rm2;
0383   rm2.rotateY(phi2);
0384 
0385   
0386   const G4double innRadius = fOutRadius;
0387   const G4double out_Radius = 5*fOutRadius ;
0388   fBigcover_hight = 7.5*mm;
0389   const G4double startAngle = 0. * deg;
0390   const G4double spanningAngle = 360. * deg;
0391    fBigcover_XPosition = fXPositionVSFlash - fHightVSFlash+fBigcover_hight;
0392 
0393    G4VSolid * solid =
0394       new G4Tubs("coverbig", innRadius, out_Radius, fBigcover_hight,
0395                  startAngle, spanningAngle);
0396 
0397   G4LogicalVolume *log = new G4LogicalVolume(
0398       solid, aluminumNist, "coverbig_log", 0, 0, 0);
0399 
0400   new G4PVPlacement(
0401       G4Transform3D(rm2, G4ThreeVector((fBigcover_XPosition), 0., 0.)), "coverbig_phys",
0402       log, fMotherPhys, false, 0);
0403 
0404   log->SetVisAttributes(skyBlue);
0405   
0406   
0407   const G4double innRadius_2 = fToroid_outRadius;
0408   const G4double out_Radius_2 = innRadius_2 + 1.2*cm ;
0409   const G4double fBigcover_hight_2 = 30*mm;
0410   const G4double startAngle_2 = 0. * deg;
0411   const G4double spanningAngle_2 = 360. * deg;
0412    const double fBigcover_XPosition_2 = fBigcover_XPosition+fBigcover_hight_2+fBigcover_hight;
0413 
0414    G4VSolid * solid_2 =
0415       new G4Tubs("coverbig_2", innRadius_2, out_Radius_2, fBigcover_hight_2,
0416                  startAngle_2, spanningAngle_2);
0417 
0418   G4LogicalVolume *log_2 = new G4LogicalVolume(
0419       solid_2, aluminumNist, "coverbig_log", 0, 0, 0);
0420 
0421   new G4PVPlacement(
0422       G4Transform3D(rm2, G4ThreeVector((fBigcover_XPosition_2), 0., 0.)), "coverbig_phys",
0423       log_2, fMotherPhys, false, 0);
0424 
0425   log_2->SetVisAttributes(green);
0426   
0427   
0428 }
0429 
0430 void FlashApplicator::OverCover2() {
0431 
0432 G4double phi2 = 90. * deg;
0433 
0434   G4RotationMatrix rm2;
0435   rm2.rotateY(phi2);
0436 
0437   
0438   const G4double innRadius = fToroid_outRadius;
0439   const G4double out_Radius = innRadius+40*mm ;
0440   const G4double hight = 34*mm;
0441   const G4double startAngle = 0. * deg;
0442   const G4double spanningAngle = 360. * deg;
0443   const G4double XPosition = fBigcover_XPosition+fBigcover_hight+hight;
0444 
0445    G4VSolid * solid =
0446       new G4Tubs("coverbig", innRadius, out_Radius, hight,
0447                  startAngle, spanningAngle);
0448 
0449   G4LogicalVolume *log = new G4LogicalVolume(
0450       solid, aluminumNist, "coverbig_log", 0, 0, 0);
0451 
0452 new G4PVPlacement(
0453       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys",
0454       log, fMotherPhys, false, 0);
0455 
0456   log->SetVisAttributes(yellow);
0457 
0458 }
0459 
0460 void FlashApplicator::MonitorChamber(){
0461 
0462 G4double phi2 = 90. * deg;
0463 
0464   G4RotationMatrix rm2;
0465   rm2.rotateY(phi2);
0466 
0467   
0468   const G4double innRadius = 20*mm;
0469   const G4double out_Radius = innRadius+1.7*mm ;
0470   const G4double hight = 3*mm;
0471   const G4double startAngle = 0. * deg;
0472   const G4double spanningAngle = 360. * deg;
0473    G4double XPosition = fInitial_pos+hight;
0474 
0475    G4VSolid * solid =
0476       new G4Tubs("first", innRadius, out_Radius, hight,
0477                  startAngle, spanningAngle);
0478 
0479 
0480 
0481 G4LogicalVolume *log = new G4LogicalVolume(
0482       solid, PVDF, "chamberfirst_log", 0, 0, 0);
0483 
0484   new G4PVPlacement(
0485       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys",
0486       log, fMotherPhys, false, 0);
0487 
0488   log->SetVisAttributes(red);
0489   
0490   G4VSolid * solid_pvdf=
0491       new G4Tubs("s_pvdf", innRadius, out_Radius, 0.5*mm,
0492                  startAngle, spanningAngle);
0493     
0494       
0495       G4LogicalVolume *log_pvdf= new G4LogicalVolume(
0496       solid_pvdf, PVDF, "pvdf_log", 0, 0, 0);
0497                  
0498   G4VSolid * solid_film =
0499       new G4Tubs("s_film", innRadius, out_Radius, 0.05/2*mm,
0500                  startAngle, spanningAngle);
0501    G4LogicalVolume *log_film = new G4LogicalVolume(
0502       solid_film, FILM, "ka_log", 0, 0, 0);
0503       
0504   G4VSolid * solid_al =
0505       new G4Tubs("s_al", innRadius, out_Radius, 0.005/2*mm,
0506                  startAngle, spanningAngle);          
0507   
0508   G4LogicalVolume *log_al = new G4LogicalVolume(
0509       solid_al, aluminumNist, "al_log", 0, 0, 0);
0510   XPosition=XPosition+hight;
0511 
0512   G4int j=0;
0513   for(G4int i = 0;i<3;i++){
0514   XPosition=XPosition+(i+1)*0.05/2*mm;
0515   new G4PVPlacement(
0516       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "ka_phys",
0517       log_film, fMotherPhys, false, j);
0518   XPosition=XPosition+(i+1)*0.005/2*mm;
0519   new G4PVPlacement(
0520       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "al_phys",
0521       log_al, fMotherPhys, false, j);
0522       
0523   XPosition=XPosition+(i+1)*1/2*mm;
0524   new G4PVPlacement(
0525       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "pvdf_phys",
0526       log_pvdf, fMotherPhys, false, j);
0527   
0528   
0529   
0530   }
0531   fChamberpos = XPosition +1/2*mm;
0532   log_film->SetVisAttributes(green);
0533     log_al->SetVisAttributes(blue);
0534       log_pvdf->SetVisAttributes(yellow);
0535 
0536 
0537 }
0538 
0539 void FlashApplicator::Flash_connector(){
0540 
0541 G4double phi2 = 90. * deg;
0542 
0543   G4RotationMatrix rm2;
0544   rm2.rotateY(phi2);
0545 
0546   
0547   const G4double innRadius = 10*cm;
0548   const G4double out_Radius = innRadius+2.5*cm ;
0549   const G4double hight = 15*mm;
0550   const G4double startAngle = 0. * deg;
0551   const G4double spanningAngle = 360. * deg;
0552   const G4double XPosition = fChamberpos+hight;
0553   
0554   G4VSolid * solid =
0555       new G4Tubs("cover", innRadius, out_Radius, hight,
0556                  startAngle, spanningAngle);
0557 
0558   G4LogicalVolume *log = new G4LogicalVolume(
0559       solid, aluminumNist, "coverbig_log", 0, 0, 0);
0560 
0561  new G4PVPlacement(
0562       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys",
0563       log, fMotherPhys, false, 0);
0564 
0565   log->SetVisAttributes(magenta);
0566   
0567   
0568   G4VSolid * solid_ =
0569       new G4Tubs("littlecover", 22*mm, innRadius, 0.2*mm,
0570                  startAngle, spanningAngle);
0571   G4LogicalVolume *log_ = new G4LogicalVolume(
0572       solid_, aluminumNist, "covers_log", 0, 0, 0);
0573       
0574     new G4PVPlacement(
0575       G4Transform3D(rm2, G4ThreeVector((fChamberpos+0.2*mm), 0., 0.)), "coverl_phys",
0576       log_, fMotherPhys, false, 0);  
0577 log_->SetVisAttributes(green);
0578 
0579 fInitial_pos=XPosition+hight;
0580 }
0581 
0582 void FlashApplicator::Bigconnector() {
0583 
0584 G4double phi2 = 90. * deg;
0585 
0586   G4RotationMatrix rm2;
0587   rm2.rotateY(phi2);
0588 
0589   
0590   const G4double innRadius = 10*cm;
0591   const G4double out_Radius = innRadius+30*mm ;
0592   const G4double hight = 7.05*cm + 0.0075/2*mm;
0593   const G4double startAngle = 0. * deg;
0594   const G4double spanningAngle = 360. * deg;
0595   const G4double XPosition = fInitial_pos+hight;
0596 
0597    G4VSolid * solid =
0598       new G4Tubs("coverbig", innRadius, out_Radius, hight,
0599                  startAngle, spanningAngle);
0600 
0601   G4LogicalVolume *log = new G4LogicalVolume(
0602       solid, aluminumNist, "coverbig_log", 0, 0, 0);
0603 
0604  new G4PVPlacement(
0605       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys",
0606       log, fMotherPhys, false, 0);
0607 
0608   log->SetVisAttributes(red);
0609 fInitial_pos=XPosition+hight;
0610 }
0611 void FlashApplicator::Bigconnector2() {
0612 
0613 G4double phi2 = 90. * deg;
0614 
0615   G4RotationMatrix rm2;
0616   rm2.rotateY(phi2);
0617 
0618   
0619   const G4double innRadius = 6*cm;
0620   const G4double out_Radius = innRadius+70*mm ;
0621   const G4double hight = 4.4*cm-12/4*mm;
0622   const G4double startAngle = 0. * deg;
0623   const G4double spanningAngle = 360. * deg;
0624   const G4double XPosition = fInitial_pos+hight;
0625 
0626    G4VSolid * solid =
0627       new G4Tubs("coverbig", innRadius, out_Radius, hight,
0628                  startAngle, spanningAngle);
0629 
0630 
0631 
0632       
0633       G4LogicalVolume *log = new G4LogicalVolume(
0634       solid, PVDF, "coverbig_log", 0, 0, 0);
0635 
0636  new G4PVPlacement(
0637       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys",
0638       log, fMotherPhys, false, 0);
0639 
0640   log->SetVisAttributes(blue);
0641 fInitial_pos=XPosition+hight;
0642 }
0643 
0644 void FlashApplicator::Bigconnector3() {//this is a piece of the applicator that connects the tube to the optics
0645 
0646 G4double phi2 = 90. * deg;
0647 
0648   G4RotationMatrix rm2;
0649   rm2.rotateY(phi2);
0650 
0651   
0652   const G4double innRadius = 6*cm;
0653   const G4double out_Radius = innRadius+60*mm ;
0654   const G4double hight = 3.4*cm-11/4*mm;
0655   const G4double startAngle = 0. * deg;
0656   const G4double spanningAngle = 360. * deg;
0657   const G4double XPosition = fInitial_pos+hight;
0658 
0659 
0660                  
0661   G4VSolid *t1 = new G4Tubs("t1_", 0*mm, out_Radius, hight,
0662                  startAngle, spanningAngle);
0663                              
0664     G4VSolid *t2 = new G4Cons("t2_", 0*mm,60*mm, 0*mm,fInnerRadiusFirstApplicatorFlash,hight +0.1*mm, startAngle,spanningAngle);
0665     
0666    
0667     G4ThreeVector zTrans(0, 0, 0);
0668 
0669     G4SubtractionSolid *hollowcover =
0670         new G4SubtractionSolid("hollowcover_log_", t1, t2, 0, zTrans);
0671 
0672   G4LogicalVolume *log = new G4LogicalVolume(
0673       hollowcover, PMMA, "coverbig_log_", 0, 0, 0);
0674 
0675  new G4PVPlacement(
0676       G4Transform3D(rm2, G4ThreeVector((XPosition), 0., 0.)), "coverbig_phys_",
0677       log, fMotherPhys, false, 0);
0678 
0679   log->SetVisAttributes(yellow);
0680 fInitial_pos=XPosition+hight;
0681 }
0682 
0683 void FlashApplicator::FlashBeamLineApplicator() {
0684 
0685   
0686 
0687 
0688   // hightFinalApplicatorFlash = 300 * mm;//modify this for length of applicator
0689    if (fHightFinalApplicatorFlash != 0*mm){//set to zero if you do not want the applicator
0690      Bigconnector3(); //comment this line to remove the applicator piece
0691   const G4double startAngleFirstApplicatorFlash = 0. * deg;
0692   const G4double spanningAngleFirstApplicatorFlash = 360. * deg;
0693    fFinalApplicatorXPositionFlash = fInitial_pos+fHightFinalApplicatorFlash;
0694 
0695   G4double phi6 = 90. * deg;
0696 
0697   G4RotationMatrix rm6;
0698   rm6.rotateY(phi6);
0699 
0700   fSolidFirstApplicatorFlash = new G4Tubs(
0701       "FirstApplicatorFlash", fInnerRadiusFirstApplicatorFlash,
0702       fOuterRadiusFirstApplicatorFlash, fHightFinalApplicatorFlash,
0703       startAngleFirstApplicatorFlash, spanningAngleFirstApplicatorFlash);
0704 
0705   G4LogicalVolume *logFirstApplicatorFlash = new G4LogicalVolume(
0706       fSolidFirstApplicatorFlash, fFirstApplicatorMaterialFlash,
0707       "FirstApplicatorFlash", 0, 0, 0);
0708 
0709   fPhysiFirstApplicatorFlash = new G4PVPlacement(
0710       G4Transform3D(rm6,
0711                     G4ThreeVector((fFinalApplicatorXPositionFlash), 0., 0.)),
0712       "FirstApplicatorFlash", logFirstApplicatorFlash, fMotherPhys, false, 0);
0713 
0714   logFirstApplicatorFlash->SetVisAttributes(magenta); } else{fFinalApplicatorXPositionFlash = fInitial_pos+3*cm;}
0715 } 
0716 
0717 
0718 void FlashApplicator::SetOuterRadius(G4double radius)
0719 {
0720  
0721   fOuterRadiusFirstApplicatorFlash=radius;
0722   fInnerRadiusFirstApplicatorFlash= fOuterRadiusFirstApplicatorFlash-5*mm;
0723   
0724 }
0725 
0726 void FlashApplicator::SetApplicatorLength(G4double length)
0727 {
0728   fHightFinalApplicatorFlash=length;
0729   
0730 }
0731 
0732 
0733 
0734 
0735