00001 #ifndef __EMCQAS_H__
00002 #define __EMCQAS_H__
00003
00004 #ifndef __EMCFEMTUPLE_H__
00005 #include "emcFEMtuple.h"
00006 #endif
00007 #ifndef __EMCQAFEM_H__
00008 #include "emcQAFEM.h"
00009 #endif
00010 #include <string>
00011 #include <map>
00012
00013 typedef char INT8;
00014
00020 class emcQAs : public emcFEMtuple
00021 {
00022 public:
00023
00024
00025 emcQAs() : emcFEMtuple(), fDeadMap(0), fWarnMap(0)
00026 {
00027 SetExtraRejectListFilename();
00028 }
00029 emcQAs(const char* name, const char* title, const char* classname)
00030 : emcFEMtuple(name, title, classname), fDeadMap(0), fWarnMap(0)
00031 {
00032 SetExtraRejectListFilename();
00033 }
00034
00035 virtual ~emcQAs()
00036 {
00037 delete[] fDeadMap;
00038 delete[] fWarnMap;
00039 }
00040
00041 bool BuildDeadMap(void);
00042
00043 bool ApplyExtraRejectList(void);
00044
00045 virtual const char* GetCategory(void) const
00046 {
00047 return "QAs";
00048 }
00049
00050 Int_t GetDead(int ichannel);
00051 Int_t GetWarn(int ichannel);
00052
00053 Int_t* GetDeadMap(void);
00054 Int_t* GetWarnMap(void);
00055
00056
00057
00058 INT32 GetError(int ichannel) const;
00059
00060 const char* GetExtraRejectListFilename(void) const
00061 {
00062 return fExtraRejectListFilename.c_str();
00063 }
00064
00065 INT32 GetWarning(int channel) const;
00066
00067 static INT32 IamDeadMask(void)
00068 {
00069 return 0x400;
00070 }
00071
00072
00073
00074
00075
00076 void SetExtraRejectListFilename(const char* filename = "" )
00077 {
00078 fExtraRejectListFilename = filename;
00079 }
00080
00081 static bool WriteDataToFile(const char* producerName, int femCode,
00082 const PHTimeStamp& tStart,
00083 const PHTimeStamp& tEnd,
00084 INT8* errors, INT8* warnings);
00085 private:
00086
00087 std::string fExtraRejectListFilename;
00088
00089 Int_t* fDeadMap;
00090 Int_t *fWarnMap;
00091
00092
00093 static const INT32 fMoniAmplMask;
00094 static const INT32 fMoniTofMask;
00095 static const INT32 fMoniAmplWarnMask;
00096 static const INT32 fMoniTofWarnMask;
00097
00098
00099
00100
00101
00102
00103
00104
00105 std::map<int, unsigned char> fPhysRejectMap;
00106 std::map<int, unsigned char> fPhysWarningMap;
00107
00108 static unsigned char const fPhysAmplMask;
00109 static unsigned char const fPhysTofMask;
00110
00111 };
00112
00113 #endif