24 #include "G4VisAttributes.hh"
45 G4cout << G4endl <<
"###### Calling QweakSimHDC::QweakHDC() " << G4endl << G4endl;
108 for(
int i = 0; i < 2; i++){
189 G4cout << G4endl <<
"###### Calling QweakSimHDC::ConstructComponent() " << G4endl << G4endl;
204 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_MasterContainer_Solid" << G4endl << G4endl;
206 G4Box* HDC_MasterContainer_Solid =
new G4Box(
"HDC_MasterContainer_Sol",
212 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_MasterContainer_Logical " << G4endl << G4endl;
215 HDC_MasterContainer_Material,
216 "HDC_MasterContainer_Log",
228 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_OuterFrame_Solid" << G4endl << G4endl;
230 G4Box* HDC_OuterFrame_Solid =
new G4Box(
"HDC_OuterFrame_Sol",
236 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_InnerFrame_Solid" << G4endl << G4endl;
238 G4Box* HDC_InnerFrame_Solid =
new G4Box(
"HDC_InnerFrame_Sol",
245 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Frame_Solid" << G4endl << G4endl;
248 HDC_OuterFrame_Solid,
249 HDC_InnerFrame_Solid);
252 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Frame_Logical" << G4endl << G4endl;
260 G4ThreeVector position_Frame = G4ThreeVector(0. , 0. , 0.);
262 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Frame_Physical" << G4endl << G4endl;
267 "HDC_Frame_Physical",
280 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_SubContainer_Solid" << G4endl << G4endl;
282 G4Box* HDC_SubContainer_Solid =
new G4Box(
"HDC_OuterFrame_Sol",
287 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_SubContainer_Logical" << G4endl << G4endl;
290 HDC_SubContainer_Material,
291 "HDC_SubContainer_Log",
296 G4ThreeVector position_SubContainer = G4ThreeVector(0. , 0. , 0.);
298 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_SubContainer_Physical" << G4endl << G4endl;
301 position_SubContainer,
303 "HDC_SubContainer_Physical",
317 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Foil_Solid" << G4endl << G4endl;
319 G4Box* HDC_Foil_Solid =
new G4Box(
"HDC_OuterFrame_Sol",
325 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Foil_Logical" << G4endl << G4endl;
335 G4double HDC_Foil_PositionIndexInZ[9] = { -14.0 , -12.0 , -8.0 , -4.0 , 0.0 , 4.0 , 8.0 , 12.0 , 14.0 };
338 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_Foil_Physical" << G4endl << G4endl;
340 for( G4int index = 0; index < 9; index++){
358 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_WirePlane_Solid" << G4endl << G4endl;
360 G4Box* HDC_WirePlane_Solid =
new G4Box(
"HDC_WirePlane_Sol",
366 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_WirePlane_Logical" << G4endl << G4endl;
369 HDC_WirePlane_Material,
376 G4double HDC_WirePlane_PositionIndexInZ[6] = { -10.0 , -6.0 , -2.0 , 2.0 , 6.0 , 10.0 };
379 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_WirePlane_Physical" << G4endl << G4endl;
381 for( G4int index = 0; index < 6; index++){
386 "HDC_WirePlane_Physical",
396 G4cout << G4endl <<
"###### QweakSimHDC: Setting Sensitive Detectors " << G4endl << G4endl;
402 G4SDManager* SDman = G4SDManager::GetSDMpointer();
420 G4cout << G4endl <<
"###### QweakSimHDC: Setting Attributes " << G4endl << G4endl;
422 G4Colour orange (241/255.,224/255.,0/255.);
423 G4Colour gray (210/255.,213/255.,210/255.);
425 G4Colour red (255/255., 0/255.,0/255.);
426 G4Colour green ( 0/255., 255/255.,0/255.);
449 G4cout << G4endl <<
"###### Leaving QweakSimHDC::ConstructComponent() " << G4endl << G4endl;
459 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
462 G4cout <<
"==== Changing HDC MasterContainer Material: Looking up Material " << G4endl;
464 G4cout <<
"==== Changing HDC MasterContainer Material: Now the HDC MasterContainer is made of " << materialName << G4endl;
467 G4cerr <<
"==== ERROR: Changing HDC MasterContainer Material failed" << G4endl;
476 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
479 G4cout <<
"==== Changing HDC SubContainer Material: Looking up Material " << G4endl;
481 G4cout <<
"==== Changing HDC SubContainer Material: Now the HDC SubContainer is made of " << materialName << G4endl;
484 G4cerr <<
"==== ERROR: Changing HDC SubContainer Material failed" << G4endl;
493 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
496 G4cout <<
"==== Changing HDC Frame Material: Looking up Material " << G4endl;
498 G4cout <<
"==== Changing HDC Frame Material: Now the HDC Plane is made of " << materialName << G4endl;
501 G4cerr <<
"==== ERROR: Changing HDC Frame Material failed" << G4endl;
510 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
513 G4cout <<
"==== Changing HDC Foil Material: Looking up Material " << G4endl;
515 G4cout <<
"==== Changing HDC Foil Material: Now the HDC Foil is made of " << materialName << G4endl;
518 G4cerr <<
"==== ERROR: Changing HDC Foil Material failed" << G4endl;
527 G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
530 G4cout <<
"==== Changing HDC WirePlane Material: Looking up Material " << G4endl;
532 G4cout <<
"==== Changing HDC WirePlane Material: Now the HDC WirePlane is made of " << materialName << G4endl;
535 G4cerr <<
"==== ERROR: Changing HDC WirePlane Material failed" << G4endl;
548 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInX() " << G4endl << G4endl;
556 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInX() " << G4endl << G4endl;
562 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInY() " << G4endl << G4endl;
570 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInY() " << G4endl << G4endl;
576 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInZ() " << G4endl << G4endl;
584 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInZ() " << G4endl << G4endl;
591 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetBackHDC_CenterPositionInX() " << G4endl << G4endl;
599 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInX() " << G4endl << G4endl;
605 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetBackHDC_CenterPositionInY() " << G4endl << G4endl;
613 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInY() " << G4endl << G4endl;
619 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetBackHDC_CenterPositionInZ() " << G4endl << G4endl;
626 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInZ() " << G4endl << G4endl;
632 G4cout << G4endl <<
"###### Calling QweakSimHDC::SetHDC_RotationAngleInPhi() " << G4endl << G4endl;
635 G4double kAngle_GlobalRotation = HDC_phiangle -90.0*degree;
638 kAngle_GlobalRotation += 180*degree;
640 G4RotationMatrix* Rotation_HDCPackageContainer =
new G4RotationMatrix();
641 Rotation_HDCPackageContainer->setPhi(kAngle_GlobalRotation);
644 G4cout << G4endl <<
"###### Leaving QweakSimHDC::SetHDC_RotationAngleInPhi() " << G4endl << G4endl;
650 G4Box* HDC_PackageContainer_Solid =
new G4Box(
"HDC_PackageContainer_Solid",
655 G4LogicalVolume* HDC_PackageContainer_Logical =
new G4LogicalVolume( HDC_PackageContainer_Solid,
657 "HDC_PackageContainer_Logical",
661 G4Colour aluminum ( 169/255. , 172/255. , 182/255.);
662 G4VisAttributes* HDC_PackageContainer_VisAtt =
new G4VisAttributes(aluminum);
663 HDC_PackageContainer_VisAtt->SetForceWireframe(
true);
664 HDC_PackageContainer_VisAtt->SetVisibility(
false);
665 HDC_PackageContainer_Logical->SetVisAttributes(HDC_PackageContainer_VisAtt);
670 G4ThreeVector Translation_HDC_PackageContainer;
673 G4RotationMatrix* Rotation_HDC_PackageContainer =
new G4RotationMatrix();
677 Translation_HDC_PackageContainer,
678 "HDC_PackageContainer_Physical",
679 HDC_PackageContainer_Logical,
701 G4cout << G4endl <<
"###### QweakSimHDC: Define HDC_MasterContainerFront_Physical" << G4endl << G4endl;
704 position_MasterContainerFront,
705 Form(
"HDC_MasterContainerFront_Physical%ld",i),
717 position_MasterContainerBack,
718 Form(
"HDC_MasterContainerBack_Physical%ld",i),
G4double HDCFrame_BorderWidthInY
QweakSimMaterial * pMaterial
G4double HDCFrame_OuterWidth
G4double HDC_CenterPositionInZ
G4double HDCFrame_BorderWidthInX
static QweakSimMaterial * GetInstance()
G4double AluFrame_Thickness
std::vector< G4VPhysicalVolume * > HDC_MasterContainerBack_Physical
Checks for a valid HDC WirePlane hit and stores the hit information (Up to now I only activated only ...
void SetBackHDC_CenterPositionInZ(G4double zPos, G4int pkg)
G4LogicalVolume * HDC_Foil_Logical
void PlaceHDC_MasterContainers()
void SetHDC_RotationAngleInPhi(G4double HDC_phiangle, G4int pkg)
G4double HDCFrame_Thickness
std::vector< G4double > HDC_CenterFront_YPos
G4double AluFrame_OuterLength
G4VPhysicalVolume * HDC_SubContainer_Physical
void SetHDC_SubContainerMaterial(G4String)
void SetFrontHDC_CenterPositionInZ(G4double zPos, G4int pkg)
G4double AluFrame_InnerLength
std::vector< QweakSimHDCMessenger * > HDC_Messenger
static const G4bool pSurfChk
G4VPhysicalVolume * theMotherPV
G4LogicalVolume * HDC_SubContainer_Logical
G4double AluFrame_InnerWidth
std::vector< G4VPhysicalVolume * > HDC_MasterContainerFront_Physical
G4double HDC_DriftCell_TotalThickness
void SetBackHDC_CenterPositionInY(G4double yPos, G4int pkg)
G4VPhysicalVolume * HDC_Foil_Physical
G4VPhysicalVolume * HDC_WirePlane_Physical
static const G4double mil
std::vector< G4double > HDC_CenterBack_ZPos
G4double AluFrame_OuterWidth
void SetHDC_MasterContainerMaterial(G4String)
G4VisAttributes * HDC_MasterContainer_VisAtt
G4LogicalVolume * HDC_Frame_Logical
void SetHDC_WirePlaneMaterial(G4String)
void SetHDC_FrameMaterial(G4String)
G4Material * GetMaterial(G4String material)
G4VisAttributes * HDC_SubContainer_VisAtt
std::vector< G4double > HDC_CenterBack_XPos
std::vector< G4double > HDC_CenterFront_XPos
std::vector< G4double > HDC_CenterFront_ZPos
void SetFrontHDC_CenterPositionInY(G4double yPos, G4int pkg)
G4VPhysicalVolume * HDC_Frame_Physical
G4double HDC_RotationAngleInPhi[2]
G4VSensitiveDetector * HdriftChamberSD
G4VisAttributes * HDC_WirePlane_VisAtt
G4VPhysicalVolume * HDC_PackageContainer_Physical
void ConstructComponent(G4VPhysicalVolume *)
G4LogicalVolume * HDC_WirePlane_Logical
G4double HDCFrame_InnerLength
std::vector< G4RotationMatrix * > Rotation_HDC
Scans the input file for /HDC/xyz commands.
void SetFrontHDC_CenterPositionInX(G4double xPos, G4int pkg)
G4double HDCFrame_InnerWidth
G4double HDCFrame_OuterLength
G4VisAttributes * HDC_Foil_VisAtt
G4VisAttributes * HDC_Frame_VisAtt
G4SubtractionSolid * HDC_Frame_Solid
void SetHDC_FoilMaterial(G4String)
std::vector< G4double > HDC_CenterBack_YPos
G4LogicalVolume * HDC_MasterContainer_Logical
void SetBackHDC_CenterPositionInX(G4double xPos, G4int pkg)