BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
bmn_qa_generator.C
Go to the documentation of this file.
1// --------------------------------------------------------------------------
2// Macro for generating QA-reports
3// --------------------------------------------------------------------------
4#include <Rtypes.h>
5R__ADD_INCLUDE_PATH($VMCWORKDIR)
6
7void bmn_qa_generator(TString recoFile = "$VMCWORKDIR/macro/run/bmndst.root",
8 TString mcFile = "$VMCWORKDIR/macro/run/bmnsim.root",
9 TString outFile = "qa_0.root",
10 Int_t nStartEvent = 0,
11 Bool_t isPrimary = kFALSE,
12 Int_t nEvents = 1000000)
13{
14
15 FairRunAna* fRun = new FairRunAna();
16
17 FairFileSource* fFileSource = new FairFileSource(mcFile);
18 fFileSource->AddFriend(recoFile);
19 fRun->SetSource(fFileSource);
20 fRun->SetSink(new FairRootFileSink(outFile));
21
22 fRun->SetGenerateRunInfo(false);
23
24 Int_t period = 8;
25
26 TString gPathConfig = gSystem->Getenv("VMCWORKDIR");
27 TString gPathGemConfig = gPathConfig + "/parameters/gem/XMLConfigs/";
28 TString gPathSilConfig = gPathConfig + "/parameters/silicon/XMLConfigs/";
29 TString gPathCscConfig = gPathConfig + "/parameters/csc/XMLConfigs/";
30 TString confGem = gPathGemConfig
31 + ((period == 8) ? "GemRun8.xml"
32 : (period == 7) ? "GemRunSpring2018.xml"
33 : (period == 6) ? "GemRunSpring2017.xml"
34 : "GemRunSpring2017.xml");
35 TString confSil = gPathSilConfig
36 + ((period == 8) ? "SiliconRun8.xml"
37 : (period == 7) ? "SiliconRunSpring2018.xml"
38 : (period == 6) ? "SiliconRunSpring2017.xml"
39 : "SiliconRunSpring2017.xml");
40 TString confCSC = gPathCscConfig + ((period == 8) ? "CSCRun8.xml" : "");
41
42 // ============ TASKS ============= //
43
44 if (period < 8) {
45 BmnMatchRecoToMC* mcMatching = new BmnMatchRecoToMC();
46 fRun->AddTask(mcMatching);
47 }
48
49 // BmnClusteringQa* clQa = new BmnClusteringQa();
50 // clQa->SetOnlyPrimes(isPrimary);
51 // fRun->AddTask(clQa);
52
53 BmnTrackingQa* trQaAll = new BmnTrackingQa(0, "tracking_qa", confGem, confSil, confCSC);
57 trQaAll->SetOnlyPrimes(isPrimary);
58 // trQaAll->SetInnerTracksBranchName("StsTrack");
59 trQaAll->SetInnerTracksBranchName("StsVector");
60 fRun->AddTask(trQaAll);
61 //
62 // BmnTrackingQa* trQaPos = new BmnTrackingQa(+1, "tracking_qa_positive", confGem, confSil);
63 // trQaPos->SetOnlyPrimes(isPrimary);
64 // fRun->AddTask(trQaPos);
65 //
66 // BmnTrackingQa* trQaNeg = new BmnTrackingQa(-1, "tracking_qa_negative", confGem, confSil);
67 // trQaNeg->SetOnlyPrimes(isPrimary);
68 // fRun->AddTask(trQaNeg);
69
70 // ============ TASKS ============= //
71 TList* parFileList = new TList();
72
73 FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
74
75 FairParRootFileIo* parIo1 = new FairParRootFileIo();
76 FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
77 parIo1->open(mcFile.Data());
78 parIo2->open(parFileList, "in");
79 rtdb->setFirstInput(parIo1);
80 rtdb->setSecondInput(parIo2);
81 rtdb->setOutput(parIo1);
82 rtdb->saveOutput();
83
84 FairTask* pKF = new CbmKF();
85 fRun->AddTask(pKF);
86
87 // ----- Intialise and run --------------------------------------------
88 fRun->Init();
89 cout << "Starting run" << endl;
90 fRun->Run(nStartEvent, nStartEvent + nEvents);
91 // ------------------------------------------------------------------------
92}
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
R__EXTERN TSystem * gSystem
@ kSILICON
@ kGEM
@ kSSD
void SetInnerTracksBranchName(TString name)
void SetDetectorPresence(DetectorId det, Bool_t use)
void SetOnlyPrimes(const Bool_t prime)
The CbmKF Kalman Filter algorithm.
Definition CbmKF.h:28
void bmn_qa_generator(TString recoFile="$VMCWORKDIR/macro/run/bmndst.root", TString mcFile="$VMCWORKDIR/macro/run/bmnsim.root", TString outFile="qa_0.root", Int_t nStartEvent=0, Bool_t isPrimary=kFALSE, Int_t nEvents=1000000)