BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
BesCrystalParameterisation Class Reference

#include <BesCrystalParameterisation.hh>

+ Inheritance diagram for BesCrystalParameterisation:

Public Member Functions

 BesCrystalParameterisation (const G4int, const G4int, const G4int, BesEmcGeometry *, const G4int)
 
virtual ~BesCrystalParameterisation ()
 
void ComputeTransformation (const G4int, G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Torus &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Para &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polycone &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Hype &, const G4int, const G4VPhysicalVolume *) const
 
G4Material * ComputeMaterial (const G4int, G4VPhysicalVolume *, const G4VTouchable *parentTouch=0)
 
G4VSolid * ComputeSolid (const G4int, G4VPhysicalVolume *)
 
void ComputeIDAndSide (const G4VPhysicalVolume *) const
 
void SetVerboseLevel (G4int val)
 

Detailed Description

Definition at line 23 of file BesCrystalParameterisation.hh.

Constructor & Destructor Documentation

◆ BesCrystalParameterisation()

BesCrystalParameterisation::BesCrystalParameterisation ( const G4int startID,
const G4int endID,
const G4int thetaAllCrystals,
BesEmcGeometry * besEMCGeometry,
const G4int verboseLevel )

Definition at line 23 of file BesCrystalParameterisation.cc.

29 :fVerboseLevel(0)
30{
31 //for debug
32 //G4Exception("BesCrystalParameterisation::BesCrystalParameterisation() starting........");
33 fBesEmcGeometry = besEMCGeometry;
34 fVerboseLevel = verboseLevel; //if need to debug this class,open it
35 fStartID = startID;
36 fAllCrystals = thetaAllCrystals;
37 fCrystalID = 0;
38 fFlagLeft = true;
39 if (startID>endID||endID>thetaAllCrystals||startID<1)
40 {
41 G4cout<<"BesCrystalParameterisation construction: ID of crystal>No avaible!"<<G4endl;
42 exit(-1);
43 }
44
45}

◆ ~BesCrystalParameterisation()

BesCrystalParameterisation::~BesCrystalParameterisation ( )
virtual

Definition at line 49 of file BesCrystalParameterisation.cc.

50{}

Member Function Documentation

◆ ComputeDimensions() [1/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Box & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 37 of file BesCrystalParameterisation.hh.

39 {}

◆ ComputeDimensions() [2/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Cons & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 53 of file BesCrystalParameterisation.hh.

55 {}

◆ ComputeDimensions() [3/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Hype & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 81 of file BesCrystalParameterisation.hh.

83 {}

◆ ComputeDimensions() [4/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Orb & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 61 of file BesCrystalParameterisation.hh.

63 {}

◆ ComputeDimensions() [5/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Para & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 69 of file BesCrystalParameterisation.hh.

71 {}

◆ ComputeDimensions() [6/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Polycone & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 73 of file BesCrystalParameterisation.hh.

75 {}

◆ ComputeDimensions() [7/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Polyhedra & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 77 of file BesCrystalParameterisation.hh.

79 {}

◆ ComputeDimensions() [8/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Sphere & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 57 of file BesCrystalParameterisation.hh.

59 {}

◆ ComputeDimensions() [9/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Torus & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 65 of file BesCrystalParameterisation.hh.

67 {}

◆ ComputeDimensions() [10/12]

void BesCrystalParameterisation::ComputeDimensions ( G4Trap & trackerChamber,
const G4int copyNo,
const G4VPhysicalVolume * physVol ) const
virtual

Definition at line 111 of file BesCrystalParameterisation.cc.

114{
115 //for debug
116 //G4Exception("BesCrystalParameterisation::ComputeDimensions() starting........");
117 ComputeIDAndSide(physVol);
118
119 G4double zHalfLength = fBesEmcGeometry->GetZHalfLength(fCrystalID);
120 G4double thetaAxis = fBesEmcGeometry->GetThetaAxis(fCrystalID);
121 G4double phiAxis = fBesEmcGeometry->GetPhiAxis(fCrystalID);
122 G4double yHalfLength1 = fBesEmcGeometry->GetYHalfLength1(fCrystalID);
123 G4double xHalfLength1 = fBesEmcGeometry->GetXHalfLength1(fCrystalID);
124 G4double xHalfLength2 = fBesEmcGeometry->GetXHalfLength2(fCrystalID);
125 G4double tanAlpha1 = fBesEmcGeometry->GetTanAlpha1(fCrystalID);
126 G4double yHalfLength2 = fBesEmcGeometry->GetYHalfLength2(fCrystalID);
127 G4double xHalfLength3 = fBesEmcGeometry->GetXHalfLength3(fCrystalID);
128 G4double xHalfLength4 = fBesEmcGeometry->GetXHalfLength4(fCrystalID);
129 G4double tanAlpha2 = fBesEmcGeometry->GetTanAlpha2(fCrystalID);
130
131 if(!fFlagLeft)
132 {
133 phiAxis=-phiAxis;
134 tanAlpha1=-tanAlpha1;
135 tanAlpha2=-tanAlpha2;
136 G4double tmp;
137 tmp=xHalfLength1;
138 xHalfLength1=xHalfLength2;
139 xHalfLength2=tmp;
140 tmp=xHalfLength3;
141 xHalfLength3=xHalfLength4;
142 xHalfLength4=tmp;
143 }
144 if(fVerboseLevel>5)
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;
160 //G4cout << fStartID << "-->This is an output sentence for debug." << G4endl;
161
162 trackerChamber.SetAllParameters(
163 zHalfLength,
164 thetaAxis,
165 phiAxis,
166 yHalfLength1,
167 xHalfLength1,
168 xHalfLength2,
169 tanAlpha1,
170 yHalfLength2,
171 xHalfLength3,
172 xHalfLength4,
173 tanAlpha2);
174
175}
void ComputeIDAndSide(const G4VPhysicalVolume *) const
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)
G4double GetXHalfLength1(G4int NbCrystal)
G4double GetPhiAxis(G4int NbCrystal)
G4double GetXHalfLength3(G4int NbCrystal)

◆ ComputeDimensions() [11/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Trd & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 45 of file BesCrystalParameterisation.hh.

47 {}

◆ ComputeDimensions() [12/12]

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Tubs & ,
const G4int ,
const G4VPhysicalVolume *  ) const
inlinevirtual

Definition at line 41 of file BesCrystalParameterisation.hh.

43 {}

◆ ComputeIDAndSide()

void BesCrystalParameterisation::ComputeIDAndSide ( const G4VPhysicalVolume * pPhyVol) const

Definition at line 203 of file BesCrystalParameterisation.cc.

205{
206 //for debug
207 //G4Exception("BesCrystalParameterisation::ComputeIDAndSide() starting......");
208 G4int* pCrystalID=const_cast<G4int*>(&fCrystalID);
209 G4bool* pFlagLeft=const_cast<G4bool*>(&fFlagLeft);
210 G4int* pVerboseLevel=const_cast<G4int*>(&fVerboseLevel);
211
212 *pVerboseLevel=
214
215 //*pCrystalID=pPhyVol->GetMotherPhysical()->GetCopyNo();
216 *pCrystalID=-1;
217 for(G4int i=fStartID;i<=fAllCrystals;i++)
218 {
219 //G4cout << fBesEmcGeometry->GetPhysiBSCCrystal(i) << ".vs."
220 // << pPhyVol << G4endl;
221 if(fBesEmcGeometry->GetPhysiBSCCrystal(i)==pPhyVol)
222 {
223 *pCrystalID=i;
224 }
225 }
226 if(*pCrystalID==-1)
227 {
228 G4cout<<"The point of PhysicCrystal error!!!!!!!!!!!"<<G4endl;
229 exit(-1);
230 }
231 //*pCrystalID=pPhyVol->GetCopyNo();
232 //if(fVerboseLevel>6)
233 //G4cout<<"******BesCrystalParameterisation::ComputeIDAndSide******"<<G4endl
234 // <<"point of pPhyVol =" << pPhyVol << G4endl
235 // <<"point of mother =" << pPhyVol->GetMother() << G4endl
236 // <<"CopyNo of pPhyVol=" << pPhyVol->GetCopyNo() << G4endl
237 // <<"CopyNo of mother =" << pPhyVol->GetMother()->GetCopyNo() << G4endl
238 // <<"********************************************************"<<G4endl;
239
240 if(fCrystalID>fAllCrystals/2)
241 {
242 *pFlagLeft=false;
243 *pCrystalID=fCrystalID-fAllCrystals/2;
244 }
245 else
246 {
247 *pFlagLeft=true;
248 *pCrystalID=fAllCrystals/2-fCrystalID+1;
249 }
250 *pCrystalID=*pCrystalID-1;
251}
static BesEmcConstruction * GetBesEmcConstruction()
G4VPhysicalVolume * GetPhysiBSCCrystal(G4int NbCrystal)

Referenced by ComputeDimensions(), ComputeMaterial(), ComputeSolid(), and ComputeTransformation().

◆ ComputeMaterial()

G4Material * BesCrystalParameterisation::ComputeMaterial ( const G4int copyNo,
G4VPhysicalVolume * pPhysicalVol,
const G4VTouchable * parentTouch = 0 )

Definition at line 186 of file BesCrystalParameterisation.cc.

188{
189 if(0) G4cout<<copyNo<<parentTouch<<G4endl;
190 ComputeIDAndSide(pPhysicalVol);
191 G4int nBSCTheta=fBesEmcGeometry->GetBSCNbTheta();
192 //if(fVerboseLevel>5)
193 //G4cout <<"******BesCrystalParameterisation::ComputeMaterial******"<<G4endl
194 // <<"Number of all crystals=" << nBSCTheta << G4endl
195 // <<"No of current crystal =" << pPhysicalVol->GetCopyNo() << G4endl
196 // <<"*******************************************************"<<G4endl;
197 if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
199 else
201}
G4Material * GetCasingMaterial()
G4Material * GetCrystalMaterial()

◆ ComputeSolid()

G4VSolid * BesCrystalParameterisation::ComputeSolid ( const G4int copyNo,
G4VPhysicalVolume * pPhysicalVol )

Definition at line 178 of file BesCrystalParameterisation.cc.

180{
181 if(0) G4cout<<copyNo<<G4endl;
182 ComputeIDAndSide(pPhysicalVol);
183 return pPhysicalVol->GetLogicalVolume()->GetSolid();
184}

◆ ComputeTransformation()

void BesCrystalParameterisation::ComputeTransformation ( const G4int copyNo,
G4VPhysicalVolume * physVol ) const

Definition at line 54 of file BesCrystalParameterisation.cc.

56{
57 //for debug
58 //G4Exception("BesCrystalParameterisation::ComputeTransformation() starting........");
59 ComputeIDAndSide(physVol);
60
61 if(fVerboseLevel>3)
62 {
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;
69 }
70
71 G4double xPosition= fBesEmcGeometry->GetXPosition(fCrystalID);
72 G4double yPosition= fBesEmcGeometry->GetYPosition(fCrystalID);
73 G4double zPosition= fBesEmcGeometry->GetZPosition(fCrystalID);
74 //G4Exception("BesCrystalParameterisation::ComputeTransformation() running........");
75 //G4double xPosition=0,yPosition=0,zPosition=0;
76 if(fFlagLeft) zPosition=-zPosition;
77 G4ThreeVector origin(xPosition,yPosition,zPosition);
78 physVol->SetTranslation(origin);
79
80 //G4double thetaPosition=fBesEmcGeometry->GetThetaPosition(fCrystalID);
81 //G4RotationMatrix *rotateMatrix;
82 //rotateMatrix = new G4RotationMatrix();
83 //if(fFlagLeft)
84 // {
85 // rotateMatrix->rotateZ(-90*deg);
86 // rotateMatrix->rotateX(-180*deg+thetaPosition);
87 // }
88 //else
89 // {
90 // rotateMatrix->rotateZ(-90*deg);
91 // rotateMatrix->rotateX(-thetaPosition);
92 // }
93 //G4double delta = 0*deg;
94 //G4ThreeVector axis = G4ThreeVector(0,0,0);
95 //rotateMatrix->getAngleAxis(delta, axis);
96 if(fVerboseLevel>5)
97 {
98 G4cout << "The crystals are at the position:" << G4endl
99 << origin/cm <<"(cm)" << G4endl;
100 //G4cout << thetaPosition/deg <<"(deg)." << G4endl
101 //<< "The axis of crystals in the world system is: " << G4endl
102 //<< delta/deg << "(deg)(delta) " << G4endl
103 //<< axis << "(Z axis)" << G4endl;
104 }
105 //physVol->SetRotation(rotateMatrix);
106
107}
const DifPoint origin
G4double GetYPosition(G4int NbCrystal)
G4double GetXPosition(G4int NbCrystal)
G4double GetZPosition(G4int NbCrystal)

◆ SetVerboseLevel()

void BesCrystalParameterisation::SetVerboseLevel ( G4int val)
inline

Definition at line 91 of file BesCrystalParameterisation.hh.

91{fVerboseLevel=val;};

The documentation for this class was generated from the following files: