BesTwogam Class Reference

#include <BesTwogam.h>

List of all members.

Public Member Functions

 BesTwogam (const string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

int m_numberEvent
int m_seed
int m_unw
float m_cmEnergy
float m_m2min
std::string m_fcard
std::vector< std::stringm_pypars


Detailed Description

Definition at line 24 of file BesTwogam.h.


Constructor & Destructor Documentation

BesTwogam::BesTwogam ( const string name,
ISvcLocator *  pSvcLocator 
)

Definition at line 152 of file BesTwogam.cxx.

References m_cmEnergy, m_fcard, m_m2min, m_pypars, m_seed, and m_unw.

00152                                                                 :Algorithm( name, pSvcLocator )
00153 {
00154   declareProperty("InitialSeed",m_seed=1001);
00155   declareProperty("CMEnergy", m_cmEnergy = 3.097); // 2*Ebeam [GeV]
00156   declareProperty("MinimumW2",m_m2min=0.02);
00157   declareProperty("Unweighted",m_unw=1);
00158   declareProperty("CardFileName", m_fcard="BesTwogam.conf");
00159   //interface set pythia pars, pingrg
00160   m_pypars.clear();
00161   declareProperty("setPythiaPars", m_pypars);
00162 }


Member Function Documentation

StatusCode BesTwogam::execute (  ) 

Definition at line 196 of file BesTwogam.cxx.

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

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

StatusCode BesTwogam::finalize (  ) 

Definition at line 242 of file BesTwogam.cxx.

References FINISH, and Bes_Common::INFO.

00243 {
00244   MsgStream log(messageService(), name());
00245   log << MSG::INFO << "BesTwogam finalized" << endreq;
00246   FINISH();
00247   return StatusCode::SUCCESS;
00248 }

StatusCode BesTwogam::initialize (  ) 

Definition at line 164 of file BesTwogam.cxx.

References EvtCyclic3::c_str(), DOCUTS, calibUtil::ERROR, ESTMAXCS, EXCUTS, FNAMES, genRecEmupikp::i, INPARC, ISEEDC, m_cmEnergy, m_fcard, m_m2min, m_numberEvent, m_pypars, m_seed, m_unw, PRTCUT, pygive_(), QCDSTA, RDCUTS, SETDEF, and Bes_Common::WARNING.

00164                                 {
00165   MsgStream log(messageService(), name());
00166   log << MSG::WARNING << "BesTwogam initialize" << endreq;
00167 
00168   if(m_fcard.size()>254){
00169   log << MSG::ERROR << "Too big name of BesTwogam card file" << endreq;
00170   return StatusCode::FAILURE;
00171   }
00172   //  FNAMES.dummy=61777;
00173   strcpy(FNAMES.cardName,m_fcard.c_str());
00174   FNAMES.i_cardName=m_fcard.size();
00175 
00176   RDCUTS();
00177   ISEEDC.ISEED=m_seed;
00178   EXCUTS.EBEAME=0.5*m_cmEnergy;
00179   EXCUTS.W2MINE=m_m2min;
00180   INPARC.NTUNW=m_unw;
00181 
00182   SETDEF();
00183   QCDSTA();
00184   DOCUTS();
00185   ESTMAXCS();
00186   PRTCUT();
00187   //  USRINI();
00188   m_numberEvent=0;
00189   //for pythia parameter setting,pingrg-2013-12-11
00190   for(int i=0;i<m_pypars.size();i++){
00191     pygive_(m_pypars[i].c_str(),strlen(m_pypars[i].c_str()));
00192   }
00193   return StatusCode::SUCCESS;
00194 }


Member Data Documentation

float BesTwogam::m_cmEnergy [private]

Definition at line 36 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().

std::string BesTwogam::m_fcard [private]

Definition at line 38 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().

float BesTwogam::m_m2min [private]

Definition at line 37 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().

int BesTwogam::m_numberEvent [private]

Definition at line 33 of file BesTwogam.h.

Referenced by execute(), and initialize().

std::vector<std::string> BesTwogam::m_pypars [private]

Definition at line 39 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().

int BesTwogam::m_seed [private]

Definition at line 34 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().

int BesTwogam::m_unw [private]

Definition at line 35 of file BesTwogam.h.

Referenced by BesTwogam(), and initialize().


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