5 #include <FairLogger.h>
6 #include <FairRootManager.h>
7 #include <FairRunAna.h>
10 #include <TClonesArray.h>
19 fReductionFunc = [
this, func]() {
return func(fEvent); };
24 FairRootManager *ioMan = FairRootManager::Instance();
25 if (ioMan ==
nullptr) {
26 LOG(fatal) <<
"Cannot find RootManager!";
30 fInputEventArray =
dynamic_cast<TClonesArray *
>(ioMan->GetObject(fInputBranchName));
31 if (fInputEventArray ==
nullptr) {
32 LOG(fatal) <<
"Cannot find TClonesArray in branch " << fInputBranchName <<
"!";
42 if (fInputEventArray->GetEntriesFast() == 0)
44 fEvent =
dynamic_cast<AtBaseEvent *
>(fInputEventArray->At(0));
48 LOG(info) <<
"Keeping event " << fEvent->
GetEventID() <<
" at " << FairRootManager::Instance()->GetEntryNr();
51 LOG(info) <<
"Skipping event " << fEvent->
GetEventID() <<
" at " << FairRootManager::Instance()->GetEntryNr();
53 FairRootManager *ioMan = FairRootManager::Instance();
54 for (
auto name : fOutputBranchs) {
55 auto b =
dynamic_cast<TClonesArray *
>(ioMan->GetObject(name));
56 if (fInputEventArray ==
nullptr)
57 LOG(fatal) <<
"Cannot find branch " << name <<
"!";
61 LOG(error) <<
"Not setting " << name;
66 FairRunAna::Instance()->MarkFill(
false);