00001 #include "HltEvent/DstHltInf.h" 00002 00003 const std::string DstHltInf::s_chn[32]={ 00004 "Junk","GJunk","Beamgas","GBeamgas", 00005 "Cosmic","GCosmic","EBhabha","GEBhabha", 00006 "BBhabha","GBBhabha","Dimuon","GDimuon", 00007 "Diphoton","GDiphoton","Hadron","GHadron", 00008 "Twophoton","Twophoton","","", 00009 "","","","", 00010 "","EMCEBhabha","","", 00011 "","Other","Error","RandomTrg"}; 00012 const std::string DstHltInf::s_err="EventFilterError"; 00013 00014 DstHltInf::DstHltInf(const unsigned int type, const unsigned int alg, 00015 const unsigned int cri, const unsigned int ver, const float etot): 00016 DataObject(),IHltInterface(), 00017 m_eventType(type), 00018 m_algProcess(alg), 00019 m_criTable(cri), 00020 m_version(ver), 00021 m_eTotal(etot), 00022 m_number(0), 00023 m_ncon(0){ 00024 } 00025 00026 DstHltInf::DstHltInf(): 00027 DataObject(),IHltInterface(), 00028 m_eventType(0), 00029 m_algProcess(0), 00030 m_criTable(0), 00031 m_version(0), 00032 m_eTotal(0), 00033 m_number(0), 00034 m_ncon(0){ 00035 } 00036 00037 DstHltInf::DstHltInf(const DstHltInf& other): 00038 DataObject(),IHltInterface(), 00039 m_eventType(other.m_eventType), 00040 m_algProcess(other.m_algProcess), 00041 m_criTable(other.m_criTable), 00042 m_version(other.m_version), 00043 m_eTotal(other.m_eTotal), 00044 m_number(other.m_number), 00045 m_ncon(other.m_ncon) { 00046 } 00047 00048 DstHltInf& DstHltInf::operator=(const DstHltInf& h) { 00049 if( &h != this ){ 00050 m_eventType =h.m_eventType; 00051 m_algProcess=h.m_algProcess; 00052 m_criTable =h.m_criTable; 00053 m_version =h.m_version; 00054 m_eTotal =h.m_eTotal; 00055 m_number =h.m_number; 00056 m_ncon =h.m_ncon; 00057 } 00058 return *this; 00059 } 00060 00061 const string& DstHltInf::getEventName() const{ 00062 for(int i=0;i<32;i++){ 00063 if(m_eventType&(1<<i)) return (s_chn[i]); 00064 } 00065 return s_err; 00066 } 00067 00068 bool DstHltInf::isType(string& type) const{ 00069 for(int i=0;i<32;i++){ 00070 if(type!=s_chn[i]) continue; 00071 if(m_eventType&(1<<i))return true; 00072 } 00073 return false; 00074 } 00075 00076 ostream& operator<<(ostream & os, const DstHltInf& aHlt){ 00077 os<<"-----DstHltInf-----:"<<endl; 00078 os<<"EventType: "<<aHlt.getEventType()<<endl 00079 <<"AlgProcess: "<<aHlt.getAlgProcess()<<endl 00080 <<"CriteriaTab:"<<aHlt.getCriteriaTable()<<endl 00081 <<"EFVersion: "<<aHlt.getVersion()<<endl 00082 <<"TotalEnergy:"<<aHlt.getTotalEnergy()<<endl; 00083 return os; 00084 }