Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
KFParticleTopoReconstructor.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file KFParticleTopoReconstructor.h
1
/*
2
* This file is part of KFParticle package
3
* Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4
* 2007-2019 Goethe University of Frankfurt
5
* 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6
* 2007-2019 Maksym Zyzak
7
*
8
* KFParticle is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* KFParticle is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef KFParticleTopoReconstructor_H
23
#define KFParticleTopoReconstructor_H
24
25
#include "
KFParticlePVReconstructor.h
"
26
#include "
KFParticleFinder.h
"
27
28
#include <vector>
29
#include <string>
30
31
#include "
KFPTrackVector.h
"
32
#include "
KFParticleSIMD.h
"
33
34
#ifdef USE_TIMERS
35
#ifndef HLTCA_STANDALONE
36
#include "TStopwatch.h"
37
typedef
TStopwatch
Stopwatch
;
38
#else
39
#include "
Stopwatch.h
"
40
#endif
41
#endif
42
43
#ifdef KFPWITHTRACKER
44
class
AliHLTTPCCAGBTracker;
45
#endif
46
47
#ifdef WITHSCIF
48
#include <scif.h>
49
#endif
50
64
class
KFParticleTopoReconstructor
{
65
public
:
66
KFParticleTopoReconstructor
():
fKFParticlePVReconstructor
(0),
fKFParticleFinder
(0),
fTracks
(0),
fParticles
(0),
fPV
(0),
fNThreads
(1)
67
#ifdef USE_TIMERS
68
,fTime(0.),timer()
69
#endif
70
{
72
#ifdef USE_TIMERS
73
for
(
int
i
= 0;
i
< fNTimers;
i
++ ) fStatTime[
i
] = 0;
74
#endif
75
fKFParticlePVReconstructor
=
new
KFParticlePVReconstructor
;
76
77
fKFParticleFinder
=
new
KFParticleFinder
;
78
fKFParticleFinder
->
SetNThreads
(
fNThreads
);
79
}
80
~KFParticleTopoReconstructor
();
81
82
#ifdef KFPWITHTRACKER
83
91
void
Init
(AliHLTTPCCAGBTracker* tracker, std::vector<int>*
pdg
=0);
// init array of particles
92
#endif
93
104
void
Init
(std::vector<KFParticle> &
particles
, std::vector<int>*
pdg
=0, std::vector<int>* nPixelHits=0);
114
void
Init
(
const
KFPTrackVector
*
particles
,
const
std::vector<KFParticle>& pv);
121
void
Init
(
KFPTrackVector
&
tracks
,
KFPTrackVector
&tracksAtLastPoint);
122
124
void
SetEmcClusters
(
KFPEmcCluster
*
clusters
) {
fKFParticleFinder
->
SetEmcClusters
(clusters); }
125
void
SetMixedEventAnalysis
() {
fKFParticleFinder
->
SetMixedEventAnalysis
(); }
126
127
void
DeInit
() {
fTracks
= NULL; }
128
129
void
Clear
() {
fParticles
.clear();
fPV
.clear();
fKFParticlePVReconstructor
->
CleanPV
(); }
130
131
void
ReconstructPrimVertex
(
bool
isHeavySystem = 1);
// find primary vertex
132
void
SortTracks
();
//sort tracks according to the pdg hypothesis and pv index
133
void
ReconstructParticles
();
//find short-lived particles
134
void
SelectParticleCandidates
();
//clean particle candidates: track can belong to only one particle
135
#ifdef WITHSCIF
136
void
SendDataToXeonPhi(
int
iHLT, scif_epd_t& endpoint,
void
*
buffer
, off_t& offsetServer, off_t& offsetSender,
float
Bz
);
137
#endif
138
int
NPrimaryVertices
()
const
{
return
fKFParticlePVReconstructor
->
NPrimaryVertices
(); }
139
KFParticle
&
GetPrimVertex
(
int
iPV=0)
const
{
return
fKFParticlePVReconstructor
->
GetPrimVertex
(iPV); }
140
KFVertex
&
GetPrimKFVertex
(
int
iPV=0)
const
{
return
fKFParticlePVReconstructor
->
GetPrimKFVertex
(iPV); }
141
142
std::vector<int>&
GetPVTrackIndexArray
(
int
iPV=0)
const
{
return
fKFParticlePVReconstructor
->
GetPVTrackIndexArray
(iPV); }
143
144
std::vector<KFParticle>
const
&
GetParticles
()
const
{
return
fParticles
; }
145
146
void
RemoveParticle
(
const
int
iParticle) {
if
(iParticle>=0 && iParticle<
int
(
fParticles
.size()))
fParticles
[iParticle].SetPDG(-1); }
147
const
KFPTrackVector
*
GetTracks
()
const
{
return
fTracks
; }
148
const
kfvector_float
*
GetChiPrim
()
const
{
return
fChiToPrimVtx
; }
149
150
KFParticleFinder
*
GetKFParticleFinder
() {
return
fKFParticleFinder
; }
151
const
KFParticleFinder
*
GetKFParticleFinder
()
const
{
return
fKFParticleFinder
; }
152
153
void
CleanPV
() {
155
fKFParticlePVReconstructor
->
CleanPV
();
156
}
157
void
AddPV
(
const
KFVertex
&pv,
const
std::vector<int> &
tracks
) {
163
fKFParticlePVReconstructor
->
AddPV
(pv,tracks);
164
KFParticle
pvPart=pv;
165
fPV
.push_back(pvPart);
166
fKFParticleFinder
->
SetNPV
(
fPV
.size());
167
}
168
void
AddPV
(
const
KFVertex
&pv) {
172
fKFParticlePVReconstructor
->
AddPV
(pv);
173
KFParticle
pvPart=pv;
174
fPV
.push_back(pvPart);
175
fKFParticleFinder
->
SetNPV
(
fPV
.size());
176
}
177
void
FillPVIndices
()
178
{
181
if
(
fTracks
)
182
for
(
int
iPV=0; iPV<
NPrimaryVertices
(); iPV++)
183
for
(
unsigned
int
iPVTrack=0; iPVTrack<
GetPVTrackIndexArray
(iPV).size(); iPVTrack++)
184
fTracks
[0].
SetPVIndex
(iPV,
GetPVTrackIndexArray
(iPV)[iPVTrack]);
185
}
187
void
AddParticle
(
const
KFParticle
&
particle
) {
fParticles
.push_back(particle); }
189
void
AddCandidate
(
const
KFParticle
& candidate,
int
iPV = -1) {
fKFParticleFinder
->
AddCandidate
(candidate, iPV); }
190
191
void
SetBeamLine
(
KFParticle
&
p
) {
fKFParticlePVReconstructor
->
SetBeamLine
(p); }
192
#ifdef HomogeneousField
193
void
SetField(
double
b
);
194
#endif
195
196
//speed measurements
197
#ifdef USE_TIMERS
198
void
SetTime(
double
d) { fTime = d; }
199
double
Time()
const
{
return
fTime; }
200
206
double
StatTime(
int
iTimer )
const
{
return
fStatTime[iTimer]; }
207
int
NTimers()
const
{
return
fNTimers; }
208
#endif
209
210
void
SaveInputParticles
(
const
std::string
prefix
=
"KFPData"
,
bool
onlySecondary = 0);
211
void
SetNThreads
(
short
int
n
) {
fNThreads
=
n
; }
212
213
void
SetChi2PrimaryCut
(
float
chi) {
215
fKFParticlePVReconstructor
->
SetChi2PrimaryCut
(chi);
216
fKFParticleFinder
->
SetChiPrimaryCut2D
(chi);
217
}
218
219
void
GetListOfDaughterTracks
(
const
KFParticle
&
particle
, std::vector<int>& daughters);
220
bool
ParticleHasRepeatingDaughters
(
const
KFParticle
&
particle
);
221
222
const
KFParticleTopoReconstructor
&
operator=
(
const
KFParticleTopoReconstructor
&
a
)
223
{
225
fKFParticlePVReconstructor
= 0;
226
fKFParticleFinder
= 0;
227
fTracks
= 0;
228
229
fNThreads
= a.
fNThreads
;
230
231
return
*
this
;
232
}
233
235
KFParticleTopoReconstructor
(
const
KFParticleTopoReconstructor
&
a
):
fKFParticlePVReconstructor
(0),
fKFParticleFinder
(0),
fTracks
(0),
fParticles
(),
fPV
(),
fNThreads
(a.
fNThreads
)
236
#ifdef USE_TIMERS
237
,fTime(0.),timer()
238
#endif
239
{
240
}
241
243
void
CopyCuts
(
const
KFParticleTopoReconstructor
* topo) {
fKFParticleFinder
->
CopyCuts
(topo->
fKFParticleFinder
); }
244
private
:
245
246
void
GetChiToPrimVertex
(
KFParticleSIMD
* pv,
const
int
nPV);
247
void
TransportPVTracksToPrimVertex
();
248
249
KFParticlePVReconstructor
*
fKFParticlePVReconstructor
;
250
KFParticleFinder
*
fKFParticleFinder
;
251
264
KFPTrackVector
*
fTracks
;
265
kfvector_float
fChiToPrimVtx
[2];
266
std::vector<KFParticle>
fParticles
;
267
std::vector<KFParticleSIMD, KFPSimdAllocator<KFParticleSIMD> >
fPV
;
268
269
short
int
fNThreads
;
270
271
//speed measurements
272
#ifdef USE_TIMERS
273
double
fTime;
274
static
const
int
fNTimers = 4;
275
277
double
fStatTime[fNTimers];
278
Stopwatch
timer;
279
#endif // USE_TIMERS
280
281
}
__attribute__
((aligned(
sizeof
(float_v))));
// class KFParticleTopoReconstructor
282
283
284
285
#endif // KFParticleTopoReconstructor_H
286
KFParticle
blob
master
KFParticle
KFParticleTopoReconstructor.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:26
using
1.8.2 with
sPHENIX GitHub integration