CGEM BOSS 6.6.5.g
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 147 of file BesTwogam.cxx.

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

Member Function Documentation

◆ execute()

StatusCode BesTwogam::execute ( )

Definition at line 184 of file BesTwogam.cxx.

185{
186 MsgStream log(messageService(), name());
187 log << MSG::INFO << "BesTwogam executing" << endreq;
188 HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
189 HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
190 HepMC::IO_HEPEVT HepEvtIO;
191 HEPEVT_CLEAN();
192 GEN1EVT();
193 //PRINTEVT();
194 if(CFLAGS.GOODEV!=1){
195 log << MSG::ERROR<<" BesTwogam: fail to generate good event"<<endl;
196 return StatusCode::FAILURE;
197 }
198 m_numberEvent++;
199 if( log.level() < MSG::INFO )LULIST(1);
200 LUHEPC(1);
201 // HEPEVT_PRINT();
202 HepMC::GenEvent* evt = HepEvtIO.read_next_event();
203 evt->set_event_number(m_numberEvent);
204 evt->set_signal_process_id(1);
205 //Check if the McCollection already exists
206 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
207 if (anMcCol!=0) {
208 // Add event to existing collection
209 MsgStream log(messageService(), name());
210 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
211 McGenEvent* mcEvent = new McGenEvent(evt);
212 anMcCol->push_back(mcEvent);
213 } else {
214 // Create Collection and add to the transient store
215 McGenEventCol *mcColl = new McGenEventCol;
216 McGenEvent* mcEvent = new McGenEvent(evt);
217 mcColl->push_back(mcEvent);
218 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
219 if (sc != StatusCode::SUCCESS) {
220 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
221 delete mcColl;
222 delete evt;
223 delete mcEvent;
224 return StatusCode::FAILURE;
225 }
226 }
227 return StatusCode::SUCCESS;
228}
#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
ObjectVector< McGenEvent > McGenEventCol
Definition: McGenEvent.h:39

◆ finalize()

StatusCode BesTwogam::finalize ( )

Definition at line 230 of file BesTwogam.cxx.

231{
232 MsgStream log(messageService(), name());
233 log << MSG::INFO << "BesTwogam finalized" << endreq;
234 FINISH();
235 return StatusCode::SUCCESS;
236}
#define FINISH(IN, SIGT, ER)
Definition: BesBdkRc.cxx:109

◆ initialize()

StatusCode BesTwogam::initialize ( )

Definition at line 156 of file BesTwogam.cxx.

156 {
157 MsgStream log(messageService(), name());
158 log << MSG::WARNING << "BesTwogam initialize" << endreq;
159
160 if(m_fcard.size()>254){
161 log << MSG::ERROR << "Too big name of BesTwogam card file" << endreq;
162 return StatusCode::FAILURE;
163 }
164 // FNAMES.dummy=61777;
165 strcpy(FNAMES.cardName,m_fcard.c_str());
166 FNAMES.i_cardName=m_fcard.size();
167
168 RDCUTS();
169 ISEEDC.ISEED=m_seed;
170 EXCUTS.EBEAME=0.5*m_cmEnergy;
171 EXCUTS.W2MINE=m_m2min;
172 INPARC.NTUNW=m_unw;
173
174 SETDEF();
175 QCDSTA();
176 DOCUTS();
177 ESTMAXCS();
178 PRTCUT();
179 // USRINI();
180 m_numberEvent=0;
181 return StatusCode::SUCCESS;
182}
#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

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