BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
gemAlignment.C
Go to the documentation of this file.
1#include <TStopwatch.h>
2#include <TString.h>
3
4void gemAlignment(UInt_t nEvents = 1e6, TString recoFileName = "bmndst.root", TString addInfo = "")
5{
6 gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
7 bmnloadlibs(); // load BmnRoot libraries
8 // ----- Timer ---------------------------------------------------------
9 TStopwatch timer;
10 timer.Start();
11 FairRunAna* fRunAna = new FairRunAna();
12 FairSource* fFileSource = new BmnFileSource(recoFileName.Data());
13 fRunAna->SetSource(fFileSource);
14 // Output file
15 TString outputFileName = recoFileName;
16 if (addInfo != "")
17 outputFileName.ReplaceAll("bmndst", addInfo + "_align");
18 else {
19 outputFileName.ReplaceAll("bmndst", "align");
20 }
21 cout << "outputFileName: " + outputFileName << endl;
22 fRunAna->SetOutputFile(outputFileName);
23 // resultName will be only essential part without ".root":
24 TString resultName = outputFileName;
25 resultName.ReplaceAll(".root", "");
26 cout << "resultName: " + resultName << endl;
27 BmnGemAlignment* gemAlign = new BmnGemAlignment();
28 gemAlign->SetResultName(resultName);
29 gemAlign->SetGeometry(BmnGemStripConfiguration::RunWinter2016);
30 // GEM stations 4, 5 and 6 consist of two separate modules that can be either fixed or not simultaneously
31 // 0 1 2 3 4 5 6
32 TString fixedStats[7] = {"fixed", "", "", "", "", "", ""};
33 gemAlign->SetStatNumFixed(fixedStats);
34 // gemAlign->SetRunType(type);
35 gemAlign->SetPreSigma(0.001); // Default value is 1
36 gemAlign->SetAccuracy(0.001); // Default value is 0.001
37 gemAlign->SetUseRealHitErrors(kTRUE); // Default value is false
38 // gemAlign->SetUseTrackWithMinChi2(kTRUE); // Default value is false
39 gemAlign->SetUseRegularization(kTRUE); // Default value is false
40 // gemAlign->SetHugecut(200.); // Default value is 50
41 // gemAlign->SetChisqcut(5., 2.); // Default value is (0., 0.)
42 // gemAlign->SetEntriesPerParam(100); // Default value is 10
43 gemAlign->SetOutlierdownweighting(4); // Default value is 0
44 gemAlign->SetDwfractioncut(0.5); // Default value is 0, should be less than 0.5
45 gemAlign->SetFixDetector(kTRUE, kTRUE, kTRUE); // Default values are false(X), false(Y) and false(Z)
46 // gemAlign->SetDebugInfo(kTRUE); // Default value is false
47
48 // Restrictions on track params:
49 // gemAlign->SetMinHitsAccepted(5); // Default value is 3
50 // gemAlign->SetChi2MaxPerNDF(2.); // Cut on chi2/ndf for found tracks, default value is not limited
51 // gemAlign->SetTxMinMax(-1., 0.);
52 // gemAlign->SetTyMinMax(-0.05, 0.05);
53
54 fRunAna->AddTask(gemAlign);
55 fRunAna->Init();
56 fRunAna->Run(0, nEvents);
57 // ----- Finish --------------------------------------------------------
58 timer.Stop();
59 Double_t rtime = timer.RealTime();
60 Double_t ctime = timer.CpuTime();
61 cout << endl << endl;
62 cout << "Macro finished successfully." << endl;
63 cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
64 cout << endl;
65}
unsigned int UInt_t
double Double_t
constexpr Bool_t kTRUE
#define gROOT
BmnFileSource.h.
Double_t RealTime()
void Start(Bool_t reset=kTRUE)
Double_t CpuTime()
void Stop()
char * Init(Ssiz_t capacity, Ssiz_t nchar)
TString & ReplaceAll(const char *s1, const char *s2)
void gemAlignment(UInt_t nEvents=1e6, TString recoFileName="bmndst.root", TString addInfo="")
Definition gemAlignment.C:4