BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTwogam Class Reference

#include <BesTwogam.h>

Inheritance diagram for BesTwogam:

Public Member Functions

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

Detailed Description

Definition at line 24 of file BesTwogam.h.

Constructor & Destructor Documentation

◆ BesTwogam()

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

Definition at line 146 of file BesTwogam.cxx.

147 : Algorithm( name, pSvcLocator ) {
148 declareProperty( "InitialSeed", m_seed = 1001 );
149 declareProperty( "CMEnergy", m_cmEnergy = 3.097 ); // 2*Ebeam [GeV]
150 declareProperty( "MinimumW2", m_m2min = 0.02 );
151 declareProperty( "Unweighted", m_unw = 1 );
152 declareProperty( "CardFileName", m_fcard = "BesTwogam.conf" );
153 // interface set pythia pars, pingrg
154 m_pypars.clear();
155 declareProperty( "setPythiaPars", m_pypars );
156}

Referenced by BesTwogam().

Member Function Documentation

◆ execute()

StatusCode BesTwogam::execute ( )

Definition at line 190 of file BesTwogam.cxx.

190 {
191 MsgStream log( msgSvc(), name() );
192 log << MSG::INFO << "BesTwogam executing" << endmsg;
193 HepMC::HEPEVT_Wrapper::set_max_number_entries( 2000 );
194 HepMC::HEPEVT_Wrapper::set_sizeof_real( 8 );
195 HepMC::IO_HEPEVT HepEvtIO;
196 HEPEVT_CLEAN();
197 GEN1EVT();
198 // PRINTEVT();
199 if ( CFLAGS.GOODEV != 1 )
200 {
201 log << MSG::ERROR << " BesTwogam: fail to generate good event" << endl;
202 return StatusCode::FAILURE;
203 }
204 m_numberEvent++;
205 if ( log.level() < MSG::INFO ) LULIST( 1 );
206 LUHEPC( 1 );
207 // HEPEVT_PRINT();
208 HepMC::GenEvent* evt = HepEvtIO.read_next_event();
209 evt->set_event_number( m_numberEvent );
210 evt->set_signal_process_id( 1 );
211 // Check if the McCollection already exists
212 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(), "/Event/Gen" );
213 if ( anMcCol != 0 )
214 {
215 // Add event to existing collection
216 MsgStream log( msgSvc(), name() );
217 log << MSG::INFO << "Add McGenEvent to existing collection" << endmsg;
218 McGenEvent* mcEvent = new McGenEvent( evt );
219 anMcCol->push_back( mcEvent );
220 }
221 else
222 {
223 // Create Collection and add to the transient store
224 McGenEventCol* mcColl = new McGenEventCol;
225 McGenEvent* mcEvent = new McGenEvent( evt );
226 mcColl->push_back( mcEvent );
227 StatusCode sc = eventSvc()->registerObject( "/Event/Gen", mcColl );
228 if ( sc != StatusCode::SUCCESS )
229 {
230 log << MSG::ERROR << "Could not register McGenEvent" << endmsg;
231 delete mcColl;
232 delete evt;
233 delete mcEvent;
234 return StatusCode::FAILURE;
235 }
236 }
237 return StatusCode::SUCCESS;
238}
#define LULIST(ICONV)
Definition BesBdkRc.cxx:93
#define GEN1EVT()
Definition BesBdkRc.cxx:116
#define LUHEPC(ICONV)
Definition BesBdkRc.cxx:90
#define HEPEVT_CLEAN()
Definition BesBdkRc.cxx:96
#define CFLAGS
Definition BesTwogam.cxx:69
ObjectVector< McGenEvent > McGenEventCol
IMessageSvc * msgSvc()

◆ finalize()

StatusCode BesTwogam::finalize ( )

Definition at line 240 of file BesTwogam.cxx.

240 {
241 MsgStream log( msgSvc(), name() );
242 log << MSG::INFO << "BesTwogam finalized" << endmsg;
243 FINISH();
244 return StatusCode::SUCCESS;
245}
#define FINISH(IN, SIGT, ER)
Definition BesBdkRc.cxx:105

◆ initialize()

StatusCode BesTwogam::initialize ( )

Definition at line 158 of file BesTwogam.cxx.

158 {
159 MsgStream log( msgSvc(), name() );
160 log << MSG::WARNING << "BesTwogam initialize" << endmsg;
161
162 if ( m_fcard.size() > 254 )
163 {
164 log << MSG::ERROR << "Too big name of BesTwogam card file" << endmsg;
165 return StatusCode::FAILURE;
166 }
167 // FNAMES.dummy=61777;
168 strcpy( FNAMES.cardName, m_fcard.c_str() );
169 FNAMES.i_cardName = m_fcard.size();
170
171 RDCUTS();
172 ISEEDC.ISEED = m_seed;
173 EXCUTS.EBEAME = 0.5 * m_cmEnergy;
174 EXCUTS.W2MINE = m_m2min;
175 INPARC.NTUNW = m_unw;
176
177 SETDEF();
178 QCDSTA();
179 DOCUTS();
180 ESTMAXCS();
181 PRTCUT();
182 // USRINI();
183 m_numberEvent = 0;
184 // for pythia parameter setting,pingrg-2013-12-11
185 for ( int i = 0; i < m_pypars.size(); i++ )
186 { pygive_( m_pypars[i].c_str(), strlen( m_pypars[i].c_str() ) ); }
187 return StatusCode::SUCCESS;
188}
#define ISEEDC
Definition BesTwogam.cxx:29
#define DOCUTS()
#define FNAMES
Definition BesTwogam.cxx:36
#define ESTMAXCS()
#define EXCUTS
Definition BesTwogam.cxx:76
#define PRTCUT()
#define SETDEF()
#define RDCUTS()
#define INPARC
Definition BesTwogam.cxx:42
#define QCDSTA()
void pygive_(const char *cnfgstr, int length)
char * c_str(Index i)

The documentation for this class was generated from the following files: