BmnRoot
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#include "CbmL1Def.h"
18#include "CbmL1Track.h"
19
21
22
23#include "TStopwatch.h"
24#include <iostream>
26 fPVFinder(),
27 fPrimVtx(),
28 fParticles()
29{
30}
31
35
36void CbmL1ParticlesFinder::FindPV(vector<CbmL1Track> &vRTracks)
37{
38 fPVFinder.Clear();
39 for( unsigned short iTr=0; iTr<vRTracks.size(); iTr++ ){
40 if( vRTracks[iTr].GetNOfHits() < 4 ) continue;
41 if( vRTracks[iTr].GetRefChi2()<0. || vRTracks[iTr].GetRefChi2()>3.5*3.5*vRTracks[iTr].GetRefNDF() ) continue;
42 if( !finite(vRTracks[iTr].GetTrack()[0]) || !finite(vRTracks[iTr].GetCovMatrix()[0])) continue;
43 fPVFinder.AddTrack(&vRTracks[iTr]);
44 }
45 fPVFinder.Fit( fPrimVtx );
46// std::cout << "!!!!!!!!!!!!!!!!!!!!!!! Tracks " << fPrimVtx.GetRefNTracks() << std::endl;
47}
48
49void CbmL1ParticlesFinder::FindParticles(vector<CbmL1Track> &vRTracks)
50{
51 TStopwatch timerSelect, timerAll, timerPV;
52
53 fParticles.clear();
54
55 timerAll.Start();
56 timerPV.Start();
57
58 FindPV(vRTracks);
59
60 timerPV.Stop();
61 timerSelect.Start();
62
63 vector<int> vTrackPDG(vRTracks.size(), 211);
64// CbmKFParticleInterface::FindParticles(vRTracks, fParticles, fPrimVtx, vTrackPDG);
65
66 timerSelect.Stop();
67 timerAll.Stop();
68
69 static int NEv=0;
70 NEv++;
71 static double timeSelectCPU=0., timeAllCPU=0., timePVCPU=0.;
72 static double timeSelectReal=0., timeAllReal=0., timePVReal=0.;
73
74 timePVCPU += timerPV.CpuTime();
75 timeSelectCPU += timerSelect.CpuTime();
76 timeAllCPU += timerAll.CpuTime();
77
78 timePVReal += timerPV.RealTime();
79 timeSelectReal += timerSelect.RealTime();
80 timeAllReal += timerAll.RealTime();
81
82 std::cout << "Particle Finder Times:"<<std::endl;
83 std::cout << " PVFinder: " <<" Real - "<< timePVReal/NEv << " CPU - "<< timePVCPU/NEv << std::endl;
84 std::cout << " Particle finding" <<" Real - "<< timeSelectReal/NEv << " CPU - "<< timeSelectCPU/NEv << std::endl;
85 std::cout << " Total " <<" Real - "<< timeAllReal/NEv << " CPU - "<< timeAllCPU/NEv << std::endl;
86}
void AddTrack(CbmKFTrackInterface *Track)
void Fit(CbmKFVertexInterface &vtx)
void FindParticles(vector< CbmL1Track > &vRTracks)