Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BesEmcEndGeometry Class Reference

#include <BesEmcEndGeometry.hh>

List of all members.

Public Member Functions

 BesEmcEndGeometry ()
 BesEmcEndGeometry ()
G4ThreeVector ComputeDimAndPos (const G4int, const G4int, const G4int)
G4ThreeVector ComputeDimAndPos (const G4int, const G4int, const G4int)
void ComputeParameters ()
void ComputeParameters ()
void Exchange (G4int cry1, G4int cry2)
void Exchange (G4int cry1, G4int cry2)
void ExchangeSector7 (G4int cry1, G4int cry2)
void ExchangeSector7 (G4int cry1, G4int cry2)
G4int GetCryNumInOneLayer (G4int num)
G4int GetCryNumInOneLayer (G4int num)
void ModifyForCasing (G4ThreeVector pos[8], G4int CryNb)
void ModifyForCasing (G4ThreeVector pos[8], G4int CryNb)
void ReadParameters ()
void ReadParameters ()
void ReflectX ()
void ReflectX ()
void Zoom (const G4ThreeVector pos[8], const G4double factor)
void Zoom (const G4ThreeVector pos[8], const G4double factor)
 ~BesEmcEndGeometry ()
 ~BesEmcEndGeometry ()

Private Attributes

G4int cryNumInOneLayer [6]
G4ThreeVector cryPoint [8]
G4double CrystalLength
G4double fAlThickness
G4double fMylarThickness
G4ThreeVector fPnt [35][8]
G4ThreeVector fPnt1 [35][8]
G4double fTyvekThickness
G4double param [35][24]
G4double penta [5][6]
G4int pentaInOneSector [5]
G4double SectorDz
G4double SectorRmax1
G4double SectorRmax2
G4double SectorRmin1
G4double SectorRmin2
G4double SectorZPosition
G4double totalThickness
G4double WorldDz
G4double WorldRmax1
G4double WorldRmax2
G4double WorldRmin1
G4double WorldRmin2
G4double WorldZPosition
G4ThreeVector zoomPoint [8]

Friends

class BesEmcConstruction
class BesEmcDigitizer
class EmcGdmlWriter


Constructor & Destructor Documentation

BesEmcEndGeometry::BesEmcEndGeometry  ) 
 

00015 {;}

BesEmcEndGeometry::~BesEmcEndGeometry  ) 
 

00018 {;}

BesEmcEndGeometry::BesEmcEndGeometry  ) 
 

BesEmcEndGeometry::~BesEmcEndGeometry  ) 
 


Member Function Documentation

G4ThreeVector BesEmcEndGeometry::ComputeDimAndPos const   G4int,
const   G4int,
const   G4int
 

G4ThreeVector BesEmcEndGeometry::ComputeDimAndPos const   G4int,
const   G4int,
const   G4int
 

00375 {
00376   //ComputeParameters();
00377   G4int sector=-1, cryNb=-1;
00378   G4int leftFlag=0;
00379   G4int downFlag=0;
00380   G4int pentaFlag=0;
00381   G4int flag=0;
00382   G4double A1=0,a1=0,B1=0,b1=0,C1=0,c1=0,D1=0,d1=0,E1=0,e1=0; //dimension of pentagonal crystal
00383   G4int m_numPhi=0;
00384   G4ThreeVector position=0;
00385   G4int cryInOneSector = cryNumInOneLayer[numTheta]/16; //number of crystal in one layer in one sector
00386   G4ThreeVector pos[8];
00387 
00388   if(partId==2) //west end
00389   {
00390     if(numPhi>=0&&numPhi<8*cryInOneSector)
00391       m_numPhi=8*cryInOneSector-1-numPhi;
00392     else if(numPhi>=8*cryInOneSector&&numPhi<16*cryInOneSector)
00393       m_numPhi=16*cryInOneSector-1-numPhi;
00394   }
00395   else          //east end
00396     m_numPhi=numPhi;
00397 
00398   if(numPhi>=4*cryInOneSector&&numPhi<5*cryInOneSector) //crystal in 4th sector
00399   {
00400     leftFlag = 1;
00401     m_numPhi=8*cryInOneSector-1-numPhi;
00402   }
00403   else if(numPhi>=11*cryInOneSector&&numPhi<12*cryInOneSector) //crystal in 11th sector
00404   {
00405     leftFlag = 1;
00406     downFlag = 1;
00407     m_numPhi=numPhi-8*cryInOneSector;
00408   }
00409   if(numPhi>=12*cryInOneSector&&numPhi<13*cryInOneSector) //crystal in 12th sector
00410   {
00411     downFlag = 1;
00412     m_numPhi=16*cryInOneSector-1-numPhi;
00413   }
00414   
00415   //translate numTheta and numPhi to sector and cryNb
00416   G4int cryNbOffset = 0;
00417   for(G4int i=0;i<numTheta;i++)
00418     cryNbOffset += cryNumInOneLayer[i]/16;
00419   if(cryInOneSector)
00420     sector = m_numPhi/cryInOneSector;
00421   cryNb = m_numPhi-cryInOneSector*sector+cryNbOffset;
00422   sector += 3;
00423   if(sector>15&&sector<=18)
00424     sector -= 16;
00425     
00426   //sector beside the gap
00427   if(sector==6)
00428     for(G4int i=0;i<8;i++)
00429       pos[i]=fPnt1[cryNb][i];
00430   else
00431     for(G4int i=0;i<8;i++)
00432     {
00433       pos[i]=fPnt[cryNb][i];
00434       pos[i].rotateZ(-67.5*deg+sector*22.5*deg);
00435     }
00436 
00437   //crystal dimension
00438   Zoom(pos,0.999);
00439   ModifyForCasing(zoomPoint,cryNb);
00440   G4double A = (cryPoint[0]-cryPoint[3]).r();
00441   G4double a = (cryPoint[4]-cryPoint[7]).r();
00442   G4double B = (cryPoint[1]-cryPoint[2]).r();
00443   G4double b = (cryPoint[5]-cryPoint[6]).r();
00444   G4double C = (cryPoint[0]-cryPoint[1]).r();
00445   G4double c = (cryPoint[4]-cryPoint[5]).r();
00446   G4double D = (cryPoint[2]-cryPoint[3]).r();
00447   G4double d = (cryPoint[6]-cryPoint[7]).r();
00448 
00449   //reflect the axis according to the flag
00450   for(G4int i=0;i<8;i++)
00451   {
00452     pos[i].setZ(pos[i].getZ()+WorldZPosition+SectorZPosition);  //give the absolute z coordinate
00453     if(leftFlag==1)
00454        pos[i].setX(-pos[i].getX());
00455     if(downFlag==1)
00456       pos[i].setY(-pos[i].getY());
00457     if(partId==2)
00458     {
00459       pos[i].setX(-pos[i].getX());
00460       pos[i].setZ(-pos[i].getZ());
00461     }
00462   }
00463   
00464   //compute the position
00465   for(G4int j=4;j<8;j++)
00466     position += pos[j];
00467   position /= 4;
00468 
00469   //compute pentagonal crystal
00470   for(G4int i=0;i<5;i++)
00471   {
00472     if(cryNb==pentaInOneSector[i])
00473     {
00474       pentaFlag = 1;
00475       G4ThreeVector penta[8];
00476       
00477       //sector beside the gap
00478       if(sector==6)
00479         for(G4int j=0;j<8;j++)
00480           penta[j]=fPnt1[30+i][j];
00481       else
00482         for(G4int j=0;j<8;j++)
00483         {
00484           penta[j]=fPnt[30+i][j];
00485           penta[j].rotateZ(-67.5*deg+sector*22.5*deg);
00486         }
00487       
00488       //crystal dimension
00489       ModifyForCasing(penta,30+i);
00490       A1 = (cryPoint[1]-cryPoint[2]).r();
00491       a1 = (cryPoint[5]-cryPoint[6]).r();
00492       B1 = (cryPoint[1]-cryPoint[0]).r();
00493       b1 = (cryPoint[5]-cryPoint[4]).r();
00494       C1 = (cryPoint[0]-cryPoint[3]).r()+A;
00495       c1 = (cryPoint[4]-cryPoint[7]).r()+a;
00496       D1 = D;
00497       d1 = d;
00498       E1 = B;
00499       e1 = b;
00500 
00501       //reflect the axis according to the flag
00502       for(G4int j=0;j<8;j++)
00503       {
00504         penta[j].setZ(penta[j].getZ()+WorldZPosition+SectorZPosition);  //give the absolute z coordinate
00505         if(leftFlag==1)
00506           penta[j].setX(-penta[j].getX());
00507         if(downFlag==1)
00508           penta[j].setY(-penta[j].getY());
00509         if(partId==2)
00510         {
00511           penta[j].setX(-penta[j].getX());
00512           penta[j].setZ(-penta[j].getZ());
00513         }
00514       }
00515       
00516       //compute the position
00517       for(G4int j=4;j<8;j++)
00518       {
00519         if(j!=0&&j!=4)
00520           position += pos[j];
00521         if(j==0||j==1||j==4||j==5)
00522           position += penta[j];
00523       }
00524       position /= 10;
00525       
00526       flag = leftFlag+downFlag;
00527       if(flag==1)
00528       {
00529         G4double temp1 = B1; B1 = D1; D1 = temp1;
00530         temp1 = A1; A1 = E1; E1 = temp1;
00531         temp1 = b1; b1 = d1; d1 = temp1;
00532         temp1 = a1; a1 = e1; e1 = temp1;
00533       }
00534 
00535       break;
00536     }
00537   }
00538               
00539   flag = leftFlag+downFlag+partId/2;
00540   if(flag==1||flag==3)
00541   {
00542     G4double temp = C;    C = D;    D = temp;
00543     temp = c;    c = d;    d = temp;
00544   }
00545 
00546   /*G4cout<<"##########################################################################"<<G4endl;
00547   G4cout<<"###sector="<<sector<<",cryNb="<<cryNb<<",left flag="<<leftFlag<<",down flag="<<downFlag<<G4endl;
00548   G4cout<<"partId="<<partId<<"\t"<<"theta number="<<numTheta<<"\t"<<"phi number="<<numPhi<<G4endl;
00549   G4cout<<"crystal point:"<<G4endl;
00550   for(G4int i=0;i<8;i++)
00551     G4cout<<pos[i]<<G4endl;
00552   G4cout<<"crystal position:"<<"\t"<<position<<"\t"<<"phi="<<position.phi()/deg<<G4endl;
00553   G4cout<<"crystal dimension:"<<G4endl;
00554   if(pentaFlag==1)
00555     G4cout<<"A="<<A1<<",a="<<a1<<",B="<<B1<<",b="<<b1<<",C="<<C1<<",c="<<c1<<",D="<<D1<<",d="<<d1<<",E="<<E1<<",e="<<e1<<G4endl;
00556   else
00557     G4cout<<"A="<<A<<",a="<<a<<",B="<<B<<",b="<<b<<",C="<<C<<",c="<<c<<",D="<<D<<",d="<<d<<G4endl;
00558   G4cout<<"##########################################################################"<<G4endl;*/
00559 
00560   return position;
00561 }

void BesEmcEndGeometry::ComputeParameters  ) 
 

void BesEmcEndGeometry::ComputeParameters  ) 
 

00069 {
00070 
00072   // emc endcap crystal                                                   //
00074   //                              1                                       //
00075   //                  0     __  --                                        //
00076   //                    --         \                                      //
00077   //                  | \           \                                     //  
00078   //                  |   \      __ - 2                                   //
00079   //                  |     \ --     |                                    //
00080   //                  |     | 3      |                                    //
00081   //                  |     |        |                                    //
00082   //                  |     |        |                                    //
00083   //                  |     |        |                                    //
00084   //                  |     |    5   |                                    //
00085   //                4  \    |        |                                    //
00086   //                     \  |    __ - 6                                   //
00087   //                       \| --                                          //
00088   //                         7                                            //
00090   
00091   ReadParameters();
00092 
00093   G4int pentaNb=0;
00094   for(G4int i=0;i<30;i++)
00095   {
00096     for (G4int j=0;j<8;j++)
00097     {
00098       //use 24 parameters to construct 8 point of one crystal 
00099       G4ThreeVector* pPnt = new G4ThreeVector(param[i][j],param[i][j+8],param[i][j+16]-WorldZPosition-SectorZPosition);
00100       fPnt[i][j] = *pPnt;
00101     }
00102 
00103     if(i==5||i==6||i==14||i==15||i==16)
00104     //if(0)   //no pentagonal crystal now
00105     {
00106       for(G4int j=0;j<8;j++)
00107         fPnt[30+pentaNb][j] = fPnt[i][j];
00108       
00109       //compute the 5th point of the pentagonal crystal
00110       G4double y0,y1,y4,y5;
00111       G4ThreeVector v0,v1,v4,v5;
00112       y0 = penta[pentaNb][0];
00113       y1 = penta[pentaNb][1];
00114       y4 = penta[pentaNb][2];
00115       y5 = penta[pentaNb][3];
00116       v0 = (y0-fPnt[i][3].getY())*(fPnt[i][0]-fPnt[i][3])/(fPnt[i][0].getY()-fPnt[i][3].getY())
00117         +fPnt[i][3];
00118       v1 = (y1-fPnt[i][2].getY())*(fPnt[i][1]-fPnt[i][2])/(fPnt[i][1].getY()-fPnt[i][2].getY())
00119         +fPnt[i][2];
00120       v4 = (y4-fPnt[i][7].getY())*(fPnt[i][4]-fPnt[i][7])/(fPnt[i][4].getY()-fPnt[i][7].getY())
00121         +fPnt[i][7];
00122       v5 = (y5-fPnt[i][6].getY())*(fPnt[i][5]-fPnt[i][6])/(fPnt[i][5].getY()-fPnt[i][6].getY())
00123         +fPnt[i][6];
00124 
00125       G4double x1,x5;
00126       x1 = penta[pentaNb][4];
00127       x5 = penta[pentaNb][5];
00128       v1 = (x1-v0.getX())*(v1-v0)/(v1.getX()-v0.getX())+v0;   //v1', the fifth point
00129       v5 = (x5-v4.getX())*(v5-v4)/(v5.getX()-v4.getX())+v4;   //v5'
00130       
00131       fPnt[i][0] = v0;
00132       fPnt[i][1] = v1;
00133       fPnt[i][4] = v4;
00134       fPnt[i][5] = v5;
00135       
00136       fPnt[30+pentaNb][2] = v1;
00137       fPnt[30+pentaNb][3] = v0;
00138       fPnt[30+pentaNb][6] = v5;
00139       fPnt[30+pentaNb][7] = v4;
00140 
00141       pentaNb++;
00142     }
00143   }
00144 
00145   //reflect point in one sector according to new design
00146   G4ThreeVector temp[35][8];
00147   for(G4int i=0;i<35;i++)
00148   {
00149     for (G4int j=0;j<8;j++)
00150     {
00151       temp[i][j]=fPnt[i][j];
00152       fPnt[i][j].rotateZ(157.5*deg);
00153       fPnt[i][j].setX(-fPnt[i][j].getX());
00154     }
00155 
00156     // point 0<-->3, 1<-->2, 4<-->7, 5<-->6
00157     for (G4int j=0;j<8;j++)
00158     {
00159       if(j<2)
00160       {
00161         G4ThreeVector v=fPnt[i][j];
00162         fPnt[i][j]=fPnt[i][3-j];
00163         fPnt[i][3-j]=v;
00164       }
00165       else if(j>=4&&j<6)
00166       {
00167         G4ThreeVector v=fPnt[i][j];
00168         fPnt[i][j]=fPnt[i][11-j];
00169         fPnt[i][11-j]=v;
00170       }
00171     }
00172   }
00173 
00174   //exchange sequence in the same layer
00175   //Exchange(0,3);  Exchange(1,2);  Exchange(4,7);  Exchange(5,6);  
00176   //Exchange(8,12);  Exchange(9,11);  Exchange(13,17);  Exchange(14,16);
00177   //Exchange(18,23);  Exchange(19,22);  Exchange(20,21);  Exchange(24,29);  Exchange(25,28); Exchange(26,27);
00178 
00179   Exchange(0,3);  Exchange(1,2);  Exchange(4,7);  Exchange(5,31);  Exchange(6,30);
00180   Exchange(8,12);  Exchange(9,11);  Exchange(13,17);  Exchange(14,34);  Exchange(15,33);  Exchange(16,32); 
00181   Exchange(18,23);  Exchange(19,22);  Exchange(20,21);  Exchange(24,29);  Exchange(25,28); Exchange(26,27);
00182 
00183   /*for(G4int i=0;i<35;i++)
00184   {
00185     G4cout<<"crystal number: "<<i<<G4endl;
00186     for(G4int j=0;j<8;j++)
00187       G4cout<<fPnt[i][j]<<G4endl;
00188   }*/
00189     
00190                 
00191   //compute the 6 crystal beside the 20mm gap
00192   for(G4int i=0;i<35;i++)
00193   {
00194     for (G4int j=0;j<8;j++)
00195     {
00196       G4ThreeVector pPnt1 = temp[i][j];
00197       fPnt1[i][j] = pPnt1.rotateZ(67.5*deg);
00198     }
00199     if((i==3)||(i==7)||(i==12)||(i==17)||(i==23)||(i==29))
00200     {
00201       fPnt1[i][0].setX(10);
00202       fPnt1[i][1].setX(10);
00203       fPnt1[i][4].setX(10);
00204       fPnt1[i][5].setX(10);
00205 
00206       G4double y0 = fPnt1[i][0].getY()+10*(fPnt1[i][3].getY()-fPnt1[i][0].getY())/fPnt1[i][3].getX();
00207       G4double y1 = fPnt1[i][1].getY()+10*(fPnt1[i][2].getY()-fPnt1[i][1].getY())/fPnt1[i][2].getX();
00208       G4double y4 = fPnt1[i][4].getY()+10*(fPnt1[i][7].getY()-fPnt1[i][4].getY())/fPnt1[i][7].getX();
00209       G4double y5 = fPnt1[i][5].getY()+10*(fPnt1[i][6].getY()-fPnt1[i][5].getY())/fPnt1[i][6].getX();
00210 
00211       G4double z0 = fPnt1[i][0].getZ()+10*(fPnt1[i][3].getZ()-fPnt1[i][0].getZ())/fPnt1[i][3].getX();
00212       G4double z1 = fPnt1[i][1].getZ()+10*(fPnt1[i][2].getZ()-fPnt1[i][1].getZ())/fPnt1[i][2].getX();
00213       G4double z4 = fPnt1[i][4].getZ()+10*(fPnt1[i][7].getZ()-fPnt1[i][4].getZ())/fPnt1[i][7].getX();
00214       G4double z5 = fPnt1[i][5].getZ()+10*(fPnt1[i][6].getZ()-fPnt1[i][5].getZ())/fPnt1[i][6].getX();
00215 
00216       fPnt1[i][0].setY(y0);
00217       fPnt1[i][1].setY(y1);
00218       fPnt1[i][4].setY(y4);
00219       fPnt1[i][5].setY(y5);
00220 
00221       fPnt1[i][0].setZ(z0);
00222       fPnt1[i][1].setZ(z1);
00223       fPnt1[i][4].setZ(z4);
00224       fPnt1[i][5].setZ(z5);
00225     }
00226   }
00227 }

void BesEmcEndGeometry::Exchange G4int  cry1,
G4int  cry2
 

void BesEmcEndGeometry::Exchange G4int  cry1,
G4int  cry2
 

00230 {
00231   G4ThreeVector v;
00232   for(G4int i=0;i<8;i++)
00233   {
00234     v = fPnt[cry1][i];
00235     fPnt[cry1][i] = fPnt[cry2][i];
00236     fPnt[cry2][i] = v;
00237   }
00238 }

void BesEmcEndGeometry::ExchangeSector7 G4int  cry1,
G4int  cry2
 

void BesEmcEndGeometry::ExchangeSector7 G4int  cry1,
G4int  cry2
 

00241 {
00242   G4ThreeVector v;
00243   for(G4int i=0;i<8;i++)
00244   {
00245     v = fPnt1[cry1][i];
00246     fPnt1[cry1][i] = fPnt1[cry2][i];
00247     fPnt1[cry2][i] = v;
00248   }
00249 }

G4int BesEmcEndGeometry::GetCryNumInOneLayer G4int  num  )  [inline]
 

00030 { return cryNumInOneLayer[num]; }

G4int BesEmcEndGeometry::GetCryNumInOneLayer G4int  num  )  [inline]
 

00030 { return cryNumInOneLayer[num]; }

void BesEmcEndGeometry::ModifyForCasing G4ThreeVector  pos[8],
G4int  CryNb
 

void BesEmcEndGeometry::ModifyForCasing G4ThreeVector  pos[8],
G4int  CryNb
 

00322 {
00323   G4ThreeVector center1=0;        //the center of large surface
00324   G4ThreeVector center2=0;        //the center of small surface
00325   
00326   const G4double dt=1e-5; //avoid overlap between crystal and casing
00327   
00328   if(CryNb==5||CryNb==6||CryNb==14||CryNb==15||CryNb==16)
00329   {
00330     center1 = (pos[0]+pos[1])*(1-dt)/2+(pos[2]+pos[3])*dt/2;
00331     center2 = (pos[4]+pos[5])*(1-dt)/2+(pos[6]+pos[7])*dt/2;
00332   }
00333   else if(CryNb>=30&&CryNb<35)
00334   {
00335     center1 = (pos[0]+pos[1])*dt/2+(pos[2]+pos[3])*(1-dt)/2;
00336     center2 = (pos[4]+pos[5])*dt/2+(pos[6]+pos[7])*(1-dt)/2;
00337   }
00338   else
00339   {
00340     center1 = (pos[0]+pos[1]+pos[2]+pos[3])/4;
00341     center2 = (pos[4]+pos[5]+pos[6]+pos[7])/4;
00342   }
00343   
00344   G4double r1=(pos[1]-center1).r();
00345   G4double r2=(pos[2]-center1).r();
00346   G4double r12=(pos[1]-pos[2]).r();
00347   G4double theta=acos((r2*r2+r12*r12-r1*r1)/(2*r2*r12));
00348   G4double h=r2*sin(theta);       //distance from the center to the vertical side
00349   G4double t1=totalThickness/h;
00350 
00351   r1=(pos[5]-center2).r();
00352   r2=(pos[6]-center2).r();
00353   r12=(pos[5]-pos[6]).r();
00354   theta=acos((r2*r2+r12*r12-r1*r1)/(2*r2*r12));
00355   h=r2*sin(theta);
00356   G4double t2=totalThickness/h;
00357   
00358   for(G4int i=0;i<8;i++)
00359   {
00360     if(i<4)
00361     {
00362       cryPoint[i] = (1-t1)*pos[i]+t1*center1;
00363     }
00364     else
00365     {
00366       G4ThreeVector temp = (1-t2)*pos[i]+t2*center2;
00367       cryPoint[i] = (1-totalThickness/CrystalLength)*temp+(totalThickness/CrystalLength)*pos[i-4];
00368     }
00369   //G4cout<<"casing="<<pos[i]<<"\t"<<"crystal="<<cryPoint[i]<<G4endl;
00370   }
00371 }

void BesEmcEndGeometry::ReadParameters  ) 
 

void BesEmcEndGeometry::ReadParameters  ) 
 

00021 {
00022   BesEmcParameter& emcPara=BesEmcParameter::GetInstance();
00023   
00024   WorldRmin1 = emcPara.GetWorldRmin1();
00025   WorldRmax1 = emcPara.GetWorldRmax1();
00026   WorldRmin2 = emcPara.GetWorldRmin2();//+5.*mm; //add 5mm to avoid warning
00027   WorldRmax2 = emcPara.GetWorldRmax2();
00028   WorldDz = emcPara.GetWorldDz();
00029   WorldZPosition = emcPara.GetWorldZPosition();
00030   CrystalLength = emcPara.GetCrystalLength();
00031 
00032   SectorRmin1 = 489.27*mm;
00033   SectorRmax1 = 880.*mm;
00034   SectorRmin2 = 621.57*mm;
00035   SectorRmax2 = 1113.53*mm;
00036   SectorDz = WorldDz-44.*mm;
00037   SectorZPosition = -18.*mm;
00038 
00039   for(G4int i=0;i<6;i++)
00040     cryNumInOneLayer[i] = emcPara.GetCryInOneLayer(i);
00041   for(G4int i=0;i<5;i++)
00042     pentaInOneSector[i] = emcPara.GetPentaInOneSector(i);
00043 
00044   fTyvekThickness   = emcPara.GetTyvekThickness();
00045   fAlThickness      = emcPara.GetAlThickness();
00046   fMylarThickness   = emcPara.GetMylarThickness();
00047   totalThickness=fTyvekThickness+fAlThickness+fMylarThickness;
00048       
00049   G4String ParaPath = getenv("EMCSIMROOT");
00050   if(!ParaPath){
00051     G4Exception("BOOST environment not set!");
00052   }
00053   ParaPath += "/dat/EmcEndGeometry.dat";
00054 
00055   ifstream fin;
00056   fin.open(ParaPath);
00057   assert(fin);
00058   for(G4int i=0;i<30;i++)
00059     for (G4int j=0;j<24;j++)
00060       fin>>param[i][j];
00061   for(G4int i=0;i<5;i++)
00062     for (G4int j=0;j<6;j++)
00063       fin>>penta[i][j];
00064   fin.close();
00065 }

void BesEmcEndGeometry::ReflectX  ) 
 

void BesEmcEndGeometry::ReflectX  ) 
 

00253 {
00254   for(G4int i=0;i<35;i++)
00255   {
00256     for(G4int j=0;j<8;j++)
00257     {
00258       fPnt1[i][j].setX(-fPnt1[i][j].getX());
00259     }
00260 
00261     // point 0<-->3, 1<-->2, 4<-->7, 5<-->6
00262     for (G4int j=0;j<8;j++)
00263     {
00264       if(j<2)
00265       {
00266         G4ThreeVector v=fPnt1[i][j];
00267         fPnt1[i][j]=fPnt1[i][3-j];
00268         fPnt1[i][3-j]=v;
00269       }
00270       else if(j>=4&&j<6)
00271       {
00272         G4ThreeVector v=fPnt1[i][j];
00273         fPnt1[i][j]=fPnt1[i][11-j];
00274         fPnt1[i][11-j]=v;
00275       }
00276     }
00277     
00278     //change the sequence of eight points according to the requirment of IrregBox
00279     // point 0<-->1, 2<-->3, 4<-->5, 6<-->7
00280     /*for(G4int j=0;j<8;j++)
00281     {
00282       if((j%2)==0)
00283       {
00284         G4ThreeVector v2=fPnt1[i][j];
00285         fPnt1[i][j]=fPnt1[i][j+1];
00286         fPnt1[i][j+1]=v2;
00287       }
00288     }*/
00289   }
00290   ExchangeSector7(0,3);  ExchangeSector7(1,2);  ExchangeSector7(4,7);  
00291   ExchangeSector7(5,31); ExchangeSector7(6,30); ExchangeSector7(8,12);  
00292   ExchangeSector7(9,11);  ExchangeSector7(13,17); ExchangeSector7(14,34);  
00293   ExchangeSector7(15,33);  ExchangeSector7(16,32); ExchangeSector7(18,23);  
00294   ExchangeSector7(19,22);  ExchangeSector7(20,21);  ExchangeSector7(24,29);  
00295   ExchangeSector7(25,28); ExchangeSector7(26,27);
00296 }  

void BesEmcEndGeometry::Zoom const G4ThreeVector  pos[8],
const G4double  factor
 

void BesEmcEndGeometry::Zoom const G4ThreeVector  pos[8],
const G4double  factor
 

00299 {
00300   G4ThreeVector center1(0,0,0);
00301   G4ThreeVector center2(0,0,0);
00302   for(G4int i=0;i<8;i++)
00303     zoomPoint[i]=0;
00304   
00305   for(G4int i=0;i<8;i++)
00306   {
00307     if(i<4) center1+=pos[i];
00308     else center2+=pos[i];
00309   }
00310   center1/=4;
00311   center2/=4;
00312 
00313   for(G4int i=0;i<8;i++)
00314   {
00315     if(i<4) zoomPoint[i]=factor*pos[i]+(1-factor)*center1;
00316     else zoomPoint[i]=factor*pos[i]+(1-factor)*center2;
00317   }
00318 }


Friends And Related Function Documentation

BesEmcConstruction [friend]
 

BesEmcDigitizer [friend]
 

EmcGdmlWriter [friend]
 


Member Data Documentation

G4int BesEmcEndGeometry::cryNumInOneLayer [private]
 

G4ThreeVector BesEmcEndGeometry::cryPoint [private]
 

G4double BesEmcEndGeometry::CrystalLength [private]
 

G4double BesEmcEndGeometry::fAlThickness [private]
 

G4double BesEmcEndGeometry::fMylarThickness [private]
 

G4ThreeVector BesEmcEndGeometry::fPnt [private]
 

G4ThreeVector BesEmcEndGeometry::fPnt1 [private]
 

G4double BesEmcEndGeometry::fTyvekThickness [private]
 

G4double BesEmcEndGeometry::param [private]
 

G4double BesEmcEndGeometry::penta [private]
 

G4int BesEmcEndGeometry::pentaInOneSector [private]
 

G4double BesEmcEndGeometry::SectorDz [private]
 

G4double BesEmcEndGeometry::SectorRmax1 [private]
 

G4double BesEmcEndGeometry::SectorRmax2 [private]
 

G4double BesEmcEndGeometry::SectorRmin1 [private]
 

G4double BesEmcEndGeometry::SectorRmin2 [private]
 

G4double BesEmcEndGeometry::SectorZPosition [private]
 

G4double BesEmcEndGeometry::totalThickness [private]
 

G4double BesEmcEndGeometry::WorldDz [private]
 

G4double BesEmcEndGeometry::WorldRmax1 [private]
 

G4double BesEmcEndGeometry::WorldRmax2 [private]
 

G4double BesEmcEndGeometry::WorldRmin1 [private]
 

G4double BesEmcEndGeometry::WorldRmin2 [private]
 

G4double BesEmcEndGeometry::WorldZPosition [private]
 

G4ThreeVector BesEmcEndGeometry::zoomPoint [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:52:14 2011 for BOSS6.5.5 by  doxygen 1.3.9.1