| [807] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | // Rich advanced example for Geant4
|
|---|
| 27 | // RichTbSiDet.cc for Rich of LHCb
|
|---|
| 28 | // History:
|
|---|
| 29 | // Created: Sajan Easo (Sajan.Easo@cern.ch)
|
|---|
| 30 | // Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
|
|---|
| 31 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 32 | #include <iostream>
|
|---|
| 33 | #include "globals.hh"
|
|---|
| 34 | #include "G4Box.hh"
|
|---|
| 35 | #include "G4Trd.hh"
|
|---|
| 36 | #include "G4RotationMatrix.hh"
|
|---|
| 37 | #include "G4ThreeVector.hh"
|
|---|
| 38 | #include "G4Transform3D.hh"
|
|---|
| 39 | #include "G4LogicalVolume.hh"
|
|---|
| 40 | #include "G4VPhysicalVolume.hh"
|
|---|
| 41 | #include "G4PVPlacement.hh"
|
|---|
| 42 | #include "G4UnionSolid.hh"
|
|---|
| 43 | #include "RichTbSiDet.hh"
|
|---|
| 44 | #include "G4SDManager.hh"
|
|---|
| 45 | #include "RichTbSD.hh"
|
|---|
| 46 | #include "G4LogicalBorderSurface.hh"
|
|---|
| 47 |
|
|---|
| 48 | RichTbSiDet::RichTbSiDet() {;}
|
|---|
| 49 | RichTbSiDet::~RichTbSiDet() {;}
|
|---|
| 50 | RichTbSiDet::RichTbSiDet(RichTbMaterial* RMaterial,
|
|---|
| 51 | G4VPhysicalVolume* MotherOfSiDet,
|
|---|
| 52 | G4bool ConstructTrackingGeomSwitch,
|
|---|
| 53 | G4int IHpdNum, G4int SectNum){
|
|---|
| 54 | //
|
|---|
| 55 | //
|
|---|
| 56 | ConstructTrackGeomSwitch=ConstructTrackingGeomSwitch;
|
|---|
| 57 | IHpdNumber=IHpdNum;
|
|---|
| 58 | CurSiSectNum=SectNum;
|
|---|
| 59 | //This is done for each sector.
|
|---|
| 60 |
|
|---|
| 61 | G4double SiSectRotZ;
|
|---|
| 62 | G4double SiSectPosX,SiSectPosY;
|
|---|
| 63 | G4double SiSectCoatingRotZ;
|
|---|
| 64 | G4double SiSectCoatingPosX,SiSectCoatingPosY;
|
|---|
| 65 | G4int isec=SectNum;
|
|---|
| 66 | G4Trd* HpdSiSect=
|
|---|
| 67 | new G4Trd("HpdSiSect",SiSectTrapHalfX1, SiSectTrapHalfX2,
|
|---|
| 68 | SiSectTrapHalfY1,SiSectTrapHalfY2,SiSectTrapHalfZ);
|
|---|
| 69 |
|
|---|
| 70 | G4RotationMatrix SiSectRotationX,SiSectRotationZ;
|
|---|
| 71 |
|
|---|
| 72 | SiSectRotationX.rotateX(SiSectRotX);
|
|---|
| 73 | SiSectRotZ = SiSectAngStart-isec*SiSectAngSize;
|
|---|
| 74 | SiSectRotationZ.rotateZ(SiSectRotZ);
|
|---|
| 75 | SiSectPosX=SiSectTrapHalfZ*std::cos(SiSectRotZ-pi/2.0);
|
|---|
| 76 | //
|
|---|
| 77 | if(isec < NumberOfSiDetSectors/2 ) {
|
|---|
| 78 | SiSectPosY=SiSectTrapHalfZ*std::sin(SiSectRotZ-pi/2.0)-SiSectHalfMoonGap/2.0;
|
|---|
| 79 | }else{
|
|---|
| 80 | SiSectPosY=SiSectTrapHalfZ*std::sin(SiSectRotZ-pi/2.0)+SiSectHalfMoonGap/2.0;
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 | G4ThreeVector SiSectTrapPos(SiSectPosX,SiSectPosY,SiSectPosZ);
|
|---|
| 84 |
|
|---|
| 85 | G4Transform3D SiSectTransform(SiSectRotationZ*SiSectRotationX,
|
|---|
| 86 | SiSectTrapPos);
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | G4LogicalVolume* HpdSiSectLog =
|
|---|
| 90 | new G4LogicalVolume(HpdSiSect,RMaterial->getHpdSiDetMaterial(),
|
|---|
| 91 | "HpdSiSect",0,0,0);
|
|---|
| 92 |
|
|---|
| 93 | G4VPhysicalVolume* HpdSiSectPhys=
|
|---|
| 94 | new G4PVPlacement(SiSectTransform,"HpdSiSect",
|
|---|
| 95 | HpdSiSectLog,MotherOfSiDet,false,SectNum);
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | if(ConstructTrackingGeomSwitch) {
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | G4Trd* HpdSectCoat=
|
|---|
| 102 | new G4Trd("HpdSectCoat",SiSectCoatingTrapHalfX1,
|
|---|
| 103 | SiSectCoatingTrapHalfX2,
|
|---|
| 104 | SiSectCoatingTrapHalfY1,SiSectCoatingTrapHalfY2,
|
|---|
| 105 | SiSectCoatingTrapHalfZ);
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | G4RotationMatrix SiSectCoatingRotationX,SiSectCoatingRotationZ;
|
|---|
| 109 | SiSectCoatingRotationX.rotateX(SiSectCoatingRotX);
|
|---|
| 110 | SiSectCoatingRotZ = SiSectRotZ;
|
|---|
| 111 | SiSectCoatingRotationZ.rotateZ(SiSectCoatingRotZ);
|
|---|
| 112 | SiSectCoatingPosX= SiSectPosX;
|
|---|
| 113 | SiSectCoatingPosY=SiSectPosY;
|
|---|
| 114 | G4ThreeVector SiSectCoatingTrapPos(SiSectCoatingPosX,SiSectCoatingPosY,
|
|---|
| 115 | SiSectCoatingPosZ);
|
|---|
| 116 |
|
|---|
| 117 | G4Transform3D SiSectCoatingTransform(SiSectCoatingRotationZ*SiSectCoatingRotationX, SiSectCoatingTrapPos);
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 | G4LogicalVolume* HpdSectCoatLog =
|
|---|
| 122 | new G4LogicalVolume(HpdSectCoat,RMaterial->getHpdSiCoatingMaterial(),
|
|---|
| 123 | "HpdSectCoat",0,0,0);
|
|---|
| 124 |
|
|---|
| 125 | G4VPhysicalVolume* HpdSectCoatPhys=
|
|---|
| 126 | new G4PVPlacement(SiSectCoatingTransform,"HpdSectCoat",
|
|---|
| 127 | HpdSectCoatLog,MotherOfSiDet,false,SectNum);
|
|---|
| 128 |
|
|---|
| 129 | // G4LogicalBorderSurface* HpdSectCoatSurface =
|
|---|
| 130 | new G4LogicalBorderSurface("HpdSectCoatSurface",MotherOfSiDet ,
|
|---|
| 131 | HpdSectCoatPhys ,
|
|---|
| 132 | RMaterial-> getHpdSiCoatSurface());
|
|---|
| 133 |
|
|---|
| 134 | RichTbHpdSectCoatLVol=HpdSectCoatLog;
|
|---|
| 135 | RichTbHpdSectCoatPVol=HpdSectCoatPhys;
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | //Construct the Silicon Pixels
|
|---|
| 142 | NumHpdSiPix=NumberOfPadHpdSiPixels;
|
|---|
| 143 | if(!ConstructTrackingGeomSwitch) {
|
|---|
| 144 | for (G4int ipix=0; ipix<NumberOfPadHpdSiPixels; ipix++){
|
|---|
| 145 |
|
|---|
| 146 | hpdSiPixel[ipix] = new RichTbSiPixel(RMaterial,HpdSiSectPhys,
|
|---|
| 147 | IHpdNum,isec,ipix);
|
|---|
| 148 |
|
|---|
| 149 | }
|
|---|
| 150 | }
|
|---|
| 151 | RichTbHpdSiSectLVol=HpdSiSectLog;
|
|---|
| 152 | RichTbHpdSiSectPVol=HpdSiSectPhys;
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 | }
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|