#include <LCDG4CalSDProj.hh>
Inheritance diagram for LCDG4CalSDProj:


Public Member Functions | |
| LCDG4CalSDProj (G4String name, const XERCES_CPP_NAMESPACE::DOM_Element &voldb) | |
| ~LCDG4CalSDProj () | |
| unsigned int | findCell (const G4ThreeVector &position) |
| G4ThreeVector | getCellCenter (unsigned int cellIndex) |
| unsigned int | getIndex1 (unsigned int cellIndex) const |
| unsigned int | getIndex2 (unsigned int cellIndex) const |
| unsigned int | getIndex3 (unsigned int cellIndex) const |
Private Attributes | |
| G4int | _phiseg |
| G4int | _thetaseg |
|
||||||||||||
|
|
|
|
Definition at line 39 of file LCDG4CalSDProj.cc.
00039 {
00040 }
|
|
|
Implements LCDG4CalSD. Definition at line 43 of file LCDG4CalSDProj.cc. References _phiseg, _thetaseg, and LCDG4CalSD::index.
00043 {
00044
00045 // theta,phi are spherical coords from geant hit
00046 G4double hittheta = pos.theta();
00047 G4double hitphi = pos.phi();
00048 if(hitphi < 0.0) hitphi += 360.0*degree;
00049
00050 G4double dphi = 360.0*degree/_phiseg;
00051 G4double dtheta = 180.0*degree/_thetaseg;
00052 // convenience aliases
00053 unsigned int& ilayer = index[1];
00054 unsigned int& iphi = index[2];
00055 unsigned int& itheta = index[3];
00056 // set geometry-dependent indices: index[2] and index[3]
00057 iphi = int(hitphi/dphi);
00058 itheta = int(hittheta/dtheta);
00059 unsigned int cellIndex = itheta + _thetaseg* (iphi + _phiseg*ilayer);
00060 return cellIndex;
00061 }
|
|
|
Implements LCDG4CalSD. Definition at line 64 of file LCDG4CalSDProj.cc. References _phiseg, _thetaseg, LCDG4CalSD::index, LCDG4CalSD::layer0CenterDepth, LCDG4CalSD::layerThickness, and LCDG4CalSD::north.
00064 {
00065 if(cellIndex) ; // make compiler happy
00066 // convenience aliases
00067 unsigned int& sysno = index[0];
00068 unsigned int& ilayer = index[1];
00069 unsigned int& iphi = index[2];
00070 unsigned int& itheta = index[3];
00071
00072 double dtheta = 180.*degree / _thetaseg;
00073 double dphi = 360.*degree / _phiseg;
00074 double theta = (itheta+0.5)*dtheta/radian; // +0.5 for center of cell
00075 double phi = (iphi+0.5)*dphi/radian; // +0.5 for center of cell
00076
00077 // rcyl is cyl radius for the center of active material in i-th layer
00078 // rsph is spherical rad for the center of active
00079 double rcyl=0, zc=0;
00080 if(sysno%2==0) {
00081 // ** BARREL **
00082 rcyl = layer0CenterDepth + ilayer*layerThickness;
00083 zc = rcyl/tan(theta);
00084 }
00085 else {
00086 // ** ENDCAP **
00087 zc = layer0CenterDepth + ilayer*layerThickness;
00088 // Check for north/south
00089 if(north) zc = -zc;
00090 rcyl = zc*tan(theta);
00091 assert(rcyl >= 0.0);
00092 }
00093
00094
00095 double xc = rcyl*cos(phi);
00096 double yc = rcyl*sin(phi);
00097 G4ThreeVector cellcenter(xc,yc,zc);
00098 return cellcenter;
00099 }
|
|
|
Implements LCDG4CalSD. Definition at line 102 of file LCDG4CalSDProj.cc. References _phiseg, and _thetaseg.
|
|
|
Implements LCDG4CalSD. Definition at line 110 of file LCDG4CalSDProj.cc. References _thetaseg.
00110 {
00111 return cellIndex % _thetaseg;
00112 }
|
|
|
Implements LCDG4CalSD. Definition at line 115 of file LCDG4CalSDProj.cc. References _phiseg, and _thetaseg.
|
|
|
Definition at line 44 of file LCDG4CalSDProj.hh. Referenced by findCell(), getCellCenter(), getIndex1(), and getIndex3(). |
|
|
Definition at line 46 of file LCDG4CalSDProj.hh. Referenced by findCell(), getCellCenter(), getIndex1(), getIndex2(), and getIndex3(). |
1.3.4