Changeset 1342 for trunk/examples/advanced/microbeam/src
- Timestamp:
- Nov 5, 2010, 4:08:39 PM (15 years ago)
- Location:
- trunk/examples/advanced/microbeam/src
- Files:
-
- 3 edited
-
MicrobeamEventAction.cc (modified) (3 diffs)
-
MicrobeamRunAction.cc (modified) (5 diffs)
-
MicrobeamSteppingAction.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/microbeam/src/MicrobeamEventAction.cc
r1337 r1342 25 25 // 26 26 // ------------------------------------------------------------------- 27 // $Id: MicrobeamEventAction.cc,v 1. 8 2010/06/07 03:18:01 sincerti Exp $27 // $Id: MicrobeamEventAction.cc,v 1.9 2010/10/07 14:03:11 sincerti Exp $ 28 28 // ------------------------------------------------------------------- 29 29 … … 33 33 #include "MicrobeamEventAction.hh" 34 34 #include "MicrobeamRunAction.hh" 35 #include "MicrobeamHistoManager.hh" 35 36 36 37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 37 38 38 MicrobeamEventAction::MicrobeamEventAction(MicrobeamRunAction* run) 39 :Run(run),drawFlag("all"),printModulo(10000) 39 MicrobeamEventAction::MicrobeamEventAction(MicrobeamRunAction* run, 40 MicrobeamHistoManager * his) 41 :Run(run),Histo(his),drawFlag("all"),printModulo(10000) 40 42 {} 41 43 … … 64 66 if (Run->GetDoseN()>0 || Run->GetDoseC()>0) 65 67 { 66 FILE* myFile;67 myFile=fopen("dose.txt","a");68 fprintf(myFile,"%e %e\n",Run->GetDoseN(),Run->GetDoseC()); 69 fclose (myFile); 68 Histo->FillNtuple(3,0,Run->GetDoseN()); 69 Histo->FillNtuple(3,1,Run->GetDoseC()); 70 Histo->AddRowNtuple(3); 71 70 72 G4cout << " ===> The incident alpha particle has reached the targeted cell :" << G4endl; 71 73 G4cout << " -----> total absorbed dose within Nucleus is (Gy) = " << Run->GetDoseN() << G4endl; -
trunk/examples/advanced/microbeam/src/MicrobeamRunAction.cc
r807 r1342 25 25 // 26 26 // ------------------------------------------------------------------- 27 // $Id: MicrobeamRunAction.cc,v 1. 6 2006/06/29 16:05:37 gunterExp $27 // $Id: MicrobeamRunAction.cc,v 1.7 2010/10/07 14:03:11 sincerti Exp $ 28 28 // ------------------------------------------------------------------- 29 29 … … 36 36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 37 37 38 MicrobeamRunAction::MicrobeamRunAction(MicrobeamDetectorConstruction* det) 39 :Detector(det) 38 MicrobeamRunAction::MicrobeamRunAction(MicrobeamDetectorConstruction* det, 39 MicrobeamHistoManager * his) 40 :Detector(det),Histo(his) 40 41 { 41 42 saveRndm = 0; … … 55 56 { 56 57 58 // Histograms 59 Histo->book(); 60 57 61 // save Rndm status 58 62 if (saveRndm > 0) … … 99 103 } 100 104 101 FILE *myFile;102 myFile=fopen("3DDose.txt","a");103 105 for (G4int i=0; i<nbOfPixels; i++) 104 106 { … … 106 108 v = mapVoxels[i]; 107 109 if ( (GetNumEvent()+1) !=0) 108 fprintf (myFile,"%f %f %f %f \n", v.x(), v.y(), v.z(), dose3DDose[i]/(GetNumEvent()+1)); 110 { 111 Histo->FillNtuple(4,0,v.x()); 112 Histo->FillNtuple(4,1,v.y()); 113 Histo->FillNtuple(4,2,v.z()); 114 Histo->FillNtuple(4,3,dose3DDose[i]/(GetNumEvent()+1)); 115 Histo->AddRowNtuple(4); 116 } 109 117 } 110 fclose (myFile); 111 118 112 119 G4cout << "-> Total number of particles detected by the gas detector : " << GetNbOfHitsGas() << G4endl; 113 120 G4cout << G4endl; 121 122 //save histograms 123 Histo->save(); 124 114 125 } -
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.
