UseMuc Class Reference

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

#include <UseMuc.h>

List of all members.

Public Member Functions

 UseMuc (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 23 of file UseMuc.h.


Constructor & Destructor Documentation

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

Definition at line 49 of file UseMuc.cxx.

00051   : Algorithm     ( name, pSvcLocator ), m_pCalibDataSvc(0)
00052 {
00053   // Declare properties here.
00054 
00055 }


Member Function Documentation

StatusCode UseMuc::execute (  ) 

Definition at line 99 of file UseMuc.cxx.

References B_LAY_NUM, B_SEG_NUM, CLST_MAX, E_LAY_NUM, E_SEG_NUM, genRecEmupikp::i, Bes_Common::INFO, ganga-rec::j, LAYER_MAX, m_pCalibDataSvc, msgSvc(), PART_MAX, deljobs::string, and test.

00099                             {
00100    
00101   MsgStream log(msgSvc(), name());
00102 /*  std::vector<double> emccalib;
00103   CalibData::MucCalibData* emc = new CalibData::MucCalibData;
00104   //set emcCalibdata--------------------------------
00105    for(i=0;i<6000;i++)
00106     {  emccalib.push_back(i);
00107     }
00108   
00109    emc->setDigiCalibConst(&emccalib);
00110    emccalib.clear();
00111   //set EnCoeff
00112    for(i=0;i<43;i++)
00113     { emccalib.push_back(1);
00114     }
00115    emc->setEnCoeff(&emccalib);
00116    emccalib.clear();  
00117    //set PosCoeff
00118   for(i=0;i<15;i++)
00119     { emccalib.push_back(0);
00120     }
00121   emc->setPosCoeff(&emccalib);
00122   emc->setrunfrm(0);
00123   emc->setrunto(0);
00124  */
00125    //register the emcCalibData into the TCDS ; nelectable
00126    std::string fullPath = "/Calib/MucCal";
00127     log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
00128   //  m_pCalibDataSvc->registerObject(fullPath,emc);
00129 
00130     //write the MucCalibData to the rootfile; 
00131 //   m_pRootSvc->writeToRoot("./Muc_dat.root", fullPath);
00132    //another way,write the MucCalibData without TCDS
00133 //   m_pRootSvc->writeToRoot("./Muc_dat1.root", emc);
00134   //retrieve DataObject from the TCDS-----------------
00135   SmartDataPtr<CalibData::MucCalibData> test(m_pCalibDataSvc, fullPath);
00136   if(!test);
00137    std::cout<<"m_uniformEff="<<test->getUniformEff()<<std::endl;
00138    std::cout<<"m_UniformNos="<<test->getUniformNos()<<std::endl;
00139    std::cout<<"m_UniformClst="<<test->getUniformClst()<<std::endl;
00140    for(int i=0;i<LAYER_MAX;i++){
00141      std::cout<<"m_layerEff["<<i<<"]="<< test->getLayerEff(i)<<"  m_layerNos["<<i<<"]="<<test->getLayerNos(i)<<std::endl;
00142      for(int j=0;j<CLST_MAX;j++){
00143       std::cout<<"m_layerClstPro["<<i<<"]["<<j<<"]="<<test->getLayerClstPro(i,j)<<std::endl;
00144      }
00145    }
00146 
00147    for(int i=0; i<PART_MAX; i++)
00148         {
00149           for(int j=0; j<((i==1)?B_SEG_NUM:E_SEG_NUM); j++)
00150           {
00151             for(int k=0; k<((i==1)?B_LAY_NUM:E_LAY_NUM); k++)
00152             {
00153                     std::cout << "Box: " << i << "\t" << j << "\t" << k << "\t"
00154                     << test->getBoxEff(i, j, k) << endl;
00155             }
00156           }     
00157         }
00158 /*
00159         int strip_max;
00160         for(int i=0; i<PART_MAX; i++)
00161         {
00162           for(int j=0; j<((i==1)?B_SEG_NUM:E_SEG_NUM); j++)
00163           {
00164             for(int k=0; k<((i==1)?B_LAY_NUM:E_LAY_NUM); k++)
00165             {
00166                 strip_max = m_pIdTr->GetStripMax(i, j, k);
00167                 for(int n=0; n<strip_max; n++)
00168                 {
00169                         std::cout << "Strip: " << i << "\t" << j << "\t" << k << "\t" 
00170                             << "\t" << n << "\t" << test->getStripEff(i, j, k, n) << endl;
00171                 }
00172             }
00173           }                     
00174         }
00175 */
00176 
00177       return StatusCode::SUCCESS;
00178 }

StatusCode UseMuc::finalize (  ) 

Definition at line 180 of file UseMuc.cxx.

References Bes_Common::INFO, and msgSvc().

00180                              {
00181 
00182   MsgStream log(msgSvc(), name());
00183   log << MSG::INFO 
00184       << "        UseMuc FINALIZE!! "
00185       << endreq;
00186   
00187   return StatusCode::SUCCESS;
00188 }

StatusCode UseMuc::initialize (  ) 

Definition at line 58 of file UseMuc.cxx.

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

00058                               {
00059   StatusCode sc;
00060   MsgStream log(msgSvc(), name());
00061   log << MSG::INFO << "Initialize()" << endreq;
00062 
00063   // So far don't have any properties, but in case we do some day..
00064 //  setProperties();
00065 
00066    log<<MSG::INFO << "setProperties()" << endreq;
00067   
00068    sc = service("CalibDataSvc", m_pCalibDataSvc, true);
00069 
00070   if ( !sc.isSuccess() ) {
00071     log << MSG::ERROR 
00072         << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc" 
00073         << endreq;
00074     return sc;
00075   } else {
00076     log << MSG::DEBUG 
00077         << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" 
00078         << endreq;
00079   }
00080   
00081   sc = service("CalibRootCnvSvc", m_pRootSvc, true);
00082   if ( !sc.isSuccess() ) {
00083     log << MSG::ERROR 
00084         << "Could not get ICalibRootSvc interface of CalibRootCnvSvc" 
00085         << endreq;
00086     return sc;
00087   }
00088   // Get properties from the JobOptionsSvc
00089   
00090  sc = setProperties();
00091 
00092  // m_pIdTr = new MucIdTransform();
00093 
00094  return StatusCode::SUCCESS;
00095 
00096 }


Member Data Documentation

IDataProviderSvc* UseMuc::m_pCalibDataSvc [private]

Definition at line 36 of file UseMuc.h.

Referenced by execute(), and initialize().

ICalibRootSvc* UseMuc::m_pRootSvc [private]

Definition at line 37 of file UseMuc.h.

Referenced by initialize().


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