BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
globAlignment.C
Go to the documentation of this file.
1#include <Rtypes.h>
2
3R__ADD_INCLUDE_PATH($VMCWORKDIR)
4#include "macro/run/bmnloadlibs.C"
5
6#include <TStopwatch.h>
7#include <TString.h>
8
9R__LOAD_LIBRARY(libSilicon.so)
10
11void 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 Int_t
unsigned int UInt_t
double Double_t
constexpr Bool_t kTRUE
#define R__LOAD_LIBRARY(LIBRARY)
#define R__ADD_INCLUDE_PATH(PATH)
BmnFileSource.h.
void SetDwfractionCut(Double_t fraction)
void SetOutlierDownweighting(Int_t n)
void SetDetectors(Bool_t gem, Bool_t si)
void SetAccuracy(Double_t accuracy)
void SetPreSigma(Double_t presigma)
Double_t RealTime()
void Start(Bool_t reset=kTRUE)
Double_t CpuTime()
void Stop()
TString & ReplaceAll(const char *s1, const char *s2)
void globAlignment(UInt_t nEvents=1e3, TString recoFileName="bmndst.root", TString addInfo="", Int_t runPeriod=7)