CbmRoot
CbmMCEventFilter Class Reference

Class deciding whether to store an MC event. More...

#include <CbmMCEventFilter.h>

Inheritance diagram for CbmMCEventFilter:
[legend]
Collaboration diagram for CbmMCEventFilter:
[legend]

Public Member Functions

 CbmMCEventFilter ()
 
virtual ~CbmMCEventFilter ()
 Destructor. More...
 
Int_t GetNofInputEvents () const
 Number of processed events. More...
 
void SetMinNofData (ECbmDataType type, Int_t value)
 Set a cut on the minimum number of data of a given type. More...
 

Protected Member Functions

TObject * GetData (ECbmDataType type, Int_t index) const
 Get a data object by index. More...
 
Int_t GetNofData (ECbmDataType type) const
 Number of data in a branch. More...
 
Bool_t SelectEvent () const
 Event selector method. More...
 

Private Member Functions

virtual void Exec (Option_t *)
 Execution. More...
 
virtual void Finish ()
 Finish (end of run) More...
 
virtual InitStatus Init ()
 Initialisation. More...
 
void GetBranch (ECbmDataType type)
 Get a branch from FairRootManager. More...
 
std::string Statistics () const
 Info on number of MC objects in the arrays. More...
 
TString GetBranchName (ECbmDataType type) const
 Get branch name from data type. More...
 
 ClassDef (CbmMCEventFilter, 2)
 

Private Attributes

std::map< ECbmDataType, TClonesArray * > fData
 
std::map< ECbmDataType, Int_t > fMinNofData
 Data arrays. More...
 
Int_t fNofEventsIn
 Counter: input events. More...
 
Int_t fNofEventsOut
 Counter: output events. More...
 

Detailed Description

Class deciding whether to store an MC event.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
7 August 2019

The event selection is performed in the method SelectEvent() (nomen est omen...). If this method returns false, the event will not be filled to the output tree.

SelectEvent() can be re-implemented in derived classes. Here, the selection is based on the number of MC data objects (MCTrack, MCPoints), on which the user can specify a minimum by SetMinNofObjects.

Definition at line 34 of file CbmMCEventFilter.h.

Constructor & Destructor Documentation

◆ CbmMCEventFilter()

CbmMCEventFilter::CbmMCEventFilter ( )

brief Constructor

Definition at line 18 of file CbmMCEventFilter.cxx.

◆ ~CbmMCEventFilter()

virtual CbmMCEventFilter::~CbmMCEventFilter ( )
inlinevirtual

Destructor.

Definition at line 42 of file CbmMCEventFilter.h.

Member Function Documentation

◆ ClassDef()

CbmMCEventFilter::ClassDef ( CbmMCEventFilter  ,
 
)
private

◆ Exec()

void CbmMCEventFilter::Exec ( Option_t *  )
privatevirtual

Execution.

          Sets the storage of current event in FairMCApplication according to
          the outcome of SeelectEvent().

Definition at line 36 of file CbmMCEventFilter.cxx.

References fNofEventsIn, fNofEventsOut, and SelectEvent().

◆ Finish()

void CbmMCEventFilter::Finish ( )
privatevirtual

Finish (end of run)

          Prints event statistics

Definition at line 54 of file CbmMCEventFilter.cxx.

References fNofEventsIn, and fNofEventsOut.

◆ GetBranch()

void CbmMCEventFilter::GetBranch ( ECbmDataType  type)
private

Get a branch from FairRootManager.

Parameters
typeCBM data type

Definition at line 84 of file CbmMCEventFilter.cxx.

References fData, and GetBranchName().

Referenced by Init().

◆ GetBranchName()

TString CbmMCEventFilter::GetBranchName ( ECbmDataType  type) const
private

Get branch name from data type.

Parameters
typeCBM data type
Returns
Branch name

Definition at line 101 of file CbmMCEventFilter.cxx.

References kMCTrack, kMuchPoint, kMvdPoint, kPsdPoint, kRichPoint, kStsPoint, kTofPoint, and kTrdPoint.

Referenced by GetBranch(), and SelectEvent().

◆ GetData()

TObject * CbmMCEventFilter::GetData ( ECbmDataType  type,
Int_t  index 
) const
protected

Get a data object by index.

Parameters
typeCBM data type
indexIndex in data array

Definition at line 28 of file CbmMCEventFilter.cxx.

References fData, and GetNofData().

◆ GetNofData()

Int_t CbmMCEventFilter::GetNofData ( ECbmDataType  type) const
inlineprotected

Number of data in a branch.

Parameters
typeCBM data type
Returns
Number of objects in array

Definition at line 75 of file CbmMCEventFilter.h.

References fData.

Referenced by GetData(), SelectEvent(), and Statistics().

◆ GetNofInputEvents()

Int_t CbmMCEventFilter::GetNofInputEvents ( ) const
inline

Number of processed events.

Returns
Number of processed input events

Definition at line 48 of file CbmMCEventFilter.h.

References fNofEventsIn.

◆ Init()

InitStatus CbmMCEventFilter::Init ( )
privatevirtual

Initialisation.

          Gets MC data branches from FairRootManager

Definition at line 67 of file CbmMCEventFilter.cxx.

References GetBranch(), kMCTrack, kMuchPoint, kMvdPoint, kPsdPoint, kRichPoint, kStsPoint, kTofPoint, and kTrdPoint.

◆ SelectEvent()

Bool_t CbmMCEventFilter::SelectEvent ( ) const
protected

Event selector method.

Returns
If kTRUE, the event will be stored

Definition at line 122 of file CbmMCEventFilter.cxx.

References fMinNofData, GetBranchName(), GetNofData(), and Statistics().

Referenced by Exec().

◆ SetMinNofData()

void CbmMCEventFilter::SetMinNofData ( ECbmDataType  type,
Int_t  value 
)
inline

Set a cut on the minimum number of data of a given type.

Parameters
typeCBM data type
valueMinimum for number of objects in array

In case cuts are defined for more than one data type, they are logically additive (each of them has to be passed).

Definition at line 58 of file CbmMCEventFilter.h.

References fMinNofData.

◆ Statistics()

std::string CbmMCEventFilter::Statistics ( ) const
private

Info on number of MC objects in the arrays.

Definition at line 142 of file CbmMCEventFilter.cxx.

References fData, GetNofData(), kMCTrack, kMuchPoint, kMvdPoint, kPsdPoint, kRichPoint, kStsPoint, kTofPoint, and kTrdPoint.

Referenced by SelectEvent().

Member Data Documentation

◆ fData

std::map<ECbmDataType, TClonesArray*> CbmMCEventFilter::fData
private

Definition at line 87 of file CbmMCEventFilter.h.

Referenced by GetBranch(), GetData(), GetNofData(), and Statistics().

◆ fMinNofData

std::map<ECbmDataType, Int_t> CbmMCEventFilter::fMinNofData
private

Data arrays.

Cut values

Definition at line 89 of file CbmMCEventFilter.h.

Referenced by SelectEvent(), and SetMinNofData().

◆ fNofEventsIn

Int_t CbmMCEventFilter::fNofEventsIn
private

Counter: input events.

Definition at line 90 of file CbmMCEventFilter.h.

Referenced by Exec(), Finish(), and GetNofInputEvents().

◆ fNofEventsOut

Int_t CbmMCEventFilter::fNofEventsOut
private

Counter: output events.

Definition at line 91 of file CbmMCEventFilter.h.

Referenced by Exec(), and Finish().


The documentation for this class was generated from the following files: