00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef ADREADOUTFIGS_H
00011 #define ADREADOUTFIGS_H
00012
00013
00014 #define TRIGGERRATE 0
00015 #define DTTRIGGER 1
00016 #define LOGDTTRIGGER 2
00017 #define NCHANNELS 3
00018 #define NCHANNELSVSTIME 4
00019 #define CHANNELHITS 5
00020 #define CHANNELDADCFINE 6
00021 #define CHANNELDADCCOARSE 7
00022 #define TDCVSBOARD 8
00023 #define TDC 9
00024 #define ADCFINE 10
00025 #define ADCCOARSE 11
00026 #define DADCVSTIMEFINE 12
00027 #define DADCVSPEDFINE 13
00028 #define DADCFINEVSTDC 14
00029 #define PEDFINEVSTDC 15
00030 #define NHISTOGRAMS 16
00031
00032 #define NSITES 5
00033 #define NDETECTORS 5
00034 #define NBOARDS 21
00035 #define NCONNECTORS 17
00036
00037 #define MAXHISTS NSITES*NDETECTORS*NBOARDS*NCONNECTORS*NHISTOGRAMS
00038
00039 #include "GaudiAlg/GaudiAlgorithm.h"
00040 #include "Context/TimeStamp.h"
00041 #include "Conventions/Detectors.h"
00042 #include <vector>
00043 #include <map>
00044 #include <string>
00045
00046 class IStatisticsSvc;
00047 class TH1;
00048
00049 class AdReadoutFigs : public GaudiAlgorithm
00050 {
00051
00052 public:
00053 AdReadoutFigs(const std::string& name, ISvcLocator* pSvcLocator);
00054 virtual ~AdReadoutFigs();
00055
00056 virtual StatusCode initialize();
00057 virtual StatusCode execute();
00058 virtual StatusCode finalize();
00059
00060 private:
00061 TH1* getOrMakeHist(int run, const DayaBay::Detector& detector,
00062 int board, int connector, int histogram);
00063 std::string getPath(int run, const char* detectorName,
00064 int board, int connector,
00065 const char* histName);
00066 void extendRange(TH1* hist, int xBinsAdd, int yBinsAdd=0);
00067
00068
00069 IStatisticsSvc* m_statsSvc;
00070
00071 TimeStamp* m_firstTriggerTime;
00072 std::map<DayaBay::Detector,TimeStamp> m_lastTriggerTime;
00073 std::map<int,TH1**> m_shortCuts;
00074 std::vector<TH1*> m_normalize;
00075 };
00076
00077 #endif // ADREADOUTFIGS_H