24.3.2010 Kamil Sedlak

New variable "timeToNextEvent" added in order to simulate time differences between subsequent events.
	1)  /gun/meanarrivaltime meanArrivalTime (defines the mean time difference betweent 
                                                  the subsequent events).
        2)  timeToNextEvent - new variable written out to the root tree.

   This new variable is needed for the pile-up studies
This commit is contained in:
2010-03-24 16:21:08 +00:00
parent 29e49736ea
commit d308d597bd
9 changed files with 48 additions and 17 deletions

View File

@ -161,7 +161,7 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
else if (strcmp(tmpString1,"construct")==0){
float x1=0,x2=0,x3=0,x4=0,x5=0,x6=0,x7=0;
float x1=0,x2=0,x3=0,x4=0,x5=0,x6=0,x7=0,x8=0,x9=0,x10=0,x11,x12;
float posx,posy,posz;
char name[100];
char mothersName[100];
@ -333,6 +333,22 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
G4Tubs* solidOuterDetTube = new G4Tubs("SolidOuterDetTube",0.*mm,x2*mm,x3*mm,x4*deg,x5*deg);
solid = new G4SubtractionSolid(solidName, solidOuterDetTube, solidInnerDetBox);
}
else if (strcmp(tmpString2,"GPDcollimator")==0){
// Create a box, from which a box is cut out. x1, x2, x3 = box half-widths;
// x4,x5,x6,x7 define the tube, x8, x9 and x10 are the distances between the tube and box centres.
// x11, x12 are the half-withs of the ractangular opening in the collimator
sscanf(&line[0],"%*s %*s %*s %s %g %g %g %g %g %g %g %g %g %g %g %g %s",
name,&x1,&x2,&x3,&x4,&x5,&x6,&x7,&x8,&x9,&x10,&x11,&x12,material);
sscanf(&line[0],"%*s %*s %*s %*s %*g %*g %*g %*g %*g %*g %*g %*g %*g %*g %*g %*g %*s %g %g %g %s %s %s %d %s",&posx,&posy,&posz,mothersName,rotMatrix,sensitiveDet,&volumeID,actualFieldName);
solidName+=name;
G4Box* solidDetBox = new G4Box("SolidDetBox",x1*mm,x2*mm,x3*mm);
G4Box* solidHole = new G4Box("SolidDetBox",x11*mm,x2*mm+0.1,x12*mm);
G4Tubs* solidDetTube = new G4Tubs("SolidDetTube",0.,x4*mm,x5*mm,x6*deg,x7*deg);
G4RotationMatrix* yRot = new G4RotationMatrix();
G4ThreeVector zTrans(-x8*mm,-x9*mm,-x10*mm);
G4SubtractionSolid* solidPart1 = new G4SubtractionSolid("solidPart1", solidDetBox, solidDetTube, yRot, zTrans);
solid = new G4SubtractionSolid(solidName,solidPart1,solidHole);
}
else if (strcmp(tmpString2,"tubsboxsegm")==0){
// Create a volume that looks like an intersection of tube and box.
char orientation[100];
@ -359,17 +375,6 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
else if (strcmp(tmpString2,"GPDsampleHolderA")==0){
// First part of the GPD sample holder, where posx, posy, posz = centre of the whole (long) tube
// (=111.25mm below the centre of the holes)
// Create a tube, from which center a box is cut out. x1=box half-width; x2,x3,x4,x5 define the tube.
// sscanf(&line[0],"%*s %*s %*s %s %g %g %g %g %g %s %g %g %g %s %s",
// name,&x1,&x2,&x3,&x4,&x5,material,&posx,&posy,&posz,mothersName,rotMatrix);
// sscanf(&line[0],"%*s %*s %*s %*s %*g %*g %*g %*g %*g %*s %*g %*g %*g %*s %*s %s %d %s",sensitiveDet,&volumeID,actualFieldName);
// solidName+=name;
// G4double roundingErr=0.01*mm; // to avoid some displaying problems of the subtracted volumes
// G4Box* solidInnerDetBox = new G4Box("SolidInnerDetBox",x1*mm,x1*mm,x3*mm+roundingErr);
// G4Tubs* solidOuterDetTube = new G4Tubs("SolidOuterDetTube",0.*mm,x2*mm,x3*mm,x4*deg,x5*deg);
// solid = new G4SubtractionSolid(solidName, solidOuterDetTube, solidInnerDetBox);
sscanf(&line[0],"%*s %*s %*s %s %g %g %g %g %g %s %g %g %g %s %s",
name,&x1,&x2,&x3,&x4,&x5,material,&posx,&posy,&posz,mothersName,rotMatrix);
sscanf(&line[0],"%*s %*s %*s %*s %*g %*g %*g %*g %*g %*s %*g %*g %*g %*s %*s %s %d",sensitiveDet,&volumeID);
@ -391,10 +396,6 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
G4SubtractionSolid* solidA123 = new G4SubtractionSolid("solidA123", solidA12 , solidGPDBoxA2, yRotA12, zTransA13);
G4ThreeVector zTransA5(0,0,111.25*mm);
solid = new G4SubtractionSolid(solidName, solidA123, solidGPDBoxA5, yRotA12, zTransA5);
//G4cout<<"solidName="<<solidName<<" solidA123="<<solidA123<<" solidGPDBoxA5="<<solidGPDBoxA5<<" yRotA12="<<yRotA12<<" zTransA5="<<zTransA5<<G4endl;
//solid = new G4SubtractionSolid(solidName, solidGPDTubeA1, solidGPDBoxA2, yRotA12, zTransA12);
G4cout<<"Debug 80"<<G4endl;
}
else ReportGeometryProblem(line);