BesBdkRc Class Reference

#include <BesBdkRc.h>

List of all members.

Public Member Functions

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

Private Attributes

double toRad
double toDeg
float m_w2min
float m_CMEnergy
float m_ewe
float m_kzero
float qmass [6]
int m_maxNTry
int m_ifinal
int m_iseed
float m_tcmin
float m_pcmin
long int m_numberEvent
IBesRndmGenSvcp_BesRndmGenSvc


Detailed Description

Definition at line 21 of file BesBdkRc.h.


Constructor & Destructor Documentation

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


Member Function Documentation

StatusCode BesBdkRc::execute (  ) 

Definition at line 192 of file BesBdkRc.cxx.

References calibUtil::ERROR, FLAGS, GEN1EVT, HEPEVT_CLEAN, Bes_Common::INFO, LUHEPC, LULIST, and m_numberEvent.

00193 { 
00194   MsgStream log(messageService(), name());
00195   log << MSG::INFO << "BesBdkRc executing" << endreq;
00196   HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
00197   HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
00198   HepMC::IO_HEPEVT HepEvtIO;
00199 
00200   HEPEVT_CLEAN();
00201   GEN1EVT();
00202 
00203   if(FLAGS.GOODEVT!=1){
00204     log << MSG::ERROR<<" BesBdkRc: fail to generate good event"<<endl;
00205     return StatusCode::FAILURE;
00206   }
00207 
00208   m_numberEvent++;
00209   if( log.level() < MSG::INFO )LULIST(1);
00210   //  LULIST(1);
00211   LUHEPC(1);
00212   HepMC::GenEvent* evt = HepEvtIO.read_next_event();
00213   evt->set_event_number(m_numberEvent);
00214   evt->set_signal_process_id(1);
00215   //  evt->print();
00216   //Check if the McCollection already exists                                                 
00217   SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
00218   if (anMcCol!=0) {
00219     // Add event to existing collection                                                       
00220     MsgStream log(messageService(), name());
00221     log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
00222     McGenEvent* mcEvent = new McGenEvent(evt);
00223     anMcCol->push_back(mcEvent);
00224   }  else {
00225     // Create Collection and add  to the transient store                                      
00226     McGenEventCol *mcColl = new McGenEventCol;
00227     McGenEvent* mcEvent = new McGenEvent(evt);
00228     mcColl->push_back(mcEvent);
00229     StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
00230     if (sc != StatusCode::SUCCESS) {
00231       log << MSG::ERROR << "Could not register McGenEvent" << endreq;
00232       delete mcColl;
00233       delete evt;
00234       delete mcEvent;
00235       return StatusCode::FAILURE;
00236     }
00237   }
00238   // string s;
00239   // getline(cin,s);
00240 
00241   return StatusCode::SUCCESS; 
00242 }

StatusCode BesBdkRc::finalize (  ) 

Definition at line 244 of file BesBdkRc.cxx.

References DELPHC, FINISH, Bes_Common::INFO, and XSECTC.

00245 {
00246   MsgStream log(messageService(), name());
00247   log << MSG::INFO << "BesBdkRc finalized" << endreq;
00248   int itot;
00249   itot=XSECTC.ITOT;
00250   double cstot;
00251   double cserr;
00252   FINISH(itot,cstot,cserr);
00253   float effcut=0;
00254   float cscut=0;
00255   float efferr=0;
00256   float cscuterr=0;
00257   if(XSECTC.NEVUNW){
00258     effcut=float(DELPHC.NEVCUT)/float(XSECTC.NEVUNW);
00259     cscut=effcut*cstot;
00260     efferr=sqrt(effcut*(1.0-effcut)/float(XSECTC.NEVUNW));
00261     cscuterr = sqrt(cstot*efferr*cstot*efferr + effcut*effcut*cserr*cserr);
00262   }
00263   printf("BDKRC SUMMARY: Cross section after user cuts= %G +- %G nb\n",cscut,cscuterr);
00264   printf("               Cut acceptance              = %G +- %G \n",effcut,efferr);
00265   return StatusCode::SUCCESS;
00266 }

StatusCode BesBdkRc::initialize (  ) 

Definition at line 152 of file BesBdkRc.cxx.

References COLCHC, DELPHC, calibUtil::ERROR, FINCUT, GEN_INIT, IBesRndmGenSvc::GetEngine(), genRecEmupikp::i, INPUT, LOCALC, m_CMEnergy, m_ewe, m_ifinal, m_kzero, m_maxNTry, m_pcmin, m_tcmin, m_w2min, p_BesRndmGenSvc, qmass, BesBdkRcRandom::setRandomEngine(), toRad, Bes_Common::WARNING, and XSECTC.

00152                                {
00153   MsgStream log(messageService(), name());
00154   log << MSG::WARNING << "BesBdkRc initialize" << endreq;
00155 
00156   static const bool CREATEIFNOTTHERE(true);                                                            
00157   StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);                 
00158   if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)                                                 
00159   {                                                                                                    
00160     log << MSG::ERROR << " Could not initialize Random Number Service" << endreq;                      
00161     return RndmStatus;                                                                                 
00162   }                                                                                                    
00163   CLHEP::HepRandomEngine* engine  = p_BesRndmGenSvc->GetEngine("BesBdkRc");                            
00164   engine->showStatus();
00165   BesBdkRcRandom::setRandomEngine(engine); 
00166 
00167   //"INIT" subroutine action is replaced by c++ code
00168   // for gen_init  fortran code is called   
00169 
00170   FINCUT.TCHMIN=m_tcmin*toRad;
00171   FINCUT.PCHMIN=m_pcmin;
00172 //  RLUXGO(3,m_iseed,0,0);
00173 
00174   DELPHC.MAXNTRY=m_maxNTry;
00175 
00176   COLCHC.IFINAL=m_ifinal;
00177 
00178   INPUT.EB=0.5*m_CMEnergy;
00179 
00180   LOCALC.W2MINR=m_w2min;
00181   LOCALC.EBEAM=0.5*m_CMEnergy;
00182   LOCALC.MAXESW=m_ewe;
00183   LOCALC.KZERO=m_kzero;
00184 //  LOCALC.ISEED=m_iseed;
00185   for(int i=0; i<6;i++)LOCALC.QMASS[i]=qmass[i];
00186   GEN_INIT();
00187   XSECTC.NEVUNW=0;
00188 
00189   return StatusCode::SUCCESS;
00190 }


Member Data Documentation

float BesBdkRc::m_CMEnergy [private]

Definition at line 35 of file BesBdkRc.h.

Referenced by initialize().

float BesBdkRc::m_ewe [private]

Definition at line 36 of file BesBdkRc.h.

Referenced by initialize().

int BesBdkRc::m_ifinal [private]

Definition at line 41 of file BesBdkRc.h.

Referenced by initialize().

int BesBdkRc::m_iseed [private]

Definition at line 42 of file BesBdkRc.h.

float BesBdkRc::m_kzero [private]

Definition at line 37 of file BesBdkRc.h.

Referenced by initialize().

int BesBdkRc::m_maxNTry [private]

Definition at line 40 of file BesBdkRc.h.

Referenced by initialize().

long int BesBdkRc::m_numberEvent [private]

Definition at line 46 of file BesBdkRc.h.

Referenced by execute().

float BesBdkRc::m_pcmin [private]

Definition at line 45 of file BesBdkRc.h.

Referenced by initialize().

float BesBdkRc::m_tcmin [private]

Definition at line 44 of file BesBdkRc.h.

Referenced by initialize().

float BesBdkRc::m_w2min [private]

Definition at line 33 of file BesBdkRc.h.

Referenced by initialize().

IBesRndmGenSvc* BesBdkRc::p_BesRndmGenSvc [private]

Definition at line 48 of file BesBdkRc.h.

Referenced by initialize().

float BesBdkRc::qmass[6] [private]

Definition at line 38 of file BesBdkRc.h.

Referenced by initialize().

double BesBdkRc::toDeg [private]

Definition at line 32 of file BesBdkRc.h.

double BesBdkRc::toRad [private]

Definition at line 31 of file BesBdkRc.h.

Referenced by initialize().


Generated on Tue Nov 29 23:17:28 2016 for BOSS_7.0.2 by  doxygen 1.4.7