10 #include <FairLogger.h>
11 #include <FairRootManager.h>
13 #include <TClonesArray.h>
21 : fInputBranchName(
"AtEventH"), fOutputBranchName(
"AtPatternEvent"), kIsPersistence(kFALSE), kIsReprocess(kFALSE),
22 fPatternEventArray(
"AtPatternEvent", 1)
30 kIsPersistence = value;
34 fInputBranchName = branchName;
39 fOutputBranchName = branchName;
48 fRANSACThreshold = threshold;
56 fNumItera = niterations;
64 fRandSamplMode = mode;
72 fInputBranchName = inputName;
76 fOutputBranchName = outputName;
82 FairRootManager *ioMan = FairRootManager::Instance();
83 if (ioMan ==
nullptr) {
84 LOG(error) <<
"Cannot find RootManager!";
88 fEventArray =
dynamic_cast<TClonesArray *
>(ioMan->GetObject(fInputBranchName));
89 if (fEventArray ==
nullptr) {
91 LOG(error) <<
"Cannot find AtEvent array!";
95 ioMan->Register(fOutputBranchName,
"AtTPC", &fPatternEventArray, kIsPersistence);
99 ioMan->Register(
"AtEventH",
"AtTPC", fEventArray, kIsPersistence);
108 if (fEventArray->GetEntriesFast() == 0)
111 fEvent =
dynamic_cast<AtEvent *
>(fEventArray->At(0));
113 LOG(debug) <<
"Running RANSAC with " << fEvent->
GetNumHits() <<
" hits.";
114 LOG(debug) <<
"Running Unified RANSAC";
131 fPatternEventArray.Delete();
132 auto patternEvent = ransac.
Solve(fEvent);