81 G4cout<<
"Creating worm plot: "<<fileName<<G4endl;
83 G4cout<<
"xAxis unit vector = "<<
xAxis<<G4endl;
84 G4cout<<
"yAxis unit vector = "<<
yAxis<<G4endl;
85 G4cout<<
"zAxis unit vector = "<<
zAxis<<G4endl;
86 G4cout<<
"x limits = ("<<
xMin/CLHEP::cm<<
", "<<
xMax/CLHEP::cm<<
") cm"<<G4endl;
87 G4cout<<
"y limits = ("<<
yMin/CLHEP::cm<<
", "<<
yMax/CLHEP::cm<<
") cm"<<G4endl;
88 G4cout<<
"z0 position = "<<
z0/CLHEP::cm<<
" cm"<<G4endl;
107 G4int nX(1000), nY(1000);
108 G4double dx = (
xMax -
xMin)/(nX*1.0);
109 G4double dy = (
yMax -
yMin)/(nY*1.0);
110 G4cout<<
"dx = "<<dx/CLHEP::cm<<
", dy = "<<dy/CLHEP::cm<<
" cm"<<G4endl;
113 G4VPhysicalVolume* pWorld = G4TransportationManager::GetTransportationManager()->
114 GetNavigatorForTracking()->GetWorldVolume();
115 G4RegionStore::GetInstance()->UpdateMaterialList(pWorld);
117 G4ProductionCutsTable::GetProductionCutsTable()->UpdateCoupleTable(pWorld);
119 G4ProcessVector* pVector = G4Geantino::GeantinoDefinition()->GetProcessManager()->GetProcessList();
120 for (G4int j=0; j < pVector->size(); ++j) {
121 (*pVector)[j]->BuildPhysicsTable(*(G4Geantino::GeantinoDefinition()));
125 G4GeometryManager* geomManager = G4GeometryManager::GetInstance();
126 geomManager->OpenGeometry();
127 geomManager->CloseGeometry(1,0);
129 G4ThreeVector center(0,0,0);
130 G4Navigator* navigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
131 navigator->LocateGlobalPointAndSetup(center,0,
false);
133 G4StateManager* theStateMan = G4StateManager::GetStateManager();
134 theStateMan->SetNewState(G4State_GeomClosed);
136 TGraph* theGraph =
new TGraph();
137 theGraph->SetMarkerStyle(21);
138 theGraph->SetMarkerSize(0.02);
142 for (G4int iy = 0; iy < nY; iy++) {
145 G4ThreeVector yVect = (iy*dy +
yMin)*
yAxis;
146 G4ThreeVector rayStart = yVect + x0;
151 G4int nI = hIntersections.size();
154 for (G4int j = 0; j < nI; j++) {
156 G4ThreeVector hP = hIntersections[j];
161 theGraph->SetPoint(theGraph->GetN(), hP.dot(
xAxis)/CLHEP::cm, hP.dot(
yAxis)/CLHEP::cm);
169 for (G4int ix = 0; ix < nX; ix++) {
172 G4ThreeVector xVect = (ix*dx +
xMin)*
xAxis;
173 G4ThreeVector rayStart = xVect + y0;
178 G4int nI = vIntersections.size();
180 for (G4int j = 0; j < nI; j++) {
182 G4ThreeVector vP = vIntersections[j];
186 theGraph->SetPoint(theGraph->GetN(), vP.dot(
xAxis)/CLHEP::cm, vP.dot(
yAxis)/CLHEP::cm);
192 TCanvas theCanvas(
"theCanvas",
"", 900, 700);
193 gROOT->SetStyle(
"Plain");
194 gStyle->SetOptStat(0);
195 theCanvas.UseCurrentStyle();
200 TH2D* theHist =
new TH2D(
"axes",
"", 2,
xMin/CLHEP::cm,
xMax/CLHEP::cm, 2,
yMin/CLHEP::cm,
yMax/CLHEP::cm);
201 theHist->SetDirectory(0);
203 xLabel.ReplaceAll(
"\"",
"");
204 yLabel.ReplaceAll(
"\"",
"");
205 theHist->GetXaxis()->SetTitle(xLabel);
206 theHist->GetYaxis()->SetTitle(yLabel);
209 theGraph->Draw(
"psame");
212 theCanvas.Print(fileName);
218 theStateMan->SetNewState(G4State_Idle);
std::vector< G4ThreeVector > findIntersections(const G4ThreeVector &rayPosition, const G4ThreeVector &rayDirection) const