Changeset 19686 for trunk/FACT++/gui


Ignore:
Timestamp:
09/27/19 16:39:30 (5 years ago)
Author:
tbretz
Message:
Improved output and fixed some issued with MC files which had less than 1440 pixels.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r19387 r19686  
    198198//            color = float(eventData[nRoi*i + whichSlice] + (VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
    199199//        else
    200             color = float(eventData[nRoi*hardwareMapping[i] + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
     200            color = i<nPixels ? float(eventData[nRoi*hardwareMapping[i] + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1) : 0;
    201201        if (logScale)
    202202        {
     
    623623    nTM =            inputFile->HasKey("NTMARK") ? inputFile->GetInt("NTMARK") : 0;
    624624
    625     runType = "unkown";
     625    runType = "unknown";
    626626    if (inputFile->HasKey("RUNTYPE"))
    627627    {
    628628        runType = inputFile->GetStr("RUNTYPE");
    629629        if (runType == "")
    630             runType = "unkown";
     630            runType = "unknown";
    631631    }
    632632    firstDataTime =  inputFile->HasKey("TSTART") ? inputFile->GetInt("TSTART") : -1;
     
    648648        nPixels = 1440;
    649649    }
     650    if (nPixels > 1440)
     651        cout << "More than 1440 pixels not supported." << endl;
     652    if (nPixels==1440 && nRoi!=0)
     653        cout << "Time marker not suppoerted with number of pixel not euqal 1440." << endl;
     654
    650655    if (nRoi == 0 && !inputFile->HasKey("NROI"))
    651656    {//let's try to figure out the roi from the column's format
     
    889894        if (nRoiTM != 0)
    890895            cout << "Warning: did not expect Time Markers data from Monte-Carlo simulations. These will not be mapped properly." << endl;
     896
    891897        //first copy the data
    892         vector<int16_t> tempData(rawEventData.begin(), rawEventData.begin()+1440*nRoi);
     898        const vector<int16_t> tempData(rawEventData);//.begin(), rawEventData.begin()+1440*nRoi);
     899        rawEventData.assign(rawEventData.size(), 0);
    893900        //copy back the data and re-map it on the fly
    894901        for (int i=0;i<1440;i++)
    895             for (int j=0;j<nRoi;j++)
    896                 rawEventData[i*nRoi + j] = tempData[softwareMapping[i]*nRoi + j];
     902            if (softwareMapping[i]<nPixels)
     903                for (int j=0;j<nRoi;j++)
     904                    rawEventData[i*nRoi + j] = tempData[softwareMapping[i]*nRoi + j];
    897905    }
    898906//    cout << "Getting row " << rowNum << endl;
    899 
    900907
    901908    ApplyCalibration();
     
    21412148        if (i==863)//keep crazy pixel out of the autoscale
    21422149            continue;
     2150
     2151        if (GLWindow->softwareMapping[i]>=GLWindow->nPixels)
     2152            continue;
     2153
    21432154        for (int j=10;j<GLWindow->nRoi-50;j++)
    21442155        {
Note: See TracChangeset for help on using the changeset viewer.