Ignore:
Timestamp:
Nov 5, 2010, 4:08:39 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/advanced/microbeam/src/MicrobeamSteppingAction.cc

    r1230 r1342  
    2525//
    2626// -------------------------------------------------------------------
    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 $
    2828// -------------------------------------------------------------------
    2929
     
    3636//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    3737
    38 MicrobeamSteppingAction::MicrobeamSteppingAction(MicrobeamRunAction* run,MicrobeamDetectorConstruction* det)
    39 :Run(run),Detector(det)
     38MicrobeamSteppingAction::MicrobeamSteppingAction(MicrobeamRunAction* run,MicrobeamDetectorConstruction* det,
     39MicrobeamHistoManager* his)
     40:Run(run),Detector(det),Histo(his)
    4041{ }
    4142
     
    8687        {
    8788       
    88         if(aStep->GetTotalEnergyDeposit()>0)
     89         if( (aStep->GetPreStepPoint()->GetKineticEnergy() - aStep->GetPostStepPoint()->GetKineticEnergy() ) >0)
    8990         {
    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);
    9596         }
    9697
    97          // Average dE over step syggested by Michel Maire
     98         // Average dE over step suggested by Michel Maire
    9899
    99100         G4StepPoint* p1 = aStep->GetPreStepPoint();
     
    111112         // end
    112113
    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);                       
    122117
    123118        }
     
    142137       
    143138        {               
    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);                       
    153143        }
    154144
    155145// TOTAL DOSE DEPOSIT AND DOSE DEPOSIT WITHIN A PHANTOM VOXEL
     146// FOR ALL PARTICLES
    156147
    157148if (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()  == "physicalNucleus")
Note: See TracChangeset for help on using the changeset viewer.