CbmRoot
CbmKresConversionMain.cxx
Go to the documentation of this file.
1 
14 #include "CbmKresConversionMain.h"
15 
16 #include "CbmGlobalTrack.h"
17 #include "CbmMCTrack.h"
18 #include "CbmMvdHit.h"
19 #include "CbmRichHit.h"
20 #include "CbmRichPoint.h"
21 #include "CbmRichRing.h"
22 #include "CbmStsHit.h"
23 #include "CbmStsTrack.h"
24 #include "CbmTrackMatchNew.h"
25 #include "FairRootManager.h"
26 #include "TDirectory.h"
27 
28 #include <boost/assign/list_of.hpp>
29 #include <iostream>
30 #include <string>
31 
32 using namespace std;
33 using boost::assign::list_of;
34 
37  : FairTask("CbmKresConversionMain")
38  , DoKresGeneral(0)
39  , DoKresReconstruction(0)
40  , DoKresKF(0)
41  , DoKresManual(0)
42  , DoKresManualmbias(0)
43  , DoKresTemperature(0)
44  , DoKresPhotons(0)
45  , DoKresCorrectedPhotons(0)
46  , DoKresEtaMCAnalysis(0)
47  , DoKresEta(0)
48  , fKresGeneral(nullptr)
49  , fKresReco(nullptr)
50  , fKresKF(nullptr)
51  , fKresManual(nullptr)
52  , fKFparticle(nullptr)
53  , fKFparticleFinderQA(nullptr)
54  , fKresManualmbiasPart1(nullptr)
55  , fKresManualmbiasPart2(nullptr)
56  , fKresManualmbiasPart3(nullptr)
57  , fKresManualmbiasPart4(nullptr)
58  , fKresTemperature(nullptr)
59  , fKresPhotons(nullptr)
60  , fKresCorrectedPhotons(nullptr)
61  , fKresEtaMCAnalysis(nullptr)
62  , fKresEta(nullptr)
63  , fEventNum(0)
64  , OpeningAngleCut(0.)
65  , GammaInvMassCut(0.)
66  , fRealPID(0) {
67  OpeningAngleCut = 2.; // Opening angle cut for photon reconstruction
68  GammaInvMassCut = 0.02; // Invariant mass for photon reconstruction
69  fRealPID =
70  1; // Particle identifiaction from detectors. 1 is Real !!!; 0 is MC.
71 
72  DoKresGeneral = 0;
73  DoKresReconstruction = 0; // estimation for eta and pi^0 reconstruction
74  DoKresManual = 0; // central mode
75  DoKresPhotons = 0; // photons mode
77  0; // photons mode with apllying of acceptance (rough) correction
78 
79  DoKresKF = 0;
80  DoKresManualmbias = 1; // mbias mode
81 
82  DoKresTemperature = 0; // temperature mode
83 
84  DoKresEtaMCAnalysis = 0; // Monte Carlo analysis for eta
85  DoKresEta = 0; // eta mode
86 }
87 
88 
90 
91 
94 
95  cout << "CbmKresConversionMain::Init" << endl;
96 
97  // if (DoKresManual == 1 && DoKresManualmbias == 1) { Fatal("", " !!!! Central and mbias modes are activated together !!!! "); }
98 
99 
100  cout << endl;
101  if (DoKresGeneral) {
103  fKresGeneral->Init();
104  cout << endl;
105  cout << "\t *** CbmKresConversionGeneral ==> "
106  "analysis is activated"
107  << endl;
108  }
109 
110  if (DoKresReconstruction) {
112  fKresReco->Init();
113  cout << "\t *** CbmKresConversionReconstruction ==> "
114  "analysis is activated"
115  << endl;
116  }
117  if (DoKresKF) {
120  fKresKF->Init();
121  cout << "\t *** CbmKresConversionKF ==> "
122  "analysis is activated"
123  << endl;
124  }
125  if (DoKresManual) {
127  fKresManual->Init();
128  cout << "\t *** CbmKresConversionManual ==> "
129  "analysis is activated"
130  << endl;
131  }
132  if (DoKresManualmbias) {
135  cout << "\t *** CbmKresConversionManualmbias (b <= 2 fm) ==> "
136  "analysis is activated"
137  << endl;
138 
141  cout << "\t *** CbmKresConversionManualmbias (2 < b <= 6 fm) ==> "
142  "analysis is activated"
143  << endl;
144 
147  cout << "\t *** CbmKresConversionManualmbias (6 < b <= 10 fm) ==> "
148  "analysis is activated"
149  << endl;
150 
153  cout << "\t *** CbmKresConversionManualmbias (b > 10 fm) ==> "
154  "analysis is activated"
155  << endl;
156  }
157 
158  if (DoKresTemperature) {
161  cout << "\t *** CbmKresTemperature ==> "
162  "analysis is activated"
163  << endl;
164  }
165 
166  if (DoKresPhotons) {
168  fKresPhotons->Init();
169  cout << "\t *** CbmKresConversionPhotons ==> "
170  "analysis is activated"
171  << endl;
172  }
173 
177  cout << "\t *** CbmKresConversionCorrectedPhotons ==> "
178  "analysis is activated"
179  << endl;
180  }
181 
182  if (DoKresEtaMCAnalysis) {
185  cout << "\t *** CbmKresEtaMCAnalysis ==> "
186  "analysis is activated"
187  << endl;
188  }
189 
190  if (DoKresEta) {
191  fKresEta = new CbmKresEta();
192  fKresEta->Init();
193  cout << "\t *** CbmKresEta ==> "
194  "analysis is activated"
195  << endl;
196  }
197 
198 
199  cout << "\t CUTS : " << endl;
200  cout << "\t Gamma Invariant Mass cut = " << GammaInvMassCut << endl;
201  cout << "\t Gamma Opening Angle cut = " << OpeningAngleCut << endl;
202  if (fRealPID == 1) {
203  cout << "\t PID mode is << RealPID >> " << endl;
204  } else {
205  cout << "\t PID mode is << MCPID >> " << endl;
206  }
207  cout << endl;
208 
209 
210  InitHistograms();
211 
212  return kSUCCESS;
213 }
214 
217 
219 void CbmKresConversionMain::Exec(Option_t* /*option*/) {
220  fEventNum++;
221  // cout << "CbmKresConversionMain, event No. " << fEventNum << endl;
222 
223 
225 
227 
228  if (DoKresKF) {
230  }
231 
232  if (DoKresManual) {
234  }
235 
236  if (DoKresManualmbias) {
245  }
246 
248 
249  if (DoKresPhotons) {
251  }
252 
256  }
257 
258  if (DoKresEtaMCAnalysis) {
260  }
261 
262  if (DoKresEta) {
264  }
265 }
266 
269  CbmKFParticleFinderQA* kfparticleQA) {
270  fKFparticle = kfparticle;
271  fKFparticleFinderQA = kfparticleQA;
272  if (fKFparticle) {
273  cout << "kf works" << endl;
274  } else {
275  cout << "kf works not" << endl;
276  }
277 }
278 
281  gDirectory->mkdir("conversionKres");
282  gDirectory->cd("conversionKres");
283 
284  if (DoKresGeneral) { fKresGeneral->Finish(); }
286  if (DoKresKF) { fKresKF->Finish(); }
287  if (DoKresManual) { fKresManual->Finish(); }
288  if (DoKresManualmbias) {
289  gDirectory->mkdir("Manual_mbias");
290  gDirectory->cd("Manual_mbias");
291 
292  gDirectory->mkdir("b <= 2 (central) ");
293  gDirectory->cd("b <= 2 (central) ");
295  gDirectory->cd("..");
296 
297  gDirectory->mkdir("2 < b <= 6 ");
298  gDirectory->cd("2 < b <= 6 ");
300  gDirectory->cd("..");
301 
302  gDirectory->mkdir("6 < b <= 10 ");
303  gDirectory->cd("6 < b <= 10 ");
305  gDirectory->cd("..");
306 
307  gDirectory->mkdir("b > 10 (miss) ");
308  gDirectory->cd("b > 10 (miss) ");
310  gDirectory->cd("..");
311 
312  gDirectory->cd("..");
313  }
315  if (DoKresPhotons) { fKresPhotons->Finish(); }
318  if (DoKresEta) { fKresEta->Finish(); }
319 
320  gDirectory->cd("..");
321 
322  // remove unnecessary folders, which are created by default
323  gDirectory->rmdir("cbmout");
324  gDirectory->rmdir("BranchList");
325  gDirectory->rmdir("TimeBasedBranchList");
326  gDirectory->rmdir("FileHeader");
327 
328 
329  cout << endl;
330  cout << "END... we will continue soon... " << fEventNum << endl;
331 }
332 
CbmRichPoint.h
CbmKresConversionPhotons::Init
void Init()
Definition: CbmKresConversionPhotons.cxx:491
CbmKresConversionReconstruction::Init
void Init()
Definition: CbmKresConversionReconstruction.cxx:97
CbmKresConversionMain::DoKresEta
Int_t DoKresEta
Definition: CbmKresConversionMain.h:66
CbmKresConversionMain::SetKF
void SetKF(CbmKFParticleFinder *kfparticle, CbmKFParticleFinderQA *kfparticleQA)
Definition: CbmKresConversionMain.cxx:268
CbmKresConversionManualmbias3::Finish
void Finish()
Definition: CbmKresConversionManualmbias3.cxx:2360
CbmKresConversionManualmbias4::Finish
void Finish()
Definition: CbmKresConversionManualmbias4.cxx:2360
CbmKresTemperature::Init
void Init()
Definition: CbmKresTemperature.cxx:44
CbmKresConversionReconstruction::Exec
void Exec(int fEventNumRec)
Definition: CbmKresConversionReconstruction.cxx:137
CbmKresConversionManualmbias4::Exec
void Exec(int fEventNumMan, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionManualmbias4.cxx:666
CbmKFParticleFinder
Definition: CbmKFParticleFinder.h:26
CbmKresConversionManualmbias2
Definition: CbmKresConversionManualmbias2.h:17
CbmKresConversionMain::fKFparticle
CbmKFParticleFinder * fKFparticle
Definition: CbmKresConversionMain.h:73
CbmKresConversionMain::fKresCorrectedPhotons
CbmKresConversionCorrectedPhotons * fKresCorrectedPhotons
Definition: CbmKresConversionMain.h:83
CbmKresConversionReconstruction
Definition: CbmKresConversionReconstruction.h:16
CbmKresTemperature::Exec
void Exec(int fEventNumTempr)
Definition: CbmKresTemperature.cxx:68
CbmKresConversionMain::fEventNum
Int_t fEventNum
Definition: CbmKresConversionMain.h:88
CbmKFParticleFinderQA
Definition: CbmKFParticleFinderQA.h:21
CbmKresConversionMain::fKresManualmbiasPart3
CbmKresConversionManualmbias3 * fKresManualmbiasPart3
Definition: CbmKresConversionMain.h:78
CbmKresConversionMain::DoKresKF
Int_t DoKresKF
Definition: CbmKresConversionMain.h:59
CbmKresConversionManualmbias3::Exec
void Exec(int fEventNumMan, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionManualmbias3.cxx:666
CbmKresConversionMain::fKresManualmbiasPart1
CbmKresConversionManualmbias1 * fKresManualmbiasPart1
Definition: CbmKresConversionMain.h:76
CbmKresConversionMain::fKresReco
CbmKresConversionReconstruction * fKresReco
Definition: CbmKresConversionMain.h:70
CbmKresConversionMain::DoKresManual
Int_t DoKresManual
Definition: CbmKresConversionMain.h:60
CbmKresConversionMain::fKresTemperature
CbmKresTemperature * fKresTemperature
Definition: CbmKresConversionMain.h:81
CbmKresConversionMain::DoKresManualmbias
Int_t DoKresManualmbias
Definition: CbmKresConversionMain.h:61
CbmGlobalTrack.h
CbmKresConversionCorrectedPhotons::Exec
void Exec(int fEventNumDP, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionCorrectedPhotons.cxx:448
CbmKresConversionManualmbias4::Init
void Init()
Definition: CbmKresConversionManualmbias4.cxx:586
CbmKresConversionMain::DoKresPhotons
Int_t DoKresPhotons
Definition: CbmKresConversionMain.h:63
CbmKresConversionMain::DoKresReconstruction
Int_t DoKresReconstruction
Definition: CbmKresConversionMain.h:58
CbmKresConversionPhotons::Exec
void Exec(int fEventNumDP, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionPhotons.cxx:585
CbmKresConversionMain::DoKresTemperature
Int_t DoKresTemperature
Definition: CbmKresConversionMain.h:62
CbmKresConversionMain::DoKresCorrectedPhotons
Int_t DoKresCorrectedPhotons
Definition: CbmKresConversionMain.h:64
CbmKresConversionMain::fKresEta
CbmKresEta * fKresEta
Definition: CbmKresConversionMain.h:85
CbmRichRing.h
CbmKresConversionManualmbias1
Definition: CbmKresConversionManualmbias1.h:17
CbmKresEta::Init
void Init()
Definition: CbmKresEta.cxx:506
CbmKresTemperature::Finish
void Finish()
Definition: CbmKresTemperature.cxx:172
CbmKresConversionMain::fRealPID
Int_t fRealPID
Definition: CbmKresConversionMain.h:91
CbmKresConversionMain::fKresManualmbiasPart4
CbmKresConversionManualmbias4 * fKresManualmbiasPart4
Definition: CbmKresConversionMain.h:79
CbmKresConversionMain::fKresEtaMCAnalysis
CbmKresEtaMCAnalysis * fKresEtaMCAnalysis
Definition: CbmKresConversionMain.h:84
CbmKresConversionPhotons
Definition: CbmKresConversionPhotons.h:23
CbmKresConversionCorrectedPhotons::Init
void Init(double OA, double IM)
Definition: CbmKresConversionCorrectedPhotons.cxx:339
CbmKresEtaMCAnalysis::Exec
void Exec(int Event, double OpeningAngleCut, double GammaInvMassCut)
Definition: CbmKresEtaMCAnalysis.cxx:152
CbmKresConversionMain
Definition: CbmKresConversionMain.h:27
CbmKresConversionManual
Definition: CbmKresConversionManual.h:21
CbmKresTemperature
Definition: CbmKresTemperature.h:13
CbmKresConversionKF
Definition: CbmKresConversionKF.h:23
CbmKresConversionGeneral
Definition: CbmKresConversionGeneral.h:22
CbmStsTrack.h
Data class for STS tracks.
CbmKresConversionMain.h
CbmKresConversionManual::Init
void Init()
Definition: CbmKresConversionManual.cxx:1116
CbmKresEtaMCAnalysis::Init
void Init()
Definition: CbmKresEtaMCAnalysis.cxx:122
CbmKresConversionPhotons::Finish
void Finish()
Definition: CbmKresConversionPhotons.cxx:2975
CbmKresConversionMain::fKresManual
CbmKresConversionManual * fKresManual
Definition: CbmKresConversionMain.h:72
CbmKresConversionGeneral::Init
void Init()
Definition: CbmKresConversionGeneral.cxx:139
CbmKresConversionManual::Exec
void Exec(int fEventNumMan, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionManual.cxx:1214
CbmKresConversionMain::Finish
virtual void Finish()
Definition: CbmKresConversionMain.cxx:280
CbmKresConversionKF::SetKF
void SetKF(CbmKFParticleFinder *kfparticle, CbmKFParticleFinderQA *kfparticleQA)
Definition: CbmKresConversionKF.cxx:466
CbmKresConversionMain::fKresPhotons
CbmKresConversionPhotons * fKresPhotons
Definition: CbmKresConversionMain.h:82
CbmTrackMatchNew.h
CbmKresConversionMain::fKresManualmbiasPart2
CbmKresConversionManualmbias2 * fKresManualmbiasPart2
Definition: CbmKresConversionMain.h:77
CbmKresConversionGeneral::Exec
void Exec(int fEventNumGen)
Definition: CbmKresConversionGeneral.cxx:202
CbmKresConversionMain::DoKresGeneral
Int_t DoKresGeneral
Definition: CbmKresConversionMain.h:57
CbmKresConversionMain::OpeningAngleCut
Double_t OpeningAngleCut
Definition: CbmKresConversionMain.h:89
CbmKresConversionCorrectedPhotons
Definition: CbmKresConversionCorrectedPhotons.h:24
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmKresConversionManualmbias1::Exec
void Exec(int fEventNumMan, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionManualmbias1.cxx:666
CbmKresEta
Definition: CbmKresEta.h:16
CbmKresConversionManualmbias2::Init
void Init()
Definition: CbmKresConversionManualmbias2.cxx:586
CbmKresConversionManualmbias4
Definition: CbmKresConversionManualmbias4.h:17
CbmKresConversionMain::fKresKF
CbmKresConversionKF * fKresKF
Definition: CbmKresConversionMain.h:71
CbmKresConversionMain::fKFparticleFinderQA
CbmKFParticleFinderQA * fKFparticleFinderQA
Definition: CbmKresConversionMain.h:74
CbmKresConversionKF::Exec
void Exec(int fEventNumKF, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionKF.cxx:534
CbmKresConversionReconstruction::Finish
void Finish()
Definition: CbmKresConversionReconstruction.cxx:887
CbmKresEtaMCAnalysis
Definition: CbmKresEtaMCAnalysis.h:14
CbmMCTrack.h
CbmKresConversionMain::Exec
virtual void Exec(Option_t *option)
Definition: CbmKresConversionMain.cxx:219
CbmKresConversionMain::fKresGeneral
CbmKresConversionGeneral * fKresGeneral
Definition: CbmKresConversionMain.h:69
CbmMvdHit.h
CbmKresConversionCorrectedPhotons::Finish
void Finish()
Definition: CbmKresConversionCorrectedPhotons.cxx:2372
CbmKresConversionManualmbias2::Exec
void Exec(int fEventNumMan, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresConversionManualmbias2.cxx:666
CbmKresConversionMain::GammaInvMassCut
Double_t GammaInvMassCut
Definition: CbmKresConversionMain.h:90
CbmKresConversionManualmbias1::Init
void Init()
Definition: CbmKresConversionManualmbias1.cxx:586
CbmKresEtaMCAnalysis::Finish
void Finish()
Definition: CbmKresEtaMCAnalysis.cxx:1422
CbmKresConversionGeneral::Finish
void Finish()
Definition: CbmKresConversionGeneral.cxx:532
CbmKresConversionMain::DoKresEtaMCAnalysis
Int_t DoKresEtaMCAnalysis
Definition: CbmKresConversionMain.h:65
CbmKresConversionManual::Finish
void Finish()
Definition: CbmKresConversionManual.cxx:4084
CbmKresEta::Exec
void Exec(int fEventNumEta, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
Definition: CbmKresEta.cxx:571
CbmRichHit.h
CbmKresConversionManualmbias3::Init
void Init()
Definition: CbmKresConversionManualmbias3.cxx:586
CbmKresConversionKF::Finish
void Finish()
Definition: CbmKresConversionKF.cxx:1513
CbmKresConversionManualmbias3
Definition: CbmKresConversionManualmbias3.h:17
CbmKresConversionMain::Init
virtual InitStatus Init()
Definition: CbmKresConversionMain.cxx:93
CbmKresConversionManualmbias1::Finish
void Finish()
Definition: CbmKresConversionManualmbias1.cxx:2360
CbmKresConversionMain::CbmKresConversionMain
CbmKresConversionMain()
Definition: CbmKresConversionMain.cxx:36
CbmKresConversionManualmbias2::Finish
void Finish()
Definition: CbmKresConversionManualmbias2.cxx:2360
CbmKresConversionMain::InitHistograms
void InitHistograms()
Definition: CbmKresConversionMain.cxx:216
CbmKresConversionMain::~CbmKresConversionMain
virtual ~CbmKresConversionMain()
Definition: CbmKresConversionMain.cxx:89
CbmKresEta::Finish
void Finish()
Definition: CbmKresEta.cxx:2248
CbmStsHit.h
Data class for a reconstructed hit in the STS.
CbmKresConversionKF::Init
void Init()
Definition: CbmKresConversionKF.cxx:477