Rev 117 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 117 | Rev 128 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | namespace HepMC { |
16 | namespace HepMC { |
| 17 | 17 | ||
| 18 | IO_ExtendedAscii::IO_ExtendedAscii( const char* filename, std::ios::openmode mode ) |
18 | IO_ExtendedAscii::IO_ExtendedAscii( const char* filename, std::ios::openmode mode ) |
| 19 | : m_mode(mode), m_file(filename, mode), m_finished_first_event_io(0) |
19 | : m_mode(mode), m_file(filename, mode), m_finished_first_event_io(0) |
| 20 | {
|
20 | {
|
| - | 21 | std::cout << "-------------------------------------------------------" << std::endl; |
|
| - | 22 | std::cout << "Use of HepMC/IO_ExtendedAscii is deprecated" << std::endl; |
|
| - | 23 | std::cout << "-------------------------------------------------------" << std::endl; |
|
| 21 | if ( (m_mode&std::ios::out && m_mode&std::ios::in) || |
24 | if ( (m_mode&std::ios::out && m_mode&std::ios::in) || |
| 22 | (m_mode&std::ios::app && m_mode&std::ios::in) ) { |
25 | (m_mode&std::ios::app && m_mode&std::ios::in) ) { |
| 23 | std::cerr << "IO_ExtendedAscii::IO_ExtendedAscii Error, open of file requested " |
26 | std::cerr << "IO_ExtendedAscii::IO_ExtendedAscii Error, open of file requested " |
| 24 | << "of input AND output type. Not allowed. Closing file." |
27 | << "of input AND output type. Not allowed. Closing file." |
| 25 | << std::endl; |
28 | << std::endl; |
| 26 | m_file.close(); |
29 | m_file.close(); |
| - | 30 | return; |
|
| 27 | }
|
31 | }
|
| 28 | // precision 16 (# digits following decimal point) is the minimum that
|
32 | // precision 16 (# digits following decimal point) is the minimum that
|
| 29 | // will capture the full information stored in a double
|
33 | // will capture the full information stored in a double
|
| 30 | m_file.precision(16); |
34 | m_file.precision(16); |
| 31 | // we use decimal to store integers, because it is smaller than hex!
|
35 | // we use decimal to store integers, because it is smaller than hex!
|
| Line 561... | Line 565... | ||
| 561 | // read values into temp variables, then create a new PdfInfo object
|
565 | // read values into temp variables, then create a new PdfInfo object
|
| 562 | int id1 =0, id2 =0; |
566 | int id1 =0, id2 =0; |
| 563 | double x1 = 0., x2 = 0., scale = 0., pdf1 = 0., pdf2 = 0.; |
567 | double x1 = 0., x2 = 0., scale = 0., pdf1 = 0., pdf2 = 0.; |
| 564 | m_file >> id1 >> id2 >> x1 >> x2 >> scale >> pdf1 >> pdf2; |
568 | m_file >> id1 >> id2 >> x1 >> x2 >> scale >> pdf1 >> pdf2; |
| 565 | m_file.ignore(2,'\n'); |
569 | m_file.ignore(2,'\n'); |
| 566 | //std::cout << "read " << id1 << std::endl;
|
- | |
| 567 | if( id1 == 0 ) return 0; |
570 | if( id1 == 0 ) return 0; |
| 568 | PdfInfo* pdf = new PdfInfo( id1, id2, x1, x2, scale, pdf1, pdf2); |
571 | PdfInfo* pdf = new PdfInfo( id1, id2, x1, x2, scale, pdf1, pdf2); |
| 569 | //
|
572 | //
|
| 570 | return pdf; |
573 | return pdf; |
| 571 | }
|
574 | }
|