Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
QAManager.cxx
1/*
2 * QACoreManager.cxx
3 *
4 * Created on: 4 maj 2021
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "QAManager.h"
11
12#include "AnalysisManager.h"
13#include "Const.h"
14#include "Source.h"
15#include "TrackAna.h"
16#include "TrackOnlyPrimariesCut.h"
17#include "TrackPdgCut.h"
18
19namespace Hal {
20 void QAManager::SetMcTrackCut(TrackAna* ana, ePidCut cut, eParticleType primary, TString flag) {
21 Int_t pid = 0;
22 switch (cut) {
23 case ePidCut::kPionPlus: {
24 pid = Const::PionPlusPID();
25 } break;
26 case ePidCut::kPionMinus: {
27 pid = -Const::PionPlusPID();
28 } break;
29 case ePidCut::kKaonPlus: {
30 pid = Const::KaonPlusPID();
31 } break;
32 case ePidCut::kKaonMinus: {
33 pid = -Const::KaonPlusPID();
34 } break;
35 case ePidCut::kProton: {
36 pid = Const::ProtonPID();
37 } break;
38 case ePidCut::kAntiProton: {
39 pid = -Const::ProtonPID();
40 } break;
41 case ePidCut::kUnkown: {
42 pid = 0;
43 } break;
44 }
45 TrackPdgCut pdgCut;
46 pdgCut.SetMinAndMax(pid);
47 ana->AddCut(pdgCut, flag);
48 switch (primary) {
49 case eParticleType::kPrimaryOnly: {
51 ana->AddCut(prim, flag);
52 } break;
53 case eParticleType::kSecondaryOnly: {
55 prim.AcceptOnlyNonPrimaries();
56 ana->AddCut(prim, flag);
57 } break;
58 default: break;
59 }
60 }
61 Event* QAManager::GetFormat(eFormatType /*type*/, eAnaType /*ana*/) { return nullptr; }
62
63 void QAManager::SetRecoTrackCut(TrackAna* /*ana*/, ePidCut /*cut*/, eParticleType /*primary*/, TString /*flag*/) {}
64
65 void QAManager::SetEventCut(TrackAna* /*ana*/, Int_t /*col*/, TString /*flag*/) {}
66
67 AnalysisManager* QAManager::GetAna(TString outFile, TString simFile, TString recoFile) {
68 AnalysisManager* run = new AnalysisManager();
69 run->SetOutput(outFile);
70 RootSource* source = new RootSource(simFile);
71 run->SetSource(source);
72 if (!recoFile.EqualTo(simFile)) { source->AddFriend(simFile, 0); }
73 return run;
74 }
75
76 void QAManager::SetPairCut(TwoTrackAna* /*ana*/, ePidCut /*pid1*/, ePidCut /*pid2*/) {}
77
78 QAManager::ePidCut QAManager::ToPid(Int_t i) {
79 switch (i) {
80 case 0: return QAManager::ePidCut::kPionPlus; break;
81 case 1: return QAManager::ePidCut::kPionMinus; break;
82 case 2: return QAManager::ePidCut::kKaonPlus; break;
83 case 3: return QAManager::ePidCut::kKaonMinus; break;
84 case 4: return QAManager::ePidCut::kProton; break;
85 case 5: return QAManager::ePidCut::kAntiProton; break;
86 default: return QAManager::ePidCut::kUnkown;
87 }
88 }
89} // namespace Hal
void SetMinAndMax(Double_t val, Int_t i=0)
Definition Cut.cxx:91
virtual void AddCut(const Cut &cut, Option_t *opt="")
Definition EventAna.cxx:322
virtual void SetRecoTrackCut(TrackAna *ana, ePidCut cut, eParticleType primary, TString flag="")
Definition QAManager.cxx:63
virtual void SetMcTrackCut(TrackAna *ana, ePidCut cut, eParticleType primary, TString flag="")
Definition QAManager.cxx:20