Message: Re: Recording the data in output file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Recording the data in output file 

Forum: Analysis
Re: None Recording the data in output file (Bauyrzhan Yessenov)
Re: None Re: Recording the data in output file (Ivana Hrivnacova)
Re: None Re: Recording the data in output file (Bauyrzhan Yessenov)
Date: 24 Apr, 2015
From: Bauyrzhan Yessenov <Bauyrzhan Yessenov>

Hi, Ivana Hrivnacova!
Firstly, I would like to say thank to you for your help with writing data in output file. 
I used your advice, and I have watched Examples, and ANAEX01, ANAEX02, ANAEX03. 
Yesterday, I tried to write the code, but I am having a question for you: 
this my code: 
 if (particleType == G4Proton::Definition())
         {

           G4double Ep = (step->GetPreStepPoint()->GetKineticEnergy());

            //G4cout << "Proton" ;  
            edepStep = a*Ep - b*(f-std::exp(-cc*std::pow(Ep,dd)));
            edepStep2 = a*Ep - b*(f-std::exp(-cc*std::pow(Ep,dd)));
            step->GetTrack()->SetTrackStatus(fKillTrackAndSecondaries);    
        }

  else if (particleType == G4Gamma::Definition() || particleType == G4Electron::Definition() || particleType == G4Positron::Definition()) 
{

              edepStep2  = step->GetTotalEnergyDeposit();
              edepStep1 = step->GetTotalEnergyDeposit();     
         //write data // &#1089;&#1076;&#1077;&#1083;&#1072;&#1090;&#1100; &#1087;&#1086;&#1087;&#1088;&#1072;&#1074;&#1082;&#1091; &#1085;&#1072; &#1076;&#1088;&#1091;&#1075;&#1086;&#1088;&#1077; &#1088;&#1072;&#1089;&#1096;&#1080;&#1088;&#1077;&#1085;&#1080;&#1077; -----
               std::ofstream WriteDataIn("BGO_gamma_electron_positron.txt", std::ios::app);
               WriteDataIn	<< edepStep1  << '\t' << "   " << G4endl; 
        }
now I don't understand what "ios::app" is. Can You explain me? 
After running the code, firstly it creates the file named "BGO_gamma_electron_positron.txt", but inside of file there are a lot of nubers, and unfortunately I don't understand what the numbers are. 
Here, "edepstep" has an unit of MeV, and My Particle Energy is 15 MeV. 
now I will be sending my txt file with data. 
Best wishes, Bauyrzhan Yessenov!

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/04/24/00.40-61120-mma_electron_positron.txt

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Recording the data in output file   (Ivana Hrivnacova - 28 Apr, 2015)
 Add Message Add Message
to: "Re: Recording the data in output file"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]