DriftResponse.h
Go to the documentation of this file.
1 // \file DriftResponse.h
2 // \brief A DriftResponse entry contains Drift Calibration information for an individual subrun and offline channel
3 // \version $Id: DriftResponse.h,v 1.0 2013/02/1 22:06:10 rtoner Exp $
4 // \author $Author: rtoner $
5 // \date $Date: 2013/02/01 22:06:10 $
6 
7 #ifndef DRIFTRESPONSE_H
8 #define DRIFTRESPONSE_H
9 
11 #include <map>
12 #include <stdint.h>
13 #include <iosfwd>
14 
15 namespace caldp
16 {
17 
18  struct MeanStruct
19  {
20 
21  double mean; ///Mean response
22  double meanerr; ///Error on mean response
23  double rms; ///Error on mean response
24  int nhits; ///Number of hits in mean calculation
25 
26  double Mean () const {return mean; }; ///Return mean
27  double MeanErr () const {return meanerr; }; ///Return error on mean
28  double RMS () const {return rms; }; ///Return rms of distribution
29  int NHits () const {return nhits; }; ///Return number of hits in distribution
30 
31  void SetResponse ( double fMean, double fMeanErr, double fRMS, int fNHits ); ///Set a single channel
32 
33 
34  };///Structure to hold drift response in a single channel at a single time
35 
37  {
38  public:
39 
40  DriftResponse();
41  DriftResponse(int fRun, uint32_t fStartTime, uint32_t fEndTime);
42 
43  ~DriftResponse();
44 
45 #ifndef __GCCXML__
46  int Run () const {return run; }; ///Return run number
47  uint32_t StartTime() const {return startTime; }; ///Return subrun start time
48  uint32_t EndTime () const {return endTime; }; ///Return subrun end time
49 
50  void AddChannelResponse ( int fOffChan, double fMean, double fMeanErr, double fRMS, int fNHits); ///Function to add response value for single channel;
51 
52  double Mean (int fOffChan) const; ///Return mean for given offline channel
53  double MeanErr (int fOffChan) const; ///Return mean error for given offline channel
54  double RMS (int fOffChan) const; ///Return rms for given offline channel
55  double NHits (int fOffChan) const; ///Return number of hits for given offline channel
56 
57  //RBTNOTE: ADD THREE OF THESE?
58  bool CheckForChannel ( int fOffChan ) const; ///Check for existence of channel in DriftResponse
59  bool GetChannelResponse ( int fOffChan, double &fMean, double &fMeanErr, double &fRMS, int &fNHits) const;
60 
61  std::map<int, MeanStruct > const& ReturnMap () const { return meanMap; };
62 
63  friend std::ostream& operator << (std::ostream& o, const DriftResponse& dr);
64 
65 #endif
66 
67  private:
68 
69  int run ;///Run number
70  uint32_t startTime;///Start time of the run period
71  uint32_t endTime ;///End time of the run period
72 
73  std::map<int, MeanStruct > meanMap ;///Map of offline channel number to MeanInfo struct information
74 
75  };
76 
77 } // end namespace
78 
79 #endif // DRIFTRESPONSE_H
Structure to hold drift response in a single channel at a single time.
Definition: DriftResponse.h:36
int NHits() const
Return rms of distribution.
Definition: DriftResponse.h:29
std::map< int, MeanStruct > meanMap
End time of the run period.
Definition: DriftResponse.h:73
uint32_t startTime
Run number.
Definition: DriftResponse.h:70
std::ostream & operator<<(std::ostream &o, const DriftResponse &dr)
double meanerr
Mean response.
Definition: DriftResponse.h:22
double RMS() const
Return error on mean.
Definition: DriftResponse.h:28
double Mean() const
Number of hits in mean calculation.
Definition: DriftResponse.h:26
double rms
Error on mean response.
Definition: DriftResponse.h:23
uint32_t endTime
Start time of the run period.
Definition: DriftResponse.h:71
void SetResponse(double fMean, double fMeanErr, double fRMS, int fNHits)
Return number of hits in distribution.
Histograms used by attenuation calibration.
uint32_t EndTime() const
Return subrun start time.
Definition: DriftResponse.h:48
uint32_t StartTime() const
Return run number.
Definition: DriftResponse.h:47
std::map< int, MeanStruct > const & ReturnMap() const
Definition: DriftResponse.h:61
double MeanErr() const
Return mean.
Definition: DriftResponse.h:27
int nhits
Error on mean response.
Definition: DriftResponse.h:24