All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
evdb_tool::SpacePoint3DDrawerChiSquare Class Reference
Inheritance diagram for evdb_tool::SpacePoint3DDrawerChiSquare:
evdb_tool::ISpacePoints3D

Public Member Functions

 SpacePoint3DDrawerChiSquare (const fhicl::ParameterSet &)
 
 ~SpacePoint3DDrawerChiSquare ()
 
void Draw (const std::vector< art::Ptr< recob::SpacePoint >> &, evdb::View3D *, int, int, float, const art::FindManyP< recob::Hit > *) const
 
- Public Member Functions inherited from evdb_tool::ISpacePoints3D
virtual ~ISpacePoints3D () noexcept=default
 

Detailed Description

Definition at line 21 of file SpacePoint3DDrawerChiSquare_tool.cc.

Constructor & Destructor Documentation

evdb_tool::SpacePoint3DDrawerChiSquare::SpacePoint3DDrawerChiSquare ( const fhicl::ParameterSet &  pset)
explicit

Definition at line 41 of file SpacePoint3DDrawerChiSquare_tool.cc.

42 {
43 // fNumPoints = pset.get< int>("NumPoints", 1000);
44 // fFloatBaseline = pset.get<bool>("FloatBaseline", false);
45  // For now only draw cryostat=0.
46 
47  return;
48 }
evdb_tool::SpacePoint3DDrawerChiSquare::~SpacePoint3DDrawerChiSquare ( )

Definition at line 50 of file SpacePoint3DDrawerChiSquare_tool.cc.

51 {
52  return;
53 }

Member Function Documentation

void evdb_tool::SpacePoint3DDrawerChiSquare::Draw ( const std::vector< art::Ptr< recob::SpacePoint >> &  hitsVec,
evdb::View3D *  view,
int  color,
int  marker,
float  size,
const art::FindManyP< recob::Hit > *  hitAssns 
) const
virtual

Implements evdb_tool::ISpacePoints3D.

Definition at line 55 of file SpacePoint3DDrawerChiSquare_tool.cc.

61 {
62  // Get services.
63  art::ServiceHandle<evd::ColorDrawingOptions const> cst;
64 
65  using HitPosition = std::array<double,6>;
66  std::map<int,std::vector<HitPosition>> colorToHitMap;
67 
68  float minHitChiSquare(0.);
69  float maxHitChiSquare(2.);
70  float hitChiSqScale((cst->fRecoQHigh[geo::kCollection] - cst->fRecoQLow[geo::kCollection]) / (maxHitChiSquare - minHitChiSquare));
71 
72  for(const auto& spacePoint : hitsVec)
73  {
74  const double* pos = spacePoint->XYZ();
75  const double* err = spacePoint->ErrXYZ();
76 
77  int chargeColorIdx(0);
78  float spacePointChiSq(spacePoint->Chisq());
79 
80  float hitChiSq = std::max(minHitChiSquare, std::min(maxHitChiSquare, spacePointChiSq));
81 
82  float chgFactor = cst->fRecoQHigh[geo::kCollection] - hitChiSqScale * hitChiSq;
83 
84  chargeColorIdx = cst->CalQ(geo::kCollection).GetColor(chgFactor);
85 
86  colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2],err[3],err[3],err[5]}});
87  }
88 
89  for(auto& hitPair : colorToHitMap)
90  {
91  TPolyMarker3D& pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.17);
92  for (const auto& hit : hitPair.second) pm.SetNextPoint(hit[0],hit[1],hit[2]);
93  }
94 
95  return;
96 }
EResult err(const char *call)
process_name hit
Definition: cheaterreco.fcl:51
Signal from collection planes.
Definition: geo_types.h:146

The documentation for this class was generated from the following file: