UseDedx Class Reference

Simple algorithm to test functioning of "the other" TDS. More...

#include <UseDedx.h>

List of all members.

Public Member Functions

 UseDedx (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

IDataProviderSvc * m_pCalibDataSvc
ICalibRootSvcm_pRootSvc


Detailed Description

Simple algorithm to test functioning of "the other" TDS.

Definition at line 15 of file UseDedx.h.


Constructor & Destructor Documentation

UseDedx::UseDedx ( const std::string name,
ISvcLocator *  pSvcLocator 
)

Definition at line 39 of file UseDedx.cxx.

00041   : Algorithm     ( name, pSvcLocator ), m_pCalibDataSvc(0)
00042 {
00043   // Declare properties here.
00044 
00045 }


Member Function Documentation

StatusCode UseDedx::execute (  ) 

Definition at line 88 of file UseDedx.cxx.

References genRecEmupikp::i, Bes_Common::INFO, ganga-rec::j, m_pCalibDataSvc, msgSvc(), deljobs::string, and test.

00088                              {
00089    
00090   MsgStream log(msgSvc(), name());
00091 
00092 
00093   std::string fullPath = "/Calib/DedxCal";
00094 
00095    log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
00096    
00097     SmartDataPtr<CalibData::DedxCalibData> test(m_pCalibDataSvc, fullPath);
00098     int i;
00099     int j;
00100    double ddg;
00101    double ggs;
00102    double wireg;
00103    double gain;
00104    double zdep;
00105    double resol;
00106    double layerg;
00107    double m_id_doca;
00108    double m_iner_chi;
00109    double m_iner_gain;
00110    double m_iner_hits;
00111    double m_ip_eangle;
00112    double m_out_chi;
00113    double m_out_gain;
00114    double m_out_hits;
00115 
00116     for(i=0;i<4;i++){
00117       for(j=0;j<43;j++){
00118         ddg = test->getddg(i,j);
00119         ggs = test->getggs(i,j);
00120         zdep = test->getzdep(i,j);
00121 //      std::cout<<"ddg["<<i<<"]["<<j<<"]="<<ddg;
00122 //        std::cout<<"         ggs["<<i<<"]["<<j<<"]="<<ggs;
00123 //        std::cout<<"        zdep["<<i<<"]["<<j<<"]="<<zdep;
00124 //      std::cout<<"\n";
00125       }
00126     }
00127     
00128      for(int i=0;i<1600;i++){
00129       m_id_doca = test->get_id_doca(i);
00130       m_iner_chi= test->get_iner_chi(i);
00131       m_iner_gain= test->get_iner_gain(i);
00132       m_iner_hits= test->get_iner_hits(i);
00133       m_ip_eangle= test->get_ip_eangle(i);
00134       m_out_chi= test->get_out_chi(i);
00135       m_out_gain= test->get_out_gain(i);
00136       m_out_hits= test->get_out_hits(i);
00137      std::cout<<"m_id_doca:  "<<m_id_doca<<" m_iner_chi: "<<m_iner_chi<<" m_iner_gain: "<<m_iner_gain<<" m_iner_hits:"<<m_iner_hits<<" m_ip_eangle:"<<m_ip_eangle<<"  m_out_chi="<<m_out_chi<<" m_out_gain:"<<m_out_gain<<" m_out_hits="<<m_out_hits<<std::endl;
00138       }
00139     gain = test->getgain();
00140 //    std::cout<<"gain="<<gain<<"\n";
00141      double m_costheta;
00142     for(int i=0;i<80;i++){
00143      m_costheta = test->get_costheta(i);
00144       std::cout<<" m_costheta="<<m_costheta;
00145       if(i%5==0) std::cout<<"\n"<<std::endl;
00146     }
00147     double t0,dedx;
00148     for(int i=0;i<35;i++){
00149      t0=test->get_t0(i);
00150      dedx=test->get_dedx(i);
00151      std::cout<<"t0  ="<<t0<<"  dedx="<<dedx;
00152      if(i%5==0) std::cout<<"\n"<<std::endl;
00153     }
00154 
00155     resol = test->getresol();
00156   //  std::cout<<"resol="<<resol<<"\n";
00157 
00158     for(i=0;i<43;i++)
00159      { layerg = test -> getlayerg(i);
00160   //   std::cout<<"layerg["<<i<<"]="<<layerg;
00161      }
00162 
00163     for(i=0;i<60;i++)
00164      { wireg = test -> getwireg(i);
00165     // std::cout<<"wireg["<<i<<"]="<<wireg<<"\n";
00166      }
00167     
00168     for(i=0;i<20;i++){
00169     std::cout<<"hadron "<<i<<" = "<<test->get_hadron(i);
00170      }   
00171 
00172      //for pah is error
00173      //m_pRootSvc->writeToRoot("/home/huangb/2.root", fullPath);
00174    return StatusCode::SUCCESS;
00175 }

StatusCode UseDedx::finalize (  ) 

Definition at line 177 of file UseDedx.cxx.

References Bes_Common::INFO, and msgSvc().

00177                               {
00178 
00179   MsgStream log(msgSvc(), name());
00180   log << MSG::INFO 
00181       << "        UseDedx FINALIZE!! "
00182       << endreq;
00183   
00184   return StatusCode::SUCCESS;
00185 }

StatusCode UseDedx::initialize (  ) 

Definition at line 48 of file UseDedx.cxx.

References Bes_Common::DEBUG, calibUtil::ERROR, Bes_Common::INFO, m_pCalibDataSvc, m_pRootSvc, and msgSvc().

00048                                {
00049   StatusCode sc;
00050   MsgStream log(msgSvc(), name());
00051   log << MSG::INFO << "Initialize()" << endreq;
00052 
00053   // So far don't have any properties, but in case we do some day..
00054 //  setProperties();
00055 
00056    log<<MSG::INFO << "setProperties()" << endreq;
00057   
00058    sc = service("CalibDataSvc", m_pCalibDataSvc, true);
00059 
00060   if ( !sc.isSuccess() ) {
00061     log << MSG::ERROR 
00062         << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc" 
00063         << endreq;
00064     return sc;
00065   } else {
00066     log << MSG::DEBUG 
00067         << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" 
00068         << endreq;
00069   }
00070 
00071 sc = service("CalibRootCnvSvc", m_pRootSvc, true);
00072   if ( !sc.isSuccess() ) {
00073     log << MSG::ERROR 
00074         << "Could not get ICalibRootSvc interface of CalibRootCnvSvc" 
00075         << endreq;
00076     return sc;
00077   }
00078 
00079   // Get properties from the JobOptionsSvc
00080   
00081  sc = setProperties();
00082 
00083  return StatusCode::SUCCESS;
00084 
00085 }


Member Data Documentation

IDataProviderSvc* UseDedx::m_pCalibDataSvc [private]

Definition at line 27 of file UseDedx.h.

Referenced by execute(), and initialize().

ICalibRootSvc* UseDedx::m_pRootSvc [private]

Definition at line 28 of file UseDedx.h.

Referenced by initialize().


Generated on Tue Nov 29 23:36:20 2016 for BOSS_7.0.2 by  doxygen 1.4.7