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 19 of file SpacePoint3DDrawerChiSquare_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 39 of file SpacePoint3DDrawerChiSquare_tool.cc.

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 }
evdb_tool::SpacePoint3DDrawerChiSquare::~SpacePoint3DDrawerChiSquare ( )

Definition at line 48 of file SpacePoint3DDrawerChiSquare_tool.cc.

49 {
50  return;
51 }

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 53 of file SpacePoint3DDrawerChiSquare_tool.cc.

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]) / (maxHitChiSquare - minHitChiSquare));
69 
70  for(const auto& spacePoint : hitsVec)
71  {
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(HitPosition()={{pos[0],pos[1],pos[2],err[3],err[3],err[5]}});
85  }
86 
87  for(auto& hitPair : colorToHitMap)
88  {
89  TPolyMarker3D& pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.17);
90  for (const auto& hit : hitPair.second) pm.SetNextPoint(hit[0],hit[1],hit[2]);
91  }
92 
93  return;
94 }
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
const evdb::ColorScale & CalQ(geo::SigType_t st) const
static int max(int a, int b)
void err(const char *fmt,...)
Definition: message.cpp:226
Detector simulation of raw signals on wires.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Signal from collection planes.
Definition: geo_types.h:146

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