35 #include "DetectorConstruction.hh"
40 #include "CLHEP/Random/Randomize.h"
46 #define countof(x) (sizeof(x) / sizeof(x[0]))
66 :physiWorld(NULL), logicWorld(NULL), solidWorld(NULL)
138 float chromosomePositionSizeRotation[][7] = {
139 {4.467, 2.835, 0, 1.557, 1.557, 1.557, 90},
140 {-4.467, 2.835, 0, 1.557, 1.557, 1.557, 0},
141 {4.423, -2.831, 0, 1.553, 1.553, 1.553, 90},
142 {-4.423, -2.831, 0, 1.553, 1.553, 1.553, 0},
143 {1.455, 5.63, 0, 1.455, 1.455, 1.455, 0},
144 {-1.455, 5.63, 0, 1.455, 1.455, 1.455, 90},
145 {1.435, 0, 1.392, 1.435, 1.435, 1.435, 0},
146 {-1.435, 0, 1.392, 1.435, 1.435, 1.435, 90},
147 {1.407, 0, -1.450, 1.407, 1.407, 1.407, 90},
148 {-1.407, 0, -1.450, 1.407, 1.407, 1.407, 0},
149 {1.380, -5.437, 0, 1.380, 1.380, 1.380, 0},
150 {-1.380, -5.437, 0, 1.380, 1.380, 1.380, 90},
151 {1.347, 2.782, -1.150, 1.347, 1.347, 1.347, 90},
152 {-1.347, 2.782, -1.150, 1.347, 1.347, 1.347, 0},
153 {1.311, -2.746, -1.220, 1.311, 1.311, 1.311, 90},
154 {-1.311, -2.746, -1.220, 1.311, 1.311, 1.311, 0},
155 {7.251, -2.541, 0, 1.275, 1.275, 1.275, 0},
156 {-6.701, 0, -0.85, 1.275, 1.275, 1.275, 90},
157 {4.148, 0, 1.278, 1.278, 1.278, 1.278, 90},
158 {-4.148, 0, 1.278, 1.278, 1.278, 1.278, 0},
159 {4.147, 0, -1.277, 1.277, 1.277, 1.277, 0},
160 {-4.147, 0, -1.277, 1.277, 1.277, 1.277, 90},
161 {8.930, 0.006, 0, 1.272, 1.272, 1.272, 90},
162 {-7.296, 2.547, 0, 1.272, 1.272, 1.272, 90},
163 {1.207, -2.642, 1.298, 1.207, 1.207, 1.207, 0},
164 {-1.207, -2.642, 1.298, 1.207, 1.207, 1.207, 90},
165 {1.176, 2.611, 1.368, 1.176, 1.176, 1.176, 0},
166 {-1.176, 2.611, 1.368, 1.176, 1.176, 1.176, 90},
167 {4.065, 5.547, 0, 1.155, 1.155, 1.155, 90},
168 {-4.065, 5.547, 0, 1.155, 1.155, 1.155, 0},
169 {6.542, 0.159, 1.116, 1.116, 1.116, 1.116, 0},
170 {-9.092, 0, 0, 1.116, 1.116, 1.116, 0},
171 {6.507, 0.159, -1.081, 1.081, 1.081, 1.081, 90},
172 {-7.057, -2.356, 0, 1.081, 1.081, 1.081, 90},
173 {3.824, -5.448, 0, 1.064, 1.064, 1.064, 90},
174 {-3.824, -5.448, 0, 1.064, 1.064, 1.064, 0},
175 {5.883, -5.379, 0, 0.995, 0.995, 0.995, 0},
176 {-9.133, -2.111, 0, 0.995, 0.995, 0.995, 0},
177 {6.215, 5.387, 0, 0.995, 0.995, 0.995, 0},
178 {-6.971, -4.432, 0, 0.995, 0.995, 0.995, 90},
179 {9.583, 2.177, 0, 0.899, 0.899, 0.899, 90},
180 {-9.467, 2.03, 0, 0.899, 0.899, 0.899, 0},
181 {9.440, -2.180, 0, 0.914, 0.914, 0.914, 90},
182 {-6.34, 0, 1.339, 0.914, 0.914, 0.914, 0},
183 {-6.947, 4.742, 0, 0.923, 0.923, 0.923, 90},
184 {7.354, 2.605, 0, 1.330, 1.330, 1.330, 0}
187 rotch->rotateY(90 *
degree);
189 for (
unsigned int i = 0; i <
countof(chromosomePositionSizeRotation); i++)
191 float* p = &chromosomePositionSizeRotation[i][0];
192 float* size = &chromosomePositionSizeRotation[i][3];
193 float rotation = chromosomePositionSizeRotation[i][6];
197 snprintf(name,
countof(name),
"box%d%c", (i / 2) + 1, i % 2 ?
'l' :
'r');
198 G4Box* solidBox =
new G4Box(name, size[0] * micrometer, size[1] * micrometer, size[2] * micrometer);
243 G4float matriceSP1[3][3]={{cos(
n*0.076),-sin(
n*0.076),0},{sin(
n*0.076),cos(
n*0.076),0},{0,0,1}};
246 for(
G4int i=0;i<3;i++)
250 for(
G4int j=0;j<3;j++)
252 sumSP1+=matriceSP1[i][j]*SP1[0][j];
253 sumSP2+=matriceSP1[i][j]*SP1[1][j];
255 matriceSP2[0][i] = sumSP1;
256 matriceSP2[1][i] = sumSP2;
259 for(
G4int i=0;i<3;i++)
261 matriceSP2[0][i]+=heliceSP[i];
262 matriceSP2[1][i]+=heliceSP[i];
267 snprintf(name,
countof(name),
"sugar %d",
n);
271 snprintf(name,
countof(name),
"sugar %d",
n);
284 G4float matriceBP1[3][3]={{cos(
n*0.076),-sin(
n*0.076),0},{sin(
n*0.076),cos(
n*0.076),0},{0,0,1}};
287 for(
G4int i=0;i<3;i++)
291 for(
G4int j=0;j<3;j++)
293 sumBP1+=matriceBP1[i][j]*bp1[0][j];
294 sumBP2+=matriceBP1[i][j]*bp1[1][j];
296 matriceBP2[0][i] = sumBP1;
297 matriceBP2[1][i] = sumBP2;
301 for(
G4int i=0;i<3;i++)
303 matriceBP2[0][i]+=heliceBP[i];
304 matriceBP2[1][i]+=heliceBP[i];
327 for (
G4int i = 0; i < 7; i++) {
329 rotFiber->rotateX(90*
degree);
330 rotFiber->rotateY(i *25.72*
degree);
332 posFiber.rotateZ(i*25.72*degree);
336 rotFiber->rotateX(90 * degree);
337 rotFiber->rotateY((7 + i) * 25.72 *degree);
339 posFiber.rotateZ((7 + i) * 25.72*degree);
343 rotFiber->rotateX(90 * degree);
344 rotFiber->rotateY((25.72 + (i - 14) * 51.43) * degree);
346 posFiber.rotateZ((i - 14) * 51.43 * degree);
350 rotFiber->rotateX(90 * degree);
351 rotFiber->rotateY(180 * degree);
352 rotFiber->rotateY((i - 21) * 51.43 * degree);
354 posFiber.rotateZ((i - 21) * 51.43 * degree);
362 for (
int j = 0; j < 90; j++) {
365 rotStrand1->rotateZ(j*-51.43*
degree);
367 posStrand1.rotateZ(j*51.43*
degree);
371 rotStrand2->rotateZ(j* -51.43*degree);
372 G4ThreeVector posStrand2(-2.7*nanometer,9.35*nanometer,(-68.7*nanometer)+(j*1.67*nanometer));
373 posStrand2.rotateZ(j*51.43*degree);
378 rotHistone->rotateY(90*degree);
379 rotHistone->rotateX(j*(-51.43*degree));
380 G4ThreeVector posHistone(0.0,9.35 *nanometer,(-74.15+ j*1.67)*nanometer);
381 posHistone.rotateZ(j*51.43*degree);
387 for (
int k = 0; k < 22; k++)
389 snprintf(name,
countof(name),
"chromo%d.dat", k + 1);
static G4VisAttributes visWhite(true, G4Colour(1.0, 1.0, 1.0))
static G4VisAttributes visInvCyan(false, G4Colour(0.0, 1.0, 1.0))
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void LoadChromosome(const char *filename, G4VPhysicalVolume *physiBox)
CLHEP::Hep3Vector G4ThreeVector
static G4VisAttributes visInvRed(false, G4Colour(1.0, 0.0, 0.0))
CLHEP::HepRotation G4RotationMatrix
static const double nanometer
G4VPhysicalVolume * Construct()
G4LogicalVolume * logicNucleus
static G4NistManager * Instance()
static G4VisAttributes visCyan(true, G4Colour(0.0, 1.0, 1.0))
G4LogicalVolume * logicSphere3
G4VPhysicalVolume * physiWorld
G4Ellipsoid * solidNucleus
G4LogicalVolume * logicTin
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume * physiBp1[200]
static G4VisAttributes visInvWhite(false, G4Colour(1.0, 1.0, 1.0))
G4VPhysicalVolume * physiBox[48]
G4LogicalVolume * logicSphere4
static G4VisAttributes visInvPink(false, G4Colour(1.0, 0.0, 1.0))
G4LogicalVolume * logicBp2
static G4VisAttributes visInvGreen(false, G4Colour(0.0, 1.0, 0.0))
G4VPhysicalVolume * physiNucleus
static const double micrometer
static G4VisAttributes visGreen(true, G4Colour(0.0, 1.0, 0.0))
G4VPhysicalVolume * physiTin
static const double degree
G4LogicalVolume * logicHistone
G4LogicalVolume * logicBp1
G4LogicalVolume * logicWorld
G4VPhysicalVolume * ConstructDetector()
G4LogicalVolume * logicEnv
static G4VisAttributes visBlue(true, G4Colour(0.0, 0.0, 1.0))
G4VPhysicalVolume * physiBp2[200]
G4Material * waterMaterial
static G4VisAttributes visPink(true, G4Colour(1.0, 0.0, 1.0))
void SetVisAttributes(const G4VisAttributes *pVA)
static const G4double pos
static G4VisAttributes visInvBlue(false, G4Colour(0.0, 0.0, 1.0))
static G4VisAttributes visRed(true, G4Colour(1.0, 0.0, 0.0))
G4LogicalVolume * logicBoxros