00001
00002 #ifndef TrigConf_ThresholdConfig
00003 #define TrigConf_ThresholdConfig
00004
00005 #include "TrigConfL1Data/TriggerThreshold.h"
00006 #include "TrigConfL1Data/CaloInfo.h"
00007 #include "TrigConfL1Data/L1DataBaseclass.h"
00008 #include "TrigConfL1Data/L1DataDef.h"
00009
00010 namespace TrigConf {
00011
00012 class ThresholdConfig : public L1DataBaseclass {
00013 public:
00014
00015 typedef std::vector<TriggerThreshold*> thrVec_t;
00016 typedef std::map< L1DataDef::TriggerType, thrVec_t> thrVecMap_t;
00017
00018 ThresholdConfig();
00019 ~ThresholdConfig();
00020
00021 std::vector<TriggerThreshold*>& thresholdVector(L1DataDef::TriggerType);
00022 const std::vector<TriggerThreshold*>& getThresholdVector(L1DataDef::TriggerType) const;
00023
00024 const std::vector<TriggerThreshold*>& getThresholdVector() const { return m_TriggerThresholdVector; }
00025 const std::vector<TriggerThreshold*>& thresholdVector() const { return m_TriggerThresholdVector; }
00026
00027
00028 std::string getClusterThresholdType( int thresholdnumber ) const;
00029
00030
00031 float getThreshold(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const;
00032
00033
00034 int getWindow(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const;
00035
00036 size_t size() const { return getThresholdVector().size(); }
00037 size_t size(L1DataDef::TriggerType type) const { return getThresholdVector(type).size(); }
00038
00039
00040 float getClusterThreshold(int eta, int phi, int thresholdnumber) const;
00041 float getJetThreshold(int eta, int phi, int thresholdnumber) const;
00042 float getJbThreshold(int eta, int phi, int thresholdnumber) const;
00043 float getJfThreshold(int eta, int phi, int thresholdnumber) const;
00044 float getMuonThreshold(int eta, int phi, int thresholdnumber) const;
00045 float getTotEtThreshold(int eta, int phi, int thresholdnumber) const;
00046 float getJetEtThreshold(int eta, int phi, int thresholdnumber) const;
00047 float getMissEtThreshold(int eta, int phi, int thresholdnumber) const;
00048 float getMissEtSigThreshold(int eta, int phi, int thresholdnumber) const;
00049 float getClusterEmIsolation(int eta, int phi, int thresholdnumber) const;
00050 float getClusterHadIsolation(int eta, int phi, int thresholdnumber) const;
00051 float getClusterHadVeto(int eta, int phi, int thresholdnumber) const;
00052 int getJetWindow(int eta, int phi, int thresholdnumber) const;
00053 int getJbWindow(int eta, int phi, int thresholdnumber) const;
00054 int getJfWindow(int eta, int phi, int thresholdnumber) const;
00055
00056 const CaloInfo& caloInfo() const { return m_CaloInfo; }
00057 void setCaloInfo (const CaloInfo& ci) { m_CaloInfo = ci; }
00058
00059 bool addTriggerThreshold(TriggerThreshold* value);
00060
00061 virtual void print(const std::string& indent="", unsigned int detail=1) const;
00062
00063 void printTriggerThresholdVector(const std::string& indent="") const;
00064
00065 void printThresholdValueMap() const;
00066 void printTtvMap(const TriggerThreshold* thr) const;
00067 void printTtvSummary(const thrVec_t& vec, const std::string& name) const;
00068
00069 void clear();
00070
00071 void attributeThresholdNumbers();
00072
00073 TriggerThreshold* findTriggerThreshold(unsigned int id);
00074
00075 void setCtpVersion(unsigned int ctpVersion) { m_ctpVersion = ctpVersion; }
00076 unsigned int ctpVersion() const { return m_ctpVersion; }
00077
00078 void setL1Version(unsigned int l1Version) { m_l1Version = l1Version; }
00079 unsigned int l1Version() const { return m_l1Version; }
00080
00081 private:
00082
00083 bool insertInPosition(std::vector<TriggerThreshold*>& thrVec, TriggerThreshold* tt, unsigned int pos);
00084
00085 std::vector<TriggerThreshold*> getNimThresholdVectorByType(const std::string& type) const;
00086
00087 private:
00088 friend class CTPConfig;
00089
00090 unsigned int m_ctpVersion;
00091 unsigned int m_l1Version;
00092 thrVecMap_t m_thresholdVectors;
00093 thrVec_t m_TriggerThresholdVector;
00094 thrVec_t m_ClusterThresholdVector;
00095 CaloInfo m_CaloInfo;
00096
00097
00098 public:
00099
00100 const std::vector<TriggerThreshold*>& getClusterThresholdVector() const { return m_ClusterThresholdVector; }
00101 const std::vector<TriggerThreshold*>& getJetThresholdVector() const { return getThresholdVector(L1DataDef::JET); }
00102 const std::vector<TriggerThreshold*>& getFJetThresholdVector() const { return getThresholdVector(L1DataDef::FJ); }
00103 const std::vector<TriggerThreshold*>& getJbThresholdVector() const { return getThresholdVector(L1DataDef::JB); }
00104 const std::vector<TriggerThreshold*>& getJfThresholdVector() const { return getThresholdVector(L1DataDef::JF); }
00105 const std::vector<TriggerThreshold*>& getTotEtVector() const { return getThresholdVector(L1DataDef::TE); }
00106 const std::vector<TriggerThreshold*>& getJetEtVector() const { return getThresholdVector(L1DataDef::JE); }
00107 const std::vector<TriggerThreshold*>& getMissEtVector() const { return getThresholdVector(L1DataDef::XE); }
00108 const std::vector<TriggerThreshold*>& getMissEtSignVector() const { return getThresholdVector(L1DataDef::XS); }
00109 const std::vector<TriggerThreshold*>& getMuonThresholdVector() const { return getThresholdVector(L1DataDef::MUON); }
00110 const std::vector<TriggerThreshold*>& getRndmThresholdVector() const { return getThresholdVector(L1DataDef::RNDM); }
00111 const std::vector<TriggerThreshold*>& getBgrpThresholdVector() const { return getThresholdVector(L1DataDef::BGRP); }
00112 const std::vector<TriggerThreshold*>& getPclkThresholdVector() const { return getThresholdVector(L1DataDef::PCLK); }
00113 const std::vector<TriggerThreshold*>& getNimThresholdVector() const { return getThresholdVector(L1DataDef::NIM); }
00114 const std::vector<TriggerThreshold*>& getZBThresholds() const { return getThresholdVector(L1DataDef::ZB);}
00115 const std::vector<TriggerThreshold*>& getMbtsThresholdVector() const { return getThresholdVector(L1DataDef::MBTS); }
00116 const std::vector<TriggerThreshold*>& getMbtssiThresholdVector() const { return getThresholdVector(L1DataDef::MBTSSI); }
00117 const std::vector<TriggerThreshold*>& getTrtThresholdVector() const { return getThresholdVector(L1DataDef::TRT); }
00118 const std::vector<TriggerThreshold*>& getZdcThresholdVector() const { return getThresholdVector(L1DataDef::ZDC); }
00119 const std::vector<TriggerThreshold*>& getBcmThresholdVector() const { return getThresholdVector(L1DataDef::BCM); }
00120 const std::vector<TriggerThreshold*>& getBcmcmbThresholdVector() const { return getThresholdVector(L1DataDef::BCMCMB); }
00121 const std::vector<TriggerThreshold*>& getLucidThresholdVector() const { return getThresholdVector(L1DataDef::LUCID); }
00122 const std::vector<TriggerThreshold*>& getBptxThresholdVector() const { return getThresholdVector(L1DataDef::BPTX); }
00123
00124 #ifndef __GCCXML__
00125
00126 const std::vector<TriggerThreshold*>* getClusterThresholdPointer() const __attribute__ ((deprecated)) { return &m_ClusterThresholdVector;}
00127 const std::vector<TriggerThreshold*>* getJetThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::JET);}
00128 const std::vector<TriggerThreshold*>* getFJetThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::FJ);}
00129 const std::vector<TriggerThreshold*>* getJbThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::JB);}
00130 const std::vector<TriggerThreshold*>* getJfThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::JF);}
00131 const std::vector<TriggerThreshold*>* getTotEtPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::TE);}
00132 const std::vector<TriggerThreshold*>* getJetEtPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::JE);}
00133 const std::vector<TriggerThreshold*>* getMissEtPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::XE);}
00134 const std::vector<TriggerThreshold*>* getMissEtSignPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::XS);}
00135 const std::vector<TriggerThreshold*>* getMuonThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::MUON);}
00136 const std::vector<TriggerThreshold*>* getRndmThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::RNDM);}
00137 const std::vector<TriggerThreshold*>* getBgrpThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::BGRP);}
00138 const std::vector<TriggerThreshold*>* getPclkThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::PCLK);}
00139 const std::vector<TriggerThreshold*>* getNimThresholdPointer() const __attribute__ ((deprecated)) { return &getThresholdVector(L1DataDef::NIM);}
00140
00141 #endif
00142 };
00143 }
00144
00145 #endif