Project

General

Profile

Actions

Sim-Development #1318

closed

Filter MC Events for transport output

Added by Volker Friese almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
08/07/2019
Due date:
09/23/2019
% Done:

100%

Estimated time:
10.00 h
Spent time:

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

CbmMCSuppressionLinkDef.h (168 Bytes) CbmMCSuppressionLinkDef.h Build System Florian Uhlig, 08/07/2019 09:36 AM
CbmSuppressMCEvents.cxx (1.54 KB) CbmSuppressMCEvents.cxx Example Task Florian Uhlig, 08/07/2019 09:36 AM
CbmSuppressMCEvents.h (735 Bytes) CbmSuppressMCEvents.h Example Task Florian Uhlig, 08/07/2019 09:36 AM
CMakeLists.txt (638 Bytes) CMakeLists.txt Build System Florian Uhlig, 08/07/2019 09:36 AM
run_mc_suppress.C (12.1 KB) run_mc_suppress.C Example Macro Florian Uhlig, 08/07/2019 09:40 AM
Actions #1

Updated by Florian Uhlig almost 3 years ago

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.

Actions #2

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).

Actions #3

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)?

Actions #4

Updated by Volker Friese almost 3 years ago

Please give feedback or close the issue.

Actions #5

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?

Actions #6

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.

Actions

Also available in: Atom PDF