26 #include "G4UserLimits.hh"
38 G4cout << G4endl <<
"###### Calling QweakSimTarget::QweakTarget() " << G4endl << G4endl;
127 G4double densityLH2 = 0.0713 /(cm*cm*cm);
128 G4double densityAL = 2.804 /(cm*cm*cm);
129 G4double densityUSC = 1.70 /(cm*cm*cm);
130 G4double densityDSC = 2.205 /(cm*cm*cm);
134 G4double massLH2 = 1.00794;
135 G4double massAL = 26.9815386;
136 G4double massC = 12.0107;
138 G4double massZn = 65.38;
139 G4double massMg = 24.3050;
140 G4double massCu = 63.546;
141 G4double massCr = 51.9961;
142 G4double massFe = 55.845;
143 G4double massSi = 28.0855;
144 G4double massMn = 54.938044;
145 G4double massTi = 47.867;
150 G4double weight_std = 1.0;
151 G4double weight_Al = 0.8870;
152 G4double weight_Zn = 0.0630;
153 G4double weight_Mg = 0.0270;
154 G4double weight_Cu = 0.0180;
155 G4double weight_Cr = 0.0021;
156 G4double weight_Fe = 0.0012;
157 G4double weight_Si = 0.0010;
158 G4double weight_Mn = 0.0004;
159 G4double weight_Ti = 0.0003;
202 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructComponent() " << G4endl << G4endl;
220 G4cout << G4endl <<
"###### QweakSimTarget: Setting Attributes " << G4endl << G4endl;
222 G4Colour blue (0.,0.,1.);
223 G4Colour red (1.,0.,0.);
225 G4VisAttributes* TargetContainer_VisAtt =
new G4VisAttributes(red);
226 TargetContainer_VisAtt -> SetVisibility(
false);
230 G4VisAttributes* TargetCell_VisAtt =
new G4VisAttributes(blue);
231 TargetCell_VisAtt -> SetVisibility(
true);
235 G4VisAttributes* TargetWindow_VisAtt =
new G4VisAttributes(blue);
236 TargetWindow_VisAtt -> SetVisibility(
true);
241 G4VisAttributes* ScatteringChamberWindow_VisAtt =
new G4VisAttributes(red);
242 ScatteringChamberWindow_VisAtt -> SetVisibility(
true);
246 G4VisAttributes* TargetMaterial_VisAtt =
new G4VisAttributes(red);
247 TargetMaterial_VisAtt -> SetVisibility(
true);
255 G4SDManager* SDman = G4SDManager::GetSDMpointer();
262 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructComponent() " << G4endl << G4endl;
284 G4cout <<
"positionTarget: " <<
positionTarget/cm <<
" cm" << G4endl;
286 G4cout <<
"targetCellExitWindowThickness: " << targetCellExitWindowThickness/cm <<
" cm" << G4endl;
295 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetContainer() " << G4endl << G4endl;
297 G4Tubs* TargetContainer_Solid =
new G4Tubs(
"TargetContainer_Sol",
306 "TargetContainer_Log",
317 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetContainer() " << G4endl << G4endl;
323 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetCell() " << G4endl << G4endl;
332 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetCell_Solid " << G4endl << G4endl;
338 G4Cons* TargetCell_Solid =
new G4Cons(
"QweakTargetCell_Sol",
348 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetCell_Logical " << G4endl << G4endl;
352 "QweakTargetCell_Log",
355 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetCell_Physical " << G4endl << G4endl;
364 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetCell() " << G4endl << G4endl;
370 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetEntranceWindow() " << G4endl << G4endl;
380 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetEntranceWindow_Solid " << G4endl << G4endl;
382 G4Tubs* TargetEntranceWindow_Solid =
new G4Tubs(
"TargetEntranceWindow_Sol",
390 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetEntranceWindow_Logical " << G4endl << G4endl;
394 "QweakTargetEntranceWindow_Log",
401 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetEntranceWindow_Physical " << G4endl << G4endl;
404 "QweakTargetEntranceWindow",
410 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetEntranceWindow() " << G4endl << G4endl;
416 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetExitWindow() " << G4endl << G4endl;
425 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindow_Solid " << G4endl << G4endl;
427 G4Tubs* TargetExitWindow_Solid =
new G4Tubs(
"TargetExitWindow_Sol",
435 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindow_Logical " << G4endl << G4endl;
439 "QweakTargetExitWindow_Log",
450 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindow_Physical " << G4endl << G4endl;
453 "QweakTargetExitWindow",
459 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetExitWindow() " << G4endl << G4endl;
465 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetExitWindowNipple() " << G4endl << G4endl;
474 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindowNipple_Solid " << G4endl << G4endl;
476 G4Tubs* TargetExitWindowNipple_Solid =
new G4Tubs(
"TargetExitWindowNipple_Sol",
485 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindowNipple_Logical " << G4endl << G4endl;
489 "QweakTargetExitWindowNipple_Log",
496 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetExitWindowNipple_Physical " << G4endl << G4endl;
499 "QweakTargetExitWindowNipple_Physical",
505 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetExitWindowNipple() " << G4endl << G4endl;
511 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructScatteringChamberWindow() " << G4endl << G4endl;
514 G4cout << G4endl <<
"###### QweakSimTarget: Define ScatteringChamberWindow_Solid " << G4endl << G4endl;
515 G4Tubs* ScatteringChamberWindow_Solid =
new G4Tubs(
"ScatteringChamberWindow_Sol",
523 G4cout << G4endl <<
"###### QweakSimTarget: Define ScatteringChamberWindow_Logical " << G4endl << G4endl;
527 "ScatteringChamberWindow_Log",
531 G4cout << G4endl <<
"###### QweakSimTarget: Define ScatteringChamberWindow_Physical " << G4endl << G4endl;
534 "ScatteringChamberWindow",
540 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructScatteringChamberWindow() " << G4endl << G4endl;
550 G4cout << G4endl <<
"###### Calling QweakSimTarget::ConstructTargetMaterial() " << G4endl << G4endl;
558 G4Cons* TargetMaterial_Solid =
new G4Cons(
"QweakTargetMaterial_Sol",
569 G4cout << G4endl <<
"###### QweakSimTarget: Define Target_Logical " << G4endl << G4endl;
573 "QweakTargetMaterial_Log",
581 G4cout << G4endl <<
"###### QweakSimTarget: Define TargetMaterial_Physical " << G4endl << G4endl;
584 "QweakTargetMaterial",
590 G4cout << G4endl <<
"###### Leaving QweakSimTarget::ConstructTargetMaterial() " << G4endl << G4endl;
600 double zlength = 0.0;
607 if (strcmp(targName,
"LH2")==0)
609 G4cout <<
"==== Target is LH2 by default!! " << G4endl;
611 else if (strcmp(targName,
"USAl1p")==0)
613 G4cout <<
"==== Changing Target to " << targName << G4endl;
621 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
623 else if (strcmp(targName,
"USAl2p")==0)
625 G4cout <<
"==== Changing Target to " << targName << G4endl;
633 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
635 else if (strcmp(targName,
"USAl4p")==0)
637 G4cout <<
"==== Changing Target to " << targName << G4endl;
645 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
647 else if (strcmp(targName,
"USC")==0)
649 G4cout <<
"==== Changing Target to " << targName << G4endl;
657 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
659 else if (strcmp(targName,
"DSAl2p")==0)
661 G4cout <<
"==== Changing Target to " << targName << G4endl;
670 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
672 else if (strcmp(targName,
"DSAl4p")==0)
674 G4cout <<
"==== Changing Target to " << targName << G4endl;
684 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
686 else if (strcmp(targName,
"DSAl4pVacuum")==0)
689 G4cout <<
"==== Changing Target to " << targName << G4endl;
698 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
700 else if (strcmp(targName,
"DSAl8p")==0)
702 G4cout <<
"==== Changing Target to " << targName << G4endl;
711 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
713 else if (strcmp(targName,
"DSC")==0)
715 G4cout <<
"==== Changing Target to " << targName << G4endl;
724 G4cout <<
"==== Changing Target : Now the Target is " << targName << G4endl;
727 G4cerr <<
"==== ERROR: Changing Target failed" << G4endl;
737 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
740 G4cout <<
"==== Changing Target Material: Looking up Material " << G4endl;
742 G4cout <<
"==== Changing Target Material: Now the Target is made of " << materialName << G4endl;
745 G4cerr <<
"==== ERROR: Changing Target Material failed" << G4endl;
755 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
758 G4cout <<
"==== Changing Target Cell Material: Looking up Material " << G4endl;
760 G4cout <<
"==== Changing Target Cell Material: Now the Target Cell is made of " << materialName << G4endl;
763 G4cerr <<
"==== ERROR: Changing Target Cell Material failed" << G4endl;
773 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
776 G4cout <<
"==== Changing Target Entrance Window Material: Looking up Material " << G4endl;
778 G4cout <<
"==== Changing Target Entrance Window Material: Now the Target Entrance Window is made of " << materialName << G4endl;
781 G4cerr <<
"==== ERROR: Changing Target Entrance Window Material failed" << G4endl;
791 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
794 G4cout <<
"==== Changing Target Exit Window Material: Looking up Material " << G4endl;
796 G4cout <<
"==== Changing Target Exit Window Material: Now the Target Exit Window is made of " << materialName << G4endl;
799 G4cerr <<
"==== ERROR: Changing Target Exit Window Material failed" << G4endl;
809 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
812 G4cout <<
"==== Changing Target Exit Window Nipple Material: Looking up Material " << G4endl;
814 G4cout <<
"==== Changing Target Exit Window Nipple Material: Now the Target Exit Window Nipple is made of " << materialName << G4endl;
817 G4cerr <<
"==== ERROR: Changing Target Exit Window Nipple Material failed" << G4endl;
832 G4cout << G4endl <<
"###### Calling QweakSimTarget::SetTargetCenterPositionInZ() " << G4endl << G4endl;
837 G4cout <<
"==== Changing Target CenterPositionZ: Now the Target Center Position in Z is " << zPos/cm <<
" cm" << G4endl;
842 G4cout << G4endl <<
"###### Calling QweakSimTarget::GetTargetCenterPositionInZ() " << G4endl << G4endl;
843 G4cout <<
"==== Getting Target CenterPositionZ: Now the Target Center Position in Z is " <<
targetZPos/cm <<
" cm" << G4endl;
850 G4cout << G4endl <<
"###### Calling QweakSimTarget::SetTargetLength() " << G4endl << G4endl;
854 G4cout <<
"==== Changing Target Length: Now the Target Length is " << len/cm <<
" cm" << G4endl;
867 G4cout << G4endl <<
"###### Leaving QweakSimTarget::SetTargetLength() " << G4endl << G4endl;
872 G4cout << G4endl <<
"###### Calling QweakSimTarget::GetTargetLength() " << G4endl << G4endl;
873 G4cout <<
"==== Getting Target Length: Now the Target Length is " <<
targetCellInnerLength/cm <<
" cm" << G4endl;
880 G4cout << G4endl <<
"###### Calling QweakSimTarget::SetTargetEntranceWindowLength() " << G4endl << G4endl;
885 G4cout <<
"==== Changing Target Entrance Window Length: Now the Target Entrance Window Length is " << len/mm <<
" mm" << G4endl;
890 G4cout << G4endl <<
"###### Leaving QweakSimTarget::SetTargetEntranceWindowLength() " << G4endl << G4endl;
895 G4cout << G4endl <<
"###### Calling QweakSimTarget::SetTargetExitWindowLength() " << G4endl << G4endl;
899 G4cout <<
"==== Changing Target Exit Window Length: Now the Target Exit Window Length is " << len/mm <<
" mm" << G4endl;
904 G4cout << G4endl <<
"###### Leaving QweakSimTarget::SetTargetExitWindowLength() " << G4endl << G4endl;
909 G4cout << G4endl <<
"###### Calling QweakSimTarget::SetTargetExitWindowNippleLength() " << G4endl << G4endl;
913 G4cout <<
"==== Changing Target Exit Window Nipple Length: Now the Target Exit Window Nipple Length is " << len/mm <<
" mm" << G4endl;
918 G4cout << G4endl <<
"###### Leaving QweakSimTarget::SetTargetExitWindowNippleLength() " << G4endl << G4endl;
926 G4double N_b = 6.241e12;
927 G4double N_A = 6.02214129e23;
929 Lum = N_b*length*pweight*density*N_A/mass;
G4Material * ScatteringChamberWindow_Material
G4double TargetLuminosityUSALDummy2
G4double TargetLuminosityDSALDummy4_Si
G4VPhysicalVolume * TargetEntranceWindow_Physical
G4double TargetCenterPositionZ
G4double targetCellOuterLength
G4double ScatteringChamberWindowRadius
G4double CalculateLuminosity(G4double mass, G4double density, G4double length, G4double pweight)
G4double TargetLuminosityUSALWindow
G4double TargetLuminosityDSALDummy4
static QweakSimMaterial * GetInstance()
G4double TargetLuminosityDSALDummy2
G4double TargetLuminosityDSALDummy4_Zn
G4double TargetThicknessUSALDummy4
G4double targetCellWallThickness
G4double TargetLuminosityDSALDummy4_Mn
G4VSensitiveDetector * TargetSD
void ConstructTargetExitWindow()
void ConstructTargetContainer()
G4LogicalVolume * TargetExitWindow_Logical
Scans the input file for /Target/xyz commands.
void ConstructComponent(G4VPhysicalVolume *)
void ConstructTargetExitWindowNipple()
static const G4bool pSurfChk
G4double targetCellFrontInnerRadiusMax
void ConstructTargetMaterial()
G4ThreeVector positionTarget
G4double TargetLuminosityUSALDummy4
G4VPhysicalVolume * TargetMaterial_Physical
QweakSimMaterial * pMaterial
G4Material * TargetMaterial_Material
G4Material * TargetExitWindow_Material
G4double TargetThicknessUSALDummy2
void CalculateTargetPositions()
G4double GetTargetLength()
G4double targetCellExitWindowNippleRadius
G4double targetCellStartingPhi
G4LogicalVolume * TargetMaterial_Logical
void SetTargetCenterPositionInZ(G4double)
G4double TargetThicknessDSALDummy2
G4VPhysicalVolume * TargetCell_Physical
G4VPhysicalVolume * TargetExitWindow_Physical
void ConstructTargetEntranceWindow()
G4double TargetLuminosityDSALDummy8
G4double TargetLuminosityUSCDummy
static const G4double inch
static const G4double mil
G4double TargetThicknessUSCDummy
G4double TargetLuminosityDSALDummy4_Ti
void SetTargetEntranceWindowLength(G4double)
G4double targetCellFrontRadiusMin
G4ThreeVector positionScatteringChamberWindow
G4double targetCellEntranceWindowThickness
G4Material * GetMaterial(G4String material)
void SetTargetEntranceWindowMaterial(G4String)
G4double targetCellInnerLength
G4Material * TargetExitWindowNipple_Material
void ConstructTargetCell()
void SetTargetExitWindowNippleLength(G4double)
G4ThreeVector positionTargetExitWindow
G4LogicalVolume * ScatteringChamberWindow_Logical
G4LogicalVolume * TargetContainer_Logical
G4double TargetExitWindowNippleThickness
G4double TargetLuminosityDSCDummy
G4VPhysicalVolume * ScatteringChamberWindow_Physical
void SetTargetMaterial(G4String)
void SetTargetCellMaterial(G4String)
G4double TargetThicknessDSALDummy4
void SetTargetExitWindowLength(G4double)
G4LogicalVolume * TargetExitWindowNipple_Logical
G4double TargetLuminosityLH2
G4double GetTargetCenterPositionInZ()
G4double targetCellBackInnerRadiusMax
G4VPhysicalVolume * TargetContainer_Physical
G4double TargetLuminosityDSALDummy4_Mg
void ConstructScatteringChamberWindow()
G4double TargetThicknessUSALDummy1
G4LogicalVolume * TargetEntranceWindow_Logical
G4double TargetLuminosityDSALDummy4_Cu
G4double targetCellDeltaPhi
QweakSimTarget(QweakSimUserInformation *myUI)
G4double TargetLuminosityDSALDummy4_Fe
G4double targetCellBackOuterRadiusMax
G4Material * TargetContainer_Material
G4ThreeVector positionTargetEntranceWindow
G4double TargetExitWindowThickness
G4double ScatteringChamberWindowThickness
void SetTargetExitWindowMaterial(G4String)
G4double targetCellBackRadiusMin
G4double TargetLuminosityDSALWindow
G4Material * TargetEntranceWindow_Material
G4double targetCellExitWindowThickness
G4double targetCellExitWindowNippleThickness
G4Material * TargetCell_Material
G4VPhysicalVolume * theMotherPV
QweakSimTargetMessenger * targetMessenger
void SetTargetLength(G4double)
void SetTargetExitWindowNippleMaterial(G4String)
G4double TargetEntranceWindowThickness
G4VPhysicalVolume * TargetExitWindowNipple_Physical
G4double TargetLuminosityDSALDummy4_Al
G4LogicalVolume * TargetCell_Logical
G4double TargetThicknessDSCDummy
G4double TargetLuminosityDSALDummy4_Cr
G4double targetCellFrontOuterRadiusMax
G4double TargetThicknessDSALDummy8
G4double TargetLuminosityUSALDummy1
QweakSimUserInformation * myUserInfo