CbmRoot
Loading...
Searching...
No Matches
CaToolsWindowFinder.h
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
9
10#ifndef CaToolsWindowFinder_h
11#define CaToolsWindowFinder_h 1
12
13#include "CaIteration.h"
14#include "TCut.h"
15#include "TObject.h"
16
17#include <array>
18#include <vector>
19
20// TODO: Replace tmp asserts with exceptions
21
22class TChain;
23class TPad;
24class TCanvas;
25
26namespace cbm::algo::ca
27{
28 class SearchWindow;
29}
30
31namespace cbm::ca::tools
32{
33 namespace ca = cbm::algo::ca;
34
44
46 class WindowFinder : public TObject {
47 public:
48 // TODO: TEMPORARY CONSTANT EXPRESSIONS (TO BE MOVED TO A SEPARATE HEADER)
49 static constexpr const char* kTreeName = "t";
50
51 public:
54
56 virtual ~WindowFinder() = default;
57
59 WindowFinder(const WindowFinder&) = delete;
63
66 void AddInputFile(const char* filename);
67
69 void DumpCanvasesToPdf(const char* filename = "WFLog") const;
70
74 void Process(Option_t* opt = "");
75
77 void ReadTrackingIterationsFromYAML(const char* filename);
78
82 void SetBinning(int nBinsX, int nBinsY);
83
85 void SetEpsilon(float eps);
86
89 void SetExtraCut(const TCut& cut) { fExtraCut = cut; }
90
94 void SetNslices(int nSlices);
95
100 void SetOutputName(const char* filename) { fsOutputName = filename; }
101
105 void SetStationIndexes(const std::vector<int>& vStationIndexes);
106
111 void SetTarget(double x, double y, double z);
112
113
114 private:
116 ca::SearchWindow CreateSW(int iStation, const ca::Iteration& caIter);
117
119 const char* GetDistExpr(EExpr expr) const;
120
124 TCut GetTrackSelectionCut(int iStation, const ca::Iteration& caIter) const;
125
130 void PrintCaseInformation(TPad* pPad, int iStation, const ca::Iteration& caIter) const;
131
132
133 // *********************
134 // ** Class variables **
135 // *********************
136 int fNparams = 1;
137
138 std::string fsOutputName = "SearchWindows.dat";
139
140 // ----- Input parameters (iterations and stations)
141 std::vector<ca::Iteration> fvCaIters = {};
142 std::vector<int> fvStationIndexes = {};
143 std::array<double, 3> fTargetPos = {0};
144
145 TCut fExtraCut = TCut("");
146
147 // Window extraction settings
148 int fNbinsX = 400;
149 int fNbinsY = 400;
150 int fNslices = 1;
151 float fEps = 0.001;
152
153 TChain* fpMcTripletsTree = nullptr;
154
155 std::vector<TCanvas*> fvpCanvases; // Vector of pointer to cavnases
156
158 };
159} // namespace cbm::ca::tools
160
161#endif // CaToolsWindowsFinder_h
A set of parameters for the CA Track finder iteration.
Class L1SearchWindow defines a parameterisation of hits search window for CA tracking algorithm TODO:...
TODO: ... write an instruction ...
void AddInputFile(const char *filename)
int fNbinsX
Number of bins for the X axis of the distribution.
int fNslices
Number of slices along the X axis.
int fNbinsY
Number of bins for the Y axis of the distribution.
float fEps
Fraction of triplets (doublets), which can be omitted.
virtual ~WindowFinder()=default
Destructor.
void SetTarget(double x, double y, double z)
void PrintCaseInformation(TPad *pPad, int iStation, const ca::Iteration &caIter) const
void DumpCanvasesToPdf(const char *filename="WFLog") const
Saves canvases to a set of canvases to pdf.
WindowFinder & operator=(const WindowFinder &)=delete
void ReadTrackingIterationsFromYAML(const char *filename)
Reads the iterations from YAML config.
WindowFinder(const WindowFinder &)=delete
Copy and move are forbidden.
WindowFinder & operator=(WindowFinder &&)=delete
std::vector< int > fvStationIndexes
Global indexes of active stations to find the windows.
ca::SearchWindow CreateSW(int iStation, const ca::Iteration &caIter)
Creates a search window for a selected station and iteration.
std::array< double, 3 > fTargetPos
Target position {x, y, z} [cm].
void SetBinning(int nBinsX, int nBinsY)
std::string fsOutputName
Name for output file with estimated search windows.
const char * GetDistExpr(EExpr expr) const
Returns expression for dx or dy to be drawn in a tree.
TChain * fpMcTripletsTree
Chain of trees containing MC triplets, generated in CbmL1 Performance.
void SetStationIndexes(const std::vector< int > &vStationIndexes)
void SetOutputName(const char *filename)
WindowFinder(WindowFinder &&)=delete
static constexpr const char * kTreeName
Name of the input MC triplets tree.
void SetExtraCut(const TCut &cut)
TCut fExtraCut
Optional cut on the triplets/doublets.
TCut GetTrackSelectionCut(int iStation, const ca::Iteration &caIter) const
int fNparams
number of parameters of the searching window
std::vector< ca::Iteration > fvCaIters
Tracking iterations.
std::vector< TCanvas * > fvpCanvases
void SetEpsilon(float eps)
Sets a fraction of triplets (doublets), which can be omitted by the window.
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
EExpr
Enumeration to handle processed expressions.