diff --git a/Inputs/DetectorConfiguration/Tiara.detector b/Inputs/DetectorConfiguration/Tiara.detector index 5ed97fb7230e0467bf82278a093b085f2effad13..53c11b848480fab074a0486ce8e5abc8b0dcc7f3 100644 --- a/Inputs/DetectorConfiguration/Tiara.detector +++ b/Inputs/DetectorConfiguration/Tiara.detector @@ -14,9 +14,9 @@ Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Tiara - TiaraInnerBarrel= 0 - TiaraOuterBarrel= 0 - TiaraChamber= 0 + TiaraInnerBarrel= 1 + TiaraOuterBarrel= 1 + TiaraChamber= 1 TiaraHyballWedge Z= -147 R= 0 diff --git a/NPSimulation/Simulation.cc b/NPSimulation/Simulation.cc index d9d0164f3fd7987cee857ccb1bffcdd7ff33ac32..e54782db2b99dfe8f18d30ea6f276db33e67e80d 100644 --- a/NPSimulation/Simulation.cc +++ b/NPSimulation/Simulation.cc @@ -92,44 +92,23 @@ int main(int argc, char** argv){ event_action->SetDetector(detector) ; runManager->SetUserAction(event_action) ; - /////////////////////////////////////////////////////////////// - /////// Get the pointer to the User Interface manager //////// - /////////////////////////////////////////////////////////////// - // G4UImanager* UI = G4UImanager::GetUIpointer(); - /////////////////////////////////////////////////////////////// /////////// Define UI terminal for interactive mode /////////// /////////////////////////////////////////////////////////////// -#ifdef G4VIS_USE - //G4VisManager* visManager = new G4VisExecutive("Quiet"); - G4VisManager* visManager = new G4VisExecutive(); - visManager->Initialize(); -#endif - - /* G4UIsession* session = 0; - - #ifdef G4UI_USE_TCSH - session = new G4UIterminal(new G4UItcsh); - #else - session = new G4UIterminal(); - #endif - - UI->ApplyCommand("/control/execute vis.mac"); - session->SessionStart(); - delete session; - */ - // interactive mode : define UI session // Get the pointer to the User Interface manager G4UImanager* UImanager = G4UImanager::GetUIpointer(); + cout << UImanager->GetVerboseLevel() << endl ; #ifdef G4UI_USE G4UIExecutive* ui = new G4UIExecutive(argc, argv); #ifdef G4VIS_USE + G4VisManager* visManager = new G4VisExecutive("Quiet"); + visManager->Initialize(); UImanager->ApplyCommand("/control/execute vis.mac"); #endif if (ui->IsGUI()) UImanager->ApplyCommand("/control/execute gui.mac"); - ui->SessionStart(); + ui->SessionStart(); delete ui; #endif diff --git a/NPSimulation/Tiara/Tiara.cc b/NPSimulation/Tiara/Tiara.cc index f93e53da22b20c11c60a43b193722c3c6867eab3..8f87ec61441b90e14b1b35b67b6dabf337966848 100644 --- a/NPSimulation/Tiara/Tiara.cc +++ b/NPSimulation/Tiara/Tiara.cc @@ -281,9 +281,6 @@ void Tiara::ReadSensitive(const G4Event* event){ } // Clear Map for next event HyballHitMap->clear(); - - - } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -384,7 +381,7 @@ void Tiara::ConstructInnerBarrel(G4LogicalVolume* world){ // The Silicon Wafer itself G4Box* InertWaferFull = new G4Box("InertWaferFull", INNERBARREL_InertWafer_Width/2., - INNERBARREL_ActiveWafer_Thickness/2., + INNERBARREL_InertWafer_Thickness/2., INNERBARREL_InertWafer_Length/2.); G4Box* ActiveWafer = new G4Box("ActiveWafer", @@ -392,6 +389,11 @@ void Tiara::ConstructInnerBarrel(G4LogicalVolume* world){ INNERBARREL_ActiveWafer_Thickness/2., INNERBARREL_ActiveWafer_Length/2.); + G4Box* DeadLayer = new G4Box("DeadLayer", + INNERBARREL_ActiveWafer_Width/2., + INNERBARREL_ActiveWafer_DeadLayerThickness/2., + INNERBARREL_ActiveWafer_Length/2.); + G4Box* ActiveWaferShape = new G4Box("ActiveWaferShape", INNERBARREL_ActiveWafer_Width/2., INNERBARREL_PCB_Thickness/2., @@ -431,37 +433,57 @@ void Tiara::ConstructInnerBarrel(G4LogicalVolume* world){ new G4LogicalVolume(ActiveWafer,m_MaterialSilicon,"logicActiveWafer", 0, 0, 0); logicActiveWafer->SetVisAttributes(SiliconVisAtt); + G4LogicalVolume* logicDeadLayer = + new G4LogicalVolume(DeadLayer,m_MaterialSilicon,"logicActiveWaferDeadLayer", 0, 0, 0); + logicDeadLayer->SetVisAttributes(SiliconVisAtt); + // Set the sensitive volume logicActiveWafer->SetSensitiveDetector(m_InnerBarrelScorer); - // The Distance from target is given by half the lenght of a detector - // plus the length of a detector inclined by 45 deg. - G4double DistanceFromTarget = INNERBARREL_PCB_Width*(0.5+sin(45*deg)) ; - - for( unsigned int i = 0; i < 8; i ++){ - // Place the sub volumes in the master volume - // Last argument is the detector number, used in the scorer to get the - // revelant information - new G4PVPlacement(new G4RotationMatrix(0,0,0), + // Place the sub volumes in the master volume + // Last argument is the detector number, used in the scorer to get the + // revelant information + new G4PVPlacement(new G4RotationMatrix(0,0,0), G4ThreeVector(0,0,0), logicPCB,"Tiara_Barrel_PCB",logicBarrelDetector, - false,i+1); + false,0); + G4ThreeVector WaferPosition(0, + 0.5*(INNERBARREL_PCB_Thickness-INNERBARREL_PCB_WaferDepth+INNERBARREL_ActiveWafer_Thickness) + ,0); - G4ThreeVector WaferPosition(0,0.5*(INNERBARREL_PCB_Thickness-INNERBARREL_PCB_WaferDepth+INNERBARREL_ActiveWafer_Thickness),0); + G4ThreeVector DeadLayerPositionF = WaferPosition + G4ThreeVector(0,-INNERBARREL_ActiveWafer_Thickness*0.5-INNERBARREL_ActiveWafer_DeadLayerThickness*0.5,0); - new G4PVPlacement(new G4RotationMatrix(0,0,0), + G4ThreeVector DeadLayerPositionB = WaferPosition + G4ThreeVector(0,INNERBARREL_ActiveWafer_Thickness*0.5+INNERBARREL_ActiveWafer_DeadLayerThickness*0.5,0); + + + + new G4PVPlacement(new G4RotationMatrix(0,0,0), WaferPosition, logicActiveWafer,"Barrel_Wafer", - logicBarrelDetector,false,i+1); + logicBarrelDetector,false,0); - new G4PVPlacement(new G4RotationMatrix(0,0,0), + new G4PVPlacement(new G4RotationMatrix(0,0,0), + DeadLayerPositionF, + logicDeadLayer,"Barrel_WaferDeadLayer", + logicBarrelDetector,false,0); + + new G4PVPlacement(new G4RotationMatrix(0,0,0), + DeadLayerPositionB, + logicDeadLayer,"Barrel_WaferDeadLayer", + logicBarrelDetector,false,0); + + + new G4PVPlacement(new G4RotationMatrix(0,0,0), WaferPosition, logicInertWafer,"Barrel_Wafer_GuardRing", - logicBarrelDetector,false,i+1); + logicBarrelDetector,false,0); - - // The following build the barrel, with detector one at the top + // The Distance from target is given by half the lenght of a detector + // plus the length of a detector inclined by 45 deg. + G4double DistanceFromTarget = INNERBARREL_PCB_Width*(0.5+sin(45*deg)) ; + for( unsigned int i = 0; i < 8; i ++){ + // The following build the barrel, with detector one at the top // and going clowise looking upstrea // Detector are rotate by 45deg with each other diff --git a/NPSimulation/Tiara/Tiara.hh b/NPSimulation/Tiara/Tiara.hh index 4639241d62b37d7029f690f45bc10b766ea15c03..8dc947ac5aebcb6a45778d1c60435f6406efaa4d 100644 --- a/NPSimulation/Tiara/Tiara.hh +++ b/NPSimulation/Tiara/Tiara.hh @@ -84,8 +84,11 @@ namespace TIARA const G4double INNERBARREL_ActiveWafer_Thickness =400*um; const G4double INNERBARREL_InertWafer_Length = 97.00*mm; const G4double INNERBARREL_InertWafer_Width = 24.80*mm; + const G4double INNERBARREL_ActiveWafer_DeadLayerThickness = 1*um; + const G4double INNERBARREL_InertWafer_Thickness = + INNERBARREL_ActiveWafer_Thickness+ 2*INNERBARREL_ActiveWafer_DeadLayerThickness; const G4int INNERBARREL_NumberOfStrip = 4; - + // Outer Barrel // const G4double OUTERBARREL_PCB_Length = 98.00*mm; const G4double OUTERBARREL_PCB_Width = 33.16*mm; diff --git a/NPSimulation/gui.mac b/NPSimulation/gui.mac index bcd47fd54c458f7e2869fa6f8d33c23b634de0cb..1bed7bd6911fc28c4e45a0aa73bd9f5232e2aed1 100644 --- a/NPSimulation/gui.mac +++ b/NPSimulation/gui.mac @@ -6,20 +6,38 @@ # File # # -# Vis menu : -/gui/addMenu vis Vis -/gui/addButton vis DAWNFILE "/control/execute visTutor/exN03Vis0.mac" -/gui/addButton vis OpenInventor "/control/execute visTutor/exN03Vis5.mac" -/gui/addButton vis TimeSlicing "/control/execute visTutor/exN03Vis12.mac" -/gui/addButton vis EmShower "/control/execute visTutor/exN03Vis13.mac" -# + # Viewer menu : /gui/addMenu viewer Viewer +/gui/addButton viewer "New viewer" "/control/execute vis.mac" /gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface" -/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wire" -/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh" -/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update" -/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush" -/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers" -# -# To limit the output flow in the "dump" widget : +/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wireframe" + +/gui/addMenu tracking Tracking +/gui/addButton tracking "Set Tracking verbose" "/tracking/verbose" + +/gui/addMenu run Run +/gui/addButton run "Run beam on" "/run/beamOn" + +/gui/addMenu custom "Custom View" +/gui/addButton custom "Add Axis" "/vis/scene/add/axes" +/gui/addButton custom "Add Beam axis" "/vis/scene/add/arrow 0 0 -1 0 0 1 m" +/gui/addButton custom "Add Scorer Hits" "/vis/scene/add/psHits" +/gui/addButton custom "Add Hits" "/vis/scene/add/hits" +/gui/addButton custom "Add Event ID" "/vis/scene/add/eventID" + +/gui/addIcon "Exit" user_icon "exit" icons/power.png +/gui/addIcon "There is nothing here" user_icon "/" icons/empty.png +/gui/addIcon "Run beam on" user_icon "/run/beamOn" icons/rocket.png +/gui/addIcon "One event" user_icon "/run/beamOn 1" icons/play.png +/gui/addIcon "Seriously?" user_icon "/" icons/empty.png +/gui/addIcon "Activate tracking verbose" user_icon "/tracking/verbose 1" icons/shoeprints.png +/gui/addIcon "Only borring emptyness" user_icon "/" icons/empty.png +/gui/addIcon "Home" user_icon "/vis/viewer/set/viewpointThetaPhi 45. 45." icons/videocameraclassic.png +/gui/addIcon "Front" user_icon "/vis/viewer/set/viewpointThetaPhi 0. 0." icons/arrow-up.png +/gui/addIcon "Back" user_icon "/vis/viewer/set/viewpointThetaPhi 180. 0." icons/arrow-down.png +/gui/addIcon "Left" user_icon "/vis/viewer/set/viewpointThetaPhi 90. 0." icons/arrow-left.png +/gui/addIcon "Right" user_icon "/vis/viewer/set/viewpointThetaPhi -90. 0." icons/arrow-right.png +/gui/addIcon "Zoom in" user_icon "/vis/viewer/zoom 2" icons/zoomin.png +/gui/addIcon "Zoom out" user_icon "/vis/viewer/zoom 0.5" icons/zoomout.png + diff --git a/NPSimulation/icons/arrow-down.png b/NPSimulation/icons/arrow-down.png new file mode 100644 index 0000000000000000000000000000000000000000..4abf2bee41abb69f2fc9720cea87cd9fa17a3f36 Binary files /dev/null and b/NPSimulation/icons/arrow-down.png differ diff --git a/NPSimulation/icons/arrow-left.png b/NPSimulation/icons/arrow-left.png new file mode 100644 index 0000000000000000000000000000000000000000..cf33677a9fbd04288f252556e9bea958e681d363 Binary files /dev/null and b/NPSimulation/icons/arrow-left.png differ diff --git a/NPSimulation/icons/arrow-right.png b/NPSimulation/icons/arrow-right.png new file mode 100644 index 0000000000000000000000000000000000000000..13882b6302ea37ec11ae3f9bf30186c2b7728fd5 Binary files /dev/null and b/NPSimulation/icons/arrow-right.png differ diff --git a/NPSimulation/icons/arrow-up.png b/NPSimulation/icons/arrow-up.png new file mode 100644 index 0000000000000000000000000000000000000000..7c803ed5c165c970942a17a80fd3b281f8c90e13 Binary files /dev/null and b/NPSimulation/icons/arrow-up.png differ diff --git a/NPSimulation/icons/empty.png b/NPSimulation/icons/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..784793a9fb00eedc68ed89b310d9ce2a98400f2d Binary files /dev/null and b/NPSimulation/icons/empty.png differ diff --git a/NPSimulation/icons/play.png b/NPSimulation/icons/play.png new file mode 100644 index 0000000000000000000000000000000000000000..dd60f1c2dde40910378e16b4258b2fed1b2656fb Binary files /dev/null and b/NPSimulation/icons/play.png differ diff --git a/NPSimulation/icons/power.png b/NPSimulation/icons/power.png new file mode 100644 index 0000000000000000000000000000000000000000..f379b4b3c5f12c4cea5229e07259dcd0024adc10 Binary files /dev/null and b/NPSimulation/icons/power.png differ diff --git a/NPSimulation/icons/rocket.png b/NPSimulation/icons/rocket.png new file mode 100644 index 0000000000000000000000000000000000000000..3960f0fce3f5d3274eba390d33ada7180cf1a28b Binary files /dev/null and b/NPSimulation/icons/rocket.png differ diff --git a/NPSimulation/icons/shoeprints.png b/NPSimulation/icons/shoeprints.png new file mode 100644 index 0000000000000000000000000000000000000000..b3a70a399c7fc3d568b7f4b165353d91cae21ba4 Binary files /dev/null and b/NPSimulation/icons/shoeprints.png differ diff --git a/NPSimulation/icons/videocameraclassic.png b/NPSimulation/icons/videocameraclassic.png new file mode 100644 index 0000000000000000000000000000000000000000..efa1c44bb8854f86ab48682ba1236f9b28c60888 Binary files /dev/null and b/NPSimulation/icons/videocameraclassic.png differ diff --git a/NPSimulation/icons/zoomin.png b/NPSimulation/icons/zoomin.png new file mode 100644 index 0000000000000000000000000000000000000000..265c9a2d9e7e89ccfe483a3402bcff31e0b30c22 Binary files /dev/null and b/NPSimulation/icons/zoomin.png differ diff --git a/NPSimulation/icons/zoomout.png b/NPSimulation/icons/zoomout.png new file mode 100644 index 0000000000000000000000000000000000000000..62e3a7a6bbedf649fc559488b5e99ecf68dbca88 Binary files /dev/null and b/NPSimulation/icons/zoomout.png differ diff --git a/NPSimulation/src/EventAction.cc b/NPSimulation/src/EventAction.cc index b2a0dd506f9fbdc7a7df529335f117d9d3807417..5e96f1b7658727718cd7d009a161cd6d489755ce 100644 --- a/NPSimulation/src/EventAction.cc +++ b/NPSimulation/src/EventAction.cc @@ -53,7 +53,7 @@ void EventAction::BeginOfEventAction(const G4Event* event){ if ((event->GetEventID() + 1) % m_printModulo == 0) // G4cout << "Event: " << event->GetEventID() + 1 << G4endl; - cout << "\rEvent: " << event->GetEventID() + 1 << flush; + G4cout << "\rEvent: " << event->GetEventID() + 1 << flush; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/NPSimulation/vis.mac b/NPSimulation/vis.mac index 33d6932b1b2c5ba5b5237eaf5c713c8a178686d5..0571566bbd2b486550caa02102b002c9ac6ce7b8 100644 --- a/NPSimulation/vis.mac +++ b/NPSimulation/vis.mac @@ -3,12 +3,12 @@ # # Sets some default verbose # -/control/verbose 2 +/control/verbose 0 /control/saveHistory -/run/verbose 2 +/run/verbose 0 # # Use this open statement to create an OpenGL view: -/vis/open OGLI 600x600-0+0 +/vis/open OGLI 1200x600-0+0 # # Use this open statement to create a .prim file suitable for # viewing in DAWN: @@ -31,16 +31,16 @@ /vis/drawVolume # # Specify view angle: -/vis/viewer/set/viewpointThetaPhi 0. 90. +/vis/viewer/set/viewpointThetaPhi 45. 45. # # Specify zoom value: -/vis/viewer/zoom 2. +/vis/viewer/zoom 1. # # Specify style (surface or wireframe): /vis/viewer/set/style surface # # Draw coordinate axes: -/vis/scene/add/axes 0 0 0 20 cm +#/vis/scene/add/axes 0 0 0 20 cm # # Draw smooth trajectories at end of event, showing trajectory points # as markers 2 pixels wide: @@ -71,7 +71,7 @@ # # Re-establish auto refreshing and verbosity: /vis/viewer/set/autoRefresh true -#/vis/verbose 0 +/vis/verbose 0 # # For file-based drivers, use this to create an empty detector view: #/vis/viewer/flush