12#include <FairRootManager.h>
25 : FairTask(
"MCEventFilter")
38 if (index < 0 || index >=
GetNofData(type))
return nullptr;
39 return fData.at(type)->UncheckedAt(index);
51 LOG(info) << GetName() <<
": Current event " <<
fNofEventsIn <<
" selected for output";
55 LOG(info) << GetName() <<
": Current event " <<
fNofEventsIn <<
" discarded for output";
56 FairMCApplication::Instance()->SetSaveCurrentEvent(test);
66 LOG(info) << GetName() <<
": Number of input events " <<
fNofEventsIn;
67 LOG(info) << GetName() <<
": Number of output events " <<
fNofEventsOut <<
" = "
97 FairRootManager* rm = FairRootManager::Instance();
101 if (!branchName.IsNull()) {
102 fData[type] =
dynamic_cast<TClonesArray*
>(rm->GetObject(branchName));
103 if (
fData.at(type)) { LOG(info) << GetName() <<
": Add branch " << branchName; }
124 default: name =
"";
break;
136 LOG(info) << GetName() <<
": " <<
Statistics();
137 Bool_t check = kTRUE;
140 LOG(info) << GetName() <<
": Cut on branch " <<
GetBranchName(cut.first) <<
" not passed (number of data "
141 <<
GetNofData(cut.first) <<
", required " << cut.second <<
")";
156 std::stringstream ss;
ClassImp(CbmConverterManager)
Class deciding whether to store an MC event.
std::map< ECbmDataType, Int_t > fMinNofData
Data arrays.
Int_t fNofEventsOut
Counter: output events.
TString GetBranchName(ECbmDataType type) const
Get branch name from data type.
void GetBranch(ECbmDataType type)
Get a branch from FairRootManager.
std::string Statistics() const
Info on number of MC objects in the arrays.
TObject * GetData(ECbmDataType type, Int_t index) const
Get a data object by index.
virtual void Exec(Option_t *)
Execution.
Int_t fNofEventsIn
Counter: input events.
std::map< ECbmDataType, TClonesArray * > fData
virtual void Finish()
Finish (end of run)
Bool_t SelectEvent() const
Event selector method.
Int_t GetNofData(ECbmDataType type) const
Number of data in a branch.
virtual InitStatus Init()
Initialisation.