2 #include "GaudiKernel/SmartDataPtr.h"
3 #include "GaudiKernel/MsgStream.h"
4 #include "GaudiKernel/RndmGenerators.h"
6 #include "GaudiKernel/IDataProviderSvc.h"
7 #include "GaudiKernel/IDataManagerSvc.h"
32 static int evtnum = 0;
33 static int runnum = 999;
41 event->setEvent(++evtnum);
42 event->setRun(runnum);
46 sc = evtmgr->
setRoot(
"/Event", event);
55 MyTrack* ptrack =
new MyTrack((
float)rndmgauss(),(
float)rndmgauss(),(
float)rndmgauss());
60 myTracks->
add( ptrack );
61 myVertices->
add ( dvertex );
63 int n = (int)(rndmflat() * 100.);
64 for(
int i = 0;
i <
n;
i++ ) {
66 MyTrack* t =
new MyTrack((
float)rndmgauss(),(
float)rndmgauss(),(
float)rndmgauss());
70 if( rndmflat() > 0.5 ) {
72 myVertices->
add ( dv );
74 int m = (int)(rndmflat() * 10.);
75 for(
int j = 0; j <
m; j++ ) {
virtual StatusCode finalize()
Finalize.
virtual StatusCode setRoot(const std::string &root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
Definition of the MsgStream class used to transmit messages.
Essential information of the event used in examples It can be identified by "/Event".
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
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.
bool isFailure() const
Test for a status code of FAILURE.
virtual StatusCode execute()
Event callback.
Random number accessor This small class encapsulates the use of the random number generator...
KeyedContainer< MyVertex > MyVertexVector
#define DECLARE_COMPONENT(type)
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.
virtual const std::string & name() const
The identifying name of the algorithm object.
void addDaughterTrack(MyTrack *value)
Retrieve pointer to vector of daughter particles (const or non-const)
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
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.