emcQAs.h

Go to the documentation of this file.
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   // MV 2001/12/04 deleted calls to SetDeadMask(), added fWarnMap;
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); // MV 2001/12/08
00052 
00053   Int_t* GetDeadMap(void);
00054   Int_t* GetWarnMap(void); // MV 2001/12/08
00055 
00056   // MV 2001/12/04  INT32 GetDeadMask(void) const { return fMask; }
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   // MV 2001/12/04 noone should mess with the masks
00073   //  void SetDeadMask(INT32 amplMask=0x3, INT32 tofMask=0x0)
00074   //    {fMoniAmplMask=amplMask; fMoniTofMask=tofMask;}
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; // MV 2001/12/08
00091 
00092   // MV 2001/12/04 different masks for bad ToF and bad amplitude
00093   static const INT32 fMoniAmplMask;
00094   static const INT32 fMoniTofMask;
00095   static const INT32 fMoniAmplWarnMask;
00096   static const INT32 fMoniTofWarnMask;
00097 
00098   // MV 2001/12/04 The idea is to put all amplitude- and ToF-related errors
00099   // found from physics data into the additional reject list (ASCII) file.
00100   // When this file is read in, the error codes are put into the map.
00101   // The key of the map is the tower item id, the value is the error code
00102   // (bitmap). 4 most significant bits of this bitmap are for ToF-related
00103     // errors, 4 least significant bits are for amplitude-related errors.
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