Changeset 19288 for trunk/Mars
- Timestamp:
- 10/24/18 19:45:33 (6 years ago)
- Location:
- trunk/Mars/mfileio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mfileio/MFitsArray.cc
r19255 r19288 73 73 // status is set to kFALSE if some data cannot be stored in a FITS table, 74 74 // for example more than 1 dimensional arrays. 75 MClonesArrayHelper::MClonesArrayHelper( TClonesArray * clonesArray, MLog * log,75 MClonesArrayHelper::MClonesArrayHelper(const TClonesArray * clonesArray, MLog * log, 76 76 Bool_t & status) 77 77 : fClonesArray(clonesArray) -
trunk/Mars/mfileio/MFitsArray.h
r18140 r19288 50 50 { 51 51 // data of this TClonesArray are written to fFitsTable 52 TClonesArray * fClonesArray;52 const TClonesArray * fClonesArray; 53 53 54 54 … … 66 66 67 67 public: 68 MClonesArrayHelper( TClonesArray * clonesArray, MLog * log, Bool_t & status);68 MClonesArrayHelper(const TClonesArray * clonesArray, MLog * log, Bool_t & status); 69 69 MClonesArrayHelper(const MClonesArrayHelper & clHelper); 70 70 -
trunk/Mars/mfileio/MWriteFitsFile.cc
r19255 r19288 811 811 string comment(dataMember->GetTitle()); 812 812 string::size_type pos1, pos2; 813 if ((pos1 = comment.find( 178)) != string::npos)813 if ((pos1 = comment.find('\xb2')) != string::npos) 814 814 comment.replace(pos1, 1, "**2"); 815 815 … … 902 902 { 903 903 // special treatment for classes 904 uint32_t arraySize = 0; 905 TString typeName; 904 const char *ptr = reinterpret_cast<char*>(baseAdr) + dataMember->GetOffset(); 906 905 907 906 if (strncmp(dataMember->GetTrueTypeName(), "MArray", 6) == 0) … … 909 908 if (strcmp(dataMember->GetTrueTypeName(), "MArrayS*") == 0) 910 909 { 911 typeName = "UShort_t"; 912 arraySize = (*((MArrayS**)((char*)baseAdr + dataMember->GetOffset())))->GetSize(); 910 const MArrayS *arr = *reinterpret_cast<MArrayS* const*>(ptr); 913 911 InitSingleColumn(tableName, 914 arr aySize,915 typeName.Data(),916 (char*) (*((MArrayS**)((char*)baseAdr + dataMember->GetOffset())))->GetArray(),912 arr->GetSize(), 913 "UShort_t", 914 (char*)arr->GetArray(), 917 915 colName.Data(), 918 916 unit, … … 921 919 else if (strcmp(dataMember->GetTrueTypeName(), "MArrayB*") == 0) 922 920 { 923 typeName = "UChar_t"; 924 arraySize = (*((MArrayB**)((char*)baseAdr + dataMember->GetOffset())))->GetSize(); 921 const MArrayB *arr = *reinterpret_cast<MArrayB* const*>(ptr); 925 922 InitSingleColumn(tableName, 926 arr aySize,927 typeName.Data(),928 (char*) (*((MArrayB**)((char*)baseAdr + dataMember->GetOffset())))->GetArray(),923 arr->GetSize(), 924 "UChar_t", 925 (char*)arr->GetArray(), 929 926 colName.Data(), 930 927 unit, … … 933 930 else if (strcmp(dataMember->GetTrueTypeName(), "MArrayF*") == 0) 934 931 { 935 typeName = "TFloat_t"; 936 arraySize = (*((MArrayF**)((char*)baseAdr + dataMember->GetOffset())))->GetSize(); 932 const MArrayF *arr = *reinterpret_cast<MArrayF* const*>(ptr); 937 933 InitSingleColumn(tableName, 938 arr aySize,939 typeName.Data(),940 (char*) (*((MArrayF**)((char*)baseAdr + dataMember->GetOffset())))->GetArray(),934 arr->GetSize(), 935 "TFloat_t", 936 (char*)arr->GetArray(), 941 937 colName.Data(), 942 938 unit, … … 959 955 MClonesArrayHelper * clHelper; 960 956 961 TClonesArray * cloneArray = (TClonesArray*)((char*)baseAdr + dataMember->GetOffset());957 const TClonesArray * cloneArray = reinterpret_cast<const TClonesArray*>(ptr); 962 958 Bool_t status; 963 959 clHelper = new MClonesArrayHelper(cloneArray, fLog, status);
Note:
See TracChangeset
for help on using the changeset viewer.