GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » CBM » CBMROOT » General » FairMCEventHeader
FairMCEventHeader [message #8510] Mon, 11 May 2009 17:46 Go to next message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
The fairbase defines the class FairMCEventHeader, storing information on the event level, which is to be filled by the respective generator classes.

Now, it may not be good an idea to define such a data class in the base directories since the requirements (which information to be stored) may vary from experiment to experiment. For instance, we now want to store an additional variable (the event plane angle).

Is it possible to have a derived, experiment-specific class? As far as I can see, the class is instantiated (and the branch registered) in CbmMCApplication and otherwise used only by FairPrimaryGenerator. So, I think it would be easy to shift the instantiation and filling to the experiment specific part of the software.

A possible solution would be:
  • Implement an experiment-specific data class, e.g. CbmMCEventHeader (TNamed)
  • Introduce a virtual method Init() in CbmPrimaryGenerator, to be called from FairMCApplication::Init(). Here, the event class array has to be instantiated and its branch registered.
  • Make CbmPrimaryGenerator::GenerateEvent virtual, so the proper filling of the event class can be done in an experiment-specific class derived from FairPrimaryGenerator (e.g. CbmPrimaryGenerator) and/or by the concrete generator classes themselves.

[Updated on: Mon, 11 May 2009 18:21]

Report message to a moderator

Requirements [message #8515 is a reply to message #8510] Tue, 12 May 2009 02:12 Go to previous messageGo to next message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
OK, I implemented that and it works. What is required from the framework is:

1. Introduce a method
virtual void Init() { };
in FairPrimaryGenerator.h

2. Declare the private members of FairPrimaryGenerator protected (in fact, this is needed only for fStack).

3. Declare the method FairPrimaryGenerator::GenerateEvent virtual.

4. Add
if(fEvGen)fEvGen->Init();
somewhere in FairMCApplication::Init
Re: Requirements [message #8608 is a reply to message #8515] Wed, 20 May 2009 16:23 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,
It is done and seems to work! please test it and let me know.

Mohammad
Re: Requirements [message #8611 is a reply to message #8608] Thu, 21 May 2009 08:18 Go to previous messageGo to next message
Mikhail Ryzhinskiy is currently offline  Mikhail Ryzhinskiy
Messages: 60
Registered: December 2006
Location: St.-Petersburg, Russia
continuous participant

From: *pnpi.spb.ru
It seems that #include <stdlib.h> is missing in FairGeoLoader.cxx.
Otherwise it is not compiled.
Re: Requirements [message #8613 is a reply to message #8611] Thu, 21 May 2009 15:56 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *pools.arcor-ip.net
Hi Mikhail

Thanks for the info. I added the missing library to the includes.
This error seems to occur only for new versions of gcc (4.3?).
Which version of gcc and linux do you use?

Ciao

Florian
Re: Requirements [message #8615 is a reply to message #8613] Thu, 21 May 2009 19:04 Go to previous messageGo to next message
Mikhail Ryzhinskiy is currently offline  Mikhail Ryzhinskiy
Messages: 60
Registered: December 2006
Location: St.-Petersburg, Russia
continuous participant

From: *pppoe.avangarddsl.ru
Hello Florian
I use gcc version 4.3.2 on OpenSUSE 11.1
Regards,
Mikhail.
FairPrimaryGenerator::Init() [message #8640 is a reply to message #8608] Mon, 25 May 2009 17:49 Go to previous messageGo to next message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
Dear Mohammad,

thanks for applying the changes. Only one detail: You call fGen->Init() in FairMCApplication::InitMC. This seems to have no effect on the output tree; it is possibly too late.

If you put this call to the method FairMCApplication::InitGeometry(), it works fine. There, the possibility to register branches to the cbmsim tree still exists.
Re: FairPrimaryGenerator::Init() [message #8642 is a reply to message #8640] Mon, 25 May 2009 21:19 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 Volker,

I moved it to InitGeometry just before registering the branches and event headers, it should work now!

Mohammad
Thanks [message #8645 is a reply to message #8642] Mon, 25 May 2009 23:36 Go to previous message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
Thanks a lot, Mohammad, it is fine now!
Previous Topic: New safety feature
Next Topic: CbmGenerators and MCEvent
Goto Forum:
  


Current Time: Tue Nov 26 01:47:41 CET 2024

Total time taken to generate the page: 0.00744 seconds