Changeset 12424 for trunk/FACT++


Ignore:
Timestamp:
11/06/11 17:04:19 (13 years ago)
Author:
lyard
Message:
updated viewer
File:
1 edited

Legend:

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

    r12395 r12424  
    498498    nRoi = 0;
    499499#endif
     500    nRoiTM = 0;
     501    offSetRoi = 0;
    500502    eventNum = 0;
    501503    rowNum = -1;
     
    743745    daq = inputFile->GetStr("DAQ");
    744746    adcCount = inputFile->HasKey("ADCRANGE") ? inputFile->GetFloat("ADCRANGE") : 2000;
     747
     748    if (inputFile->HasKey("OFFSET"))
     749        offSetRoi = inputFile->GetInt("OFFSET");
     750
    745751    nbOk = 0;//inputFile->GetInt("NBEVTOK");
    746752    nbRej = 0;//inputFile->GetInt("NBEVTREJ");
     
    15581564
    15591565    //extract the file name only (no path) from the full name
    1560     str << "File: " << currentFile.substr(currentFile.find_last_of("//")+1, currentFile.size()) << "\n";
    1561     str << "Calibration: " << currentCalibFile.substr(currentCalibFile.find_last_of("//")+1, currentCalibFile.size()) << "\n";
     1566    str << "File: ";
     1567    if (currentFile.size() > 2)
     1568        str << currentFile.substr(currentFile.find_last_of("//")+1, currentFile.size()) << "\n";
     1569    else
     1570        str << "--\n";
     1571    str << "Calibration: ";
     1572    if (currentCalibFile.size() > 2)
     1573        str << currentCalibFile.substr(currentCalibFile.find_last_of("//")+1, currentCalibFile.size()) << "\n";
     1574    else
     1575        str << "--\n";
    15621576//    fileLoadedLabel->setText(QString(str.str().c_str()));
    15631577//    str.str("");
     
    21902204    if (pixel == -1)
    21912205        return;
    2192 
     2206    int softwarePix = pixel;
    21932207    pixel = GLWindow->hardwareMapping[pixel];
    21942208
     
    22072221#endif
    22082222    }
    2209 
     2223int realNumSamples = GLWindow->nRoi;
     2224    if (GLWindow->nRoiTM != 0)
     2225    {
     2226        const PixelMapEntry& mapEntry = GLWindow->fPixelMap.index(softwarePix);
     2227        const int pixelIdInPatch = mapEntry.pixel();
     2228        const int patchId = mapEntry.patch();
     2229        const int boardId = mapEntry.board();
     2230        const int crateId = mapEntry.crate();
     2231        if (pixelIdInPatch == 8)
     2232        {
     2233            int TMIndex = 0;
     2234            int xIndex = GLWindow->nRoi;
     2235            int arrayIndex = GLWindow->nRoi;
     2236            if (GLWindow->offSetRoi < 0)
     2237                TMIndex -= GLWindow->offSetRoi;
     2238            if (GLWindow->offSetRoi > 0)
     2239                xIndex += GLWindow->offSetRoi;
     2240            for (int i=TMIndex;i<GLWindow->nRoiTM;i++, xIndex++, arrayIndex++)
     2241            {
     2242                xval[arrayIndex] = xIndex;
     2243                yval[arrayIndex] = GLWindow->eventData[GLWindow->nRoi*1440 + GLWindow->nRoiTM*(40*crateId + 4*boardId + patchId) + i];
     2244            }
     2245            realNumSamples += GLWindow->nRoiTM - TMIndex;
     2246        }
     2247        cout << pixelIdInPatch << " " ;
     2248    }
     2249cout << realNumSamples << endl;
    22102250  //  GLWindow->computePulsesStatistics();
    22112251#if QWT_VERSION < 0x060000
    2212     pixelValueCurveItem.setData(xval, yval, GLWindow->nRoi);
     2252    pixelValueCurveItem.setData(xval, yval, realNumSamples);
    22132253////    aMeanCurveItem.setData(xval, GLWindow->aMeas, GLWindow->nRoi);
    22142254 //   meanCurveItem.setData(xval, GLWindow->n1mean, GLWindow->nRoi);
    22152255 //   vCorrCurveItem.setData(xval, GLWindow->vCorr, GLWindow->nRoi-3);
    22162256#else
    2217        pixelValueCurveItem.setSamples(xval, yval, GLWindow->nRoi);
     2257       pixelValueCurveItem.setSamples(xval, yval, realNumSamples);
    22182258//       aMeanCurveItem.setSamples(xval, GLWindow->aMeas, GLWindow->nRoi);
    22192259 //      meanCurveItem.setSamples(xval, GLWindow->n1mean, GLWindow->nRoi);
Note: See TracChangeset for help on using the changeset viewer.