BOSS 7.0.5
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)
 
 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 genInitialize ()
 
virtual StatusCode genuserInitialize ()
 
virtual StatusCode callGenerator ()
 
virtual StatusCode genFinalize ()
 
virtual StatusCode fillEvt (GenEvent *evt)
 
 GenModule (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~GenModule ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode genInitialize ()
 
virtual StatusCode genuserInitialize ()
 
virtual StatusCode callGenerator ()
 
virtual StatusCode genFinalize ()
 
virtual StatusCode fillEvt (GenEvent *evt)
 

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)
 
void StripPartonsInit (void)
 
void StripPartons (GenEvent *evt)
 

Detailed Description

Constructor & Destructor Documentation

◆ BesGenModule() [1/2]

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}

◆ ~BesGenModule() [1/2]

BesGenModule::~BesGenModule ( )
virtual

Definition at line 85 of file BesGenModule.cxx.

86{}

◆ BesGenModule() [2/2]

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

◆ ~BesGenModule() [2/2]

virtual BesGenModule::~BesGenModule ( )
virtual

Member Function Documentation

◆ callGenerator() [1/2]

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)

◆ callGenerator() [2/2]

virtual StatusCode BesGenModule::callGenerator ( )
virtual

Reimplemented from GenModule.

◆ fillEvt() [1/2]

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}

◆ fillEvt() [2/2]

virtual StatusCode BesGenModule::fillEvt ( GenEvent *  evt)
virtual

Reimplemented from GenModule.

◆ genFinalize() [1/2]

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 *)

◆ genFinalize() [2/2]

virtual StatusCode BesGenModule::genFinalize ( )
virtual

Reimplemented from GenModule.

◆ genInitialize() [1/2]

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 *)
virtual void setGenseed(long)=0

◆ genInitialize() [2/2]

virtual StatusCode BesGenModule::genInitialize ( )
virtual

Reimplemented from GenModule.

Member Data Documentation

◆ besMcGen_stream

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

◆ cardname

const char * BesGenModule::cardname
protected

◆ m_events

int BesGenModule::m_events
protected

◆ m_fortout

int BesGenModule::m_fortout
protected

◆ m_GenIndex

int BesGenModule::m_GenIndex
protected

◆ m_par

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

◆ m_seeds

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

◆ m_SubIndex

int BesGenModule::m_SubIndex
protected

◆ m_SuperIndex

int BesGenModule::m_SuperIndex
protected

◆ mvec

int BesGenModule::mvec
protected

◆ n

int BesGenModule::n
protected

◆ n1

int BesGenModule::n1
protected

◆ Nr

int BesGenModule::Nr
protected

◆ nvec

int BesGenModule::nvec
protected

◆ p_BesRndmGenSvc

IBesRndmGenSvc * BesGenModule::p_BesRndmGenSvc

◆ runname

std::string BesGenModule::runname
protected

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