BesCrystalParameterisation Class Reference

#include <BesCrystalParameterisation.hh>

List of all members.

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)

Private Attributes

G4int fCrystalID
G4int fVerboseLevel
G4int fStartID
G4int fAllCrystals
G4bool fFlagLeft
BesEmcGeometryfBesEmcGeometry


Detailed Description

Definition at line 23 of file BesCrystalParameterisation.hh.


Constructor & Destructor Documentation

BesCrystalParameterisation::BesCrystalParameterisation ( const   G4int,
const   G4int,
const   G4int,
BesEmcGeometry ,
const   G4int 
)

Definition at line 23 of file BesCrystalParameterisation.cc.

References fAllCrystals, fBesEmcGeometry, fCrystalID, fFlagLeft, fStartID, and fVerboseLevel.

00029          :fVerboseLevel(0)
00030 {
00031   //for debug
00032   //G4Exception("BesCrystalParameterisation::BesCrystalParameterisation() starting........");
00033   fBesEmcGeometry   =  besEMCGeometry;
00034   fVerboseLevel     =  verboseLevel; //if need to debug this class,open it
00035   fStartID          =  startID;
00036   fAllCrystals      =  thetaAllCrystals;
00037   fCrystalID        =  0;
00038   fFlagLeft         =  true;
00039   if (startID>endID||endID>thetaAllCrystals||startID<1)
00040     {
00041       G4Exception("BesCrystalParameterisation construction: ID of crystal>No avaible!");
00042     }
00043 
00044 }

BesCrystalParameterisation::~BesCrystalParameterisation (  )  [virtual]

Definition at line 48 of file BesCrystalParameterisation.cc.

00049 {}


Member Function Documentation

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Hype &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 81 of file BesCrystalParameterisation.hh.

00083                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Polyhedra &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 77 of file BesCrystalParameterisation.hh.

00079                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Polycone &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 73 of file BesCrystalParameterisation.hh.

00075                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Para &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 69 of file BesCrystalParameterisation.hh.

00071                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Torus &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 65 of file BesCrystalParameterisation.hh.

00067                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Orb &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 61 of file BesCrystalParameterisation.hh.

00063                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Sphere &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 57 of file BesCrystalParameterisation.hh.

00059                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Cons &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 53 of file BesCrystalParameterisation.hh.

00055                                        {}

void BesCrystalParameterisation::ComputeDimensions ( G4Trap &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [virtual]

Definition at line 111 of file BesCrystalParameterisation.cc.

00113 {
00114   //for debug
00115   //G4Exception("BesCrystalParameterisation::ComputeDimensions() starting........");
00116   ComputeIDAndSide(physVol);
00117 
00118   G4double zHalfLength  = fBesEmcGeometry->GetZHalfLength(fCrystalID);
00119   G4double thetaAxis    = fBesEmcGeometry->GetThetaAxis(fCrystalID);
00120   G4double phiAxis      = fBesEmcGeometry->GetPhiAxis(fCrystalID);
00121   G4double yHalfLength1 = fBesEmcGeometry->GetYHalfLength1(fCrystalID);
00122   G4double xHalfLength1 = fBesEmcGeometry->GetXHalfLength1(fCrystalID);
00123   G4double xHalfLength2 = fBesEmcGeometry->GetXHalfLength2(fCrystalID);
00124   G4double tanAlpha1    = fBesEmcGeometry->GetTanAlpha1(fCrystalID);
00125   G4double yHalfLength2 = fBesEmcGeometry->GetYHalfLength2(fCrystalID);
00126   G4double xHalfLength3 = fBesEmcGeometry->GetXHalfLength3(fCrystalID);
00127   G4double xHalfLength4 = fBesEmcGeometry->GetXHalfLength4(fCrystalID);
00128   G4double tanAlpha2    = fBesEmcGeometry->GetTanAlpha2(fCrystalID);
00129 
00130   if(!fFlagLeft)
00131     {
00132       phiAxis=-phiAxis;
00133       tanAlpha1=-tanAlpha1;
00134       tanAlpha2=-tanAlpha2;
00135       G4double tmp;
00136       tmp=xHalfLength1;
00137       xHalfLength1=xHalfLength2;
00138       xHalfLength2=tmp;
00139       tmp=xHalfLength3;
00140       xHalfLength3=xHalfLength4;
00141       xHalfLength4=tmp;
00142     }
00143   if(fVerboseLevel>5)
00144     G4cout << "The size of No." << copyNo << " crystal(placed) are:" << G4endl
00145            << "zHalfLength =" << zHalfLength/cm  << "(cm), "     << G4endl
00146            << "thetaAxis   =" << thetaAxis/deg   << "(degree), " << G4endl
00147            << "phiAxis     =" << phiAxis/deg     << "(degree), " << G4endl
00148            << "yHalfLength1=" << yHalfLength1/cm << "(cm), "     << G4endl
00149            << "xHalfLength1=" << xHalfLength1/cm << "(cm), "     << G4endl
00150            << "xHalfLength2=" << xHalfLength2/cm << "(cm), "     << G4endl
00151            << "tanAlpha1   =" << tanAlpha1       << "(), "       << G4endl
00152            << "yHalfLength2=" << yHalfLength2/cm << "(cm), "     << G4endl
00153            << "xHalfLength3=" << xHalfLength3/cm << "(cm), "     << G4endl
00154            << "xHalfLength4=" << xHalfLength4/cm << "(cm)."      << G4endl
00155            << "tanAlpha2   =" << tanAlpha2       << "(), "       << G4endl
00156            << "(x4-x3)*y1/(x2-x1)/y2="
00157            << (xHalfLength4-xHalfLength3)*yHalfLength1/(xHalfLength2-xHalfLength1)/yHalfLength2 << G4endl
00158            << "tanAlpha2/tanAlpha1=" << tanAlpha2/tanAlpha1 <<G4endl;
00159   //G4cout << fStartID << "-->This is an output sentence for debug." << G4endl;
00160 
00161   trackerChamber.SetAllParameters(
00162                                   zHalfLength,
00163                                   thetaAxis,
00164                                   phiAxis,
00165                                   yHalfLength1,
00166                                   xHalfLength1,
00167                                   xHalfLength2,
00168                                   tanAlpha1,
00169                                   yHalfLength2,
00170                                   xHalfLength3,
00171                                   xHalfLength4,
00172                                   tanAlpha2);
00173 
00174 }

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Trd &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 45 of file BesCrystalParameterisation.hh.

00047                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Tubs &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 41 of file BesCrystalParameterisation.hh.

00043                                        {}

virtual void BesCrystalParameterisation::ComputeDimensions ( G4Box &  ,
const   G4int,
const G4VPhysicalVolume *   
) const [inline, virtual]

Definition at line 37 of file BesCrystalParameterisation.hh.

00039                                        {}

void BesCrystalParameterisation::ComputeIDAndSide ( const G4VPhysicalVolume *   )  const

Definition at line 202 of file BesCrystalParameterisation.cc.

References fAllCrystals, fBesEmcGeometry, fCrystalID, fFlagLeft, fStartID, fVerboseLevel, BesEmcConstruction::GetBesEmcConstruction(), BesEmcGeometry::GetPhysiBSCCrystal(), BesEmcConstruction::GetVerboseLevel(), and genRecEmupikp::i.

Referenced by ComputeMaterial(), and ComputeSolid().

00204 {
00205   //for debug
00206   //G4Exception("BesCrystalParameterisation::ComputeIDAndSide() starting......");
00207   G4int* pCrystalID=const_cast<G4int*>(&fCrystalID);
00208   G4bool* pFlagLeft=const_cast<G4bool*>(&fFlagLeft);
00209   G4int* pVerboseLevel=const_cast<G4int*>(&fVerboseLevel);
00210   
00211   *pVerboseLevel=
00212     BesEmcConstruction::GetBesEmcConstruction()->GetVerboseLevel();
00213 
00214   //*pCrystalID=pPhyVol->GetMotherPhysical()->GetCopyNo(); 
00215   *pCrystalID=-1;
00216   for(G4int i=fStartID;i<=fAllCrystals;i++)
00217     {
00218       //G4cout << fBesEmcGeometry->GetPhysiBSCCrystal(i) << ".vs."
00219       //     << pPhyVol << G4endl;
00220       if(fBesEmcGeometry->GetPhysiBSCCrystal(i)==pPhyVol)
00221         {
00222           *pCrystalID=i;
00223         }
00224     }
00225   if(*pCrystalID==-1)
00226     G4Exception("The point of PhysicCrystal error!!!!!!!!!!!");
00227  
00228   //*pCrystalID=pPhyVol->GetCopyNo();
00229   //if(fVerboseLevel>6)
00230   //G4cout<<"******BesCrystalParameterisation::ComputeIDAndSide******"<<G4endl
00231   //  <<"point of pPhyVol =" << pPhyVol << G4endl
00232   //  <<"point of mother  =" << pPhyVol->GetMother() << G4endl
00233   //  <<"CopyNo of pPhyVol=" << pPhyVol->GetCopyNo() << G4endl
00234   //  <<"CopyNo of mother =" << pPhyVol->GetMother()->GetCopyNo() << G4endl
00235   //  <<"********************************************************"<<G4endl;
00236   
00237   if(fCrystalID>fAllCrystals/2)
00238     {
00239       *pFlagLeft=false;
00240       *pCrystalID=fCrystalID-fAllCrystals/2;
00241     }
00242   else
00243     {
00244       *pFlagLeft=true;
00245       *pCrystalID=fAllCrystals/2-fCrystalID+1;
00246     }
00247   *pCrystalID=*pCrystalID-1;
00248 }

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

Definition at line 185 of file BesCrystalParameterisation.cc.

References ComputeIDAndSide(), fBesEmcGeometry, BesEmcConstruction::GetBesEmcConstruction(), BesEmcGeometry::GetBSCNbTheta(), BesEmcConstruction::GetCasingMaterial(), and BesEmcConstruction::GetCrystalMaterial().

00187 {
00188   if(0) G4cout<<copyNo<<parentTouch<<G4endl;
00189   ComputeIDAndSide(pPhysicalVol);
00190   G4int nBSCTheta=fBesEmcGeometry->GetBSCNbTheta();
00191   //if(fVerboseLevel>5)
00192   //G4cout <<"******BesCrystalParameterisation::ComputeMaterial******"<<G4endl
00193   //   <<"Number of all crystals=" << nBSCTheta << G4endl
00194   //   <<"No of current crystal =" << pPhysicalVol->GetCopyNo() << G4endl
00195   //   <<"*******************************************************"<<G4endl;
00196   if(pPhysicalVol->GetCopyNo()>2*nBSCTheta)
00197     return BesEmcConstruction::GetBesEmcConstruction()->GetCasingMaterial();
00198   else
00199     return BesEmcConstruction::GetBesEmcConstruction()->GetCrystalMaterial();
00200 }

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

Definition at line 177 of file BesCrystalParameterisation.cc.

References ComputeIDAndSide().

00179 {
00180   if(0) G4cout<<copyNo<<G4endl;
00181   ComputeIDAndSide(pPhysicalVol);
00182   return pPhysicalVol->GetLogicalVolume()->GetSolid();
00183 }

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

Definition at line 54 of file BesCrystalParameterisation.cc.

References origin.

00055 {
00056   //for debug
00057   //G4Exception("BesCrystalParameterisation::ComputeTransformation() starting........");
00058   ComputeIDAndSide(physVol);
00059 
00060   if(fVerboseLevel>3)
00061     {
00062       G4cout<<"*BesCrystalParameterisation::ComputeTransformation()*"<<G4endl;
00063       G4cout << "copyNo(transfered)=" << copyNo << G4endl
00064              << "copyNo(gotten)    =" << physVol->GetCopyNo() << G4endl
00065              << "fStartID          =" << fStartID << G4endl
00066              << "fCrystalID        =" << fCrystalID << G4endl;
00067       G4cout << "point of fBesEmcGeometry=" << fBesEmcGeometry << G4endl;
00068     }
00069   
00070   G4double xPosition= fBesEmcGeometry->GetXPosition(fCrystalID);
00071   G4double yPosition= fBesEmcGeometry->GetYPosition(fCrystalID);
00072   G4double zPosition= fBesEmcGeometry->GetZPosition(fCrystalID);
00073   //G4Exception("BesCrystalParameterisation::ComputeTransformation() running........");
00074   //G4double xPosition=0,yPosition=0,zPosition=0;
00075   if(fFlagLeft) zPosition=-zPosition;
00076   G4ThreeVector origin(xPosition,yPosition,zPosition);
00077   physVol->SetTranslation(origin);
00078 
00079   //G4double thetaPosition=fBesEmcGeometry->GetThetaPosition(fCrystalID);
00080   //G4RotationMatrix *rotateMatrix;
00081   //rotateMatrix = new G4RotationMatrix();
00082   //if(fFlagLeft)
00083   //  {
00084   //    rotateMatrix->rotateZ(-90*deg);
00085   //    rotateMatrix->rotateX(-180*deg+thetaPosition);
00086   //  }
00087   //else
00088   //  {
00089   //    rotateMatrix->rotateZ(-90*deg);
00090   //    rotateMatrix->rotateX(-thetaPosition);
00091   //  }
00092   //G4double delta = 0*deg;
00093   //G4ThreeVector axis = G4ThreeVector(0,0,0);
00094   //rotateMatrix->getAngleAxis(delta, axis);
00095   if(fVerboseLevel>5)
00096     {
00097     G4cout << "The crystals are at the position:" << G4endl
00098            << origin/cm <<"(cm)" << G4endl;
00099     //G4cout << thetaPosition/deg <<"(deg)." << G4endl
00100     //<< "The axis of crystals in the world system is: " << G4endl
00101     //<< delta/deg << "(deg)(delta) " << G4endl
00102     //<< axis  << "(Z axis)" << G4endl;
00103     }
00104   //physVol->SetRotation(rotateMatrix);
00105   
00106 }

void BesCrystalParameterisation::SetVerboseLevel ( G4int  val  )  [inline]

Definition at line 91 of file BesCrystalParameterisation.hh.

References fVerboseLevel.

00091 {fVerboseLevel=val;};


Member Data Documentation

G4int BesCrystalParameterisation::fAllCrystals [private]

Definition at line 96 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), and ComputeIDAndSide().

BesEmcGeometry* BesCrystalParameterisation::fBesEmcGeometry [private]

Definition at line 98 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), ComputeIDAndSide(), and ComputeMaterial().

G4int BesCrystalParameterisation::fCrystalID [private]

Definition at line 91 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), and ComputeIDAndSide().

G4bool BesCrystalParameterisation::fFlagLeft [private]

Definition at line 97 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), and ComputeIDAndSide().

G4int BesCrystalParameterisation::fStartID [private]

Definition at line 95 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), and ComputeIDAndSide().

G4int BesCrystalParameterisation::fVerboseLevel [private]

Definition at line 94 of file BesCrystalParameterisation.hh.

Referenced by BesCrystalParameterisation(), ComputeIDAndSide(), and SetVerboseLevel().


Generated on Tue Nov 29 23:17:29 2016 for BOSS_7.0.2 by  doxygen 1.4.7