/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/DQA/DQACtrlSamples/DQACtrlSamples-00-00-04/src/DQACtrlSamples.cxx

Go to the documentation of this file.
00001 #include <vector>
00002 
00003 #include "GaudiKernel/MsgStream.h"
00004 #include "GaudiKernel/AlgFactory.h"
00005 #include "GaudiKernel/SmartDataPtr.h"
00006 #include "GaudiKernel/ISvcLocator.h"
00007 #include "GaudiKernel/IDataProviderSvc.h"
00008 #include "GaudiKernel/PropertyMgr.h"
00009 
00010 #include "DQAEvent/DQAEvent.h"
00011 #include "DQACtrlSamples/DQACtrlSamples.h"
00012 
00013 DECLARE_ALGORITHM_FACTORY(DQACtrlSamples)
00014 
00015 
00016 
00017 DQACtrlSamples::DQACtrlSamples(const std::string& name, ISvcLocator* pSvcLocator) :
00018   Algorithm(name, pSvcLocator) {
00019    
00020     //Declare the properties
00021     declareProperty("SelectBhabha", m_selBhabha = true);
00022     declareProperty("SelectDimu", m_selDimu = true);
00023     declareProperty("SelectHadron", m_selHadron = false);
00024     declareProperty("SelectRhopi", m_selRhopi = false);
00025     declareProperty("SelectPpbar", m_selPpbar = false);
00026     declareProperty("SelectKstark", m_selKstark = false);
00027     declareProperty("SelectLambdalambda", m_selLambdalambda = false);
00028     
00029 }
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00032 StatusCode DQACtrlSamples::initialize(){
00033   MsgStream log(msgSvc(), name());
00034 
00035   log << MSG::INFO << "in initialize()" << endmsg;
00036   StatusCode sc;
00037 
00038   if ( m_selBhabha ) {
00039       sc =  createSubAlgorithm( "DQASelBhabha", "DQASelBhabha", m_dqaBhabha);
00040       if (sc.isFailure()) {
00041           log << MSG::ERROR << "Error creating Sub-Algorithm DQASelBhabha" << endreq;
00042           return StatusCode::FAILURE;
00043       }
00044   }
00045 
00046   if ( m_selDimu ) {
00047       sc =  createSubAlgorithm( "DQASelDimu", "DQASelDimu", m_dqaDimu);
00048       if (sc.isFailure()) {
00049           log << MSG::ERROR << "Error creating Sub-Algorithm DQASelDimu" << endreq;
00050           return StatusCode::FAILURE;
00051       }
00052   }
00053 
00054   if ( m_selHadron ) {
00055       sc =  createSubAlgorithm( "DQASelHadron", "DQASelHadron", m_dqaHadron);
00056       if (sc.isFailure()) {
00057           log << MSG::ERROR << "Error creating Sub-Algorithm DQASelHadron" << endreq;
00058           return StatusCode::FAILURE;
00059       }
00060   }
00061 
00062   if ( m_selRhopi ) {
00063       sc =  createSubAlgorithm( "DQARhopi", "DQARhopi", m_dqaRhopi);
00064       if (sc.isFailure()) {
00065           log << MSG::ERROR << "Error creating Sub-Algorithm DQARhopiAlg" << endreq;
00066           return StatusCode::FAILURE;
00067       }
00068   }
00069 
00070   if ( m_selPpbar ) {
00071       sc =  createSubAlgorithm( "DQAJpsi2PPbarAlg", "DQAJpsi2PPbarAlg", m_dqaPpbar);
00072       if (sc.isFailure()) {
00073           log << MSG::ERROR << "Error creating Sub-Algorithm Jpsi2PPbarAlg" << endreq;
00074           return StatusCode::FAILURE;
00075       }
00076   }
00077   
00078   if ( m_selKstark ) {
00079       sc =  createSubAlgorithm( "DQAKsKpi", "DQAKsKpi", m_dqaKstark);
00080       if (sc.isFailure()) {
00081           log << MSG::ERROR << "Error creating Sub-Algorithm DQAKsKpi" << endreq;
00082           return StatusCode::FAILURE;
00083       }
00084   }
00085   
00086   if ( m_selLambdalambda ) {
00087       sc =  createSubAlgorithm( "JsiLL", "JsiLL", m_dqaLambdalambda);
00088       if (sc.isFailure()) {
00089           log << MSG::ERROR << "Error creating Sub-Algorithm JsiLL" << endreq;
00090           return StatusCode::FAILURE;
00091       }
00092   }
00093   
00094   log << MSG::INFO << "successfully return from initialize()" <<endmsg;
00095   return StatusCode::SUCCESS;
00096 
00097 
00098 }
00099 
00100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00101 StatusCode DQACtrlSamples::execute() {
00102   
00103   MsgStream log(msgSvc(), name());
00104   log << MSG::INFO << "in execute()" << endreq;
00105 
00106   SmartDataPtr<DQAEvent::DQAEvent> dqaevt(eventSvc(), "/Event/DQATag");
00107   if( !dqaevt ) {
00108       dqaevt = new DQAEvent::DQAEvent;
00109       StatusCode sc;
00110       sc = eventSvc()->registerObject("/Event/DQATag", dqaevt);
00111       if (sc.isFailure()) {
00112           log << MSG::ERROR << "Could not register DQAEvent to TDS" << endreq;
00113           return StatusCode::FAILURE;
00114           return sc;
00115       }
00116   }
00117 
00118   if ( m_selBhabha ) {
00119       m_dqaBhabha->execute();
00120       if ( m_dqaBhabha->filterPassed() ) dqaevt->setBhabha(1);
00121   }
00122 
00123   if ( m_selDimu ) {
00124       m_dqaDimu->execute();
00125       if ( m_dqaDimu->filterPassed() ) dqaevt->setDimu(1);
00126   }
00127 
00128   if ( m_selHadron ) {
00129       m_dqaHadron->execute();
00130       if ( m_dqaHadron->filterPassed() ) dqaevt->setHadron(1);
00131   }
00132 
00133   if ( m_selRhopi ) {
00134       m_dqaRhopi->execute();
00135       if ( m_dqaRhopi->filterPassed() ) dqaevt->setRhopi(1);
00136   }
00137   
00138   if ( m_selPpbar ) {
00139       m_dqaPpbar->execute();
00140       if ( m_dqaPpbar->filterPassed() ) dqaevt->setPpbar(1);
00141   }
00142   
00143   if ( m_selKstark ) {
00144       m_dqaKstark->execute();
00145       if ( m_dqaKstark->filterPassed() ) dqaevt->setKstark(1);
00146   }
00147   
00148   if ( m_selLambdalambda ) {
00149       m_dqaLambdalambda->execute();
00150       if ( m_dqaLambdalambda->filterPassed() ) dqaevt->setLambdalambdabar(1);
00151   }
00152   
00153   return StatusCode::SUCCESS;
00154 
00155 }
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
00158 StatusCode DQACtrlSamples::finalize() {
00159 
00160   MsgStream log(msgSvc(), name());
00161   log << MSG::INFO << "in finalize()" << endmsg;
00162   return StatusCode::SUCCESS;
00163 }
00164 
00165 

Generated on Tue Nov 29 22:58:06 2016 for BOSS_7.0.2 by  doxygen 1.4.7