Changeset 454 in svn
- Timestamp:
- Jul 9, 2009, 4:04:59 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/SmearUtil.h
r443 r454 226 226 227 227 string PdgTableFilename; 228 //map<int,PdgParticle> PdgTable;229 228 PdgTable PDGtable; 229 string inputfilelist, detectorcard, triggercard; 230 230 231 231 // to sort a vector -
trunk/src/SmearUtil.cc
r443 r454 45 45 #include <iomanip> 46 46 #include <map> 47 #include <vector> 47 48 using namespace std; 48 49 … … 207 208 208 209 PdgTableFilename = "data/particle.tbl"; 209 210 inputfilelist = ""; 211 detectorcard = ""; 212 triggercard = ""; 210 213 } 211 214 … … 352 355 PdgTableFilename = DET.PdgTableFilename; 353 356 PDGtable = DET.PDGtable; 357 inputfilelist = DET.inputfilelist; 358 detectorcard = DET.detectorcard; 359 triggercard = DET.triggercard; 354 360 } 355 361 … … 497 503 PdgTableFilename = DET.PdgTableFilename; 498 504 PDGtable = DET.PDGtable; 505 506 inputfilelist = DET.inputfilelist; 507 detectorcard = DET.detectorcard; 508 triggercard = DET.triggercard; 509 499 510 return *this; 500 511 } 501 512 502 503 513 void RESOLution::setNames(const string& list, const string& det, const string& trig) { 514 inputfilelist = list; 515 detectorcard = det; 516 triggercard = trig; 517 } 504 518 505 519 //------------------------------------------------------------------------------ … … 648 662 649 663 void RESOLution::Logfile(const string& LogName) { 650 //void RESOLution::Logfile(string outputfilename) { 651 664 665 // creates the list of good input files 666 // this list is vector<string> inputfiles. 667 ifstream infile(inputfilelist.c_str()); 668 vector<string> inputfiles; 669 string filename; 670 while(1) { 671 infile >> filename; // reads the first line of the list 672 if(!infile.good()) break; // quits when at the end of the list 673 ifstream checking_the_file(filename.c_str()); // try to open the file 674 if(!checking_the_file.good()) continue; // skips bad/unknown files 675 else checking_the_file.close(); // close file if found 676 inputfiles.push_back(filename); // append the name to the vector 677 } 678 infile.close(); 679 652 680 ofstream f_out(LogName.c_str()); 653 681 … … 704 732 f_out <<"** **"<< endl; 705 733 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n"; 706 f_out<<"# Input PDG table : " << PdgTableFilename << " *"<<"\n"; 734 f_out <<"* *"<< endl; 735 f_out <<"#******************************** *"<<"\n"; 736 f_out <<"# Input files *"<<"\n"; 737 f_out <<"#******************************** *"<<"\n"; 738 f_out << left << setw(22) <<"* Input list "<<"" 739 << left << setw(39) << inputfilelist << "" << right << setw(9) << "*"<<"\n"; 740 for (unsigned int i =0; i<inputfiles.size(); i++) { 741 f_out << left << setw(22) <<"* - file "<<"" 742 << left << setw(43) << inputfiles[i] << "" << right << setw(5) << "*"<<"\n"; 743 } 744 if(detectorcard != "") 745 f_out << left << setw(22) <<"* Detector card "<<"" 746 << left << setw(39) << detectorcard << "" << right << setw(9) << "*"<<"\n"; 747 if(triggercard != "") 748 f_out << left << setw(22) <<"* Trigger card "<<"" 749 << left << setw(39) << triggercard << "" << right << setw(9) << "*"<<"\n"; 750 f_out<<"* Beam optics : *"<<"\n"; 751 f_out << left << setw(22) <<"* - beam 1 "<<"" 752 << left << setw(33) << RP_beam1Card << "" << right << setw(15) << "*"<<"\n"; 753 f_out << left << setw(22) <<"* - beam 2 "<<"" 754 << left << setw(33) << RP_beam2Card << "" << right << setw(15) << "*"<<"\n"; 755 f_out << left << setw(22) <<"* Input PDG table " << "" 756 << left << setw(39) << PdgTableFilename << "" << right << setw(9) << "*"<<"\n"; 757 707 758 f_out<<"* *"<<"\n"; 708 759 f_out<<"* *"<<"\n";
Note:
See TracChangeset
for help on using the changeset viewer.