Ignore:
Timestamp:
11/02/11 13:50:54 (13 years ago)
Author:
kraehenb
Message:
New version of the calscope-script which is easier to adapt. The included file TPKplotevent was dropped for the FCalibrateEvent.C, which takes an event and returns an array with the DRS-calibrated pipeline.
Location:
fact/tools/rootmacros
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/calscope.C

    r12256 r12362  
    88#define HAVE_ZLIB
    99#include "fits.h"
    10 #include "TPKplotevent.c"
    1110#include "FOpenDataFile.c"
    1211#include "FOpenCalibFile.c"
     12#include "FCalibrateEvent.c"
    1313
    14 int calscope(const char *name = "../raw/20110916_025.fits", const char *drsname = "../raw/20110916_024.drs.fits", size_t eventnr = 0, size_t pixelnr = 0)
     14int calscope(const char *name, const char *drsname, size_t eventnr, size_t pixelnr)
    1515{
    1616//******************************************************************************
     
    2020//Example call in ROOT:
    2121//root [74] .x calscope.C++("20110804_024.fits","20110804_023.drs.fits",10,1348)
    22 //T. Krähenbühl, August 2011, tpk@phys.ethz.ch
     22//T. Kr�henb�hl, August 2011, tpk@phys.ethz.ch
    2323//******************************************************************************
    2424
     
    6464        }
    6565       
    66        
    6766//-------------------------------------------
    6867//Create the title
     
    7271       
    7372//-------------------------------------------
    74 //Get the event
     73//Get the calibrated event
    7574//-------------------------------------------
     75        vector<float> calevent(data_px*data_roi); //Vector for the calibrated event
     76
    7677        cout << "--------------------- Data --------------------" << endl;
    7778        datafile.GetRow(eventnr);
    7879        cout << "Event number: " << data_num << endl;
    79                
     80       
     81        FCalibrateEvent(data, data_offset, drs_basemean, drs_gainmean, drs_triggeroffsetmean, calevent, data_px, data_roi);
     82       
    8083//-------------------------------------------
    8184//Draw the data
    8285//-------------------------------------------
    83         TPKplotevent(title, data, data_offset, drs_basemean, drs_gainmean, drs_triggeroffsetmean, data_roi, pixelnr);
     86        TCanvas *canv = new TCanvas( "canv", "Mean values of the first event", 100, 10, 700, 500 );
     87        TProfile *pix = new TProfile("pix", title, 1024, -0.5, 1023.5);
     88       
     89        for (UInt_t k=0; k<data_roi; k++)
     90        {
     91                pix->Fill(k,calevent[pixelnr*data_roi+k]);
     92        }
     93       
     94        pix->Draw();
     95        canv->Modified();
     96        canv->Update();
     97       
    8498        return 0;
    8599}
Note: See TracChangeset for help on using the changeset viewer.