Changeset 157 for GLBFrejus/HEAD/data/4.5GeV/convert.C
- Timestamp:
- Jun 6, 2006, 2:50:17 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GLBFrejus/HEAD/data/4.5GeV/convert.C
r153 r157 1 1 { 2 ifstream vInput("spectreMinus.out"); 3 ofstream vOutput("SPL45GeVMinus.dat"); 2 3 ifstream fIn; 4 fIn.open("spectre45minus.out"); 5 if (!fIn) { 6 std::cout << "Input file cannot be opened.\n"; 7 return; 8 } 4 9 5 Int_t ibin; 6 Float_t ene; 7 Float_t nue, numu, nutau; 8 Float_t anue, anumu, anutau; 9 nutau = 0.; 10 anutau = 0.; 10 double bin,ene,numu,anumu,nue,anue,nutau,anutau = 0; 11 double scale; // 100km -> 130km 1/L**2 law 11 12 12 Int_t line=0; 13 while (1) { 14 vInput >> ibin >> ene >> numu >> anumu >> nue >> anue; 15 if (!vInput.good()) break; 16 line++; 17 vOutput.width(8); 18 vOutput.precision(4); 19 vOutput.setf(ios_base::scientific, ios_base::floatfield); 20 vOutput << ene << " " 21 << nue << " " 22 << numu << " " 23 << nutau << " " 24 << anue << " " 25 << anumu << " " 26 << anutau << "\n"; 13 scale = (100.0/130.0); 14 scale *= scale; 15 16 17 while (!fIn.eof()) { 18 fIn >> bin 19 >> ene 20 >> numu 21 >> anumu 22 >> nue 23 >> anue; 24 printf("%.2f %.4e %.4e %.4e %.4e %.4e %.4e\n",ene,nue*scale,numu*scale,nutau,anue*scale,anumu*scale,anutau); 27 25 }//while 28 26 29 nue = 0.; 30 numu = 0.; 31 anue = 0.; 32 anumu = 0.; 33 for (; line<501; line++) { 34 ene += 0.020; 35 vOutput.width(8); 36 vOutput.precision(4); 37 vOutput.setf(ios_base::scientific, ios_base::floatfield); 38 vOutput << ene << " " 39 << nue << " " 40 << numu << " " 41 << nutau << " " 42 << anue << " " 43 << anumu << " " 44 << anutau << "\n"; 27 while (bin!=501) { 28 bin++; 29 ene +=0.02; 30 nue=0.; 31 numu=0.; 32 anue=0.; 33 anumu=0.; 34 printf("%.2f %.4e %.4e %.4e %.4e %.4e %.4e\n",ene,nue*scale,numu*scale,nutau,anue*scale,anumu*scale,anutau); 45 35 } 46 47 vOutput.close(); 48 vInput.close(); 49 50 } 36 }//eo macro
Note: See TracChangeset
for help on using the changeset viewer.