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 G4cout<<
"BesCrystalParameterisation construction: ID of crystal>No avaible!"<<G4endl;
55(
const G4int copyNo, G4VPhysicalVolume* physVol)
const
63 G4cout<<
"*BesCrystalParameterisation::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)
181 if(0) G4cout<<copyNo<<G4endl;
183 return pPhysicalVol->GetLogicalVolume()->GetSolid();
187 G4VPhysicalVolume *pPhysicalVol,
const G4VTouchable *parentTouch)
189 if(0) G4cout<<copyNo<<parentTouch<<G4endl;
197 if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
204 const G4VPhysicalVolume* pPhyVol)
const
208 G4int* pCrystalID=
const_cast<G4int*
>(&fCrystalID);
209 G4bool* pFlagLeft=
const_cast<G4bool*
>(&fFlagLeft);
210 G4int* pVerboseLevel=
const_cast<G4int*
>(&fVerboseLevel);
217 for(G4int i=fStartID;i<=fAllCrystals;i++)
228 G4cout<<
"The point of PhysicCrystal error!!!!!!!!!!!"<<G4endl;
240 if(fCrystalID>fAllCrystals/2)
243 *pCrystalID=fCrystalID-fAllCrystals/2;
248 *pCrystalID=fAllCrystals/2-fCrystalID+1;
250 *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)