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
9void globAlignment(UInt_t nEvents = 1e6,
10 TString recoFileName = "bmndst_RUN7_GEM.root",
11 TString addInfo = "",
12 Int_t runPeriod = 7)
13{
14 bmnloadlibs(); // load BmnRoot libraries
15 // ----- Timer ---------------------------------------------------------
16 TStopwatch timer;
17 timer.Start();
18 FairRunAna* fRunAna = new FairRunAna();
19 FairSource* fFileSource = new BmnFileSource(recoFileName.Data());
20 fRunAna->SetSource(fFileSource);
21 // Output file
22 TString outputFileName = recoFileName;
23 if (addInfo != "")
24 outputFileName.ReplaceAll("bmndst", addInfo + "_align");
25 else {
26 outputFileName.ReplaceAll("bmndst", "align");
27 }
28 cout << "outputFileName: " + outputFileName << endl;
29 fRunAna->SetOutputFile(outputFileName);
30
31 BmnGlobalAlignment* globAlign = new BmnGlobalAlignment(recoFileName);
32 globAlign->SetDoTest(kTRUE);
33
34 // "GEM", MWPC", "DCH", "Vp", "SILICON"
36
37 globAlign->SetPreSigma(0.001); // Default value is 1
38 globAlign->SetAccuracy(0.001); // Default value is 0.001
39 globAlign->SetOutlierDownweighting(4); // Default value is 0
40 globAlign->SetDwfractionCut(0.5); // Default value is 0, should be less than 0.5
41
42 fRunAna->AddTask(globAlign);
43
44 fRunAna->Init();
45 fRunAna->Run(0, nEvents);
46 // ----------------------------- Finish ----------------------------------------------------
47 timer.Stop();
48 Double_t rtime = timer.RealTime();
49 Double_t ctime = timer.CpuTime();
50 cout << endl << endl;
51 cout << "Macro finished successfully." << endl;
52 cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
53 cout << endl;
54
55 delete globAlign;
56}
int Int_t
unsigned int UInt_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
BmnFileSource.h.
void SetDwfractionCut(Double_t fraction)
void SetOutlierDownweighting(Int_t n)
void SetDoTest(Bool_t flag)
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=1e6, TString recoFileName="bmndst_RUN7_GEM.root", TString addInfo="", Int_t runPeriod=7)