checkEstTof Class Reference

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

#include <checkEstTof.h>

List of all members.

Public Member Functions

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

Private Attributes

IDataProviderSvc * m_pCalibDataSvc
ICalibTreeSvcm_pTreeSvc


Detailed Description

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

Definition at line 16 of file checkEstTof.h.


Constructor & Destructor Documentation

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

Definition at line 40 of file checkEstTof.cxx.

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


Member Function Documentation

StatusCode checkEstTof::execute (  ) 

Definition at line 88 of file checkEstTof.cxx.

References genRecEmupikp::i, Bes_Common::INFO, m_pCalibDataSvc, msgSvc(), and deljobs::string.

00088                                  {
00089    
00090   MsgStream log(msgSvc(), name());
00091 
00092   // Cheat for now since Windows is having trouble finding definition
00093   // of Calibdata::Test_t
00094   std::string fullPath = "/Calib/EstTofCal";
00095    log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
00096 
00097     SmartDataPtr<CalibData::TofCalibData> btof(m_pCalibDataSvc, fullPath);
00098 
00099     for(int i =0;i<176;i++)
00100       {
00101         double bAtten0 = btof->getBTofAtten(i,0);
00102         double bAtten1 = btof->getBTofAtten(i,1);
00103       double bP0  = btof->getBTofPleft(i,0);
00104       double bP1  = btof->getBTofPleft(i,1);
00105       double bP2  = btof->getBTofPleft(i,2);
00106       double bP3 = btof->getBTofPleft(i,3);
00107       double bP4 = btof->getBTofPleft(i,4);
00108       double bP5 = btof->getBTofPleft(i,5);
00109       double bP10 = btof->getBTofPright(i,0);
00110 
00111 
00112       //      double bQ = btof->getBTofQ(i);
00113       double bSpeed0 = btof->getBTofSpeed(i,0);
00114       double bSpeed1 = btof->getBTofSpeed(i,1);
00115       //      double bW1 = btof->getBTofW(i,0);
00116       //      double bW2 = btof->getBTofW(i,1);
00117       //      double bW3 = btof->getBTofW(i,2);
00118       //      double bW4 = btof->getBTofW(i,3);
00119       std::cout<<"=========================================="<<"\n";
00120       std::cout<<"cnt ="<<i<<"\n";
00121       std::cout<<"Atten0="<<bAtten0<<"Atten1="<<bAtten1<<"Q="<< "bQ " <<"Speed0="<<bSpeed0<<"Speed1="<<bSpeed1<<"P0="<<bP0<<"P1="<<bP1<<"P2="<<bP2<<"P3="<<bP3<<"P4="<<bP4<<"P10="<<bP10;
00122       std::cout<<"\n";
00123       std::cout<<"P5="<<bP5<<"Q="<<"bQ";
00124       //      std::cout<<"W1="<<bW1<<"W2="<<bW2<<"W3="<<bW3<<"W4="<<bW4;
00125       std::cout<<"\n";
00126       
00127       /*
00128       std::cout<<"Atten[1]="<<*(bAtten+1)<<"P0[1]="<<*(bP0+1)<<"P1[1]="<<*(bP1+1)<<"P2[1]="<<*(bP2+1)<<"P3[1]="<<*(bP3+1)<<"P4[1]="<<*(bP4+1);
00129       std::cout<<"\n";
00130       std::cout<<"P5[1]="<<*(bP5+1)<<"S[1]="<<*(bS+1)<<"SS[1]="<<*(bSS+1)<<"Veff[1]="<<*(bVeff+1);
00131       */
00132       }   
00133    for(int i =0;i<96;i++)
00134       {
00135         double eAtten0 = btof->getETofAtten(i,0);
00136         double eAtten1 = btof->getETofAtten(i,1);
00137         double eP0  = btof->getETofP(i,0);
00138         double eP1  = btof->getETofP(i,1);
00139         double eP2  = btof->getETofP(i,2);
00140         double eP3 = btof->getETofP(i,3);
00141         double eP4 = btof->getETofP(i,4);
00142         double eP5 = btof->getETofP(i,5);
00143         double eP6 = btof->getETofP(i,6);
00144 
00145         double eSpeed0 = btof->getETofSpeed(i,0);
00146         double eSpeed1 = btof->getETofSpeed(i,1);
00147 
00148         std::cout<<"=========================================="<<"\n";
00149         std::cout<<"cnt ="<<i<<"\n";
00150         
00151         std::cout<<"Atten0="<<eAtten0<<"Atten1="<<eAtten1<<"Speed0="<<eSpeed0<<"Speed1="<<eSpeed1<<"P0="<<eP0<<"P1="<<eP1<<"P2="<<eP2<<"P3="<<eP3<<"P4="<<eP4<<"P6="<<eP6;
00152         std::cout<<"\n";
00153         std::cout<<"P5="<<eP5;
00154         std::cout<<"\n";
00155 
00156         }
00157        //maqm comment because cann't write 
00158       // m_pTreeSvc->writeToTree("./Tof_test.root", fullPath);
00159   
00160   return StatusCode::SUCCESS;
00161 }

StatusCode checkEstTof::finalize (  ) 

Definition at line 165 of file checkEstTof.cxx.

References Bes_Common::INFO, and msgSvc().

00165                                   {
00166 
00167   MsgStream log(msgSvc(), name());
00168   log << MSG::INFO 
00169       << "        checkEstTof FINALIZE!! "
00170       << endreq;
00171   
00172   return StatusCode::SUCCESS;
00173 }

StatusCode checkEstTof::initialize (  ) 

Definition at line 49 of file checkEstTof.cxx.

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

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


Member Data Documentation

IDataProviderSvc* checkEstTof::m_pCalibDataSvc [private]

Definition at line 28 of file checkEstTof.h.

Referenced by execute(), and initialize().

ICalibTreeSvc* checkEstTof::m_pTreeSvc [private]

Definition at line 29 of file checkEstTof.h.

Referenced by initialize().


Generated on Tue Nov 29 23:18:07 2016 for BOSS_7.0.2 by  doxygen 1.4.7