I added time stamps to the MCEventHeader (r 2772), to use this in the simulation macro:

CbmPrimaryGenerator* primGen = new CbmPrimaryGenerator();

primGen->SetEventTimeInterval ( minTime, maxTime) ;

the event time will be a random number between minTime and maxTime in nano secounds, it will also be added for each event, i.e: each event will have the time of all previous events+ its own one!

regards

Mohammad

]]>

What is the random generator you use?

I think it should be a random distribution.

Cheers,

Tobias]]>

I use:

TRandom::Uniform(min, max)

is this enough or should we change it! or should the user have the possibility to choose the Random generator?

Mohammad]]>

it should be an exponential function with the mean time between events (100 ns) as parameter]]>

Can you explain me in more details what do you mean by this! do you mean the random distribution or the the time it self?

Mohammad]]>

the probability distribution of time intervals between two consecutive events is given by: P(t) = 1/meantime * exp (- 1/meantime * t).

The meantime should be a free parameter (typically 100 ns).

I hope this clarifies it.

Have a nice weekend

Tobias]]>

So, I added a new method SetEventMeanTime(Double_t) to the CbmPrimaryGenerator,

setting this value will create a TF1 function:

TF1 *f1 = TF1("f1", "1/meanTime * Exp (-t/meanTime)", 0, meanTime*10 )

Then the event time is taken randomly from this distribution (f1->GetRandom()) and will be added for each event!

Please test it and let me know!

regards

Mohammad]]>

Or you could use TRandom::Exp(Double_t tau), that does exactly the same faster.

Greetings

Oscar]]>

You are right, it gives the same results! it is not faster but more simple! so now we have two methods:

1. SetEventMeanTime(Double_t)

2. SetEventTimeInterval ( minTime, maxTime) ;

do we need a very general one as Stefano suggested !

regards

Mohammad]]>