#include <EmcTimeRec.h>
Public Member Functions | |
EmcTimeRec (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Private Attributes | |
bool | m_output |
NTuple::Tuple * | m_tuple |
NTuple::Item< float > | m_nt_emcTime |
NTuple::Item< float > | m_nt_estTime |
NTuple::Item< float > | m_nt_corTime |
NTuple::Item< long > | m_nt_npart |
NTuple::Item< long > | m_nt_ntheta |
NTuple::Item< long > | m_nt_nphi |
NTuple::Item< float > | m_nt_e5x5 |
NTuple::Item< long > | m_nt_status |
Definition at line 12 of file EmcTimeRec.h.
EmcTimeRec::EmcTimeRec | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 16 of file EmcTimeRec.cxx.
References m_output.
00016 : 00017 Algorithm(name, pSvcLocator) 00018 { 00019 declareProperty("Output",m_output=false); 00020 }
StatusCode EmcTimeRec::execute | ( | ) |
Definition at line 54 of file EmcTimeRec.cxx.
References EmcID::barrel_ec(), Bes_Common::DEBUG, m_nt_corTime, m_nt_e5x5, m_nt_emcTime, m_nt_estTime, m_nt_npart, m_nt_nphi, m_nt_ntheta, m_nt_status, m_output, m_tuple, msgSvc(), EmcID::phi_module(), EventModel::Recon::RecEmcShowerCol, EmcID::theta_module(), and Bes_Common::WARNING.
00054 { 00055 00056 MsgStream log(msgSvc(), name()); 00057 log << MSG::DEBUG << "in execute()" << endreq; 00058 00059 SmartDataPtr<RecEsTimeCol> estimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol"); 00060 00061 if( !estimeCol || ( estimeCol->size() == 0 ) ) { 00062 log << MSG::WARNING << "Could not find RecEsTimeCol!" << endreq; 00063 return StatusCode::SUCCESS; 00064 } 00065 00066 RecEsTimeCol::iterator iter_ESTime=estimeCol->begin(); 00067 double t0 = (*iter_ESTime)->getTest(); //get t0 00068 00069 SmartDataPtr<RecEmcShowerCol> emcRecShowerCol(eventSvc(), EventModel::Recon::RecEmcShowerCol); 00070 if(!emcRecShowerCol) { 00071 log << MSG::WARNING << "Could not find RecEmcShowerCol!" << endreq; 00072 return StatusCode::SUCCESS; 00073 } 00074 00075 RecEmcShowerCol::iterator iShowerCol; 00076 for(iShowerCol=emcRecShowerCol->begin(); 00077 iShowerCol!=emcRecShowerCol->end(); 00078 iShowerCol++) { 00079 00080 if((*iShowerCol)->status()>=100) continue; //estTime has been subtracted 00081 00082 double tEmc = (*iShowerCol)->time(); 00083 (*iShowerCol)->setTime(tEmc-(int)(t0/50)); 00084 (*iShowerCol)->setStatus((*iShowerCol)->status()%100+100); 00085 00086 if(m_output) { 00087 m_nt_emcTime = tEmc; 00088 m_nt_estTime = (double)(int)(t0/50); 00089 m_nt_corTime = (*iShowerCol)->time(); 00090 RecEmcID id((*iShowerCol)->getShowerId()); 00091 m_nt_npart = EmcID::barrel_ec(id); 00092 m_nt_ntheta = EmcID::theta_module(id); 00093 m_nt_nphi = EmcID::phi_module(id); 00094 m_nt_e5x5 = (*iShowerCol)->e5x5(); 00095 m_nt_status = (*iShowerCol)->status(); 00096 m_tuple->write(); 00097 } 00098 } 00099 00100 return StatusCode::SUCCESS; 00101 }
StatusCode EmcTimeRec::finalize | ( | ) |
Definition at line 104 of file EmcTimeRec.cxx.
References Bes_Common::INFO, and msgSvc().
00104 { 00105 00106 MsgStream log(msgSvc(), name()); 00107 log << MSG::INFO << "in finalize()" << endreq; 00108 00109 return StatusCode::SUCCESS; 00110 }
StatusCode EmcTimeRec::initialize | ( | ) |
Definition at line 23 of file EmcTimeRec.cxx.
References calibUtil::ERROR, Bes_Common::INFO, m_nt_corTime, m_nt_e5x5, m_nt_emcTime, m_nt_estTime, m_nt_npart, m_nt_nphi, m_nt_ntheta, m_nt_status, m_output, m_tuple, msgSvc(), and ntupleSvc().
00023 { 00024 00025 MsgStream log(msgSvc(), name()); 00026 log << MSG::INFO << "in initialize()" << endreq; 00027 00028 if(m_output) { 00029 NTuplePtr nt(ntupleSvc(),"FILE303/n1"); 00030 if ( nt ) m_tuple = nt; 00031 else { 00032 m_tuple=ntupleSvc()->book("FILE303/n1",CLID_ColumnWiseTuple,"EmcTimeRec"); 00033 if( m_tuple ) { 00034 m_tuple->addItem ("emcTime", m_nt_emcTime); 00035 m_tuple->addItem ("estTime", m_nt_estTime); 00036 m_tuple->addItem ("corTime", m_nt_corTime); 00037 m_tuple->addItem ("npart", m_nt_npart); 00038 m_tuple->addItem ("ntheta", m_nt_ntheta); 00039 m_tuple->addItem ("nphi", m_nt_nphi); 00040 m_tuple->addItem ("e5x5", m_nt_e5x5); 00041 m_tuple->addItem ("status", m_nt_status); 00042 } 00043 else { // did not manage to book the N tuple.... 00044 log << MSG::ERROR << "Cannot book N-tuple:" << long(m_tuple) << endmsg; 00045 return StatusCode::FAILURE; 00046 } 00047 } 00048 } 00049 00050 return StatusCode::SUCCESS; 00051 }
NTuple::Item<float> EmcTimeRec::m_nt_corTime [private] |
NTuple::Item<float> EmcTimeRec::m_nt_e5x5 [private] |
NTuple::Item<float> EmcTimeRec::m_nt_emcTime [private] |
NTuple::Item<float> EmcTimeRec::m_nt_estTime [private] |
NTuple::Item<long> EmcTimeRec::m_nt_npart [private] |
NTuple::Item<long> EmcTimeRec::m_nt_nphi [private] |
NTuple::Item<long> EmcTimeRec::m_nt_ntheta [private] |
NTuple::Item<long> EmcTimeRec::m_nt_status [private] |
bool EmcTimeRec::m_output [private] |
Definition at line 21 of file EmcTimeRec.h.
Referenced by EmcTimeRec(), execute(), and initialize().
NTuple::Tuple* EmcTimeRec::m_tuple [private] |