Changeset 12362 for fact/tools/rootmacros
- Timestamp:
- 11/02/11 13:50:54 (13 years ago)
- Location:
- fact/tools/rootmacros
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/calscope.C
r12256 r12362 8 8 #define HAVE_ZLIB 9 9 #include "fits.h" 10 #include "TPKplotevent.c"11 10 #include "FOpenDataFile.c" 12 11 #include "FOpenCalibFile.c" 12 #include "FCalibrateEvent.c" 13 13 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)14 int calscope(const char *name, const char *drsname, size_t eventnr, size_t pixelnr) 15 15 { 16 16 //****************************************************************************** … … 20 20 //Example call in ROOT: 21 21 //root [74] .x calscope.C++("20110804_024.fits","20110804_023.drs.fits",10,1348) 22 //T. Kr ähenbühl, August 2011, tpk@phys.ethz.ch22 //T. Kr�henb�hl, August 2011, tpk@phys.ethz.ch 23 23 //****************************************************************************** 24 24 … … 64 64 } 65 65 66 67 66 //------------------------------------------- 68 67 //Create the title … … 72 71 73 72 //------------------------------------------- 74 //Get the event73 //Get the calibrated event 75 74 //------------------------------------------- 75 vector<float> calevent(data_px*data_roi); //Vector for the calibrated event 76 76 77 cout << "--------------------- Data --------------------" << endl; 77 78 datafile.GetRow(eventnr); 78 79 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 80 83 //------------------------------------------- 81 84 //Draw the data 82 85 //------------------------------------------- 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 84 98 return 0; 85 99 }
Note:
See TracChangeset
for help on using the changeset viewer.