Go to the documentation of this file.
8 #include "FairLogger.h"
19 : FairTask(
"MCEventFilter")
29 if (index < 0 || index >=
GetNofData(type))
return nullptr;
30 return fData.at(type)->UncheckedAt(index);
41 LOG(INFO) << GetName() <<
": Current event " <<
fNofEventsIn
42 <<
" selected for output";
46 LOG(INFO) << GetName() <<
": Current event " <<
fNofEventsIn
47 <<
" discarded for output";
48 FairMCApplication::Instance()->SetSaveCurrentEvent(test);
57 LOG(INFO) << GetName() <<
": Number of input events " <<
fNofEventsIn;
58 LOG(INFO) << GetName() <<
": Number of output events " <<
fNofEventsOut
86 FairRootManager* rm = FairRootManager::Instance();
90 if (!branchName.IsNull()) {
91 fData[type] =
dynamic_cast<TClonesArray*
>(rm->GetObject(branchName));
93 LOG(INFO) << GetName() <<
": Add branch " << branchName;
113 default: name =
"";
break;
124 LOG(INFO) << GetName() <<
": " <<
Statistics();
125 Bool_t check = kTRUE;
128 LOG(INFO) << GetName() <<
": Cut on branch " <<
GetBranchName(cut.first)
129 <<
" not passed (number of data " <<
GetNofData(cut.first)
130 <<
", required " << cut.second <<
")";
144 std::stringstream ss;
Class deciding whether to store an MC event.
virtual InitStatus Init()
Initialisation.
void GetBranch(ECbmDataType type)
Get a branch from FairRootManager.
Int_t GetNofData(ECbmDataType type) const
Number of data in a branch.
Int_t fNofEventsOut
Counter: output events.
TObject * GetData(ECbmDataType type, Int_t index) const
Get a data object by index.
TString GetBranchName(ECbmDataType type) const
Get branch name from data type.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
virtual void Exec(Option_t *)
Execution.
Bool_t SelectEvent() const
Event selector method.
std::string Statistics() const
Info on number of MC objects in the arrays.
virtual void Finish()
Finish (end of run)
std::map< ECbmDataType, TClonesArray * > fData
Int_t fNofEventsIn
Counter: input events.
std::map< ECbmDataType, Int_t > fMinNofData
Data arrays.