Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
53 m_recordSvc = service(
"FileRecordDataSvc",
true );
55 error() <<
"Unable to retrieve run records service" <<
endmsg;
58 return put( m_recordSvc.get(),
"/FileRecords/EvtCount", m_evtCount =
new Counter() );
67 auto sc =
put( m_recordSvc.get(),
"/FileRecords/SumCount", pObj );
81 static int evtnum = 0;
82 static int runnum = 999;
87 m_evtCount->increment();
91 evt->setEvent( ++evtnum );
92 evt->setRun( runnum );
95 sc = eventSvc()->registerObject(
"/Event",
"Header",
evt );
97 error() <<
"Unable to register Event Header" <<
endmsg;
105 sc = eventSvc()->registerObject(
"/Event",
"Collision_0", coll0 );
107 error() <<
"Unable to register Collision 0" <<
endmsg;
110 sc =
put( eventSvc(),
"/Event/Collision_1", coll1 );
112 sc =
put( eventSvc(),
"/Event/Collision_2", coll2 );
115 evt->addCollision( coll0 );
116 evt->addCollision( coll1 );
117 evt->addCollision( coll2 );
120 int n = (int)( rndmflat() * 100. );
122 for (
int i = 0; i <
n; i++ ) {
124 double c = rndmgauss();
125 double b = rndmgauss();
126 double a = rndmgauss();
136 myTracks->
insert( track );
140 int m = (int)( rndmflat() * 100. ) + 1;
142 for (
int j = 0;
j <
m;
j++ ) {
144 double c = rndmgauss();
145 double b = rndmgauss();
146 double a = rndmgauss();
147 MyVertex* vtx =
new MyVertex(
float( a ) / 100.0F,
float( b ) / 100.0F,
float(
c ) / 100.0F );
161 myVertices->
insert( vtx );
165 int org = (int)( rndmflat() * float(
m ) );
167 ( *k )->setOriginVertex( orgVtx );
168 int dec1 = (int)( rndmflat() * float(
m ) );
169 int dec2 = (int)( rndmflat() * float(
m ) );
171 dec1 = ( tmp < dec2 ) ? tmp : dec2;
172 dec2 = ( tmp > dec2 ) ? tmp : dec2;
173 for (
int l = dec1;
l < dec2; ++
l ) {
175 ( *k )->addDecayVertex( decVtx );
180 sc =
put( eventSvc(),
"/Event/MyTracks", myTracks );
182 sc =
put( eventSvc(),
"/Event/Collision_0/MyVertices", myVertices );
iterator end()
Retrieve terminating iterator.
void setEvent(Event *evt)
Access to event object.
StatusCode initialize() override
Initialize.
KeyedContainer< MyTrack > MyTrackVector
iterator begin()
Retrieve start iterator.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Parameters for the flat random number generation within boundaries [minimum, maximum].
void set(int val)
Set value.
void addCollision(Collision *vtx)
Add collision.
Parameters for the Gauss random number generation.
Random number accessor This small class encapsulates the use of the random number generator.
template class KeyedContainer, KeyedContainer.h
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
const key_type & insert(const value_type val, const key_type &kval)
Insert entry to the container with a valid key.
seq_type::iterator iterator
Sequential access: iterator type used in sequential container.
void setEvent(Event *evt)
Access to event object.
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
constexpr static const auto SUCCESS
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Finalize.
void setMotherParticle(MyTrack *mother)
Set mother track.
constexpr static const auto FAILURE
KeyedContainer< MyVertex > MyVertexVector
StatusCode execute() override
Event callback.
auto put(const DataObjectHandle< Out1 > &out_handle, Out2 &&out)