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);
47 if( sc.isFailure() ) {
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++ ) {
85 if( sc.isFailure() ) {
90 if( sc.isFailure() ) {
virtual StatusCode finalize()
Finalize.
Definition of the MsgStream class used to transmit messages.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Essential information of the event used in examples It can be identified by "/Event".
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.
virtual StatusCode execute()
Event callback.
const std::string & name() const override
The identifying name of the algorithm object.
Random number accessor This small class encapsulates the use of the random number generator...
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].
#define DECLARE_COMPONENT(type)
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.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.