CbmRoot
Loading...
Searching...
No Matches
cbm::ca::tools::WindowFinder Class Reference

TODO: ... write an instruction ... More...

#include <CaToolsWindowFinder.h>

Inheritance diagram for cbm::ca::tools::WindowFinder:
[legend]
Collaboration diagram for cbm::ca::tools::WindowFinder:
[legend]

Public Member Functions

 WindowFinder ()
 Default constructor.
 
virtual ~WindowFinder ()=default
 Destructor.
 
 WindowFinder (const WindowFinder &)=delete
 Copy and move are forbidden.
 
 WindowFinder (WindowFinder &&)=delete
 
WindowFinderoperator= (const WindowFinder &)=delete
 
WindowFinderoperator= (WindowFinder &&)=delete
 
void AddInputFile (const char *filename)
 
void DumpCanvasesToPdf (const char *filename="WFLog") const
 Saves canvases to a set of canvases to pdf.
 
void Process (Option_t *opt="")
 
void ReadTrackingIterationsFromYAML (const char *filename)
 Reads the iterations from YAML config.
 
void SetBinning (int nBinsX, int nBinsY)
 
void SetEpsilon (float eps)
 Sets a fraction of triplets (doublets), which can be omitted by the window.
 
void SetExtraCut (const TCut &cut)
 
void SetNslices (int nSlices)
 
void SetOutputName (const char *filename)
 
void SetStationIndexes (const std::vector< int > &vStationIndexes)
 
void SetTarget (double x, double y, double z)
 

Static Public Attributes

static constexpr const char * kTreeName = "t"
 Name of the input MC triplets tree.
 

Private Member Functions

ca::SearchWindow CreateSW (int iStation, const ca::Iteration &caIter)
 Creates a search window for a selected station and iteration.
 
const char * GetDistExpr (EExpr expr) const
 Returns expression for dx or dy to be drawn in a tree.
 
TCut GetTrackSelectionCut (int iStation, const ca::Iteration &caIter) const
 
void PrintCaseInformation (TPad *pPad, int iStation, const ca::Iteration &caIter) const
 
 ClassDef (WindowFinder, 0)
 

Private Attributes

int fNparams = 1
 number of parameters of the searching window
 
std::string fsOutputName = "SearchWindows.dat"
 Name for output file with estimated search windows.
 
std::vector< ca::IterationfvCaIters = {}
 Tracking iterations.
 
std::vector< int > fvStationIndexes = {}
 Global indexes of active stations to find the windows.
 
std::array< double, 3 > fTargetPos = {0}
 Target position {x, y, z} [cm].
 
TCut fExtraCut = TCut("")
 Optional cut on the triplets/doublets.
 
int fNbinsX = 400
 Number of bins for the X axis of the distribution.
 
int fNbinsY = 400
 Number of bins for the Y axis of the distribution.
 
int fNslices = 1
 Number of slices along the X axis.
 
float fEps = 0.001
 Fraction of triplets (doublets), which can be omitted.
 
TChain * fpMcTripletsTree = nullptr
 Chain of trees containing MC triplets, generated in CbmL1 Performance.
 
std::vector< TCanvas * > fvpCanvases
 

Detailed Description

TODO: ... write an instruction ...

Definition at line 46 of file CaToolsWindowFinder.h.

Constructor & Destructor Documentation

◆ WindowFinder() [1/3]

WindowFinder::WindowFinder ( )

◆ ~WindowFinder()

virtual cbm::ca::tools::WindowFinder::~WindowFinder ( )
virtualdefault

Destructor.

◆ WindowFinder() [2/3]

cbm::ca::tools::WindowFinder::WindowFinder ( const WindowFinder & )
delete

Copy and move are forbidden.

◆ WindowFinder() [3/3]

cbm::ca::tools::WindowFinder::WindowFinder ( WindowFinder && )
delete

Member Function Documentation

◆ AddInputFile()

void WindowFinder::AddInputFile ( const char * filename)

Adds an input file with a tree object of MC triplets

Note
Multiple file input is possible

Definition at line 48 of file CaToolsWindowFinder.cxx.

References fpMcTripletsTree.

◆ ClassDef()

cbm::ca::tools::WindowFinder::ClassDef ( WindowFinder ,
0  )
private

◆ CreateSW()

◆ DumpCanvasesToPdf()

void WindowFinder::DumpCanvasesToPdf ( const char * filename = "WFLog") const

Saves canvases to a set of canvases to pdf.

Definition at line 167 of file CaToolsWindowFinder.cxx.

References fvpCanvases.

◆ GetDistExpr()

const char * WindowFinder::GetDistExpr ( EExpr expr) const
private

Returns expression for dx or dy to be drawn in a tree.

Definition at line 177 of file CaToolsWindowFinder.cxx.

References fTargetPos, cbm::ca::tools::kDxVsX0, cbm::ca::tools::kDxVsY0, cbm::ca::tools::kDyVsX0, and cbm::ca::tools::kDyVsY0.

Referenced by CreateSW(), and PrintCaseInformation().

◆ GetTrackSelectionCut()

TCut WindowFinder::GetTrackSelectionCut ( int iStation,
const ca::Iteration & caIter ) const
private

Gets a cut for doublets/triplets defined by station and a tracking iteration

Parameters
iStationGlobal index of an active station
caIterCA track finder iteration object

Definition at line 192 of file CaToolsWindowFinder.cxx.

References cbm::algo::ca::Iteration::GetMaxQp(), and cbm::algo::ca::Iteration::GetPrimaryFlag().

Referenced by CreateSW().

◆ operator=() [1/2]

WindowFinder & cbm::ca::tools::WindowFinder::operator= ( const WindowFinder & )
delete

◆ operator=() [2/2]

WindowFinder & cbm::ca::tools::WindowFinder::operator= ( WindowFinder && )
delete

◆ PrintCaseInformation()

void WindowFinder::PrintCaseInformation ( TPad * pPad,
int iStation,
const ca::Iteration & caIter ) const
private

Prints information on the dx and dy expression as well as used cuts on the pad

Parameters
pPadA pad to print the information
iStationGlobal index of an active station
caIterCA track finder iteration object

Definition at line 215 of file CaToolsWindowFinder.cxx.

References fExtraCut, GetDistExpr(), cbm::algo::ca::Iteration::GetMaxQp(), cbm::algo::ca::Iteration::GetName(), cbm::algo::ca::Iteration::GetPrimaryFlag(), cbm::ca::tools::kDxVsY0, and cbm::ca::tools::kDyVsY0.

Referenced by CreateSW().

◆ Process()

void WindowFinder::Process ( Option_t * opt = "")

Process a tree (TEST)

Parameters
optDefine options to process: 'T' - triplets are used instead of doublets

Definition at line 250 of file CaToolsWindowFinder.cxx.

References cbm::algo::ca::constants::clrs::CL, cbm::algo::ca::constants::clrs::CLb, CreateSW(), fNparams, fsOutputName, fvCaIters, and fvStationIndexes.

◆ ReadTrackingIterationsFromYAML()

void WindowFinder::ReadTrackingIterationsFromYAML ( const char * filename)

◆ SetBinning()

void WindowFinder::SetBinning ( int nBinsX,
int nBinsY )

Sets binning of the dx (dy) distribution

Parameters
nBinsXNumber of bins for the x-axis
nBinsYNumber of bins for the y-axis

Definition at line 294 of file CaToolsWindowFinder.cxx.

References fNbinsX, and fNbinsY.

◆ SetEpsilon()

void WindowFinder::SetEpsilon ( float eps)

Sets a fraction of triplets (doublets), which can be omitted by the window.

Definition at line 304 of file CaToolsWindowFinder.cxx.

References fEps.

◆ SetExtraCut()

void cbm::ca::tools::WindowFinder::SetExtraCut ( const TCut & cut)
inline

Sets additional cut (can be useful to reduce distribution contamination by outliers)

Parameters
cutA cut object

Definition at line 89 of file CaToolsWindowFinder.h.

References fExtraCut.

◆ SetNslices()

void WindowFinder::SetNslices ( int nSlices)

Sets number of slices along the x-axiso If the number of slices larger then 1, the window bounds will be fitted with a function (...which TODO). Otherwise, the bounds will be represented with constants (independent from x0 or y0)

Definition at line 312 of file CaToolsWindowFinder.cxx.

References fNslices.

◆ SetOutputName()

void cbm::ca::tools::WindowFinder::SetOutputName ( const char * filename)
inline

Sets name of output file with search windows array

Note
Format of output file:
<number of parameters> <number of search windows stored> <array of serialized L1SearchWindow objects>
Parameters
filenameName of the file

Definition at line 100 of file CaToolsWindowFinder.h.

References fsOutputName.

◆ SetStationIndexes()

void WindowFinder::SetStationIndexes ( const std::vector< int > & vStationIndexes)

Define indexes of stations for which windows are needed

Note
: A stution TODO: Get number of stations from a tree ...

Definition at line 320 of file CaToolsWindowFinder.cxx.

References fvStationIndexes.

◆ SetTarget()

void WindowFinder::SetTarget ( double x,
double y,
double z )

Sets components of the target center position

Parameters
xPosition x-component [cm]
yPosition y-component [cm]
zPosition z-component [cm]

Definition at line 335 of file CaToolsWindowFinder.cxx.

References fTargetPos, x, and y.

Member Data Documentation

◆ fEps

float cbm::ca::tools::WindowFinder::fEps = 0.001
private

Fraction of triplets (doublets), which can be omitted.

Definition at line 151 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and SetEpsilon().

◆ fExtraCut

TCut cbm::ca::tools::WindowFinder::fExtraCut = TCut("")
private

Optional cut on the triplets/doublets.

Definition at line 145 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), PrintCaseInformation(), and SetExtraCut().

◆ fNbinsX

int cbm::ca::tools::WindowFinder::fNbinsX = 400
private

Number of bins for the X axis of the distribution.

Definition at line 148 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and SetBinning().

◆ fNbinsY

int cbm::ca::tools::WindowFinder::fNbinsY = 400
private

Number of bins for the Y axis of the distribution.

Definition at line 149 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and SetBinning().

◆ fNparams

int cbm::ca::tools::WindowFinder::fNparams = 1
private

number of parameters of the searching window

Definition at line 136 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and Process().

◆ fNslices

int cbm::ca::tools::WindowFinder::fNslices = 1
private

Number of slices along the X axis.

Definition at line 150 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and SetNslices().

◆ fpMcTripletsTree

TChain* cbm::ca::tools::WindowFinder::fpMcTripletsTree = nullptr
private

Chain of trees containing MC triplets, generated in CbmL1 Performance.

Definition at line 153 of file CaToolsWindowFinder.h.

Referenced by AddInputFile(), and CreateSW().

◆ fsOutputName

std::string cbm::ca::tools::WindowFinder::fsOutputName = "SearchWindows.dat"
private

Name for output file with estimated search windows.

Definition at line 138 of file CaToolsWindowFinder.h.

Referenced by Process(), and SetOutputName().

◆ fTargetPos

std::array<double, 3> cbm::ca::tools::WindowFinder::fTargetPos = {0}
private

Target position {x, y, z} [cm].

Definition at line 143 of file CaToolsWindowFinder.h.

Referenced by GetDistExpr(), and SetTarget().

◆ fvCaIters

std::vector<ca::Iteration> cbm::ca::tools::WindowFinder::fvCaIters = {}
private

Tracking iterations.

Definition at line 141 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), Process(), and ReadTrackingIterationsFromYAML().

◆ fvpCanvases

std::vector<TCanvas*> cbm::ca::tools::WindowFinder::fvpCanvases
private

Definition at line 155 of file CaToolsWindowFinder.h.

Referenced by CreateSW(), and DumpCanvasesToPdf().

◆ fvStationIndexes

std::vector<int> cbm::ca::tools::WindowFinder::fvStationIndexes = {}
private

Global indexes of active stations to find the windows.

Definition at line 142 of file CaToolsWindowFinder.h.

Referenced by Process(), and SetStationIndexes().

◆ kTreeName

const char* cbm::ca::tools::WindowFinder::kTreeName = "t"
staticconstexpr

Name of the input MC triplets tree.

Definition at line 49 of file CaToolsWindowFinder.h.


The documentation for this class was generated from the following files: