10#include "BesCrystalParameterisation.hh"
12#include "BesEmcConstruction.hh"
13#include "BesEmcGeometry.hh"
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(
"BesCrystalParameterisation construction: ID of crystal>No avaible!");
54(
const G4int copyNo, G4VPhysicalVolume* physVol)
const
62 G4cout<<
"*BesCrystalParameterisation::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)
180 if(0) G4cout<<copyNo<<G4endl;
182 return pPhysicalVol->GetLogicalVolume()->GetSolid();
186 G4VPhysicalVolume *pPhysicalVol,
const G4VTouchable *parentTouch)
188 if(0) G4cout<<copyNo<<parentTouch<<G4endl;
196 if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
203 const G4VPhysicalVolume* pPhyVol)
const
207 G4int* pCrystalID=
const_cast<G4int*
>(&fCrystalID);
208 G4bool* pFlagLeft=
const_cast<G4bool*
>(&fFlagLeft);
209 G4int* pVerboseLevel=
const_cast<G4int*
>(&fVerboseLevel);
216 for(G4int i=fStartID;i<=fAllCrystals;i++)
226 G4Exception(
"The point of PhysicCrystal error!!!!!!!!!!!");
237 if(fCrystalID>fAllCrystals/2)
240 *pCrystalID=fCrystalID-fAllCrystals/2;
245 *pCrystalID=fAllCrystals/2-fCrystalID+1;
247 *pCrystalID=*pCrystalID-1;
G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
BesCrystalParameterisation(const G4int, const G4int, const G4int, BesEmcGeometry *, const G4int)
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
void ComputeIDAndSide(const G4VPhysicalVolume *) const
virtual ~BesCrystalParameterisation()
G4Material * ComputeMaterial(const G4int, G4VPhysicalVolume *, const G4VTouchable *parentTouch=0)
static BesEmcConstruction * GetBesEmcConstruction()
G4Material * GetCasingMaterial()
G4Material * GetCrystalMaterial()
G4double GetYPosition(G4int NbCrystal)
G4double GetZHalfLength(G4int NbCrystal)
G4double GetXHalfLength2(G4int NbCrystal)
G4double GetTanAlpha2(G4int NbCrystal)
G4double GetTanAlpha1(G4int NbCrystal)
G4double GetYHalfLength1(G4int NbCrystal)
G4double GetThetaAxis(G4int NbCrystal)
G4double GetXHalfLength4(G4int NbCrystal)
G4double GetYHalfLength2(G4int NbCrystal)
G4VPhysicalVolume * GetPhysiBSCCrystal(G4int NbCrystal)
G4double GetXPosition(G4int NbCrystal)
G4double GetZPosition(G4int NbCrystal)
G4double GetXHalfLength1(G4int NbCrystal)
G4double GetPhiAxis(G4int NbCrystal)
G4double GetXHalfLength3(G4int NbCrystal)