00001
00002 #ifndef TrigConf_PrescaleSet
00003 #define TrigConf_PrescaleSet
00004
00005 #include <vector>
00006 #include <string>
00007 #include "TrigConfL1Data/L1DataBaseclass.h"
00008 #include <stdint.h>
00009
00015 namespace TrigConf {
00016
00017 class PrescaleSet : public L1DataBaseclass {
00018 public:
00019
00020
00021
00022 static const int32_t maxPrescaleCut;
00023
00024 static int32_t getCutFromPrescale(double prescale);
00025
00026 static double getPrescaleFromCut(int32_t cut);
00027
00028 PrescaleSet();
00029 ~PrescaleSet();
00030
00031
00032 bool isNull() const { return m_null; }
00033 bool newPrescaleStyle() const { return m_newPrescales; }
00034 const std::string& type() const { return m_Type; }
00035 unsigned int partition() const { return m_Partition; }
00036 const std::vector<int>& prescales() const __attribute__((deprecated)) { return m_Prescales; }
00037 const std::vector<int64_t>& prescales_ctp() const { return m_Prescales_ctp; }
00038 const std::vector<float>& prescales_float() const { return m_Prescales_float; }
00039 const std::vector<int32_t>& cuts() const { return m_Cuts; }
00040
00041
00042 void setNewPrescaleStyle(bool newstyle=true) { m_newPrescales = newstyle; }
00043 void setType(const std::string& type) { m_Type = type; }
00044 void setPartition(unsigned int partition) { m_Partition = partition; }
00045
00046
00047 void resize(size_t size);
00048 void setPrescales(const std::vector<int64_t>&) __attribute__ ((deprecated));
00049 void setPrescales(const int64_t p[], unsigned int size) __attribute__ ((deprecated));
00050 void setPrescales(const int p[], unsigned int size) __attribute__ ((deprecated));
00051 void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__ ((deprecated));
00052 void setPrescale(unsigned int num, int prescaleValue) __attribute__ ((deprecated));
00053 void setPrescale(unsigned int num, float prescaleValue);
00054 void setCuts(const std::vector<int32_t>& cuts);
00055 void setCut(unsigned int num, int32_t cut);
00056
00057
00058 void reset();
00059
00060 virtual void print(const std::string& indent = "", unsigned int detail=1) const;
00061
00062 void writeXML(std::ostream & xmlfile, int indentLevel = 0, int indentWidth = 2) const;
00063
00064 private:
00065 bool m_null;
00066
00067 bool m_newPrescales;
00068
00069 std::string m_Type;
00070 unsigned int m_Partition;
00071 std::vector<int> m_Prescales;
00072 std::vector<int64_t> m_Prescales_ctp;
00073 std::vector<float> m_Prescales_float;
00074 std::vector<int32_t> m_Cuts;
00075
00076 };
00077
00078 }
00079
00080 #endif
00081