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

update ti head

Location:
trunk/examples/advanced/microbeam/src
Files:
3 edited

Legend:

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

    r1337 r1342  
    2525//
    2626// -------------------------------------------------------------------
    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 $
    2828// -------------------------------------------------------------------
    2929
     
    3333#include "MicrobeamEventAction.hh"
    3434#include "MicrobeamRunAction.hh"
     35#include "MicrobeamHistoManager.hh"
    3536
    3637//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    3738
    38 MicrobeamEventAction::MicrobeamEventAction(MicrobeamRunAction* run)
    39   :Run(run),drawFlag("all"),printModulo(10000)
     39MicrobeamEventAction::MicrobeamEventAction(MicrobeamRunAction* run,
     40MicrobeamHistoManager * his)
     41:Run(run),Histo(his),drawFlag("all"),printModulo(10000)
    4042{}
    4143
     
    6466if (Run->GetDoseN()>0 || Run->GetDoseC()>0)
    6567{
    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
    7072        G4cout << "   ===> The incident alpha particle has reached the targeted cell :" << G4endl;
    7173        G4cout << "   -----> total absorbed dose within Nucleus   is (Gy) = " << Run->GetDoseN() << G4endl;
  • trunk/examples/advanced/microbeam/src/MicrobeamRunAction.cc

    r807 r1342  
    2525//
    2626// -------------------------------------------------------------------
    27 // $Id: MicrobeamRunAction.cc,v 1.6 2006/06/29 16:05:37 gunter Exp $
     27// $Id: MicrobeamRunAction.cc,v 1.7 2010/10/07 14:03:11 sincerti Exp $
    2828// -------------------------------------------------------------------
    2929
     
    3636//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    3737
    38 MicrobeamRunAction::MicrobeamRunAction(MicrobeamDetectorConstruction* det)
    39 :Detector(det)
     38MicrobeamRunAction::MicrobeamRunAction(MicrobeamDetectorConstruction* det,
     39MicrobeamHistoManager * his)
     40:Detector(det),Histo(his)
    4041{   
    4142  saveRndm = 0; 
     
    5556
    5657 
     58  // Histograms
     59  Histo->book();
     60
    5761  // save Rndm status
    5862  if (saveRndm > 0)
     
    99103  }   
    100104 
    101   FILE *myFile;
    102   myFile=fopen("3DDose.txt","a");
    103105  for (G4int i=0; i<nbOfPixels; i++)
    104106  { 
     
    106108    v = mapVoxels[i];
    107109    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      }
    109117  }
    110   fclose (myFile);                             
    111    
     118   
    112119  G4cout << "-> Total number of particles detected by the gas detector : " << GetNbOfHitsGas() << G4endl; 
    113120  G4cout << G4endl;   
     121 
     122  //save histograms     
     123  Histo->save();
     124
    114125}
  • 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.