BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnSP41FieldMapCreator.h
Go to the documentation of this file.
1#ifndef BMNSP41FIELDMAPCREATOR_H
2#define BMNSP41FIELDMAPCREATOR_H 1
3
4#include "BmnFieldMap.h"
5
6#include <TClonesArray.h>
7#include <TF1.h>
8#include <TFile.h>
9#include <TGraph.h>
10#include <TGraph2D.h>
11#include <TH1.h>
12#include <TMath.h>
13#include <TString.h>
14#include <utility>
15#include <vector>
16
17using namespace TMath;
18
19class fitParMonitor : public TObject
20{
21 public:
24 virtual ~fitParMonitor();
25
26 TH1F*** C;
27 TH1F*** M;
28 TH1F*** S;
29
30 private:
31 TFile* f;
32
34};
35
37{
38 public:
40 {
41 direction = "Z";
42 min = -DBL_MAX;
43 max = DBL_MAX;
44 }
45
47
51 std::pair<Double_t, Double_t> tailRangeLeft;
52 std::pair<Double_t, Double_t> tailRangeRight;
53
55};
56
57class smoothedValues : public TObject
58{
59 public:
61 {
62 X = 0.;
63 Y = 0.;
64 Z = 0.;
65 fieldValue = 0.;
66 }
67
68 virtual ~smoothedValues() {}
69
70 Double_t X;
71 Double_t Y;
72 Double_t Z;
74
76};
77
78class BmnSP41FieldMapCreator : public TNamed
79{
80 public:
84
87
89
90 void SetDebug(Bool_t flag) { fDebug = flag; }
91
92 void SetNodeNumber(Int_t nNodes) { dimGrid = nNodes; }
93
94 // Extrapolation new ranges ...
95
97 {
98 fConditions->min = min;
99 fConditions->max = max;
100 }
101
102 void SetExtrapolationAxis(TString axis) { fConditions->direction = axis; }
103
104 // Main method to be called ...
106
107 private:
109
111
112 Int_t dimGrid; // dimGrid x dimGrid corresponds to number of nodes to build a grid along X(Y)-axis
113 Int_t dimNhist; // dimNhist corresponds to number of profiles drawn
114
115 Double_t factor; // Transition from T to kG
116
120
130
132 TGraph2D*** mean;
133 TGraph2D*** sigma;
134
136
141
144
145 std::vector<Double_t> checkedFieldValue(Double_t bx, Double_t by, Double_t bz)
146 {
147 // To be not more than 5kG at scale = 1
148 const Double_t min = 0.001;
149 const Double_t max = 7.;
150
151 std::vector<Double_t> out;
152
153 out.push_back((TMath::Abs(bx) > min && TMath::Abs(bx) < max) ? bx : 0.);
154 out.push_back((TMath::Abs(by) > min && TMath::Abs(by) < max) ? by : 0.);
155 out.push_back((TMath::Abs(bz) > min && TMath::Abs(bz) < max) ? bz : 0.);
156
157 return out;
158 }
159
161};
162
163#endif
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:31
bool Bool_t
int Int_t
double Double_t
#define ClassDef(name, id)
void Print(BmnFieldMap *)
Double_t FieldExtrapolate(Double_t, Double_t, Double_t, TGraph2D *, TGraph2D *, TGraph2D *)
void DrawProfileExtrapZ(Int_t, TGraph ***, TF1 ***, TString, TString, Double_t, Double_t, Double_t, Double_t)
void SetOutParamFileName(TString name)
std::vector< Double_t > checkedFieldValue(Double_t bx, Double_t by, Double_t bz)
void DoExtrapolationAlongZ(Int_t, Int_t)
void SetNodeNumber(Int_t nNodes)
void DrawProfileExtrapX(Int_t, TGraph ***, TF1 ***, TString, TString, Double_t, Double_t, Double_t, Double_t)
void SetExtrapolationAxis(TString axis)
BmnSP41FieldMapCreator(TString, TString)
void DoExtrapolationAlongX(Int_t, Int_t)
void SmoothMap(TClonesArray *)
void SetNewRanges(Double_t min, Double_t max)
extrapolationConditions * fConditions
virtual ~BmnSP41FieldMapCreator()
friend friend class TClonesArray
std::pair< Double_t, Double_t > tailRangeRight
std::pair< Double_t, Double_t > tailRangeLeft
virtual ~fitParMonitor()
fitParMonitor(TString out)
Double_t Abs(Double_t d)