MdcFastTrkAlg Class Reference

#include <MdcFastTrkAlg.h>

List of all members.

Public Member Functions

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

Private Attributes

FTFinderm_ftFinder
double m_bunchtime_MC
double m_mdc_tcal
NTuple::Tuple * m_tuple
IBesTimerSvcm_timersvc
BesTimerm_timer [NTIMERS]


Detailed Description

Definition at line 18 of file MdcFastTrkAlg.h.


Constructor & Destructor Documentation

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

Definition at line 64 of file MdcFastTrkAlg.cxx.

References m_bunchtime_MC, m_ftFinder, and m_mdc_tcal.

00064                                                                             :
00065   Algorithm(name, pSvcLocator)
00066 {
00067   // Declare the properties  
00068         declareProperty("bunchtime",      m_bunchtime_MC=8.0);
00069         declareProperty("T0cal",          m_mdc_tcal=200.0);
00070   m_ftFinder = 0;
00071   
00072 }


Member Function Documentation

StatusCode MdcFastTrkAlg::beginRun (  ) 

Definition at line 236 of file MdcFastTrkAlg.cxx.

References FTFinder::begin_run(), Bes_Common::INFO, m_ftFinder, and msgSvc().

00236                                    {
00237  
00238   MsgStream log(msgSvc(), name());
00239   log << MSG::INFO << "in beginRun()" << endreq;
00240 
00241   m_ftFinder->begin_run();
00242  
00243   return StatusCode::SUCCESS;
00244 }

StatusCode MdcFastTrkAlg::execute (  ) 

Definition at line 188 of file MdcFastTrkAlg.cxx.

References Bes_Common::DEBUG, BesTimer::elapsed(), calibUtil::ERROR, FTFinder::event(), g_eventtime, m_ftFinder, m_timer, m_tuple, msgSvc(), BesTimer::start(), and BesTimer::stop().

00188                                   {
00189 
00190   MsgStream log(msgSvc(), name());
00191   log << MSG::DEBUG << "in execute()" << endreq;
00192 
00193 #ifndef OnlineMode
00194   m_timer[1]->start();
00195 #endif
00196 
00197   m_ftFinder->event();
00198 
00199 #ifndef OnlineMode
00200   m_timer[1]->stop();
00201 
00202   //cout << "m_timer[1]->elapsed()::" << m_timer[1]->elapsed() << endl;
00203   //cout << "m_timer[1]->mean()::" << m_timer[1]->mean() << endl;
00204   g_eventtime = m_timer[1]->elapsed();
00205 
00206   if(m_tuple){     
00207     StatusCode status = m_tuple->write();
00208     if (!status.isSuccess()) {
00209       log << MSG::ERROR << "Can't fill ntuple!" << endreq;
00210     }
00211   }
00212 #endif
00213 
00214   return StatusCode::SUCCESS;
00215 }

StatusCode MdcFastTrkAlg::finalize (  ) 

Definition at line 218 of file MdcFastTrkAlg.cxx.

References Bes_Common::DEBUG, Bes_Common::INFO, m_ftFinder, m_timersvc, msgSvc(), num_2Dtrk, num_3Dtrk, num_finaltrk, IBesTimerSvc::print(), and FTFinder::term().

00218                                    {
00219 
00220   MsgStream log(msgSvc(), name());
00221   log << MSG::INFO << "in finalize()" << endreq;
00222 
00223   m_ftFinder->term();
00224 #ifndef OnlineMode
00225   log << MSG::DEBUG <<"num_2Dtrk: " << num_2Dtrk 
00226       <<" num_3Dtrk: " << num_3Dtrk 
00227       <<" num_finaltrk: " << num_finaltrk 
00228       << endmsg;
00229   m_timersvc->print();
00230 #endif
00231 
00232   return StatusCode::SUCCESS;
00233 }

StatusCode MdcFastTrkAlg::initialize (  ) 

Definition at line 75 of file MdcFastTrkAlg.cxx.

References IBesTimerSvc::addItem(), calibUtil::ERROR, g_chi2sz, g_chi2xy, g_dr, g_dz, g_estime, g_eventNo, g_eventtime, g_hitmap, g_kappa, g_naxialhit, g_ncell, g_ncellMC, g_nhit, g_nstereohit, g_ntrk, g_ntrkMC, g_p, g_phi, g_phi0, g_phi0MC, g_pt, g_ptMC, g_px, g_pxMC, g_py, g_pyMC, g_pz, g_pzMC, g_sigmaxy, g_sigmaz, g_tanl, g_theta, g_theta0MC, g_vx, g_vy, g_vz, histoSvc(), Bes_Common::INFO, FTFinder::init(), m_bunchtime_MC, m_ftFinder, m_mdc_tcal, m_timer, m_timersvc, m_tuple, msgSvc(), ntupleSvc(), num_2Dtrk, num_3Dtrk, num_finaltrk, BesTimer::propName(), FTFinder::setAlgorithmPointer(), FTFinder::setBunchtime(), FTFinder::setT0cal(), and Bes_Common::WARNING.

00075                                     {
00076 
00077   MsgStream log(msgSvc(), name());
00078   log << MSG::INFO << "in initialize()" << endreq;
00079 
00080 #ifndef OnlineMode
00081   NTuplePtr nt(ntupleSvc(),"FILE102/n1");
00082   if ( nt ) m_tuple = nt;
00083   else {
00084       m_tuple=ntupleSvc()->book("FILE102/n1",CLID_ColumnWiseTuple,"MdcRecEvent");
00085       if( m_tuple ) {
00086          m_tuple->addItem ("eventNo",  g_eventNo);
00087          m_tuple->addItem ("NtrackMC", g_ntrkMC,0,50);
00088          m_tuple->addItem ("MCtheta0", g_ntrkMC,  g_theta0MC);
00089          m_tuple->addItem ("MCphi0",   g_ntrkMC, g_phi0MC);
00090          m_tuple->addItem ("pxMC",  g_ntrkMC, g_pxMC);
00091          m_tuple->addItem ("pyMC",  g_ntrkMC, g_pyMC);
00092          m_tuple->addItem ("pzMC",  g_ntrkMC, g_pzMC);
00093          m_tuple->addItem ("ptMC",  g_ntrkMC, g_ptMC);
00094          m_tuple->addItem ("Ntrack",g_ntrk, 0, 50);
00095          m_tuple->addItem ("px",    g_ntrk, g_px);
00096          m_tuple->addItem ("py",    g_ntrk, g_py);
00097          m_tuple->addItem ("pz",    g_ntrk, g_pz);
00098          m_tuple->addItem ("pt",    g_ntrk, g_pt);
00099          m_tuple->addItem ("p",     g_ntrk, g_p);
00100          m_tuple->addItem ("phi",   g_ntrk, g_phi);
00101          m_tuple->addItem ("theta", g_ntrk, g_theta);
00102          m_tuple->addItem ("vx",    g_ntrk, g_vx);
00103          m_tuple->addItem ("vy",    g_ntrk, g_vy);
00104          m_tuple->addItem ("vz",    g_ntrk, g_vz); 
00105          m_tuple->addItem ("dr",    g_ntrk, g_dr);
00106          m_tuple->addItem ("phi0",  g_ntrk, g_phi0);
00107          m_tuple->addItem ("kappa", g_ntrk, g_kappa);
00108          m_tuple->addItem ("dz",    g_ntrk, g_dz);
00109          m_tuple->addItem ("tanl",  g_ntrk, g_tanl);
00110          m_tuple->addItem ("eventtime", g_eventtime);
00111          m_tuple->addItem ("Testime", g_estime);
00112       }
00113       else    {   // did not manage to book the N tuple....
00114          log << MSG::ERROR <<"Cannot book N-tuple:" << long(m_tuple) << endmsg;
00115          //return StatusCode::FAILURE;
00116       }
00117    }
00118 
00119    g_sigmaxy   = histoSvc()->book( "sigmaxy", "1D sigmaxy", 100, -0.2, 0.2 );
00120    g_sigmaz = histoSvc()->book( "sigmaz", "1D sigmaz", 100, -3.5, 3.5);
00121    g_chi2xy = histoSvc()->book( "chi2xy", "1D chi2xy", 100, -0.01, 0.01 );
00122    g_chi2sz = histoSvc()->book( "chi2sz", "1D chi2sz", 100, -8.0, 8. );
00123    g_ncellMC = histoSvc()->book( "ncellmc", "1D ncellMC", 100, 0.0, 7000. );
00124    g_ncell = histoSvc()->book( "ncell", "1D ncell", 100, 0.0, 7000. );
00125    g_naxialhit = histoSvc()->book( "naxialhit", "2D axial hit", 30, 0.0, 30. );
00126    g_nstereohit = histoSvc()->book( "nstereohit", "2D stereo hit", 30, 0.0, 30. );
00127    g_nhit = histoSvc()->book( "nhit", "2D hit", 50, 0.0, 50. );
00128    g_hitmap[0] = histoSvc()->book( "hm0", "2d hitmap1", 80, -80., 80., 80, -80., 80. );
00129    g_hitmap[1] = histoSvc()->book( "hm1", "2d hitmap2", 80, -80., 80., 80, -80., 80. );
00130    g_hitmap[2] = histoSvc()->book( "hm2", "2d hitmap3", 80, -80., 80., 80, -80., 80. );
00131    g_hitmap[3] = histoSvc()->book( "hm3", "2d hitmap4", 80, -80., 80., 80, -80., 80. );
00132    g_hitmap[4] = histoSvc()->book( "hm4", "2d hitmap5", 80, -80., 80., 80, -80., 80. );
00133    g_hitmap[5] = histoSvc()->book( "hm5", "2d hitmap6", 80, -80., 80., 80, -80., 80. );
00134    g_hitmap[6] = histoSvc()->book( "hm6", "2d hitmap7", 80, -80., 80., 80, -80., 80. );
00135    g_hitmap[7] = histoSvc()->book( "hm7", "2d hitmap8", 80, -80., 80., 80, -80., 80. );
00136    g_hitmap[8] = histoSvc()->book( "hm8", "2d hitmap9", 80, -80., 80., 80, -80., 80. );
00137    g_hitmap[9] = histoSvc()->book( "hm9", "2d hitmap10", 80, -80., 80., 80, -80., 80. );
00138    g_hitmap[10] = histoSvc()->book( "hm10", "2d hitmap11", 80, -80., 80., 80, -80., 80. );
00139 
00140 #endif
00141 
00142   /*NTuplePtr nth(ntupleSvc(),"FILE1/Hit/2");
00143   if ( nth ) m_htuple = nth;
00144   else {
00145       m_htuple=ntupleSvc()->book("FILE1/Hit/2",CLID_ColumnWiseTuple,"MdcRecHit");
00146       if( m_htuple ) {
00147          m_htuple->addItem ("sigmaxy", g_sigmaxy);
00148          m_htuple->addItem ("sigmaz", g_sigmaz);
00149          m_htuple->addItem ("chi2xy", g_chi2xy);
00150          m_htuple->addItem ("chi2sz", g_chi2sz);
00151          m_htuple->addItem ("ncellMC", g_ncellMC);
00152          m_htuple->addItem ("ncell", g_ncell);
00153       }
00154       else    {   // did not manage to book the N tuple....
00155          log << MSG::ERROR <<"Cannot book N-tuple:" << long(m_tuple) << endmsg;
00156          return StatusCode::FAILURE;
00157       }
00158    }*/
00159 #ifndef OnlineMode   
00160    num_2Dtrk=0;
00161    num_3Dtrk=0; 
00162    num_finaltrk=0;
00163 #endif
00164 
00165    //m_ftFinder->init();
00166    m_ftFinder = new FTFinder();
00167    m_ftFinder->init(); 
00168    m_ftFinder->setBunchtime(m_bunchtime_MC);
00169    m_ftFinder->setT0cal(m_mdc_tcal);
00170    m_ftFinder->setAlgorithmPointer(this);
00171 
00172 
00173 #ifndef OnlineMode
00174   StatusCode sc = service( "BesTimerSvc", m_timersvc);
00175   if( sc.isFailure() ) {
00176      log << MSG::WARNING << name() << ": Unable to locate BesTimer Service" << endreq;
00177      return StatusCode::FAILURE;
00178   }
00179 
00180   m_timer[1] = m_timersvc->addItem("Execution");
00181   m_timer[1]->propName("nExecution");
00182 #endif
00183  
00184   return StatusCode::SUCCESS;
00185 }


Member Data Documentation

double MdcFastTrkAlg::m_bunchtime_MC [private]

Definition at line 28 of file MdcFastTrkAlg.h.

Referenced by initialize(), and MdcFastTrkAlg().

FTFinder* MdcFastTrkAlg::m_ftFinder [private]

Definition at line 27 of file MdcFastTrkAlg.h.

Referenced by beginRun(), execute(), finalize(), initialize(), and MdcFastTrkAlg().

double MdcFastTrkAlg::m_mdc_tcal [private]

Definition at line 29 of file MdcFastTrkAlg.h.

Referenced by initialize(), and MdcFastTrkAlg().

BesTimer* MdcFastTrkAlg::m_timer[NTIMERS] [private]

Definition at line 36 of file MdcFastTrkAlg.h.

Referenced by execute(), and initialize().

IBesTimerSvc* MdcFastTrkAlg::m_timersvc [private]

Definition at line 34 of file MdcFastTrkAlg.h.

Referenced by finalize(), and initialize().

NTuple::Tuple* MdcFastTrkAlg::m_tuple [private]

Definition at line 32 of file MdcFastTrkAlg.h.

Referenced by execute(), and initialize().


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