source: fact/tools/rootmacros/TPKplotevent.c@ 13591

Last change on this file since 13591 was 12166, checked in by neise, 13 years ago
initial commit
File size: 849 bytes
Line 
1#include <cstdio>
2
3int TPKplotevent(char *title, vector<int16_t> &data, vector<int16_t> &data_offset, vector<float> &drs_basemean, vector<float> &drs_gainmean, vector<float> &drs_triggeroffsetmean, UInt_t data_roi, size_t pixelnr)
4{
5 TCanvas *canv = new TCanvas( "canv", "Mean values of the first event", 100, 10, 700, 500 );
6 TProfile *pix = new TProfile("pix", title, 1024, -0.5, 1023.5);
7
8 for (UInt_t k=0; k<data_roi; k++)
9 {
10 UInt_t drs_calib_offset = (k+data_offset[pixelnr])%data_roi;
11 float sample = (data[pixelnr*data_roi+k]*2000/4096.-drs_basemean[pixelnr*data_roi+drs_calib_offset]-drs_triggeroffsetmean[pixelnr*data_roi+k])/drs_gainmean[pixelnr*data_roi+drs_calib_offset]*1907.35;
12 pix->Fill(k,sample);
13 }
14 pix->Draw();
15 canv->Modified();
16 canv->Update();
17
18 cout << "Plotting successful..." << endl;
19 return 0;
20}
Note: See TracBrowser for help on using the repository browser.