LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evdb_tool::SpacePoint3DDrawerStandard Class Reference
Inheritance diagram for evdb_tool::SpacePoint3DDrawerStandard:
evdb_tool::ISpacePoints3D

Public Member Functions

 SpacePoint3DDrawerStandard (const fhicl::ParameterSet &)
 
 ~SpacePoint3DDrawerStandard ()
 
void Draw (const std::vector< art::Ptr< recob::SpacePoint >> &, evdb::View3D *, int, int, float, const art::FindManyP< recob::Hit > *) const
 

Detailed Description

Definition at line 20 of file SpacePoint3DDrawerStandard_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 39 of file SpacePoint3DDrawerStandard_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::SpacePoint3DDrawerStandard::~SpacePoint3DDrawerStandard ( )

Definition at line 48 of file SpacePoint3DDrawerStandard_tool.cc.

49  {
50  return;
51  }

Member Function Documentation

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

Implements evdb_tool::ISpacePoints3D.

Definition at line 53 of file SpacePoint3DDrawerStandard_tool.cc.

References evdb::View3D::AddPolyMarker3D(), color(), DEFINE_ART_CLASS_TOOL, evd::RecoDrawingOptions::fColorSpacePointsByChisq, util::size(), and recob::SpacePoint::XYZ().

59  {
60  // Get services.
61 
63 
64  // Organize space points into separate collections according to the color
65  // we want them to be.
66  // If option If option fColorSpacePointsByChisq is false, this means
67  // having a single collection with color inherited from the prong
68  // (specified by the argument color).
69 
70  std::map<int, std::vector<const recob::SpacePoint*>> spmap; // Indexed by color.
71  int spcolor = color;
72 
73  for (auto& pspt : spts) {
74  //std::cout<<pspt<<std::endl;
75  //if(pspt == 0) throw cet::exception("RecoBaseDrawer:DrawSpacePoint3D") << "space point is null\n";
76 
77  // For rainbow effect, choose root colors in range [51,100].
78  // We are using 100=best (red), 51=worst (blue).
79 
80  // if (pspt->Chisq() > -100.) continue;
81 
82  spcolor = 12;
83 
84  if (pspt->Chisq() < -100.) spcolor = 16;
85 
86  if (recoOpt->fColorSpacePointsByChisq) {
87  spcolor = 100 - 2.5 * pspt->Chisq();
88 
89  if (spcolor < 51) spcolor = 51;
90  if (spcolor > 100) spcolor = 100;
91  }
92  else
93  spcolor = color;
94  //if (pspt->Chisq() < -1.) spcolor += 6;
95 
96  spmap[spcolor].push_back(&*pspt);
97  }
98 
99  // Loop over colors.
100  // Note that larger (=better) space points are plotted on
101  // top for optimal visibility.
102 
103  for (auto const& [spcolor, psps] : spmap) {
104 
105  // Make and fill a polymarker.
106 
107  TPolyMarker3D& pm = view->AddPolyMarker3D(psps.size(), spcolor, marker, size);
108 
109  for (size_t s = 0; s < psps.size(); ++s) {
110  const recob::SpacePoint& spt = *psps[s];
111 
112  const double* xyz = spt.XYZ();
113  pm.SetPoint(s, xyz[0], xyz[1], xyz[2]);
114  }
115  }
116 
117  return;
118  }
int fColorSpacePointsByChisq
Generate space point colors by chisquare?
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
std::size_t color(std::string const &procname)
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Definition: View3D.cxx:75

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