16#include "G4VPhysicalVolume.hh"
17#include "G4LogicalVolume.hh"
18#include "G4ThreeVector.hh"
20#include "G4SystemOfUnits.hh"
27 const G4int thetaAllCrystals,
29 const G4int verboseLevel
34 fBesEmcGeometry = besEMCGeometry;
35 fVerboseLevel = verboseLevel;
37 fAllCrystals = thetaAllCrystals;
40 if (startID>endID||endID>thetaAllCrystals||startID<1)
42 G4cout<<
"ExtBesCrystalParameterisation construction: ID of crystal>No avaible!"<<G4endl; exit(-1);
55(
const G4int copyNo, G4VPhysicalVolume* physVol)
const
63 G4cout<<
"*ExtBesCrystalParameterisation::ComputeTransformation()*"<<G4endl;
64 G4cout <<
"copyNo(transfered)=" << copyNo << G4endl
65 <<
"copyNo(gotten) =" << physVol->GetCopyNo() << G4endl
66 <<
"fStartID =" << fStartID << G4endl
67 <<
"fCrystalID =" << fCrystalID << G4endl;
68 G4cout <<
"point of fBesEmcGeometry=" << fBesEmcGeometry << G4endl;
71 G4double xPosition= fBesEmcGeometry->
GetXPosition(fCrystalID);
72 G4double yPosition= fBesEmcGeometry->
GetYPosition(fCrystalID);
73 G4double zPosition= fBesEmcGeometry->
GetZPosition(fCrystalID);
76 if(fFlagLeft) zPosition=-zPosition;
77 G4ThreeVector
origin(xPosition,yPosition,zPosition);
78 physVol->SetTranslation(
origin);
98 G4cout <<
"The crystals are at the position:" << G4endl
99 <<
origin/cm <<
"(cm)" << G4endl;
112(G4Trap& trackerChamber,
const G4int copyNo,
113 const G4VPhysicalVolume* physVol)
const
119 G4double zHalfLength = fBesEmcGeometry->
GetZHalfLength(fCrystalID);
120 G4double thetaAxis = fBesEmcGeometry->
GetThetaAxis(fCrystalID);
121 G4double phiAxis = fBesEmcGeometry->
GetPhiAxis(fCrystalID);
125 G4double tanAlpha1 = fBesEmcGeometry->
GetTanAlpha1(fCrystalID);
129 G4double tanAlpha2 = fBesEmcGeometry->
GetTanAlpha2(fCrystalID);
134 tanAlpha1=-tanAlpha1;
135 tanAlpha2=-tanAlpha2;
138 xHalfLength1=xHalfLength2;
141 xHalfLength3=xHalfLength4;
145 G4cout <<
"The size of No." << copyNo <<
" crystal(placed) are:" << G4endl
146 <<
"zHalfLength =" << zHalfLength/cm <<
"(cm), " << G4endl
147 <<
"thetaAxis =" << thetaAxis/deg <<
"(degree), " << G4endl
148 <<
"phiAxis =" << phiAxis/deg <<
"(degree), " << G4endl
149 <<
"yHalfLength1=" << yHalfLength1/cm <<
"(cm), " << G4endl
150 <<
"xHalfLength1=" << xHalfLength1/cm <<
"(cm), " << G4endl
151 <<
"xHalfLength2=" << xHalfLength2/cm <<
"(cm), " << G4endl
152 <<
"tanAlpha1 =" << tanAlpha1 <<
"(), " << G4endl
153 <<
"yHalfLength2=" << yHalfLength2/cm <<
"(cm), " << G4endl
154 <<
"xHalfLength3=" << xHalfLength3/cm <<
"(cm), " << G4endl
155 <<
"xHalfLength4=" << xHalfLength4/cm <<
"(cm)." << G4endl
156 <<
"tanAlpha2 =" << tanAlpha2 <<
"(), " << G4endl
157 <<
"(x4-x3)*y1/(x2-x1)/y2="
158 << (xHalfLength4-xHalfLength3)*yHalfLength1/(xHalfLength2-xHalfLength1)/yHalfLength2 << G4endl
159 <<
"tanAlpha2/tanAlpha1=" << tanAlpha2/tanAlpha1 <<G4endl;
162 trackerChamber.SetAllParameters(
179 G4VPhysicalVolume *pPhysicalVol)
182 return pPhysicalVol->GetLogicalVolume()->GetSolid();
186 G4VPhysicalVolume *pPhysicalVol)
195 if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
202 const G4VPhysicalVolume* pPhyVol)
const
206 G4int* pCrystalID=
const_cast<G4int*
>(&fCrystalID);
207 G4bool* pFlagLeft=
const_cast<G4bool*
>(&fFlagLeft);
208 G4int* pVerboseLevel=
const_cast<G4int*
>(&fVerboseLevel);
215 for(G4int i=fStartID;i<=fAllCrystals;i++)
226 G4cout<<
"The point of PhysicCrystal error!!!!!!!!!!!"<<G4endl;
239 if(fCrystalID>fAllCrystals/2)
242 *pCrystalID=fCrystalID-fAllCrystals/2;
247 *pCrystalID=fAllCrystals/2-fCrystalID+1;
249 *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)