LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SpacePoint3DDrawerChiSquare_tool.cc
Go to the documentation of this file.
1 
9 
11 
15 
16 #include "TPolyMarker3D.h"
17 
18 namespace evdb_tool {
19 
21  public:
23 
25 
26  void Draw(const std::vector<art::Ptr<recob::SpacePoint>>&, // Space points
27  evdb::View3D*, // 3D display
28  int, // Color
29  int, // Marker
30  float, // Size) const override;
31  const art::FindManyP<recob::Hit>* // pointer to associated hits
32  ) const;
33 
34  private:
35  };
36 
37  //----------------------------------------------------------------------
38  // Constructor.
40  {
41  // fNumPoints = pset.get< int>("NumPoints", 1000);
42  // fFloatBaseline = pset.get<bool>("FloatBaseline", false);
43  // For now only draw cryostat=0.
44 
45  return;
46  }
47 
49  {
50  return;
51  }
52 
54  evdb::View3D* view,
55  int color,
56  int marker,
57  float size,
58  const art::FindManyP<recob::Hit>* hitAssns) const
59  {
60  // Get services.
62 
63  using HitPosition = std::array<double, 6>;
64  std::map<int, std::vector<HitPosition>> colorToHitMap;
65 
66  float minHitChiSquare(0.);
67  float maxHitChiSquare(2.);
68  float hitChiSqScale((cst->fRecoQHigh[geo::kCollection] - cst->fRecoQLow[geo::kCollection]) /
69  (maxHitChiSquare - minHitChiSquare));
70 
71  for (const auto& spacePoint : hitsVec) {
72  const double* pos = spacePoint->XYZ();
73  const double* err = spacePoint->ErrXYZ();
74 
75  int chargeColorIdx(0);
76  float spacePointChiSq(spacePoint->Chisq());
77 
78  float hitChiSq = std::max(minHitChiSquare, std::min(maxHitChiSquare, spacePointChiSq));
79 
80  float chgFactor = cst->fRecoQHigh[geo::kCollection] - hitChiSqScale * hitChiSq;
81 
82  chargeColorIdx = cst->CalQ(geo::kCollection).GetColor(chgFactor);
83 
84  colorToHitMap[chargeColorIdx].push_back(
85  HitPosition() = {{pos[0], pos[1], pos[2], err[3], err[3], err[5]}});
86  }
87 
88  for (auto& hitPair : colorToHitMap) {
89  TPolyMarker3D& pm =
90  view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.17);
91  for (const auto& hit : hitPair.second)
92  pm.SetNextPoint(hit[0], hit[1], hit[2]);
93  }
94 
95  return;
96  }
97 
99 }
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
int GetColor(double x) const
Definition: ColorScale.cxx:126
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
The color scales used by the event display.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
const evdb::ColorScale & CalQ(geo::SigType_t st) const
Detector simulation of raw signals on wires.
std::size_t color(std::string const &procname)
A collection of 3D drawable objects.
void Draw(const std::vector< art::Ptr< recob::SpacePoint >> &, evdb::View3D *, int, int, float, const art::FindManyP< recob::Hit > *) const
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Definition: View3D.cxx:75
Signal from collection planes.
Definition: geo_types.h:152