Changeset 18572 for trunk/Mars/mraw


Ignore:
Timestamp:
09/03/16 20:42:24 (8 years ago)
Author:
tbretz
Message:
Also retrieve the name of the container from the file and create the container accordingly. Inplemented an error message.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mraw/MRawFitsRead.cc

    r18566 r18572  
    183183            break;
    184184
    185         const string clname = fin.GetStr(clnamed);
    186 
    187         MParContainer *par = (MParContainer*)fParList->FindCreateObj(clname.c_str());
    188         if (par)
    189             par->SetupFits(fin);
     185        const string cltyped = Form("CLTYPE%d", i);
     186        const string cltype  = fin.HasKey(cltyped) ? fin.GetStr(cltyped) : clnamed;
     187        const string clname  = fin.GetStr(clnamed);
     188
     189        MParContainer *par = (MParContainer*)fParList->FindCreateObj(clname.c_str(), cltype.c_str());
     190        if (par && !par->SetupFits(fin))
     191        {
     192            *fLog << err << "ERROR - Setting up " << par->GetDescriptor() << " failed." << endl;
     193            return kFALSE;
     194        }
    190195    }
    191196
Note: See TracChangeset for help on using the changeset viewer.