00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: MdcxHits.cxx,v 1.8 2009/12/16 08:59:13 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class |MdcxHits| - container for |MdcxHit|s 00007 // 00008 // Environment: 00009 // Software developed for the BaBar Detector at the SLAC B-Factory. 00010 // 00011 // Author List: 00012 // A. Snyder 00013 // S. Wagner 00014 // Zhang Yao(zhangyao@ihep.ac.cn) Migrate to BESIII 00015 // 00016 // Copyright Information: 00017 // Copyright (C) 1994 BEPCII 00018 // 00019 // History: 00020 // Migration for BESIII MDC 00021 // 00022 //------------------------------------------------------------------------ 00023 #include "MdcxReco/MdcxHits.h" 00024 #include "CLHEP/Alist/AIterator.h" 00025 #include "MdcData/MdcHit.h" 00026 #include "Identifier/Identifier.h" 00027 #include "Identifier/MdcID.h" 00028 00029 using std::cout; 00030 using std::endl; 00031 using std::ostream; 00032 00033 double MdcxHits::timecut = -50.0; 00034 00035 MdcxHits::MdcxHits() : m_debug(0) { } 00036 /* 00037 MdcxHits::MdcxHits(MdcDigiCol* mdcDigiCol, float c0, float cresol) 00038 : m_debug(0) { 00039 00040 int ij = mdcDigiCol->size(); 00041 if (ij <= 0) return; 00042 MdcDigi* theDigi; 00043 MdcDigiCol::iterator iter = mdcDigiCol->begin(); 00044 for (; iter != mdcDigiCol->end(); iter++ ) { 00045 theDigi = (*iter); 00046 MdcxHit* temp = new MdcxHit(theDigi, c0, cresol); 00047 mdcxHitList.append(temp); 00048 } 00049 return; 00050 } 00051 */ 00052 00053 MdcxHits::~MdcxHits() { KillList(); } 00054 00055 void MdcxHits::reset() { 00056 HepAListDeleteAll(mdcxHitList); 00057 } 00058 00059 void MdcxHits::create(MdcDigiVec mdcDigiVec, float c0, float cresol) { 00060 MdcDigiVec::iterator iter = mdcDigiVec.begin(); 00061 for (; iter != mdcDigiVec.end(); iter++ ) { 00062 const MdcDigi* aDigi = *iter; 00063 MdcxHit* temp = new MdcxHit(aDigi, c0, cresol); 00064 //const Identifier id= aDigi->identify(); 00065 //int layer = MdcID::layer(id); 00066 //int wire = MdcID::wire(id); 00067 //std::cout<< " ("<<layer<<","<<wire<<") "<<aDigi->getTimeChannel()<<" "<<aDigi->getChargeChannel() << std::endl;//yzhang debug 00068 mdcxHitList.append(temp); 00069 } 00070 } 00071 00072 void MdcxHits::print(ostream &o, int pmax) const { 00073 int mcheck = pmax; 00074 if (mdcxHitList.length() < pmax) mcheck = mdcxHitList.length(); 00075 o << " First " << mcheck << " Main Drift Chamber Hits:" << endl; 00076 for(int i = 0; i < mcheck; i++) { 00077 mdcxHitList[i]->print(o, i); 00078 } 00079 }