BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
BesBdkRc Class Reference

#include <BesBdkRc.h>

+ Inheritance diagram for BesBdkRc:

Public Member Functions

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

Detailed Description

Definition at line 21 of file BesBdkRc.h.

Constructor & Destructor Documentation

◆ BesBdkRc()

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

Definition at line 129 of file BesBdkRc.cxx.

129 :Algorithm( name, pSvcLocator )
130{
131// declareProperty("InitialSeed",m_iseed=1001);
132 declareProperty("CMEnergy", m_CMEnergy = 3.097); // 2*Ebeam [GeV]
133 declareProperty("W2min",m_w2min=0.02); // Cut on invariant gamma-gamma mass
134 declareProperty("EstimatedMaxWeight", m_ewe=2.5);
135 declareProperty("SoftPhotonMaxEnergy", m_kzero=0.002);
136 qmass[0] = 0.2;
137 qmass[1] = 0.2;
138 qmass[2] = 0.5;
139 qmass[3] = 1.5;
140 qmass[4] = 4.5;
141 qmass[5] = 180.;
142 declareProperty("MaxNTry", m_maxNTry);
143 declareProperty("FinalState", m_ifinal);
144 declareProperty("MinTheta",m_tcmin);
145 declareProperty("MinMomentum",m_pcmin);
146
147 m_numberEvent=0;
148 toRad=M_PI/180.0;
149 toDeg=180.0/M_PI;
150}
#define M_PI
Definition: TConstant.h:4

Member Function Documentation

◆ execute()

StatusCode BesBdkRc::execute ( )

Definition at line 192 of file BesBdkRc.cxx.

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

◆ finalize()

StatusCode BesBdkRc::finalize ( )

Definition at line 244 of file BesBdkRc.cxx.

245{
246 MsgStream log(messageService(), name());
247 log << MSG::INFO << "BesBdkRc finalized" << endreq;
248 int itot;
249 itot=XSECTC.ITOT;
250 double cstot;
251 double cserr;
252 FINISH(itot,cstot,cserr);
253 float effcut=0;
254 float cscut=0;
255 float efferr=0;
256 float cscuterr=0;
257 if(XSECTC.NEVUNW){
258 effcut=float(DELPHC.NEVCUT)/float(XSECTC.NEVUNW);
259 cscut=effcut*cstot;
260 efferr=sqrt(effcut*(1.0-effcut)/float(XSECTC.NEVUNW));
261 cscuterr = sqrt(cstot*efferr*cstot*efferr + effcut*effcut*cserr*cserr);
262 }
263 printf("BDKRC SUMMARY: Cross section after user cuts= %G +- %G nb\n",cscut,cscuterr);
264 printf(" Cut acceptance = %G +- %G \n",effcut,efferr);
265 return StatusCode::SUCCESS;
266}
#define DELPHC
Definition: BesBdkRc.cxx:68
#define FINISH(IN, SIGT, ER)
Definition: BesBdkRc.cxx:109
#define XSECTC
Definition: BesBdkRc.cxx:76

◆ initialize()

StatusCode BesBdkRc::initialize ( )

Definition at line 152 of file BesBdkRc.cxx.

152 {
153 MsgStream log(messageService(), name());
154 log << MSG::WARNING << "BesBdkRc initialize" << endreq;
155
156 static const bool CREATEIFNOTTHERE(true);
157 StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
158 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
159 {
160 log << MSG::ERROR << " Could not initialize Random Number Service" << endreq;
161 return RndmStatus;
162 }
163 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine("BesBdkRc");
164 engine->showStatus();
166
167 //"INIT" subroutine action is replaced by c++ code
168 // for gen_init fortran code is called
169
170 FINCUT.TCHMIN=m_tcmin*toRad;
171 FINCUT.PCHMIN=m_pcmin;
172// RLUXGO(3,m_iseed,0,0);
173
174 DELPHC.MAXNTRY=m_maxNTry;
175
176 COLCHC.IFINAL=m_ifinal;
177
178 INPUT.EB=0.5*m_CMEnergy;
179
180 LOCALC.W2MINR=m_w2min;
181 LOCALC.EBEAM=0.5*m_CMEnergy;
182 LOCALC.MAXESW=m_ewe;
183 LOCALC.KZERO=m_kzero;
184// LOCALC.ISEED=m_iseed;
185 for(int i=0; i<6;i++)LOCALC.QMASS[i]=qmass[i];
186 GEN_INIT();
187 XSECTC.NEVUNW=0;
188
189 return StatusCode::SUCCESS;
190}
#define COLCHC
Definition: BesBdkRc.cxx:62
#define INPUT
Definition: BesBdkRc.cxx:35
#define GEN_INIT()
Definition: BesBdkRc.cxx:115
#define FINCUT
Definition: BesBdkRc.cxx:47
#define LOCALC
Definition: BesBdkRc.cxx:55
static void setRandomEngine(CLHEP::HepRandomEngine *randomEngine)
virtual CLHEP::HepRandomEngine * GetEngine(const std::string &StreamName)=0
Interface to the CLHEP engine.

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