Ignore:
Timestamp:
11/29/11 16:13:21 (13 years ago)
Author:
lyard
Message:
viewer improvements
File:
1 edited

Legend:

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

    r12482 r12669  
    281281        }
    282282#endif
    283         if (color < 0)
     283        if (color < ss[0])
    284284        {
    285285            pixelsColor[i][0] = tooLowValueCoulour[0];
     
    288288            continue;
    289289        }
    290         if (color > 1)
     290        if (color > ss[4])
    291291        {
    292292            pixelsColor[i][0] = tooHighValueCoulour[0];
     
    523523
    524524    assignPixelMap(mypMap);
    525     buildVerticesList();
    526 //    for (int i=0;i<1440;i++)
    527 //        updateNeighbors(i);
    528525
    529526    for (int i=0;i<160;i++)
     
    719716        try {
    720717        if (!inputFile->HasKey(*it)){
    721             cout << *it << " missing. Aborting load..." << endl;
     718            cout << "Warning: header keyword " << *it << " missing." << endl;
    722719            return;}
    723720        }
     
    728725        }
    729726    }
    730     nRows = inputFile->GetInt("NAXIS2");
    731     nRoi = inputFile->GetInt("NROI");
    732     runNumber = inputFile->GetInt("RUNID");
    733     nTM = inputFile->HasKey("NTMARK") ? inputFile->GetInt("NTMARK") : 0;
    734     runType = inputFile->HasKey("RUNTYPE") ? inputFile->GetInt("RUNTYPE") : -1;
    735     firstDataTime = inputFile->GetInt("TSTART");
    736     lastDataTime = inputFile->GetInt("TSTOP");
    737     nRoiTM = inputFile->GetInt("NROITM");
    738     revision = inputFile->GetInt("REVISION");
     727    nRows =          inputFile->HasKey("NAXIS2") ? inputFile->GetInt("NAXIS2") : 0;
     728    nRoi =           inputFile->HasKey("NROI") ?  inputFile->GetInt("NROI") : 0;
     729    runNumber =      inputFile->HasKey("RUNID") ?  inputFile->GetInt("RUNID") : -1;
     730    nTM =            inputFile->HasKey("NTMARK") ? inputFile->GetInt("NTMARK") : 0;
     731    runType =        inputFile->HasKey("RUNTYPE") ? inputFile->GetInt("RUNTYPE") : -1;
     732    firstDataTime =  inputFile->HasKey("TSTART") ? inputFile->GetInt("TSTART") : -1;
     733    lastDataTime =   inputFile->HasKey("TSTOP") ? inputFile->GetInt("TSTOP"): -1;
     734    nRoiTM =         inputFile->HasKey("NROITM") ? inputFile->GetInt("NROITM") : 0;
     735    revision =       inputFile->HasKey("REVISION") ? inputFile->GetInt("REVISION") : -1;
    739736    builderVersion = inputFile->HasKey("BLDVER") ? inputFile->GetInt("BLDVER") : -1;
    740     nBoards = inputFile->GetInt("NBOARD");
    741     nPixels = inputFile->GetInt("NPIX");
    742     timeSystem = inputFile->GetStr("TIMESYS");
    743     creationDate = inputFile->GetStr("DATE");
    744     nightInt = inputFile->GetInt("NIGHT");
    745     camera = inputFile->GetStr("CAMERA");
    746     daq = inputFile->GetStr("DAQ");
    747     adcCount = inputFile->HasKey("ADCRANGE") ? inputFile->GetFloat("ADCRANGE") : 2000;
     737    nBoards =        inputFile->HasKey("NBOARD") ? inputFile->GetInt("NBOARD") : 0;
     738    nPixels =        inputFile->HasKey("NPIX") ?  inputFile->GetInt("NPIX") : 0;
     739    timeSystem =     inputFile->HasKey("TIMESYS") ? inputFile->GetStr("TIMESYS") : 0;
     740    creationDate =   inputFile->HasKey("DATE") ? inputFile->GetStr("DATE") : 0;
     741    nightInt =       inputFile->HasKey("NIGHT") ? inputFile->GetInt("NIGHT") : 0;
     742    camera =         inputFile->HasKey("CAMERA") ? inputFile->GetStr("CAMERA") : 0;
     743    daq =            inputFile->HasKey("DAQ") ? inputFile->GetStr("DAQ") : 0;
     744    adcCount =       inputFile->HasKey("ADCRANGE") ? inputFile->GetFloat("ADCRANGE") : 2000;
    748745
    749746    if (inputFile->HasKey("OFFSET"))
     
    11591156        fDrsCalib.Apply(eventData, rawEventData, startPix, nRoi);
    11601157        DrsCalibrate::RemoveSpikes(eventData, nRoi);
     1158        for (int i=0;i<1024;i++)
     1159            eventData[i] = eventData[i+1024];
    11611160        //TODO apply calibration to the Time markers
    11621161    }
     
    22132212        return;
    22142213
    2215 //int currentPixel = pixel;
    2216 int currentPixel = 0;
     2214int currentPixel = pixel;
     2215//IN ORDER TO GET THE AVERAGE OF ALL PIXELS DISPLAYED IN THE CURVE OF THE VIEWER
     2216//UNCOMMENT THE 9 LINES BELOW, i.e. UNTIL THE END OF AVERAGE DISPLAY COMMENT MARK
     2217//int currentPixel = 0;
     2218//    for (int i=0;i<GLWindow->nRoi;i++)
     2219//        yval[i] = 0;
     2220//    for (int j=0;j<1440;j++) {
     2221//        currentPixel = j;
    22172222    for (int i=0;i<GLWindow->nRoi;i++)
    2218         yval[i] = 0;
    2219     for (int j=0;j<1440;j++) {
    2220         currentPixel = j;
    2221     for (int i=0;i<GLWindow->nRoi;i++)
    22222223    {
    22232224        xval[i] = i;
    2224         yval[i] += GLWindow->eventData[GLWindow->nRoi*currentPixel + i];
    2225     }
    2226     }
    2227     for (int i=0;i<GLWindow->nRoi;i++)
    2228         yval[i] /= 1440;
    2229 
     2225        yval[i] = GLWindow->eventData[GLWindow->nRoi*currentPixel + i];
     2226//        yval[i] += GLWindow->eventData[GLWindow->nRoi*currentPixel + i];
     2227    }
     2228//    }
     2229//    for (int i=0;i<GLWindow->nRoi;i++)
     2230//        yval[i] /= 1440;
     2231//END OF AVERAGE DISPLAY COMMENTS
    22302232int realNumSamples = GLWindow->nRoi;
    22312233    if (GLWindow->nRoiTM != 0)
     
    23632365    for (int i=start;i<end;i++)
    23642366    {
    2365         for (int j=0;j<GLWindow->nRoi;j++)
     2367        for (int j=10;j<GLWindow->nRoi-50;j++)
    23662368        {
    23672369            int cValue = GLWindow->eventData[i*GLWindow->nRoi+j];
Note: See TracChangeset for help on using the changeset viewer.