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-Universität 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>(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
56 }
57
58 // -------------------------------------------------------------------------------------------------------------------
59 //
61 {
62 return -1;
63 /*
64 int hitId = iHit;
65 int iMcPoint = CbmL1::Instance()->GetHitBestMcRefs()[hitId];
66 if (iMcPoint < 0) return -1;
67 return CbmL1::Instance()->GetMcPoints()[iMcPoint].ID;
68 */
69 }
70
72 {
73 return -1;
74 /*
75 int hitId = fWindowHits[iHit].Id();
76 int iMcPoint = CbmL1::Instance()->GetHitBestMcRefs()[hitId];
77 if (iMcPoint < 0) return -1;
78 return CbmL1::Instance()->GetMcPoints()[iMcPoint].ID;
79 */
80 }
81} // namespace cbm::algo::ca
82/*
83const CbmL1MCTrack* Framework::GetMcTrackForWindowHit(int iHit) const
84{
85 return nullptr;
86 int id = GetMcTrackIdForWindowHit(iHit);
87 if (id < 0) return nullptr;
88 return &CbmL1::Instance()->GetMcTracks()[id];
89}
90*/
91
92// bool Framework::SortTrip(TripSort const& a, TripSort const& b) {
93// return ( a.trip.GetLevel() > b.trip.GetLevel() );
94// }
95//
96// bool Framework::SortCand(CandSort const& a, CandSort const& b) {
97// if (a.cand.Lengtha != b.cand.Lengtha) return (a.cand.Lengtha > b.cand.Lengtha);
98//
99// if (a.cand.ista != b.cand.ista ) return (a.cand.ista < b.cand.ista );
100//
101// if (a.cand.chi2 != b.cand.chi2 )return (a.cand.chi2 < b.cand.chi2 );
102// //return (a->chi2 < b->chi2 );
103// // return (a->CandIndex < b->CandIndex );
104// // return (a.cand.CandIndex > b.cand.CandIndex );
105// }
106
107// inline int Framework::PackIndex(const int& a, const int& b, const int& c) {
108// return (a) + ((b)*10000) + (c*100000000);
109// }
110//
111// 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
static int GetMcTrackIdForCaHit(int iHit)
Gets number of stations before the pipe (MVD stations in CBM)
static int GetMcTrackIdForWindowHit(int iGridHit)
Get mc track ID for a hit (debug tool)
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)
void ReceiveInputData(InputData &&inputData)
Receives input data.
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:78
constexpr fscal SpeedOfLightInv
Inverse speed of light [ns/cm].
Definition CaDefs.h:89
constexpr double SpeedOfLightInvD
Inverse speed of light [ns/cm].
Definition CaDefs.h:80
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:176