16#include "G4VPhysicalVolume.hh"
17#include "G4LogicalVolume.hh"
18#include "G4ThreeVector.hh"
26 const G4int thetaAllCrystals,
28 const G4int verboseLevel
33 fBesEmcGeometry = besEMCGeometry;
34 fVerboseLevel = verboseLevel;
36 fAllCrystals = thetaAllCrystals;
39 if (startID>endID||endID>thetaAllCrystals||startID<1)
41 G4Exception(
"ExtBesCrystalParameterisation construction: ID of crystal>No avaible!");
54(
const G4int copyNo, G4VPhysicalVolume* physVol)
const
62 G4cout<<
"*ExtBesCrystalParameterisation::ComputeTransformation()*"<<G4endl;
63 G4cout <<
"copyNo(transfered)=" << copyNo << G4endl
64 <<
"copyNo(gotten) =" << physVol->GetCopyNo() << G4endl
65 <<
"fStartID =" << fStartID << G4endl
66 <<
"fCrystalID =" << fCrystalID << G4endl;
67 G4cout <<
"point of fBesEmcGeometry=" << fBesEmcGeometry << G4endl;
70 G4double xPosition= fBesEmcGeometry->
GetXPosition(fCrystalID);
71 G4double yPosition= fBesEmcGeometry->
GetYPosition(fCrystalID);
72 G4double zPosition= fBesEmcGeometry->
GetZPosition(fCrystalID);
75 if(fFlagLeft) zPosition=-zPosition;
76 G4ThreeVector
origin(xPosition,yPosition,zPosition);
77 physVol->SetTranslation(
origin);
97 G4cout <<
"The crystals are at the position:" << G4endl
98 <<
origin/cm <<
"(cm)" << G4endl;
111(G4Trap& trackerChamber,
const G4int copyNo,
112 const G4VPhysicalVolume* physVol)
const
118 G4double zHalfLength = fBesEmcGeometry->
GetZHalfLength(fCrystalID);
119 G4double thetaAxis = fBesEmcGeometry->
GetThetaAxis(fCrystalID);
120 G4double phiAxis = fBesEmcGeometry->
GetPhiAxis(fCrystalID);
124 G4double tanAlpha1 = fBesEmcGeometry->
GetTanAlpha1(fCrystalID);
128 G4double tanAlpha2 = fBesEmcGeometry->
GetTanAlpha2(fCrystalID);
133 tanAlpha1=-tanAlpha1;
134 tanAlpha2=-tanAlpha2;
137 xHalfLength1=xHalfLength2;
140 xHalfLength3=xHalfLength4;
144 G4cout <<
"The size of No." << copyNo <<
" crystal(placed) are:" << G4endl
145 <<
"zHalfLength =" << zHalfLength/cm <<
"(cm), " << G4endl
146 <<
"thetaAxis =" << thetaAxis/deg <<
"(degree), " << G4endl
147 <<
"phiAxis =" << phiAxis/deg <<
"(degree), " << G4endl
148 <<
"yHalfLength1=" << yHalfLength1/cm <<
"(cm), " << G4endl
149 <<
"xHalfLength1=" << xHalfLength1/cm <<
"(cm), " << G4endl
150 <<
"xHalfLength2=" << xHalfLength2/cm <<
"(cm), " << G4endl
151 <<
"tanAlpha1 =" << tanAlpha1 <<
"(), " << G4endl
152 <<
"yHalfLength2=" << yHalfLength2/cm <<
"(cm), " << G4endl
153 <<
"xHalfLength3=" << xHalfLength3/cm <<
"(cm), " << G4endl
154 <<
"xHalfLength4=" << xHalfLength4/cm <<
"(cm)." << G4endl
155 <<
"tanAlpha2 =" << tanAlpha2 <<
"(), " << G4endl
156 <<
"(x4-x3)*y1/(x2-x1)/y2="
157 << (xHalfLength4-xHalfLength3)*yHalfLength1/(xHalfLength2-xHalfLength1)/yHalfLength2 << G4endl
158 <<
"tanAlpha2/tanAlpha1=" << tanAlpha2/tanAlpha1 <<G4endl;
161 trackerChamber.SetAllParameters(
178 G4VPhysicalVolume *pPhysicalVol)
181 return pPhysicalVol->GetLogicalVolume()->GetSolid();
185 G4VPhysicalVolume *pPhysicalVol)
194 if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
201 const G4VPhysicalVolume* pPhyVol)
const
205 G4int* pCrystalID=
const_cast<G4int*
>(&fCrystalID);
206 G4bool* pFlagLeft=
const_cast<G4bool*
>(&fFlagLeft);
207 G4int* pVerboseLevel=
const_cast<G4int*
>(&fVerboseLevel);
214 for(G4int i=fStartID;i<=fAllCrystals;i++)
224 G4Exception(
"The point of PhysicCrystal error!!!!!!!!!!!");
235 if(fCrystalID>fAllCrystals/2)
238 *pCrystalID=fCrystalID-fAllCrystals/2;
243 *pCrystalID=fAllCrystals/2-fCrystalID+1;
245 *pCrystalID=*pCrystalID-1;
ExtBesCrystalParameterisation(const G4int, const G4int, const G4int, ExtBesEmcGeometry *, const G4int)
G4Material * ComputeMaterial(const G4int, G4VPhysicalVolume *)
virtual ~ExtBesCrystalParameterisation()
G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
void ComputeDimensions(G4Trap &, const G4int, const G4VPhysicalVolume *) const
void ComputeIDAndSide(const G4VPhysicalVolume *) const
G4Material * GetCasingMaterial()
static ExtBesEmcConstruction * GetBesEmcConstruction()
G4Material * GetCrystalMaterial()
G4double GetXHalfLength1(G4int NbCrystal)
G4double GetThetaAxis(G4int NbCrystal)
G4double GetTanAlpha2(G4int NbCrystal)
G4double GetPhiAxis(G4int NbCrystal)
G4double GetTanAlpha1(G4int NbCrystal)
G4double GetYHalfLength2(G4int NbCrystal)
G4double GetYPosition(G4int NbCrystal)
G4double GetZPosition(G4int NbCrystal)
G4double GetXHalfLength3(G4int NbCrystal)
G4VPhysicalVolume * GetPhysiBSCCrystal(G4int NbCrystal)
G4double GetZHalfLength(G4int NbCrystal)
G4double GetXHalfLength2(G4int NbCrystal)
G4double GetXHalfLength4(G4int NbCrystal)
G4double GetXPosition(G4int NbCrystal)
G4double GetYHalfLength1(G4int NbCrystal)