18 #include "msdevstudio/MSconfig.h"
41 using std::runtime_error;
44 using namespace hippodraw;
47 :
BaseXML (
"HiNTuple", controller ),
56 const void * addr = reinterpret_cast <
const void * > ( & ntuple );
60 const string & full_name = ntuple.
getName ();
61 tag -> setAttribute (
m_name, full_name );
72 #ifndef STRING_CLEAR_DEFECT // change to ifdef when M4 macro is implemented
73 if ( ! ok ) name.erase ( name.begin(), name.end() );
75 if ( ! ok ) name.clear();
92 string::size_type pos = fullname.find_last_of (
":" );
93 if ( pos != string::npos && pos != 1 ) {
94 filename = fullname.substr ( 0, pos );
95 name = fullname.substr ( pos + 2 );
102 pos = filename.find_last_of (
"." );
103 if ( pos != string::npos ) {
104 suffix = filename.substr ( pos + 1 );
107 if ( suffix.empty () == false ) {
108 if ( suffix ==
"fits" || suffix ==
"gz" ) {
111 ntuple = controller -> createNTuple ( filename, name );
113 string what (
"Can not open file\n" );
114 what += filename +
"\n";
115 what +=
"because application was not built with FITS support";
116 throw runtime_error ( what );
119 else if ( suffix ==
"root" ) {
122 ntuple = controller -> createNTuple ( filename, name );
124 string what (
"Can not open file\n" );
125 what += filename +
"\n";
126 what +=
"because application was not bult with ROOT support";
127 throw runtime_error ( what );
144 const string fullname =
getName ( tag );
145 if ( fullname.empty() )
return 0;