32 static int evtnum = 0;
33 static int runnum = 999;
40 event->setEvent(++evtnum);
41 event->setRun(runnum);
45 sc = evtmgr->setRoot(
"/Event", event);
46 if( sc.isFailure() ) {
47 error() <<
"Unable to register /Event object" <<
endmsg;
54 MyTrack* ptrack =
new MyTrack((
float)rndmgauss(),(
float)rndmgauss(),(
float)rndmgauss());
59 myTracks->
add( ptrack );
60 myVertices->
add ( dvertex );
62 int n = (int)(rndmflat() * 100.);
63 for(
int i = 0;
i <
n;
i++ ) {
65 MyTrack* t =
new MyTrack((
float)rndmgauss(),(
float)rndmgauss(),(
float)rndmgauss());
69 if( rndmflat() > 0.5 ) {
71 myVertices->
add ( dv );
73 int m = (int)(rndmflat() * 10.);
74 for(
int j = 0; j <
m; j++ ) {
84 if( sc.isFailure() ) {
89 if( sc.isFailure() ) {
90 error() <<
"Unable to register MyVertices" <<
endmsg;
95 info() <<
"Generated event " << evtnum <<
endmsg;
virtual StatusCode finalize()
Finalize.
Essential information of the event used in examples It can be identified by "/Event".
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
virtual long add(ContainedObject *pObject)
ObjectContainerBase overload: Add an object to the container.
void setDecayVertex(MyVertex *decay)
Access to event object.
void setMotherTrack(MyTrack *value)
Update pointer to mother particle (by a C++ pointer or a smart reference)
float py() const
Accessors: Retrieve y-component of the track momentum.
Parameters for the Gauss random number generation.
void setEvent(Event *evt)
Access to event object.
#define DECLARE_COMPONENT(type)
virtual StatusCode execute()
Event callback.
Random number accessor This small class encapsulates the use of the random number generator...
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
KeyedContainer< MyVertex > MyVertexVector
This class is used for returning status codes from appropriate routines.
float px() const
Accessors: Retrieve x-component of the track momentum.
Parameters for the flat random number generation within boundaries [minimum, maximum].
WriteAlg class for the RootIOExample.
void addDaughterTrack(MyTrack *value)
Retrieve pointer to vector of daughter particles (const or non-const)
float pz() const
Accessors: Retrieve z-component of the track momentum.
SmartIF< IRndmGenSvc > & randSvc() const
AIDA-based NTuple service Returns a pointer to the AIDATuple service if present.
Simple class that represents a vertex for testing purposes.
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
KeyedContainer< MyTrack > MyTrackVector
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.