CbmRoot
Loading...
Searching...
No Matches
CbmQACoreManager.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023-2023 Warsaw University of Technology, Warsaw
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek [committer] */
4#include "CbmQACoreManager.h"
5
6#include "CbmAnaTreeSource.h"
8#include "HalCbmEvent.h"
9#include "HalCbmFullEvent.h"
10#include "HalCbmHbtEvent.h"
11#include "HalCbmHbtFullEvent.h"
12#include "HalCbmMCEvent.h"
13#include "HalCbmTofCut.h"
14
15#include <FairRunAna.h>
16
17#include <TString.h>
18
19#include <Hal/TrackAna.h>
20
21
23{
24 fEta[0] = -2;
25 fEta[1] = 4;
26 fDCAz[0] = 0;
27 fDCAz[1] = 10;
28}
29
30Hal::Event* CbmQACoreManager::GetFormat(eFormatType type, eAnaType ana)
31{
32 switch (ana) {
33 case eAnaType::kDefault:
34 switch (type) {
35 case eFormatType::kComplex: return new HalCbmFullEvent(); break;
36 case eFormatType::kReco: return new HalCbmEvent(); break;
37 case eFormatType::kSim: return new HalCbmMCEvent(); break;
38 }
39 break;
40 case eAnaType::kHbt:
41 switch (type) {
42 case eFormatType::kComplex: return new HalCbmHbtFullEvent(); break;
43 case eFormatType::kReco: return new HalCbmHbtEvent(); break;
44 case eFormatType::kSim: return new HalCbmMCEvent(); break;
45 }
46 break;
47 }
48 return nullptr;
49}
50
51void CbmQACoreManager::SetRecoTrackCut(Hal::TrackAna* ana, ePidCut cut, eParticleType primary, TString flag)
52{
54 switch (cut) {
55 case ePidCut::kAntiProton:
56 cuts.SetCharge(-1);
57 cuts.SetNHits(4, 20);
58 cuts.SetM2(0.75, 1.1);
59 break;
60 case ePidCut::kKaonMinus:
61 cuts.SetCharge(-1);
62 cuts.SetNHits(4, 20);
63 cuts.SetM2(0.15, 0.29);
64 break;
65 case ePidCut::kKaonPlus:
66 cuts.SetCharge(1);
67 cuts.SetNHits(4, 20);
68 cuts.SetM2(0.15, 0.29);
69 break;
70 case ePidCut::kPionMinus:
71 cuts.SetCharge(-1);
72 cuts.SetNHits(4, 20);
73 cuts.SetM2(-0.1, 0.15);
74 break;
75 case ePidCut::kPionPlus:
76 cuts.SetCharge(1);
77 cuts.SetNHits(4, 20);
78 cuts.SetM2(0.0, 0.05);
79 cuts.SetPt(0.2, 10);
80 break;
81 case ePidCut::kProton:
82 cuts.SetPt(0.2, 10);
83 cuts.SetEta(1, 3.5);
84 cuts.SetCharge(1);
85 cuts.SetNHits(0, 20);
86 cuts.SetNStsHits(5, 20);
87 cuts.SetM2(0.75, 1.1);
88 //cuts.SetChi2(0, 12);
89 cuts.GetTofCut()->SetDownPoints(0.5, 1, 0.7, 0.8, 20, 0.76);
90 break;
91 default: break;
92 }
93 if (fUsetPid == kFALSE) {
94 cuts.SetM2(-1E+9, 1E+9);
95 }
96 switch (primary) {
97 case eParticleType::kPrimaryOnly:
98 cuts.SetDCAXY(0, 1);
99 cuts.SetDCAZ(-0.01, 0.01);
100 switch (cut) {
101 case ePidCut::kProton: {
102 cuts.SetDCAXY(0, 0.5);
103 } break;
104 default: break;
105 }
106 break;
107 case eParticleType::kSecondaryOnly: {
108 cuts.SetDCAXY(1, 1E+3);
109 cuts.SetDCAZ(0.00, 1E+3);
110 switch (cut) {
111 case ePidCut::kProton: {
112 cuts.SetDCAXY(1, 1E+3);
113 } break;
114 default: break;
115 }
116 break;
117 } break;
118 case eParticleType::kAll: break;
119 }
120 cuts.SetOptionForAllCuts(flag);
121
122 ana->AddCutsAndMonitors(cuts);
123}
124
125FairRunAna* CbmQACoreManager::GetRunAna(TString outFile, TString simFile, TString /*recoFile*/, TString /*parFile*/)
126{
127 FairRunAna* run = new FairRunAna();
128 CbmAnaTreeSource* file = new CbmAnaTreeSource(simFile);
129 run->SetOutputFile(outFile);
130 run->SetSource(file);
131 return run;
132}
133
virtual FairRunAna * GetRunAna(TString outFile, TString simFile, TString recoFile, TString parFile="")
virtual void SetRecoTrackCut(Hal::TrackAna *ana, Hal::QAManager::ePidCut cut, Hal::QAManager::eParticleType primary, TString flag="")
virtual Hal::Event * GetFormat(Hal::QAManager::eFormatType type, Hal::QAManager::eAnaType ana=Hal::QAManager::eAnaType::kDefault)
void SetM2(Double_t min, Double_t max)
void SetDCAZ(Double_t min, Double_t max)
void SetDCAXY(Double_t min, Double_t max)
void SetEta(Double_t min, Double_t max)
void SetNStsHits(Int_t min, Int_t max)
void SetPt(Double_t min, Double_t max)
void SetNHits(Int_t min, Int_t max)
HalCbmTofCut * GetTofCut() const
void SetCharge(Int_t charge)