7 #include <FairLogger.h>
8 #include <FairRootManager.h>
10 #include <TClonesArray.h>
19 : fInputBranchName(
"AtEventH"), fOutputBranchName(
"AtPatternEvent"), fPatternEventArray(
"AtPatternEvent", 1),
20 fSampleConsensus(std::move(method)), kIsPersistence(kFALSE)
26 FairRootManager *ioMan = FairRootManager::Instance();
27 if (ioMan ==
nullptr) {
28 LOG(error) <<
"Cannot find RootManager!";
32 fEventArray =
dynamic_cast<TClonesArray *
>(ioMan->GetObject(fInputBranchName));
33 if (fEventArray ==
nullptr) {
35 LOG(error) <<
"Cannot find AtEvent array!";
39 ioMan->Register(fOutputBranchName,
"AtTPC", &fPatternEventArray, kIsPersistence);
47 if (fEventArray->GetEntriesFast() == 0)
50 fEvent =
dynamic_cast<AtEvent *
>(fEventArray->At(0));
52 LOG(debug) <<
"Running Sample Consensus with " << fEvent->
GetNumHits() <<
" hits.";
54 fPatternEventArray.Delete();
55 auto patternEvent = fSampleConsensus->Solve(fEvent);