BmnRoot
Loading...
Searching...
No Matches
BmnTwoParticleDecay.h
Go to the documentation of this file.
1// @(#)bmnroot/physics/particles:$Id$
2// Author: Pavel Batyuk <pavel.batyuk@jinr.ru> 2017-12-27
3
5// //
6// BmnTwoParticleDecay //
7// //
8// A supplementary class for two-body decay reconstruction //
9// //
11
12#ifndef BMNTWOPARTICLEDECAY_H
13#define BMNTWOPARTICLEDECAY_H 1
14
15#include <iostream>
16#include <vector>
17#include "FairTask.h"
18#include <TDatabasePDG.h>
19#include <TGraph.h>
20#include <TH1I.h>
21#include <TH1F.h>
22#include <TH2F.h>
23#include <TMath.h>
24#include <TString.h>
25#include <TClonesArray.h>
26#include <TLorentzVector.h>
27#include <TVector2.h>
28#include <TVector3.h>
29#include <TF1.h>
30#include <TFitResult.h>
31#include "BmnGlobalTrack.h"
32#include "BmnFieldMap.h"
33#include "BmnNewFieldMap.h"
34#include "CbmMCTrack.h"
35#include "CbmStsPoint.h"
36#include "BmnSiliconPoint.h"
37#include "BmnVertex.h"
38#include "CbmVertex.h"
39#include "BmnGemStripStationSet.h"
40#include "BmnGemStripStationSet_RunWinter2016.h"
41#include "BmnGemStripStationSet_RunSpring2017.h"
42#include "BmnGemStripHit.h"
43#include "BmnKalmanFilter.h"
44#include <BmnParticlePair.h>
45#include <UniDetectorParameter.h>
46#include <UniRun.h>
47#include "BmnTrackMatch.h"
48#include <DstEventHeader.h>
49#include <BmnEventHeader.h>
50
51using namespace std;
52using namespace TMath;
53
54// Extenion of "standard" dst event header by info to be used in dec. particle anal ...
55
57{
58 private:
60 TString fHeaderName;
61
62 Int_t fRecoTracks; // track multiplicity
63 Int_t fBD; // number of BD-counts per event
64 Int_t fFD; // number of FD-counts per event
65
66 TVector3 fVp; // reconstructed prim. vertex
67
68 public:
70 fHeaderName = "DstEventHeaderExtended.";
71
72 fBD = 0;
73 fFD = 0;
74 fRecoTracks = 0;
75
76 fVp.SetXYZ(-1., -1., -1.);
77 }
78
79 DstEventHeaderExtended(UInt_t run_id, UInt_t event_id) {
80 fBD = 0;
81 fFD = 0;
82 fRecoTracks = 0;
83
84 fVp.SetXYZ(-1., -1., -1.);
85 }
86
87 // Getters ...
88
89 Int_t bd() {
90 return fBD;
91 }
92
93 Int_t fd() {
94 return fFD;
95 }
96
97 Int_t nTracks() {
98 return fRecoTracks;
99 }
100
101 TVector3 Vp() {
102 return fVp;
103 }
104
105 // Setters ...
106
107 void SetBd(Int_t n) {
108 fBD = n;
109 }
110
111 void SetFd(Int_t n) {
112 fFD = n;
113 }
114
115 void SetVp(Double_t x, Double_t y, Double_t z) {
116 fVp.SetXYZ(x, y, z);
117 }
118
119 void SetNTracks(Int_t n) {
120 fRecoTracks = n;
121 }
122
124 ;
125 }
126
128};
129
130class BmnTwoParticleDecay : public FairTask
131{
132 private:
133 Int_t fRunPeriod; // run period
134 Int_t fRunId; // runID
135 UInt_t fEventCounter;
136 TDatabasePDG* fPDG;
137
138 TClonesArray* fGemPoints;
139 TClonesArray* fSilPoints;
140 TClonesArray* fSilHits;
141
142 TClonesArray* fGlobalTracks;
143 TClonesArray* fGemTracks;
144 TClonesArray* fSiliconTracks;
145
146 TClonesArray* fMCTracks;
147 TClonesArray* fGlobalMatches;
148 TClonesArray* fVertex;
149
150 TVector3 fMcVertex;
151 BmnVertex* fEventVertex;
152
153 TString fBranchGemPoints;
154 TString fBranchSilPoints;
155 TString fBranchGlobalTracks;
156 TString fBranchMCTracks;
157 TString fBranchGlobalMatch;
158 TString fBranchVertex;
159
160 BmnGemStripStationSet* fDetector; // Detector geometry
162
163 FairField* fField;
164 BmnFieldMap* fMagField;
165 BmnKalmanFilter* fKalman;
166
167 TClonesArray* fParticlePair;
168 TClonesArray* fParticlePair_MC;
169 TClonesArray* fParticlePair_RECO;
170
171 Int_t fPDG1, fPDG2, fPDGDecay, fPdgParticle1, fPdgParticle2;
172
173 vector <TString> fAnalType;
174 vector <double> fWeightsModel;
175
176 Bool_t fIsCbmDst;
177 TString fGeomFile;
178 TString fDigiDir;
179 TString fEoSNode;
180
181 // Dst event header ...
182 DstEventHeader* fDstHeader;
183
184 // Adding PhysInfo ...
185 DstEventHeaderExtended* fPhysInfo;
186
187 map <UInt_t, pair <Int_t, Int_t>> fTrigCountMap; // evId --> (bd, fd)
188
189 public:
194
195 virtual void Exec(Option_t * option);
196 virtual InitStatus Init();
197 virtual void Finish();
198
199 void SetParticlePDG(Int_t pdg1, Int_t pdg2) {
200 fPDG1 = pdg1;
201 fPDG2 = pdg2;
202 }
203
204 void SetGeometryFile(TString file) {
205 fGeomFile = file;
206 }
207
208 void SetDigiDir(TString dir) {
209 fDigiDir = dir;
210 }
211
212 void SetEoSNode(TString node) {
213 fEoSNode = node;
214 }
215
216 private:
217 void Analysis();
218 BmnStatus FindFirstPointOnMCTrack(Int_t, BmnGlobalTrack*, Int_t);
219 FairTrackParam KalmanTrackPropagation(BmnGlobalTrack* track, Int_t, Double_t);
220 vector <Double_t> GeomTopology(FairTrackParam, FairTrackParam, FairTrackParam, FairTrackParam);
221 Bool_t CheckTrack(BmnGlobalTrack*, Int_t, Double_t&, Double_t&);
222
223 inline Int_t recoToMcIdx(Int_t iTrack) {
224 BmnTrackMatch* globTrackMatch = (BmnTrackMatch*) (fGlobalMatches->UncheckedAt(iTrack));
225 return globTrackMatch->GetMatchedLink().GetIndex();
226 }
227
228 inline Int_t CheckSign(Double_t val) {
229 return (val > 0) ? 1 : ((val < 0) ? -1 : 0);
230 }
231
232 TVector2 ArmenterosPodol(FairTrackParam, FairTrackParam);
233 Double_t FindV0ByVirtualPlanes(BmnGlobalTrack*, BmnGlobalTrack*, Double_t, Double_t range = 50.);
234
235 ClassDef(BmnTwoParticleDecay, 0)
236};
237
238#endif
BmnStatus
Definition BmnEnums.h:24
const BmnLink & GetMatchedLink() const
Definition BmnMatch.h:39
void SetGeometryFile(TString file)
virtual ~BmnTwoParticleDecay()
void SetDigiDir(TString dir)
void SetEoSNode(TString node)
BmnTwoParticleDecay(BmnGemStripConfiguration::GEM_CONFIG config, Int_t runId=4649)
void SetParticlePDG(Int_t pdg1, Int_t pdg2)
virtual void Exec(Option_t *option)
virtual void Finish()
virtual InitStatus Init()
void SetVp(Double_t x, Double_t y, Double_t z)
DstEventHeaderExtended(UInt_t run_id, UInt_t event_id)
ClassDef(DstEventHeader, 3)
STL namespace.