00001
00002
00003 #ifndef XAODTRIGL1CALO_VERSIONS_CMXROI_V1_H
00004 #define XAODTRIGL1CALO_VERSIONS_CMXROI_V1_H
00005
00006 extern "C" {
00007 # include <stdint.h>
00008 }
00009
00010 #include "AthLinks/ElementLink.h"
00011 #include "AthContainers/AuxElement.h"
00012
00013 namespace xAOD {
00014
00021
00022 class CMXRoI_v1 : public SG::AuxElement{
00023 public:
00024
00025 enum SumType { NORMAL = 0, MASKED = 1 };
00026
00027
00028 CMXRoI_v1();
00030 virtual ~CMXRoI_v1(){}
00031
00033 virtual void initialize(uint32_t roiWord0, uint32_t roiWord1, uint32_t roiWord2,
00034 uint32_t roiWord3, uint32_t roiWord4, uint32_t roiWord5);
00035
00037 virtual void initialize(unsigned int ex, unsigned int ey, unsigned int et,
00038 int exError, int eyError, int etError,
00039 unsigned int sumEtHits, unsigned int missingEtHits,
00040 unsigned int missingEtSigHits,
00041 unsigned int exM, unsigned int eyM, unsigned int etM,
00042 int exErrorM, int eyErrorM, int etErrorM,
00043 unsigned int sumEtHitsM, unsigned int missingEtHitsM);
00044
00046 const std::vector<uint32_t>& cmxRoIWords() const;
00048 void setCmxRoIWords(const std::vector<uint32_t>&);
00049
00051 unsigned int ex(SumType type = NORMAL) const;
00053 unsigned int ey(SumType type = NORMAL) const;
00055 unsigned int et(SumType type = NORMAL) const;
00057 int exError(SumType type = NORMAL) const;
00059 int eyError(SumType type = NORMAL) const;
00061 int etError(SumType type = NORMAL) const;
00063 unsigned int sumEtHits(SumType type = NORMAL) const;
00065 unsigned int missingEtHits(SumType type = NORMAL) const;
00067 unsigned int missingEtSigHits() const;
00068
00070 uint32_t roiWord(int word) const;
00072 unsigned int exWord(SumType type = NORMAL) const;
00074 unsigned int eyWord(SumType type = NORMAL) const;
00076 unsigned int etWord(SumType type = NORMAL) const;
00077
00078
00079 private:
00080
00081 static const int s_wordIdVal0 = 0x4;
00082 static const int s_wordIdVal1 = 0x6;
00083 static const int s_wordIdVal2 = 0x5;
00084
00085 static const int s_wordIdBit = 28;
00086 static const int s_sumEtHitsBit = 16;
00087 static const int s_missingEtHitsBit = 16;
00088 static const int s_missingEtSigHitsBit = 16;
00089 static const int s_energyBit = 0;
00090 static const int s_overflowBit = 15;
00091 static const int s_sumTypeBit = 26;
00092
00093 static const int s_wordIdMask = 0xf;
00094 static const int s_sumEtHitsMask = 0xff;
00095 static const int s_missingEtHitsMask = 0xff;
00096 static const int s_missingEtSigHitsMask = 0xff;
00097 static const int s_energyMask = 0x7fff;
00098 static const int s_overflowMask = 0x1;
00099 static const int s_sumTypeMask = 0x1;
00100
00101 static const int s_exOffset = 0;
00102 static const int s_eyOffset = 2;
00103 static const int s_etOffset = 4;
00104 static const int s_maxRoiWords = 6;
00105
00106 };
00107 }
00108
00109 #endif // XAODTRIGL1CALO_VERSIONS_CMMROI_V1_H