Sim-Development #1318
closedFilter MC Events for transport output
Description
The possibility to suppress unwanted MC events in the output of the transport simulation shall be introduced to the CbmTransport class. This feature can substantially reduce the output file size in cases when one is interested in rare occurences.
The relevant framework binding is FairMCApplication::SetSaveCurrentEvent(Bool_t). A user-friendly implementation on CbmRoot level is wanted.
Files
Updated by Florian Uhlig almost 3 years ago
- File CbmMCSuppressionLinkDef.h CbmMCSuppressionLinkDef.h added
- File CbmSuppressMCEvents.cxx CbmSuppressMCEvents.cxx added
- File CbmSuppressMCEvents.h CbmSuppressMCEvents.h added
- File CMakeLists.txt CMakeLists.txt added
- File run_mc_suppress.C run_mc_suppress.C added
Here the idea was to add a FairTask after running the simulation which is possible within FairRoot. In the Exec function of this task the user can do whatever is needed to decide if the event should be written to the output file or not. In case he want to skip the event he has simply to call FairMCApplication::SetSaveCurrentEvent(kFALSE).
To allow this also with CbmTransport it should be enough to allow to add FairTasks to the CbmTransport.
I attached some ample code to the issue which shows how such a Task should look like together with a transport macro in the old style without CbmTransport.
Updated by Volker Friese almost 3 years ago
- Status changed from Assigned to In Progress
- % Done changed from 0 to 50
Thanks for the info. Yes, I was aware of that thanks to David. Adding a task is the simplest solution.
The design goes one step further, introducing a default filter class which allows to set cuts on the minimum number of data objects of a given type, without the user having to write a class.
For any more complicated event selection prescription, a class deriving from CbmMCEventFilter
and re-implementing the method Bool_t SelectEvent()
is required. The mother class already connects to the MC data branches. The data are accessible through GetData(ECbmDataType, index)
, the size of their arrays through GetNofData(ECbmDataType)
.
Updated by Volker Friese almost 3 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Volker Friese to David Emschermann
- % Done changed from 50 to 100
The functionality is implemented with r14714.
The default event filter allows to set cuts on the minimal number of MC objects (MCTrack, MCPoint) in the event. The respective method is
void CbmTransport::SetEventFilterMinNofData(ECbmDataType, Int_t)
If more advanced filtering logic is wanted, a class deriving from CbmMCEventFilter has to be created, which re-implements the virtual method Bool_t CbmMCEventFilter::SelectEvent() const
. The user filter class has to be registered to CbmTransport by
void CbmTransport::SetEventFilter(std::unique_ptr<CbmMCEventFilter>& filter)
David, could you test this for your application (mCBM simulation)?
Updated by Volker Friese almost 3 years ago
Please give feedback or close the issue.
Updated by Volker Friese over 2 years ago
Dear David,
we want to freeze the OCT19 release. Could you please look at the issue and close it if reolved satisfactorily?
Updated by Volker Friese over 2 years ago
- Due date changed from 08/30/2019 to 09/23/2019
- Status changed from Resolved to Closed
No feedback. I close the issue, hoping it works all right.