BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Eepipi Class Reference

#include <Eepipi.h>

+ Inheritance diagram for Eepipi:

Public Member Functions

 Eepipi (const string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
StatusCode getMaxEvent ()
 

Detailed Description

Definition at line 25 of file Eepipi.h.

Constructor & Destructor Documentation

◆ Eepipi()

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

Definition at line 105 of file Eepipi/Eepipi-00-01-00/src/Eepipi.cxx.

105 :Algorithm( name, pSvcLocator )
106{
107 declareProperty("Ecms", m_Ecms = 3.65); // Ecm = sqrt(s) [GeV]
108 declareProperty("OnlyDigam", m_onlyDigam = 0); //1: only with the digamma process
109 declareProperty("ExcludeDigam", m_excludeDigam = 0); //1: Exclude digamma process in the whole Feynman diagram
110 declareProperty("WriteMC", m_mctruth = 0); //write out the MC truth of final state to "pdata1.dat"
111}

Member Function Documentation

◆ execute()

StatusCode Eepipi::execute ( )

Definition at line 153 of file Eepipi/Eepipi-00-01-00/src/Eepipi.cxx.

154{
155 MsgStream log(messageService(), name());
156
157
158 int npart = 0;
159 int pid1,pid2,pid3,pid4,pst1,pst2;
160 pid1 = 11;
161 pid2 =-11;
162 pid3 = 211;
163 pid4 =-211;
164 pst1 = 1;
165 pst2 = 1;
166
167
168
169 // Fill event information
170 GenEvent* evt = new GenEvent(1,1);
171
172 GenVertex* prod_vtx = new GenVertex();
173// prod_vtx->add_particle_out( p );
174 evt->add_vertex( prod_vtx );
175
176 // incoming beam e- HepLorentzVector(px,py,pz,energy) required!
177 GenParticle* p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.p1[1][evtgen], MOMSET.p1[2][evtgen],
178 MOMSET.p1[3][evtgen], MOMSET.p1[0][evtgen]),
179 11, 3);
180 p->suggest_barcode( ++npart );
181 prod_vtx->add_particle_in(p);
182
183// std::cout<<"incoming beam e+"<<endl;
184 // incoming beam e+, e+ moving along the z-direction
185 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.q1[1][evtgen], MOMSET.q1[2][evtgen],
186 MOMSET.q1[3][evtgen], MOMSET.q1[4][evtgen]),
187 -11, 3);
188
189 p->suggest_barcode( ++npart );
190 prod_vtx->add_particle_in(p);
191
192 // scattered lepton +
193 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.p2[1][evtgen], MOMSET.p2[2][evtgen],
194 MOMSET.p2[3][evtgen], MOMSET.p2[0][evtgen]),
195 pid1,pst1);
196 p->suggest_barcode( ++npart );
197 prod_vtx->add_particle_out(p);
198
199 // scattered lepton -
200 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.q2[1][evtgen], MOMSET.q2[2][evtgen],
201 MOMSET.q2[3][evtgen], MOMSET.q2[0][evtgen]),
202 pid2, pst2);
203 p->suggest_barcode( ++npart );
204 prod_vtx->add_particle_out(p);
205
206 // outgoing pi+
207 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.p3[1][evtgen], MOMSET.p3[2][evtgen],
208 MOMSET.p3[3][evtgen], MOMSET.p3[0][evtgen]),
209 pid3,pst1);
210 p->suggest_barcode( ++npart );
211 prod_vtx->add_particle_out(p);
212
213 //outgoing pi-
214 p = new GenParticle( CLHEP::HepLorentzVector( MOMSET.q3[1][evtgen], MOMSET.q3[2][evtgen],
215 MOMSET.q3[3][evtgen], MOMSET.q3[0][evtgen]),
216 pid4, pst2);
217 p->suggest_barcode( ++npart );
218 prod_vtx->add_particle_out(p);
219
220
221
222 evtgen++;
223
224 if( log.level() < MSG::INFO )
225 {
226 evt->print();
227 }
228
229 // Check if the McCollection already exists
230 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
231 if (anMcCol!=0)
232 {
233 // Add event to existing collection
234 MsgStream log(messageService(), name());
235 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
236 McGenEvent* mcEvent = new McGenEvent(evt);
237 anMcCol->push_back(mcEvent);
238 }
239 else
240 {
241 // Create Collection and add to the transient store
242 McGenEventCol *mcColl = new McGenEventCol;
243 McGenEvent* mcEvent = new McGenEvent(evt);
244 mcColl->push_back(mcEvent);
245 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
246 if (sc != StatusCode::SUCCESS)
247 {
248 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
249 delete mcColl;
250 delete evt;
251 delete mcEvent;
252 return StatusCode::FAILURE;
253 }
254 else
255 {
256 // log << MSG::INFO << "McGenEventCol created and " << npart <<" particles stored in McGenEvent" << endreq;
257 }
258 }
259
260 return StatusCode::SUCCESS;
261}
#define MOMSET
Definition Babayaga.cxx:45
ObjectVector< McGenEvent > McGenEventCol
Definition McGenEvent.h:39

◆ finalize()

StatusCode Eepipi::finalize ( )

Definition at line 263 of file Eepipi/Eepipi-00-01-00/src/Eepipi.cxx.

264{
265 MsgStream log(messageService(), name());
266 char delcmd[300];
267 strcpy(delcmd,"cat ");
268 strcat(delcmd,"fresult.dat");
269 system(delcmd);
270
271 std::cout<< "Eepipi finalized" << endl;
272 return StatusCode::SUCCESS;
273}

◆ getMaxEvent()

StatusCode Eepipi::getMaxEvent ( )

Definition at line 275 of file Eepipi/Eepipi-00-01-00/src/Eepipi.cxx.

275 {
276 IProperty* appPropMgr=0;
277 StatusCode status =
278 serviceLocator()->getService("ApplicationMgr", IProperty::interfaceID(),
279 reinterpret_cast<IInterface*&>( appPropMgr ));
280 if( status.isFailure() ) return status;
281
282 IntegerProperty evtMax("EvtMax",0);
283 status = appPropMgr->getProperty( &evtMax );
284 if (status.isFailure()) return status;
285
286 m_evtMax = evtMax.value();
287 return status;
288}

Referenced by initialize().

◆ initialize()

StatusCode Eepipi::initialize ( )

Definition at line 113 of file Eepipi/Eepipi-00-01-00/src/Eepipi.cxx.

113 {
114
115 MsgStream log(messageService(), name());
116
117 log << MSG::INFO << "Eepipi initialize" << endreq;
118
119 //set Bes unified random engine
120 static const bool CREATEIFNOTTHERE(true);
121 StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
122 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
123 {
124 log << MSG::ERROR << " Could not initialize Random Number Service" << endreq;
125 return RndmStatus;
126 }
127 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine("Eepipi");
128 std::cout<<"==============================="<<engine<<endl;
130 // *****************
131 MCTRUTH.mccheck=m_mctruth;
132 BEAMENERGY.ecms=m_Ecms;
133 COSEE.setcos=m_cosee;
134 // std::cout<<"m_Ires= "<<m_Ires<<endl;
135 DIGAM.onlyDigam =m_onlyDigam;
136 DIGAM.excludeDigam=m_excludeDigam;
137 //--
138 std::string locvp=getenv("EEPIPIROOT");
139 locvp +="/share/fitpipi.dat";
140 FORMFACTOR.myfile=(char*)locvp.c_str();
141 std::cout<<"myfile :"<<FORMFACTOR.myfile<<std::endl;
142 system("cat $EEPIPIROOT/share/fitpipi.dat>fitpipi.dat");
143
144 getMaxEvent();
145 std::cout<<"m_evtMax = "<<m_evtMax<<std::endl;
146 intxs_();
147 GEVENT(m_evtMax);
148
149 return StatusCode::SUCCESS;
150}
#define BEAMENERGY
Definition Babayaga.cxx:65
#define GEVENT(NEVENTS)
void intxs_()
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: