BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
globAlignment.C
Go to the documentation of this file.
1
#include <
Rtypes.h
>
2
3
R__ADD_INCLUDE_PATH
($VMCWORKDIR)
4
#include "macro/run/bmnloadlibs.C"
5
6
#include <
TStopwatch.h
>
7
#include <
TString.h
>
8
9
R__LOAD_LIBRARY
(libSilicon.so)
10
11
void
globAlignment
(
UInt_t
nEvents = 1e3,
12
TString
recoFileName =
"bmndst.root"
,
13
TString
addInfo =
""
,
14
Int_t
runPeriod = 7)
15
{
16
bmnloadlibs();
// load BmnRoot libraries
17
// ----- Timer ---------------------------------------------------------
18
TStopwatch
timer;
19
timer.
Start
();
20
FairRunAna* fRunAna =
new
FairRunAna();
21
FairSource
* fFileSource =
new
BmnFileSource
(recoFileName.Data());
22
fRunAna->SetSource(fFileSource);
23
// Output file
24
TString
outputFileName = recoFileName;
25
if
(addInfo !=
""
)
26
outputFileName.
ReplaceAll
(
"bmndst"
, addInfo +
"_align"
);
27
else
{
28
outputFileName.
ReplaceAll
(
"bmndst"
,
"align"
);
29
}
30
cout <<
"outputFileName: "
+ outputFileName << endl;
31
fRunAna->SetOutputFile(outputFileName);
32
33
BmnGlobalAlignment
* globAlign =
new
BmnGlobalAlignment
(nEvents, recoFileName, runPeriod);
34
// BmnGlobalAlignment* globAlign = new BmnGlobalAlignment(recoFileName);
35
// globAlign->SetDebug(kTRUE); // default is false
36
// globAlign->SetUseConstraints(false);
37
38
// Restrictions on track params:
39
// globAlign->SetMinHitsAccepted(7); // Default value is 3
40
// globAlign->SetChi2MaxPerNDF(2.); // Cut on chi2/ndf for found tracks, default value is not limited
41
// globAlign->SetTxMinMax(-.5, +.5);
42
// globAlign->SetExclusionRangeTx(-.1, +.1);
43
// globAlign->SetTyMinMax(-1., +1.);
44
// globAlign->SetExclusionRangeTy(-0.02, 0.02);
45
// globAlign->SetTxMinMax(-1., 0. );
46
// globAlign->SetTyMinMax(-0.05, 0.05);
47
48
// "GEM", "SILICON"
49
globAlign->
SetDetectors
(
kTRUE
,
kTRUE
);
50
51
// globAlign->SetSiFixedRun7(false, false, false, false,
52
// false, false,
53
// kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE);
54
55
globAlign->
SetPreSigma
(0.001);
// Default value is 1
56
globAlign->
SetAccuracy
(0.001);
// Default value is 0.001
57
// globAlign->SetUseRealHitErrors(kTRUE); // Default value is false
58
// globAlign->SetUseRegularization(kTRUE); // Default value is false
59
// globAlign->SetHugecut(200.); // Default value is 50
60
// globAlign->SetChisqcut(5., 2.); // Default value is (0., 0.)
61
// globAlign->SetEntriesPerParam(5); // Default value is 10
62
globAlign->
SetOutlierDownweighting
(4);
// Default value is 0
63
globAlign->
SetDwfractionCut
(0.5);
// Default value is 0, should be less than 0.5
64
65
fRunAna->AddTask(globAlign);
66
67
fRunAna->Init();
68
fRunAna->Run(0, nEvents);
69
// ----- Finish --------------------------------------------------------
70
timer.
Stop
();
71
Double_t
rtime = timer.
RealTime
();
72
Double_t
ctime = timer.
CpuTime
();
73
cout << endl << endl;
74
cout <<
"Macro finished successfully."
<< endl;
75
cout <<
"Real time "
<< rtime <<
" s, CPU time "
<< ctime <<
" s"
<< endl;
76
cout << endl;
77
78
delete
globAlign;
79
}
Int_t
int Int_t
UInt_t
unsigned int UInt_t
Double_t
double Double_t
kTRUE
constexpr Bool_t kTRUE
Rtypes.h
R__LOAD_LIBRARY
#define R__LOAD_LIBRARY(LIBRARY)
R__ADD_INCLUDE_PATH
#define R__ADD_INCLUDE_PATH(PATH)
TStopwatch.h
TString.h
BmnFileSource
BmnFileSource.h.
Definition
BmnFileSource.h:30
BmnGlobalAlignment
Definition
BmnGlobalAlignment.h:50
BmnGlobalAlignment::SetDwfractionCut
void SetDwfractionCut(Double_t fraction)
Definition
BmnGlobalAlignment.h:85
BmnGlobalAlignment::SetOutlierDownweighting
void SetOutlierDownweighting(Int_t n)
Definition
BmnGlobalAlignment.h:83
BmnGlobalAlignment::SetDetectors
void SetDetectors(Bool_t gem, Bool_t si)
Definition
BmnGlobalAlignment.h:69
BmnGlobalAlignment::SetAccuracy
void SetAccuracy(Double_t accuracy)
Definition
BmnGlobalAlignment.h:79
BmnGlobalAlignment::SetPreSigma
void SetPreSigma(Double_t presigma)
Definition
BmnGlobalAlignment.h:77
FairSource
TStopwatch
TStopwatch::RealTime
Double_t RealTime()
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::CpuTime
Double_t CpuTime()
TStopwatch::Stop
void Stop()
TString
TString::ReplaceAll
TString & ReplaceAll(const char *s1, const char *s2)
globAlignment
void globAlignment(UInt_t nEvents=1e3, TString recoFileName="bmndst.root", TString addInfo="", Int_t runPeriod=7)
Definition
globAlignment.C:11
macro
alignment
globAlignment.C
Generated on
for BmnRoot by
1.17.0