MollerTarget.cc

Go to the documentation of this file.
00001 /**
00002 
00003    \file MollerTarget.cc
00004    \author Peiqing Wang
00005    \date Tue Mar 13 01:52:47 EDT 2012
00006 */
00007 
00008 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00009 
00010 #include "MollerTarget.hh"
00011 
00012 // user classes
00013 class MollerMaterial;
00014 class MollerTargetMessenger;
00015 
00016 // geant4 includes
00017 #include "G4UserLimits.hh"
00018 
00019 // user includes
00020 #include "MollerTargetMessenger.hh"
00021 
00022 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00023 
00024 MollerTarget::MollerTarget()
00025 {
00026     G4cout << G4endl << "###### Calling MollerTarget::MollerTarget() " << G4endl << G4endl;
00027 
00028     //myUserInfo = myUI;
00029 
00030     TargetContainer_Logical      = NULL;
00031     TargetContainer_Physical     = NULL;
00032     TargetContainer_Material     = NULL;
00033 
00034     TargetCell_Logical      = NULL;
00035     TargetCell_Physical     = NULL;
00036     TargetCell_Material     = NULL;
00037 
00038     TargetEntranceWindow_Logical      = NULL;
00039     TargetEntranceWindow_Physical     = NULL;
00040     TargetEntranceWindow_Material     = NULL;
00041 
00042     TargetExitWindow_Logical      = NULL;
00043     TargetExitWindow_Physical     = NULL;
00044     TargetExitWindow_Material     = NULL;
00045 
00046     TargetExitWindowNipple_Logical  = NULL;
00047     TargetExitWindowNipple_Physical = NULL;
00048     TargetExitWindowNipple_Material = NULL;
00049 
00050     TargetMaterial_Logical  = NULL;
00051     TargetMaterial_Physical = NULL;
00052     Target_Material         = NULL;
00053 
00054 
00055     // definition of a mil = inch/1000
00056     static const G4double mil = 0.001*2.54*cm;
00057     static const G4double inch = 2.54*cm;
00058 
00059      pMaterial = new MollerMaterial();
00060      pMaterial->DefineMaterials();
00061 
00062     TargetContainer_Material      = pMaterial->GetMaterial("Vacuum");
00063     TargetCell_Material           = pMaterial->GetMaterial("Aluminum");
00064     TargetEntranceWindow_Material = pMaterial->GetMaterial("Aluminum");
00065     TargetExitWindow_Material     = pMaterial->GetMaterial("Aluminum");
00066     TargetExitWindowNipple_Material = pMaterial->GetMaterial("Aluminum");
00067     Target_Material                 = pMaterial->GetMaterial("H2Liquid");
00068 
00069     // define target geometry values
00070 
00071     targetCellEntranceWindowThickness =  5*mil;;
00072     targetCellExitWindowThickness =  20*mil;
00073     targetCellExitWindowNippleThickness =  5*mil;
00074     targetCellWallThickness   = 10.0*mil;
00075 
00076     targetCellExitWindowNippleRadius = 0.5*0.622*inch;
00077 
00078     targetCellInnerLength     = 34.346*cm;
00079     targetCellOuterLength     = targetCellInnerLength
00080                                 + targetCellEntranceWindowThickness
00081                                 + targetCellExitWindowThickness;  // Full length of Target
00082 
00083     targetCellFrontRadiusMin        =  0.0*cm;
00084     targetCellFrontOuterRadiusMax   =  0.5*2.730*inch;
00085     targetCellFrontInnerRadiusMax   = targetCellFrontOuterRadiusMax - targetCellWallThickness;
00086 
00087     targetCellBackRadiusMin        =  targetCellExitWindowNippleRadius;  //0.0*cm;
00088     targetCellBackOuterRadiusMax   =  0.5*7.5*inch;
00089     targetCellBackInnerRadiusMax   = targetCellBackOuterRadiusMax - targetCellWallThickness;
00090 
00091     targetCellStartingPhi =  0.0*deg;
00092     targetCellDeltaPhi    = 360*deg;
00093 
00094     targetZPos        = 0.0*cm;
00095     //targetZPos        = myUserInfo->TargetCenterPositionZ; //-650.0*cm;
00096 
00097     ScatteringChamberWindowRadius = 0.5*23.5*inch;
00098     ScatteringChamberWindowThickness = 35*mil;
00099 
00100     //myUserInfo->TargetLength = targetCellInnerLength;
00101     //myUserInfo->TargetEntranceWindowThickness = targetCellEntranceWindowThickness;
00102     //myUserInfo->TargetExitWindowThickness = targetCellExitWindowThickness;
00103     targetMessenger = new MollerTargetMessenger(this);
00104 
00105     fTargetLength  = 150.0*cm;  
00106 
00107 }
00108 
00109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00110 MollerTarget::~MollerTarget()
00111 {
00112     delete pMaterial;
00113     delete targetMessenger;
00114 }
00115 
00116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00117 
00118 void MollerTarget::ConstructComponent(G4VPhysicalVolume* MotherVolume)
00119 {
00120     G4cout << G4endl << "###### Calling MollerTarget::ConstructComponent() " << G4endl << G4endl;
00121    
00122       //------Target-----//
00123   G4double inner_rad = 0.0*cm;
00124   G4double start_angle = 0.0*deg;
00125   G4double end_angle = 360.0*deg;
00126 
00127   G4double outer_rad_targ = 4.0*cm;
00128   G4double half_len_targ = fTargetLength/2;
00129 
00130   G4cout<< "target half-length = "<<half_len_targ/cm<<G4endl;
00131 
00132   G4Tubs* target_solid = new G4Tubs("tubeTarget", inner_rad, outer_rad_targ,
00133            half_len_targ, start_angle, end_angle);
00134 
00135   G4LogicalVolume* target_logic = new G4LogicalVolume(target_solid, Target_Material, "logicTarget");
00136 
00137       G4VPhysicalVolume* target_phys   = new G4PVPlacement(0,
00138             G4ThreeVector(0, 0, targetZPos),
00139             "Target",
00140             target_logic,
00141             MotherVolume,
00142             false,
00143             0);
00144 
00145   G4VisAttributes* targetVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
00146   targetVisAtt->SetVisibility(true);
00147   target_logic->SetVisAttributes(targetVisAtt);
00148   
00149     // define target entrance window (front, upstream)
00150     G4Tubs* TargetEntranceWindow_Solid    = new G4Tubs("TargetEntranceWindow_Sol",
00151              inner_rad, outer_rad_targ,
00152             0.5*targetCellEntranceWindowThickness,
00153             start_angle, end_angle);
00154 
00155    TargetEntranceWindow_Logical  = new G4LogicalVolume(TargetEntranceWindow_Solid,
00156             TargetEntranceWindow_Material,
00157             "MollerTargetEntranceWindow_Log",
00158             0,0,0);
00159 
00160    TargetEntranceWindow_Physical   = new G4PVPlacement(0,
00161             G4ThreeVector(0, 0, targetZPos-(half_len_targ+0.5*targetCellEntranceWindowThickness)),// positionTargetEntranceWindow,
00162             "MollerTargetEntranceWindow",
00163             TargetEntranceWindow_Logical,
00164             MotherVolume,
00165             false,
00166             0);
00167 
00168     // define target exit window (back, downstream)
00169     G4Tubs* TargetExitWindow_Solid    = new G4Tubs("TargetExitWindow_Sol",
00170              inner_rad, outer_rad_targ,
00171             0.5*targetCellExitWindowThickness,
00172             start_angle, end_angle);
00173 
00174    TargetExitWindow_Logical  = new G4LogicalVolume(TargetExitWindow_Solid,
00175             TargetExitWindow_Material,
00176             "MollerTargetExitWindow_Log",
00177             0,0,0);
00178 
00179    TargetExitWindow_Physical   = new G4PVPlacement(0,
00180             G4ThreeVector(0, 0, targetZPos+(half_len_targ+0.5*targetCellExitWindowThickness)),// positionTargetEntranceWindow,
00181             "MollerTargetExiteWindow",
00182             TargetExitWindow_Logical,
00183             MotherVolume,
00184             false,
00185             0);
00186    
00187   G4Colour  blue      (   0/255.,   0/255., 255/255.);
00188   G4VisAttributes* targetWindowVisAtt= new G4VisAttributes(blue);
00189   targetWindowVisAtt->SetVisibility(true);
00190   TargetEntranceWindow_Logical->SetVisAttributes(targetWindowVisAtt);
00191   TargetExitWindow_Logical->SetVisAttributes(targetWindowVisAtt);
00192 
00193 
00194     G4cout << G4endl << "###### Leaving MollerTarget::ConstructComponent() " << G4endl << G4endl;
00195 
00196 } // end of  MollerTarget::ConstructComponent()
00197 
00198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00199 
00200 void MollerTarget::SetTargetMaterial(G4String materialName)
00201 {
00202     // search the material by its name
00203     G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
00204     if (pttoMaterial)
00205     {
00206         G4cout << "==== Changing Target Material: Looking up Material  " << G4endl;
00207         TargetMaterial_Logical->SetMaterial(pttoMaterial);
00208         G4cout << "==== Changing Target Material:  Now the Target is made of " << materialName << G4endl;
00209     }
00210     else {
00211         G4cerr << "==== ERROR: Changing Target Material failed" << G4endl;
00212     }
00213 
00214 }
00215 
00216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00217 
00218 void MollerTarget::SetTargetCellMaterial(G4String materialName)
00219 {
00220     // search the material by its name
00221     G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
00222     if (pttoMaterial)
00223     {
00224         G4cout << "==== Changing Target Cell Material: Looking up Material  " << G4endl;
00225         TargetCell_Logical->SetMaterial(pttoMaterial);
00226         G4cout << "==== Changing Target Cell Material:  Now the Target Cell is made of " << materialName << G4endl;
00227     }
00228     else {
00229         G4cerr << "==== ERROR: Changing Target Cell Material failed" << G4endl;
00230     }
00231 
00232 }
00233 
00234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00235 
00236 void MollerTarget::SetTargetEntranceWindowMaterial(G4String materialName)
00237 {
00238     // search the material by its name
00239     G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
00240     if (pttoMaterial)
00241     {
00242         G4cout << "==== Changing Target Entrance Window Material: Looking up Material  " << G4endl;
00243         TargetEntranceWindow_Logical->SetMaterial(pttoMaterial);
00244         G4cout << "==== Changing Target Entrance Window Material:  Now the Target Entrance Window is made of " << materialName << G4endl;
00245     }
00246     else {
00247         G4cerr << "==== ERROR: Changing Target Entrance Window Material failed" << G4endl;
00248     }
00249 
00250 }
00251 
00252 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00253 
00254 void MollerTarget::SetTargetExitWindowMaterial(G4String materialName)
00255 {
00256     // search the material by its name
00257     G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
00258     if (pttoMaterial)
00259     {
00260         G4cout << "==== Changing Target Exit Window Material: Looking up Material  " << G4endl;
00261         TargetExitWindow_Logical->SetMaterial(pttoMaterial);
00262         G4cout << "==== Changing Target Exit Window Material:  Now the Target Exit Window is made of " << materialName << G4endl;
00263     }
00264     else {
00265         G4cerr << "==== ERROR: Changing Target Exit Window Material failed" << G4endl;
00266     }
00267 
00268 }
00269 
00270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00271 
00272 void MollerTarget::SetTargetExitWindowNippleMaterial(G4String materialName)
00273 {
00274     // search the material by its name
00275     G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
00276     if (pttoMaterial)
00277     {
00278         G4cout << "==== Changing Target Exit Window Nipple Material: Looking up Material  " << G4endl;
00279         TargetExitWindowNipple_Logical->SetMaterial(pttoMaterial);
00280         G4cout << "==== Changing Target Exit Window Nipple Material:  Now the Target Exit Window Nipple is made of " << materialName << G4endl;
00281     }
00282     else {
00283         G4cerr << "==== ERROR: Changing Target Exit Window Nipple Material failed" << G4endl;
00284     }
00285 
00286 }
00287 
00288 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00289 
00290 void MollerTarget::DestroyComponent()
00291 {
00292 }
00293 
00294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00295 
00296 void MollerTarget::SetTargetCenterPositionInZ(G4double zPos)
00297 {
00298     G4cout << G4endl << "###### Calling MollerTarget::SetTargetCenterPositionInZ() " << G4endl << G4endl;
00299 
00300     targetZPos = zPos;
00301     //myUserInfo->TargetCenterPositionZ = zPos;
00302     //TargetCell_Physical->SetTranslation(G4ThreeVector(0.,0., zPos));
00303     TargetContainer_Physical->SetTranslation(G4ThreeVector(0.,0., zPos));
00304 }
00305 
00306 G4double MollerTarget::GetTargetCenterPositionInZ()
00307 {
00308     G4cout << G4endl << "###### Calling MollerTarget::GetTargetCenterPositionInZ() " << G4endl << G4endl;
00309     return targetZPos;
00310 }
00311 
00312 void MollerTarget::SetTargetLength(G4double length)
00313 {
00314     G4cout << G4endl << "###### Calling MollerTarget::SetTargetLength() " << G4endl << G4endl;
00315     fTargetLength = length;
00316 }
00317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00318 

Generated on 16 Jun 2013 for mollersim by  doxygen 1.6.1