GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Time stamps in MCEventHeader
Time stamps in MCEventHeader [message #6731] Thu, 15 May 2008 09:57 Go to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

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




[Updated on: Thu, 15 May 2008 09:57]

Report message to a moderator

Re: Time stamps in MCEventHeader [message #6732 is a reply to message #6731] Thu, 15 May 2008 10:10 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Very good!

What is the random generator you use?

I think it should be a random distribution.

Cheers,

Tobias
Re: Time stamps in MCEventHeader [message #6733 is a reply to message #6732] Thu, 15 May 2008 10:24 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

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
Re: Time stamps in MCEventHeader [message #6737 is a reply to message #6733] Fri, 16 May 2008 08:23 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi Mohammad,

it should be an exponential function with the mean time between events (100 ns) as parameter
Re: Time stamps in MCEventHeader [message #6738 is a reply to message #6737] Fri, 16 May 2008 08:38 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

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
Re: Time stamps in MCEventHeader [message #6741 is a reply to message #6738] Fri, 16 May 2008 13:00 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi 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
Re: Time stamps in MCEventHeader [message #6746 is a reply to message #6741] Mon, 19 May 2008 20:41 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi,

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
Re: Time stamps in MCEventHeader [message #6749 is a reply to message #6746] Wed, 21 May 2008 15:34 Go to previous messageGo to next message
Oscar Reinecke is currently offline  Oscar Reinecke
Messages: 4
Registered: April 2008
Location: TU-Dresden
occasional visitor
From: *phy.tu-dresden.de
Hi Mohammad,

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

Greetings

Oscar
Re: Time stamps in MCEventHeader [message #6755 is a reply to message #6749] Wed, 21 May 2008 17:26 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Maybe one could just give a TF1 function as parameter, so that the user can set whichever distribution he likes.
Re: Time stamps in MCEventHeader [message #6766 is a reply to message #6746] Fri, 23 May 2008 12:03 Go to previous message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hallo 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
Previous Topic: SVN stable branch!
Next Topic: How to store only MCTrack in a root file?
Goto Forum:
  


Current Time: Fri Apr 19 08:04:15 CEST 2024

Total time taken to generate the page: 0.00891 seconds