CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGenModule Class Reference

#include <BesGenModule.h>

+ Inheritance diagram for BesGenModule:

Public Member Functions

 BesGenModule (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~BesGenModule ()
 
virtual StatusCode genInitialize ()
 
virtual StatusCode callGenerator ()
 
virtual StatusCode genFinalize ()
 
virtual StatusCode fillEvt (GenEvent *evt)
 
- Public Member Functions inherited from GenModule
 GenModule (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~GenModule ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode genuserInitialize ()
 

Public Attributes

IBesRndmGenSvcp_BesRndmGenSvc
 

Static Public Attributes

static std::string besMcGen_stream ="PHOTOS_INIT"
 

Protected Attributes

int m_fortout
 
std::vector< long int > m_seeds
 
const char * cardname
 
std::string runname
 
int Nr
 
int mvec [10]
 
int nvec [10]
 
std::vector< int > m_par
 
int m_events
 
int n
 
int n1
 
int m_GenIndex
 
int m_SuperIndex
 
int m_SubIndex
 
- Protected Attributes inherited from GenModule
bool m_fixedMode
 
double m_meanInteractions
 
int m_randomSeed
 
std::vector< int > m_AllPartons
 
std::vector< int > m_StripVector
 
bool m_StripPartonSwitch
 
CLHEP::HepRandomEngine * m_pRandomEngine
 
CLHEP::RandPoisson * m_pPoissonGenerator
 
HepPDT::ParticleDataTable * m_particleTable
 

Additional Inherited Members

- Protected Member Functions inherited from GenModule
void StripPartonsInit (void)
 
void StripPartons (GenEvent *evt)
 

Detailed Description

Definition at line 21 of file BesGenModule.h.

Constructor & Destructor Documentation

◆ BesGenModule()

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

Definition at line 73 of file BesGenModule.cxx.

74 : GenModule(name,pSvcLocator)
75{
76//--------------------------------------------------------------------------
77 besMcGen_stream = "PHOTOS_INIT";
78// declareProperty("BesMcGenCommand", m_BesMcGenCommandVector);
79
80 declareProperty("Runcards", runname = "run.cards");
81 declareProperty("Ratio", Nr = 1);
82
83}
static std::string besMcGen_stream
std::string runname
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Definition GenModule.cxx:38

◆ ~BesGenModule()

BesGenModule::~BesGenModule ( )
virtual

Definition at line 85 of file BesGenModule.cxx.

86{}

Member Function Documentation

◆ callGenerator()

StatusCode BesGenModule::callGenerator ( )
virtual

Reimplemented from GenModule.

Definition at line 143 of file BesGenModule.cxx.

143 {
144//---------------------------------------------------------------------------
145 MsgStream log(messageService(), name());
146 log << MSG::INFO << " BesGenModule generating. \n" << endreq;
147
148 StatusCode status = StatusCode::SUCCESS;
149 int iq;
150
151// n=1;
152
153
154 mainexe_(&Nr,mvec);
155
156/*
157 for (int iq = 1; iq < 11; iq++) {
158 nvec[iq-1]=mvec[iq];
159 }
160*/
161
162 McEvent* aMcEvent = new McEvent;
163 StatusCode sc = eventSvc()->registerObject("/Event/MC",aMcEvent);
164
165
166 SmartDataPtr<DecayMode> anMcCol(eventSvc(), "/Event/MC/DecayMode");
167 if (anMcCol!=0) {
168// log << MSG::INFO << "Add McEvent to existing collection" << endreq;
169 }
170 else {
171// log << MSG::INFO << "No decay mode now" << endreq;
172 DecayMode *decayMode = new DecayMode;
173 decayMode->putData(mvec, 10);
174 StatusCode sc = eventSvc()->registerObject("/Event/MC/DecayMode",decayMode);
175 }
176
177
178 SmartDataPtr<DecayMode> aMcCol(eventSvc(), "/Event/MC/DecayMode");
179 if (aMcCol!=0) {
180// log << MSG::INFO << "Haha signal exist!!!!" << endreq;
181 }
182
183
184
185
186// HEPEVT_Wrapper::print_hepevt();
187
188 ++m_events;
189
190
191
192 log << MSG::INFO << " BESGenModule generating done. \n" << endreq;
193 return status;
194
195}
void mainexe_(int *, int *mvec)
void putData(int *data, unsigned int size)

◆ fillEvt()

StatusCode BesGenModule::fillEvt ( GenEvent * evt)
virtual

Reimplemented from GenModule.

Definition at line 206 of file BesGenModule.cxx.

206 {
207 //---------------------------------------------------------------------------
208 MsgStream log(messageService(), name());
209 log << MSG:: INFO << " BESGenModule Filling... \n" << endreq;
210
211 evt->set_event_number(m_events);
212 HepMC::IO_HEPEVT hepio;
213 hepio.fill_next_event(evt);
214// cmTomm(evt);
215// GeVToMeV(evt);
216
217
218 return StatusCode::SUCCESS;
219}

◆ genFinalize()

StatusCode BesGenModule::genFinalize ( )
virtual

Reimplemented from GenModule.

Definition at line 198 of file BesGenModule.cxx.

198 {
199 //---------------------------------------------------------------------------
200 MsgStream log(messageService(), name());
201 mainfin_(&n);
202 log << MSG:: INFO << " BESGenModule Ending... \n" << endreq;
203 return StatusCode::SUCCESS;
204}
void mainfin_(int *)

◆ genInitialize()

StatusCode BesGenModule::genInitialize ( )
virtual

Reimplemented from GenModule.

Definition at line 104 of file BesGenModule.cxx.

104 {
105//---------------------------------------------------------------------------
106
107 MsgStream log(messageService(), name());
108 log << MSG::INFO << " BES PHOTOS INITIALISING. \n" << endreq;
109// log << MSG::INFO << " BES PHOTOS 2. \n" << endreq;
110
111 //caogf add for random seed of genbes
112 StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, true);
113 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
114 {
115 log << MSG::ERROR << " Could not initialize Random Number Service" << endreq;
116 return RndmStatus;
117 }
118
119 BesGenModule::besMcGen_stream = "PHOTOS_INIT";
120
121 BesGenModule::besMcGen_stream = "PHOTOS111";
122
123 m_events = 0;
124 n=0;
125 cardname = runname.c_str();
126
127
129
130 int theseed;
131 runi_seed_(&theseed);
132 p_BesRndmGenSvc->setGenseed(theseed+1);
133
134 HepMC::HEPEVT_Wrapper::set_sizeof_int(4);
135 HepMC::HEPEVT_Wrapper::set_sizeof_real(4);
136 HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
137
138
139 return StatusCode::SUCCESS;
140}
void mainini_(int *, const char *)
void runi_seed_(int *)
IBesRndmGenSvc * p_BesRndmGenSvc
const char * cardname
virtual void setGenseed(long)=0

Member Data Documentation

◆ besMcGen_stream

std::string BesGenModule::besMcGen_stream ="PHOTOS_INIT"
static

Definition at line 33 of file BesGenModule.h.

Referenced by BesGenModule(), and genInitialize().

◆ cardname

const char* BesGenModule::cardname
protected

Definition at line 44 of file BesGenModule.h.

Referenced by genInitialize().

◆ m_events

int BesGenModule::m_events
protected

Definition at line 53 of file BesGenModule.h.

Referenced by callGenerator(), fillEvt(), and genInitialize().

◆ m_fortout

int BesGenModule::m_fortout
protected

Definition at line 39 of file BesGenModule.h.

◆ m_GenIndex

int BesGenModule::m_GenIndex
protected

Definition at line 57 of file BesGenModule.h.

◆ m_par

std::vector<int> BesGenModule::m_par
protected

Definition at line 50 of file BesGenModule.h.

◆ m_seeds

std::vector<long int> BesGenModule::m_seeds
protected

Definition at line 42 of file BesGenModule.h.

◆ m_SubIndex

int BesGenModule::m_SubIndex
protected

Definition at line 61 of file BesGenModule.h.

◆ m_SuperIndex

int BesGenModule::m_SuperIndex
protected

Definition at line 59 of file BesGenModule.h.

◆ mvec

int BesGenModule::mvec[10]
protected

Definition at line 47 of file BesGenModule.h.

Referenced by callGenerator().

◆ n

int BesGenModule::n
protected

Definition at line 54 of file BesGenModule.h.

Referenced by genFinalize(), and genInitialize().

◆ n1

int BesGenModule::n1
protected

Definition at line 55 of file BesGenModule.h.

◆ Nr

int BesGenModule::Nr
protected

Definition at line 46 of file BesGenModule.h.

Referenced by BesGenModule(), and callGenerator().

◆ nvec

int BesGenModule::nvec[10]
protected

Definition at line 48 of file BesGenModule.h.

◆ p_BesRndmGenSvc

IBesRndmGenSvc* BesGenModule::p_BesRndmGenSvc

Definition at line 32 of file BesGenModule.h.

Referenced by genInitialize().

◆ runname

std::string BesGenModule::runname
protected

Definition at line 45 of file BesGenModule.h.

Referenced by BesGenModule(), and genInitialize().


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