00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <iostream>
00011 #include <string>
00012 #include <sstream>
00013
00014 namespace HepPDT {
00015
00016 namespace detail {
00017 bool getIsajetID( int & id, const std::string & pdline )
00018 {
00019 int sl = pdline.length();
00020 id = 0;
00021
00022 if( sl < 30 ) return false;
00023
00024 std::string header = pdline.substr(17,8);
00025 std::string labels = pdline.substr(11,8);
00026 if( header == "PARTICLE" || labels == "PARTICLE" ) return false;
00027
00028 std::string firstc = pdline.substr(0,1);
00029 if( firstc == " " ){
00030 std::istringstream var1( pdline.substr(0,10).c_str() );
00031 var1 >> id;
00032 return true;
00033 } else {
00034 return false;
00035 }
00036 }
00037 }
00038
00039 }