BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmL1ParticlesFinder.cxx
Go to the documentation of this file.
1/*
2 *=====================================================
3 *
4 * CBM Level 1 Reconstruction
5 *
6 * Authors: M.Zyzak
7 *
8 * e-mail :
9 *
10 *=====================================================
11 *
12 * Finds Particles: Lambdas, K0
13 *
14 */
15
17
19#include "CbmL1Def.h"
20#include "CbmL1Track.h"
21#include "TStopwatch.h"
22
23#include <iostream>
29
31
32void CbmL1ParticlesFinder::FindPV(vector<CbmL1Track>& vRTracks)
33{
34 fPVFinder.Clear();
35 for (unsigned short iTr = 0; iTr < vRTracks.size(); iTr++) {
36 if (vRTracks[iTr].GetNOfHits() < 4)
37 continue;
38 if (vRTracks[iTr].GetRefChi2() < 0. || vRTracks[iTr].GetRefChi2() > 3.5 * 3.5 * vRTracks[iTr].GetRefNDF())
39 continue;
40 if (!finite(vRTracks[iTr].GetTrack()[0]) || !finite(vRTracks[iTr].GetCovMatrix()[0]))
41 continue;
42 fPVFinder.AddTrack(&vRTracks[iTr]);
43 }
45 // std::cout << "!!!!!!!!!!!!!!!!!!!!!!! Tracks " << fPrimVtx.GetRefNTracks() << std::endl;
46}
47
48void CbmL1ParticlesFinder::FindParticles(vector<CbmL1Track>& vRTracks)
49{
50 TStopwatch timerSelect, timerAll, timerPV;
51
52 fParticles.clear();
53
54 timerAll.Start();
55 timerPV.Start();
56
57 FindPV(vRTracks);
58
59 timerPV.Stop();
60 timerSelect.Start();
61
62 vector<int> vTrackPDG(vRTracks.size(), 211);
63 // CbmKFParticleInterface::FindParticles(vRTracks, fParticles, fPrimVtx, vTrackPDG);
64
65 timerSelect.Stop();
66 timerAll.Stop();
67
68 static int NEv = 0;
69 NEv++;
70 static double timeSelectCPU = 0., timeAllCPU = 0., timePVCPU = 0.;
71 static double timeSelectReal = 0., timeAllReal = 0., timePVReal = 0.;
72
73 timePVCPU += timerPV.CpuTime();
74 timeSelectCPU += timerSelect.CpuTime();
75 timeAllCPU += timerAll.CpuTime();
76
77 timePVReal += timerPV.RealTime();
78 timeSelectReal += timerSelect.RealTime();
79 timeAllReal += timerAll.RealTime();
80
81 std::cout << "Particle Finder Times:" << std::endl;
82 std::cout << " PVFinder: " << " Real - " << timePVReal / NEv << " CPU - " << timePVCPU / NEv << std::endl;
83 std::cout << " Particle finding" << " Real - " << timeSelectReal / NEv << " CPU - " << timeSelectCPU / NEv
84 << std::endl;
85 std::cout << " Total " << " Real - " << timeAllReal / NEv << " CPU - " << timeAllCPU / NEv
86 << std::endl;
87}
CbmKFPrimaryVertexFinder fPVFinder
vector< CbmKFParticle > fParticles
void FindPV(vector< CbmL1Track > &vRTracks)
void FindParticles(vector< CbmL1Track > &vRTracks)
Double_t RealTime()
void Start(Bool_t reset=kTRUE)
Double_t CpuTime()
void Stop()