CbmRoot
Loading...
Searching...
No Matches
analysis/common/analysis_tree_converter/steer/TaskFactory.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Frederic Linz [committer], Volker Friese */
4
10#include "TaskFactory.h"
11
12#include "CbmConverterManager.h"
13#include "CbmFsdHitsConverter.h"
15#include "CbmKF.h"
16#include "CbmL1.h"
17#include "CbmMCDataManager.h"
18#include "CbmMatchEvents.h"
19#include "CbmMatchRecoToMC.h"
23#include "CbmSetup.h"
27#include "CbmTofHitsConverter.h"
31
32#include <TSystem.h>
33
34
35namespace cbm::atconverter
36{
37
38
39 // ----- Constructor ----------------------------------------------------
40 TaskFactory::TaskFactory(Run* run) : fRun(run) {}
41 // --------------------------------------------------------------------------
42
43
44 // ----- CA tracking ----------------------------------------------------
46 {
47 assert(fRun);
48
49 // --- Tracking geometry interface
50 auto interface = new CbmTrackingDetectorInterfaceInit();
51 fRun->AddTask(interface);
52
53 // --- Kalman Filter // Move after L1 task?
54 auto kf = new CbmKF();
55 fRun->AddTask(kf);
56
57 // --- CA Track Finder
58 auto ca = new CbmL1("CA Track Finder", 1, 3);
59 fRun->AddTask(ca);
60 }
61 // --------------------------------------------------------------------------
62
63
64 // ----- Converter Manager ----------------------------------------------
65 void TaskFactory::RegisterConverterManager(const TString& outputFile)
66 {
67 assert(fRun);
68
69 // AnalysisTree converter
70 auto* man = new CbmConverterManager();
71
72 man->SetSystem(fRun->fConfig.f_glb_system);
73 man->SetBeamMomentum(fRun->fConfig.f_glb_beamMom);
74 man->SetTimeSliceLength(fRun->fConfig.f_glb_tslength);
75 man->SetOutputName(outputFile.Data(), "rTree");
76
77 if (fRun->fConfig.f_glb_mode == ECbmRecoMode::Timeslice) { man->AddTask(new CbmMatchEvents()); }
78
79 // --- Converter for different branches
80 man->AddTask(new CbmSimEventHeaderConverter("SimEventHeader"));
81 man->AddTask(new CbmRecEventHeaderConverter("RecEventHeader"));
82 man->AddTask(new CbmSimTracksConverter("SimParticles"));
83
84 auto* ststracksconverter = new CbmStsTracksConverter("VtxTracks", "SimParticles");
85 ststracksconverter->SetIsWriteKFInfo();
86 ststracksconverter->SetIsReproduceCbmKFPF();
87 man->AddTask(ststracksconverter);
88
89 if (fRun->IsDataPresent(ECbmModuleId::kRich)) man->AddTask(new CbmRichRingsConverter("RichRings", "VtxTracks"));
90 if (fRun->IsDataPresent(ECbmModuleId::kTof)) man->AddTask(new CbmTofHitsConverter("TofHits", "VtxTracks"));
91 if (fRun->IsDataPresent(ECbmModuleId::kTrd)) man->AddTask(new CbmTrdTracksConverter("TrdTracks", "VtxTracks"));
92 if (fRun->IsDataPresent(ECbmModuleId::kPsd)) man->AddTask(new CbmPsdModulesConverter("PsdModules"));
93
95 man->AddTask(new CbmFsdModulesConverter("FsdModules"));
96
97 CbmFsdHitsConverter* fsdHitsConverter = new CbmFsdHitsConverter("FsdHits", "VtxTracks");
100 man->AddTask(fsdHitsConverter);
101 }
102
103 fRun->AddTask(man);
104 }
105 // --------------------------------------------------------------------------
106
107
108 // ----- MC data manager ------------------------------------------------
109 void TaskFactory::RegisterMCDataManager(const std::vector<TString>& traFiles)
110 {
111 assert(fRun);
112 CbmMCDataManager* mcManager = new CbmMCDataManager("MCDataManager", 0);
113 for (auto traFile : traFiles) {
114 mcManager->AddFile(traFile);
115 }
116 fRun->AddTask(mcManager);
117 }
118 // --------------------------------------------------------------------------
119
120
121 // ----- STS track matching ---------------------------------------------
123 {
124 assert(fRun);
125
126 auto* matchTask = new CbmMatchRecoToMC();
127 fRun->AddTask(matchTask);
128 }
129 // --------------------------------------------------------------------------
130
131 // ----- TID PID --------------------------------------------------------
133 {
134 assert(fRun);
136
137 CbmTrdSetTracksPidLike* trdPid = new CbmTrdSetTracksPidLike("TRDLikelihood", "TRDLikelihood");
138 trdPid->SetUseMCInfo(kTRUE);
139 trdPid->SetUseMomDependence(kTRUE);
140 fRun->AddTask(trdPid);
141 }
142 // --------------------------------------------------------------------------
143
144} // namespace cbm::atconverter
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kFsd
Forward spectator detector.
@ kRich
Ring-Imaging Cherenkov Detector.
FairTask for matching RECO data to MC.
void SetMinChi2GtrackHit(Double_t chi2)
void SetMaxChi2GtrackHit(Double_t chi2)
Definition CbmKF.h:34
Definition CbmL1.h:109
Task class creating and managing CbmMCDataArray objects.
Int_t AddFile(const char *fileName)
void SetUseMomDependence(Bool_t use=kTRUE)
void SetUseMCInfo(Bool_t use=kTRUE)
bool IsDataPresent(ECbmModuleId detector) const
Presence of input digi data.
void AddTask(FairTask *task)
Add a task to the run.
void RegisterConverterManager(const TString &outputFile)
AnalysisTree Converter Manager.
void RegisterMCDataManager(const std::vector< TString > &traFiles)
MC data manager for matching.
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14