source: trunk/Mars/mdrs/MDrsCalibrationTime.h@ 18154

Last change on this file since 18154 was 18154, checked in by tbretz, 10 years ago
Since the drs calibration is sorted in hw indices, the delays are better sorted in hw indices as well.
File size: 1.3 KB
Line 
1#ifndef MARS_MDrsCalibrationTime
2#define MARS_MDrsCalibrationTime
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_DrsCalib
8#include "DrsCalib.h"
9#endif
10
11class TH1;
12class TGraph;
13
14class MDrsCalibrationTime : public MParContainer, public DrsCalibrateTime
15{
16 std::vector<double> fDelays;
17
18public:
19 MDrsCalibrationTime(const char *name=0, const char *title=0)
20 {
21 fName = name ? name : "MDrsCalibrationTime";
22 fTitle = title ? title : "";
23 }
24
25 void InitSize(uint16_t channels, uint16_t samples)
26 {
27 //fDelays.clear();
28 //fDelays.resize(channels);
29
30 DrsCalibrateTime::InitSize(channels, samples);
31 }
32
33 void SetCalibration(const DrsCalibrateTime &cal)
34 {
35 *static_cast<DrsCalibrateTime*>(this) = cal;
36 }
37
38 bool SetDelays(const TH1 &cam);
39 void SetDelays(const TGraph &g);
40
41 double GetOffset(int hw, int spos, float tm) const
42 {
43 return Offset(hw/9, fmod(tm+spos, 1024)) - Offset(hw/9, spos);
44 }
45
46 double GetDelay(int hw) const
47 {
48 return fDelays.size()==0 ? 0 : fDelays[hw];
49 }
50
51 bool ReadFits(TString fname);
52 bool WriteFits(const std::string &fname) const;
53
54 ClassDef(MDrsCalibrationTime, 2) // A list of histograms storing the Fadc spektrum of one pixel
55};
56
57#endif
58
Note: See TracBrowser for help on using the repository browser.