- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/microbeam/src/MicrobeamSteppingAction.cc
r1230 r1342 25 25 // 26 26 // ------------------------------------------------------------------- 27 // $Id: MicrobeamSteppingAction.cc,v 1. 9 2008/06/16 07:46:11 sincerti Exp $27 // $Id: MicrobeamSteppingAction.cc,v 1.10 2010/10/07 14:03:11 sincerti Exp $ 28 28 // ------------------------------------------------------------------- 29 29 … … 36 36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 37 37 38 MicrobeamSteppingAction::MicrobeamSteppingAction(MicrobeamRunAction* run,MicrobeamDetectorConstruction* det) 39 :Run(run),Detector(det) 38 MicrobeamSteppingAction::MicrobeamSteppingAction(MicrobeamRunAction* run,MicrobeamDetectorConstruction* det, 39 MicrobeamHistoManager* his) 40 :Run(run),Detector(det),Histo(his) 40 41 { } 41 42 … … 86 87 { 87 88 88 if(aStep->GetTotalEnergyDeposit()>0)89 if( (aStep->GetPreStepPoint()->GetKineticEnergy() - aStep->GetPostStepPoint()->GetKineticEnergy() ) >0) 89 90 { 90 FILE *myFile;91 myFile=fopen("stoppingPower.txt","a"); 92 fprintf(myFile,"%e \n",93 (aStep->GetTotalEnergyDeposit()/keV)/(aStep->GetStepLength()/micrometer));94 fclose (myFile);91 Histo->FillNtuple(0,0,aStep->GetPreStepPoint()->GetKineticEnergy()/keV); 92 Histo->FillNtuple(0,1, 93 (aStep->GetPreStepPoint()->GetKineticEnergy() - 94 aStep->GetPostStepPoint()->GetKineticEnergy())/ keV/(aStep->GetStepLength()/micrometer)); 95 Histo->AddRowNtuple(0); 95 96 } 96 97 97 // Average dE over step s yggested by Michel Maire98 // Average dE over step suggested by Michel Maire 98 99 99 100 G4StepPoint* p1 = aStep->GetPreStepPoint(); … … 111 112 // end 112 113 113 FILE *myFile; 114 myFile=fopen("beamPosition.txt","a"); 115 fprintf 116 ( 117 myFile,"%e %e \n", 118 localPosition.x()/micrometer, 119 localPosition.y()/micrometer 120 ); 121 fclose (myFile); 114 Histo->FillNtuple(1,0,localPosition.x()/micrometer); 115 Histo->FillNtuple(1,1,localPosition.y()/micrometer); 116 Histo->AddRowNtuple(1); 122 117 123 118 } … … 142 137 143 138 { 144 FILE *myFile; 145 myFile=fopen("range.txt","a"); 146 fprintf 147 ( myFile,"%e %e %e\n", 148 (aStep->GetTrack()->GetPosition().x())/micrometer, 149 (aStep->GetTrack()->GetPosition().y())/micrometer, 150 (aStep->GetTrack()->GetPosition().z())/micrometer 151 ); 152 fclose (myFile); 139 Histo->FillNtuple(2,0,aStep->GetPostStepPoint()->GetPosition().x()/micrometer); 140 Histo->FillNtuple(2,1,aStep->GetPostStepPoint()->GetPosition().y()/micrometer); 141 Histo->FillNtuple(2,2,aStep->GetPostStepPoint()->GetPosition().z()/micrometer); 142 Histo->AddRowNtuple(2); 153 143 } 154 144 155 145 // TOTAL DOSE DEPOSIT AND DOSE DEPOSIT WITHIN A PHANTOM VOXEL 146 // FOR ALL PARTICLES 156 147 157 148 if (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physicalNucleus")
Note: See TracChangeset
for help on using the changeset viewer.