CbmRoot
Loading...
Searching...
No Matches
CaFramework.cxx
Go to the documentation of this file.
1/* Copyright (C) 2010-2021 Frankfurt Institute for Advanced Studies, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Igor Kulakov [committer], Maksym Zyzak, Valentina Akishina, Ivan Kisel, Sergey Gorbunov, Sergei Zharko, Dominik Smith */
4
5#include "CaFramework.h"
6
7#include "CaGridEntry.h"
8#include "CaTimer.h"
9#include "CaTrack.h"
10// #include "CaToolsDebugger.h"
11
12#include <chrono>
13#include <fstream>
14#include <sstream>
15#include <thread>
16
17namespace cbm::algo::ca
18{
22 //using cbm::ca::tools::Debugger;
23
24 // -------------------------------------------------------------------------------------------------------------------
25 //
27 {
29 std::make_unique<ca::TrackFinder>(*this, fParameters, fDefaultMass, mode, fMonitorData, fNofThreads, fCaRecoTime);
30 }
31
32 // -------------------------------------------------------------------------------------------------------------------
33 //
35 {
36 //Debugger::Instance().Write();
37 }
38
39 // -------------------------------------------------------------------------------------------------------------------
40 //
42 {
43 // ----- Get input data --------------------------------------------------------------------------------------------
44 fInputData = std::move(inputData);
45 }
46
47
48 // -------------------------------------------------------------------------------------------------------------------
49 //
51 {
52 fParameters = std::move(parameters);
53 fNstationsBeforePipe = fParameters.GetNstationsActive(static_cast<EDetectorID>(0));
54
55 kf::GlobalField::ForceUseOfOriginalField(fParameters.GetConfig().DevForceUseOriginalField());
56 }
57
58 // -------------------------------------------------------------------------------------------------------------------
59 //
61 {
62 if (fpMcData) {
63 return fpMcData->GetBestMcTrackIdForCaHit(iHit);
64 }
65 return -1;
66 }
67
68 // -------------------------------------------------------------------------------------------------------------------
69 //
71 {
72 if (fpMcData) {
73 return fpMcData->GetMcMatchForCaHit(iHit);
74 }
75 return McMatch();
76 }
77
78} // namespace cbm::algo::ca
79
80
81// bool Framework::SortTrip(TripSort const& a, TripSort const& b) {
82// return ( a.trip.GetLevel() > b.trip.GetLevel() );
83// }
84//
85// bool Framework::SortCand(CandSort const& a, CandSort const& b) {
86// if (a.cand.Lengtha != b.cand.Lengtha) return (a.cand.Lengtha > b.cand.Lengtha);
87//
88// if (a.cand.ista != b.cand.ista ) return (a.cand.ista < b.cand.ista );
89//
90// if (a.cand.chi2 != b.cand.chi2 )return (a.cand.chi2 < b.cand.chi2 );
91// //return (a->chi2 < b->chi2 );
92// // return (a->CandIndex < b->CandIndex );
93// // return (a.cand.CandIndex > b.cand.CandIndex );
94// }
95
96// inline int Framework::PackIndex(const int& a, const int& b, const int& c) {
97// return (a) + ((b)*10000) + (c*100000000);
98// }
99//
100// inline int Framework::UnPackIndex(const int& i, int& a, int& b, int& c) {
Timer class for CA tracking (header)
source file for the ca::Track class
std::unique_ptr< ca::TrackFinder > fpTrackFinder
Track finder steer class for the entire time slice.
InputData fInputData
Tracking input data.
void ReceiveParameters(Parameters< fvec > &&parameters)
Receives tracking parameters.
fscal fDefaultMass
mass of the propagated particle [GeV/c2]
int fNstationsBeforePipe
number of stations before pipe (MVD stations in CBM)
TrackingMonitorData fMonitorData
Tracking monitor data (statistics per call)
McMatch GetMcMatchForCaHit(int iHit) const
void ReceiveInputData(InputData &&inputData)
Receives input data.
const ca::McData * fpMcData
Monte Carlo data container.
int GetBestMcTrackIdForCaHit(int iHit) const
Gets number of stations before the pipe (MVD stations in CBM)
void Init(const TrackingMode mode)
Parameters< fvec > fParameters
Object of Framework parameters class.
A container for all external parameters of the CA tracking algorithm.
static void ForceUseOfOriginalField(bool v=true)
Forces the use of the original field function.
constexpr double ProtonMassD
Proton mass [GeV/c2] (PDG 11.08.2022)
Definition CaDefs.h:85
constexpr fscal SpeedOfLightInv
Inverse speed of light [ns/cm].
Definition CaDefs.h:96
constexpr double SpeedOfLightInvD
Inverse speed of light [ns/cm].
Definition CaDefs.h:87
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:216