/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Validation/ValidRecExtTrack/ValidRecExtTrack-00-00-01/src/ValidRecExtTrackAlg.cxx

Go to the documentation of this file.
00001 #include "ValidRecExtTrack/ValidRecExtTrackAlg.h"
00002 #include "GaudiKernel/MsgStream.h"
00003 #include "GaudiKernel/SmartDataPtr.h"
00004 //#include "GaudiKernel/IHistogramSvc.h"
00005 
00006 #include "ExtEvent/RecExtTrack.h"
00007 
00008 
00009 ValidRecExtTrackAlg::ValidRecExtTrackAlg(const std::string& name, ISvcLocator* pSvcLocator) :
00010    Algorithm(name, pSvcLocator) {
00011   
00012     m_tuple1 = 0;  
00013 }
00014 
00015 StatusCode ValidRecExtTrackAlg::initialize(){
00016 
00017    StatusCode status;
00018    MsgStream log( msgSvc(), name() );
00019    log << MSG::INFO << "Booking Histograms" << endreq;
00020 
00021    //  Book N-tuple 1
00022    NTuplePtr nt1(ntupleSvc(), "FILE208/ExtTrk");
00023    if ( nt1 ) m_tuple1 = nt1;
00024    else {
00025      m_tuple1 = ntupleSvc()->book ("FILE208/ExtTrk", CLID_RowWiseTuple, "ExtTrack parameter");
00026      if ( m_tuple1 )    {
00027        status = m_tuple1->addItem("tof1",m_tof1);
00028        status = m_tuple1->addItem("tof1Path",m_tof1Path);
00029        status = m_tuple1->addItem("tof1PosSigmaAlongX",m_tof1PosSigmaAlongX);
00030        status = m_tuple1->addItem("xTof1Pos",m_xTof1Pos);
00031        status = m_tuple1->addItem("yTof1Pos",m_yTof1Pos);
00032        status = m_tuple1->addItem("zTof1Pos",m_zTof1Pos);
00033        status = m_tuple1->addItem("emTof1_11",m_emTof1_11);
00034        status = m_tuple1->addItem("emTof1_33",m_emTof1_33);
00035        status = m_tuple1->addItem("emTof1_55",m_emTof1_55);
00036        status = m_tuple1->addItem("emTof1_66",m_emTof1_66);
00037        status = m_tuple1->addItem("emTof1_23",m_emTof1_23);
00038        status = m_tuple1->addItem("emTof1_35",m_emTof1_35);
00039      }
00040      else    {   // did not manage to book the N tuple....
00041        log << MSG::ERROR << "    Cannot book N-tuple:" << long(m_tuple1) << endmsg;
00042        //return StatusCode::FAILURE;
00043      }
00044    }
00045    log << MSG::INFO << "Finished booking NTuples" << endmsg;
00046 
00047 
00048   return StatusCode::SUCCESS;
00049 
00050 
00051 }
00052 
00053 
00054 StatusCode ValidRecExtTrackAlg::execute() {
00055    MsgStream log(msgSvc(), name());
00056    SmartDataPtr<RecExtTrackCol> extTracks(eventSvc(),"/Event/Recon/RecExtTrackCol");
00057    if( ! extTracks )
00058       {
00059          log << MSG::ERROR << "Unable to retrieve RecExtTrackCol" << endreq;
00060          return  StatusCode::FAILURE;
00061       } else {
00062          log << MSG::DEBUG << "RecExtTrackCol retrieved of size "<< extTracks->size() << endreq;
00063          for(RecExtTrackCol::iterator it=extTracks->begin(); it!=extTracks->end(); it++)
00064             {
00065                
00066                m_tof1=(*it)->tof1();
00067                m_tof1Path=(*it)->tof1Path();
00068                m_tof1PosSigmaAlongX=(*it)->tof1PosSigmaAlongX();
00069                m_xTof1Pos = (*it)->tof1Position().x();
00070                m_yTof1Pos = (*it)->tof1Position().y();
00071                m_zTof1Pos = (*it)->tof1Position().z();
00072                m_emTof1_11 = (*it)->tof1ErrorMatrix().fast(1,1);
00073                m_emTof1_33 = (*it)->tof1ErrorMatrix().fast(3,3);
00074                m_emTof1_55 = (*it)->tof1ErrorMatrix().fast(5,5);
00075                m_emTof1_66 = (*it)->tof1ErrorMatrix().fast(6,6);
00076                m_emTof1_23 = (*it)->tof1ErrorMatrix().fast(2,3);
00077                m_emTof1_35 = (*it)->tof1ErrorMatrix().fast(3,5);
00078                 
00079                StatusCode status1 = m_tuple1->write();
00080                if ( status1.isFailure() )  {
00081                  log << MSG::ERROR << "Cannot fill Ntuple1" << endreq;
00082                }
00083             }
00084       }
00085      return StatusCode::SUCCESS;
00086 }
00087 
00088 
00089 StatusCode ValidRecExtTrackAlg::finalize() {
00090 
00091    MsgStream log(msgSvc(), name());
00092    log << MSG::INFO << "Finalizing..." << endreq;
00093 
00094 }
00095 
00096 
00097 

Generated on Tue Nov 29 23:14:45 2016 for BOSS_7.0.2 by  doxygen 1.4.7