1 |
|
---|
2 |
|
---|
3 | float getValue( int slice, int pixel,
|
---|
4 | vector<float> &drs_basemean,
|
---|
5 | vector<float> &drs_gainmean,
|
---|
6 | vector<float> &drs_triggeroffsetmean,
|
---|
7 | UInt_t RegionOfInterest,
|
---|
8 | vector<int16_t> AllPixelDataVector,
|
---|
9 | vector<int16_t> StartCellVector
|
---|
10 | ){
|
---|
11 | const float dconv = 2000/4096.0;
|
---|
12 |
|
---|
13 | float vraw, vcal;
|
---|
14 |
|
---|
15 | unsigned int pixel_pt;
|
---|
16 | unsigned int slice_pt;
|
---|
17 | unsigned int cal_pt;
|
---|
18 | unsigned int drs_cal_offset;
|
---|
19 |
|
---|
20 | // printf("pixel = %d, slice = %d\n", slice, pixel);
|
---|
21 |
|
---|
22 | pixel_pt = pixel * RegionOfInterest;
|
---|
23 | slice_pt = pixel_pt + slice;
|
---|
24 | drs_cal_offset = ( slice + StartCellVector[ pixel ] )%RegionOfInterest;
|
---|
25 | cal_pt = pixel_pt + drs_cal_offset;
|
---|
26 |
|
---|
27 | vraw = AllPixelDataVector[ slice_pt ] * dconv;
|
---|
28 | vcal = ( vraw - drs_basemean[ cal_pt ] - drs_triggeroffsetmean[ slice_pt ] ) / drs_gainmean[ cal_pt ]*1907.35;
|
---|
29 |
|
---|
30 | return( vcal );
|
---|
31 | }
|
---|
32 |
|
---|
33 | size_t applyDrsCalibration( vector<float> &destination,
|
---|
34 | int pixel,
|
---|
35 | vector<float> &drs_basemean,
|
---|
36 | vector<float> &drs_gainmean,
|
---|
37 | vector<float> &drs_triggeroffsetmean,
|
---|
38 | UInt_t RegionOfInterest,
|
---|
39 | vector<int16_t> AllPixelDataVector,
|
---|
40 | vector<int16_t> StartCellVector
|
---|
41 | ){
|
---|
42 | destination.clear();
|
---|
43 | const float dconv = 2000/4096.0;
|
---|
44 | float vraw, vcal;
|
---|
45 | unsigned int pixel_pt;
|
---|
46 | unsigned int slice_pt;
|
---|
47 | unsigned int cal_pt;
|
---|
48 | unsigned int drs_cal_offset;
|
---|
49 |
|
---|
50 | pixel_pt = pixel * RegionOfInterest;
|
---|
51 |
|
---|
52 |
|
---|
53 | for ( unsigned int sl = 0; sl < RegionOfInterest; sl++){
|
---|
54 | slice_pt = pixel_pt + sl;
|
---|
55 | drs_cal_offset = ( sl + StartCellVector[ pixel ] )%RegionOfInterest;
|
---|
56 | cal_pt = pixel_pt + drs_cal_offset;
|
---|
57 |
|
---|
58 | vraw = AllPixelDataVector[ slice_pt ] * dconv;
|
---|
59 | vcal = ( vraw - drs_basemean[ cal_pt ] - drs_triggeroffsetmean[ slice_pt ] ) / drs_gainmean[ cal_pt ]*1907.35;
|
---|
60 |
|
---|
61 | destination.push_back(vcal);
|
---|
62 | }
|
---|
63 |
|
---|
64 | return destination.size();
|
---|
65 | }
|
---|