BOSS 8.0.0
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 20 of file Eepipi.h.

Constructor & Destructor Documentation

◆ Eepipi()

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

Definition at line 106 of file Eepipi/src/Eepipi.cxx.

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

Referenced by Eepipi().

Member Function Documentation

◆ execute()

StatusCode Eepipi::execute ( )

Definition at line 156 of file Eepipi/src/Eepipi.cxx.

156 {
157 MsgStream log( msgSvc(), name() );
158
159 int npart = 0;
160 int pid1, pid2, pid3, pid4, pst1, pst2;
161 pid1 = 11;
162 pid2 = -11;
163 pid3 = 211;
164 pid4 = -211;
165 pst1 = 1;
166 pst2 = 1;
167
168 // Fill event information
169 GenEvent* evt = new GenEvent( 1, 1 );
170
171 GenVertex* prod_vtx = new GenVertex();
172 // prod_vtx->add_particle_out( p );
173 evt->add_vertex( prod_vtx );
174
175 // incoming beam e- HepLorentzVector(px,py,pz,energy) required!
176 GenParticle* p =
177 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 evtgen++;
221
222 if ( log.level() < MSG::INFO ) { evt->print(); }
223
224 // Check if the McCollection already exists
225 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(), "/Event/Gen" );
226 if ( anMcCol != 0 )
227 {
228 // Add event to existing collection
229 MsgStream log( msgSvc(), name() );
230 log << MSG::INFO << "Add McGenEvent to existing collection" << endmsg;
231 McGenEvent* mcEvent = new McGenEvent( evt );
232 anMcCol->push_back( mcEvent );
233 }
234 else
235 {
236 // Create Collection and add to the transient store
237 McGenEventCol* mcColl = new McGenEventCol;
238 McGenEvent* mcEvent = new McGenEvent( evt );
239 mcColl->push_back( mcEvent );
240 StatusCode sc = eventSvc()->registerObject( "/Event/Gen", mcColl );
241 if ( sc != StatusCode::SUCCESS )
242 {
243 log << MSG::ERROR << "Could not register McGenEvent" << endmsg;
244 delete mcColl;
245 delete evt;
246 delete mcEvent;
247 return StatusCode::FAILURE;
248 }
249 else
250 {
251 // log << MSG::INFO << "McGenEventCol created and " << npart <<" particles stored in
252 // McGenEvent" << endmsg;
253 }
254 }
255
256 return StatusCode::SUCCESS;
257}
#define MOMSET
Definition Babayaga.cxx:43
ObjectVector< McGenEvent > McGenEventCol
IMessageSvc * msgSvc()

◆ finalize()

StatusCode Eepipi::finalize ( )

Definition at line 259 of file Eepipi/src/Eepipi.cxx.

259 {
260 MsgStream log( msgSvc(), name() );
261 char delcmd[300];
262 strcpy( delcmd, "cat " );
263 strcat( delcmd, "fresult.dat" );
264 system( delcmd );
265
266 std::cout << "Eepipi finalized" << endl;
267 return StatusCode::SUCCESS;
268}

◆ getMaxEvent()

StatusCode Eepipi::getMaxEvent ( )

Definition at line 270 of file Eepipi/src/Eepipi.cxx.

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

Referenced by initialize().

◆ initialize()

StatusCode Eepipi::initialize ( )

Definition at line 116 of file Eepipi/src/Eepipi.cxx.

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

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