Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxTrackStateRemoval.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxTrackStateRemoval.cc
1 
3 
6 #include <phool/PHDataNode.h>
7 #include <phool/PHNode.h>
8 #include <phool/PHNodeIterator.h>
9 #include <phool/PHObject.h>
10 #include <phool/PHTimer.h>
11 #include <phool/getClass.h>
12 #include <phool/phool.h>
13 
16 
20 
21 //____________________________________________________________________________..
23  : SubsysReco(name)
24 {
25 }
26 
27 //____________________________________________________________________________..
29 {
30 }
31 
32 //____________________________________________________________________________..
34 {
36 }
37 
38 //____________________________________________________________________________..
40 {
42 }
43 
44 //____________________________________________________________________________..
46 {
47  auto trackmap = findNode::getClass<SvtxTrackMap>(topNode, "SvtxTrackMap");
48  if (!trackmap)
49  {
50  std::cout << PHWHERE << "No track map on node tree, can't continue."
51  << std::endl;
53  }
54 
55  auto tpotgeom = findNode::getClass<PHG4CylinderGeomContainer>(topNode, "CYLINDERGEOM_MICROMEGAS_FULL");
56  if (!tpotgeom)
57  {
58  std::cout << PHWHERE << "No micromegas geometry, can't continue."
59  << std::endl;
61  }
62 
64  auto layergeom = tpotgeom->GetLayerGeom(56);
65 
66  const float lastradius = layergeom->get_radius();
67  const float lastthickness = layergeom->get_thickness();
68  const float lasttrackingradius = lastradius + lastthickness / 2.;
69 
70  for (auto& [key, track] : *trackmap)
71  {
72  for (auto iter = track->begin_states(); iter != track->end_states(); ++iter)
73  {
75  if (iter == track->begin_states())
76  {
77  continue;
78  }
79 
80  float pathlength = iter->second->get_pathlength();
81  if (pathlength < lasttrackingradius)
82  {
83  track->erase_state(pathlength);
84  }
85  }
86 
87  if (Verbosity() > 1)
88  {
89  track->identify();
90  }
91  }
92 
94 }
95 
96 //____________________________________________________________________________..
98 {
100 }