00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef ADCALIBFIGS_H
00011 #define ADCALIBFIGS_H
00012
00013
00014 #define ADCHARGE 0
00015 #define LOGADCHARGE 1
00016 #define PMTCHARGE 2
00017 #define ADCHARGEVSTIME 3
00018 #define ADCHARGEVSDTTRIGGER 4
00019 #define MAXPMTCHARGEVSADCHARGE 5
00020 #define NCHANNELSVSADCHARGE 6
00021 #define NCALIBHISTOGRAMS 7
00022
00023 #define NSITES 5
00024 #define NDETECTORS 5
00025 #define NCOLUMNS 25
00026 #define NRINGS 9
00027
00028 #define MAXCALIBHISTS NSITES*NDETECTORS*NCOLUMNS*NRINGS*NCALIBHISTOGRAMS
00029
00030 #include "GaudiAlg/GaudiAlgorithm.h"
00031 #include "Context/TimeStamp.h"
00032 #include "Conventions/Detectors.h"
00033 #include <vector>
00034 #include <map>
00035 #include <string>
00036
00037 class IStatisticsSvc;
00038 class TH1;
00039
00040 class AdCalibFigs : public GaudiAlgorithm
00041 {
00042
00043 public:
00044 AdCalibFigs(const std::string& name, ISvcLocator* pSvcLocator);
00045 virtual ~AdCalibFigs();
00046
00047 virtual StatusCode initialize();
00048 virtual StatusCode execute();
00049 virtual StatusCode finalize();
00050
00051 private:
00052 TH1* getOrMakeHist(int run, const DayaBay::Detector& detector,
00053 int column, int ring, int histogram);
00054 std::string getPath(int run, const char* detectorName,
00055 int column, int ring,
00056 const char* histName);
00057 void extendRange(TH1* hist, int xBinsAdd, int yBinsAdd=0);
00058
00059
00060 IStatisticsSvc* m_statsSvc;
00061
00062 TimeStamp* m_firstTriggerTime;
00063 std::map<DayaBay::Detector,TimeStamp> m_lastTriggerTime;
00064 std::map<int,TH1**> m_shortCuts;
00065 std::vector<TH1*> m_normalize;
00066 };
00067
00068 #endif // ADCALIBFIGS_H