BOSS 7.0.2
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 ()
 
 BesTwogam (const string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Constructor & Destructor Documentation

◆ BesTwogam() [1/2]

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

Definition at line 152 of file BesTwogam.cxx.

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

◆ BesTwogam() [2/2]

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

Member Function Documentation

◆ execute() [1/2]

StatusCode BesTwogam::execute ( )

Definition at line 196 of file BesTwogam.cxx.

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

◆ execute() [2/2]

StatusCode BesTwogam::execute ( )

◆ finalize() [1/2]

StatusCode BesTwogam::finalize ( )

Definition at line 242 of file BesTwogam.cxx.

243{
244 MsgStream log(messageService(), name());
245 log << MSG::INFO << "BesTwogam finalized" << endreq;
246 FINISH();
247 return StatusCode::SUCCESS;
248}
#define FINISH(IN, SIGT, ER)
Definition: BesBdkRc.cxx:109

◆ finalize() [2/2]

StatusCode BesTwogam::finalize ( )

◆ initialize() [1/2]

StatusCode BesTwogam::initialize ( )

Definition at line 164 of file BesTwogam.cxx.

164 {
165 MsgStream log(messageService(), name());
166 log << MSG::WARNING << "BesTwogam initialize" << endreq;
167
168 if(m_fcard.size()>254){
169 log << MSG::ERROR << "Too big name of BesTwogam card file" << endreq;
170 return StatusCode::FAILURE;
171 }
172 // FNAMES.dummy=61777;
173 strcpy(FNAMES.cardName,m_fcard.c_str());
174 FNAMES.i_cardName=m_fcard.size();
175
176 RDCUTS();
177 ISEEDC.ISEED=m_seed;
178 EXCUTS.EBEAME=0.5*m_cmEnergy;
179 EXCUTS.W2MINE=m_m2min;
180 INPARC.NTUNW=m_unw;
181
182 SETDEF();
183 QCDSTA();
184 DOCUTS();
185 ESTMAXCS();
186 PRTCUT();
187 // USRINI();
188 m_numberEvent=0;
189 //for pythia parameter setting,pingrg-2013-12-11
190 for(int i=0;i<m_pypars.size();i++){
191 pygive_(m_pypars[i].c_str(),strlen(m_pypars[i].c_str()));
192 }
193 return StatusCode::SUCCESS;
194}
#define ISEEDC
Definition: BesTwogam.cxx:33
#define DOCUTS()
Definition: BesTwogam.cxx:118
#define FNAMES
Definition: BesTwogam.cxx:40
#define ESTMAXCS()
Definition: BesTwogam.cxx:121
#define EXCUTS
Definition: BesTwogam.cxx:82
#define PRTCUT()
Definition: BesTwogam.cxx:124
#define SETDEF()
Definition: BesTwogam.cxx:112
#define RDCUTS()
Definition: BesTwogam.cxx:109
#define INPARC
Definition: BesTwogam.cxx:46
#define QCDSTA()
Definition: BesTwogam.cxx:115
void pygive_(const char *cnfgstr, int length)
char * c_str(Index i)
Definition: EvtCyclic3.cc:252

◆ initialize() [2/2]

StatusCode BesTwogam::initialize ( )

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