20 #include "TVirtualPad.h" 31 void Plot(
const std::vector<recob::SpacePoint>& pts,
const std::string& suffix)
const;
33 void Plot3D(
const std::vector<recob::SpacePoint>& pts,
const std::string& suffix)
const;
55 pset.
get<
std::
string>("SpacePointInstanceLabel")))
67 const std::string& suffix)
const 78 const double* xyz =
pt.XYZ();
79 const double x = xyz[0];
80 const double y = xyz[1];
81 const double z = xyz[2];
82 gZX.SetPoint(gZX.GetN(),
z,
x);
83 gYX.SetPoint(gYX.GetN(),
y,
x);
84 gZY.SetPoint(gZY.GetN(),
z,
y);
87 if (gZX.GetN() == 0) gZX.SetPoint(0, 0, 0);
88 if (gYX.GetN() == 0) gYX.SetPoint(0, 0, 0);
89 if (gZY.GetN() == 0) gZY.SetPoint(0, 0, 0);
92 gPad->Print((
"plots/evd" + suffix +
".png").c_str());
95 gPad->Print((
"plots/evd_ortho" + suffix +
".png").c_str());
97 gPad->Print((
"plots/evd_zy" + suffix +
".png").c_str());
105 std::vector<recob::SpacePoint> pts_true;
107 const double err[6] = {
112 for (
unsigned int i = 0; i <
hits->size(); ++i) {
115 pts_true.emplace_back(&xyz[0], err, 0);
126 const std::string& suffix)
const 129 for (
int phase = 0; phase < 4; ++phase) {
131 for (
int iang = 0; iang < Nang; ++iang) {
132 const double ang = M_PI / 2 * iang / double(Nang);
137 const double* xyz = p.XYZ();
141 x = cos(ang) * xyz[1] + sin(ang) * xyz[2];
146 y = cos(ang) * xyz[0] + sin(ang) * xyz[1];
149 x = cos(ang) * xyz[2] - sin(ang) * xyz[0];
153 x = -cos(ang) * xyz[0] + sin(ang) * xyz[1];
154 y = cos(ang) * xyz[1] + sin(ang) * xyz[0];
158 const double phi = 0;
159 g.SetPoint(g.GetN(), cos(phi) *
x + sin(phi) *
y, cos(phi) * y - sin(phi) *
x);
163 TString::Format((
"anim/evd3d" + suffix +
"_%03d.png").c_str(), frame++).Data();
164 g.SetTitle(fname.c_str());
165 if (g.GetN()) g.Draw(
"ap");
166 gPad->Print(fname.c_str());
177 const std::string suffix = TString::Format(
"%s_%d",
fSuffix.c_str(), evt.
event()).Data();
189 auto const clockData =
191 const std::vector<recob::SpacePoint> pts =
TrueSpacePoints(clockData, hits);
193 const std::string suffix = TString::Format(
"%s_true_%d",
fSuffix.c_str(), evt.
event()).Data();
std::vector< recob::SpacePoint > TrueSpacePoints(detinfo::DetectorClocksData const &clockData, art::Handle< std::vector< recob::Hit >> hits) const
Declaration of signal hit object.
PlotSpacePoints(const fhicl::ParameterSet &pset)
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
art::InputTag fSpacePointTag
EventNumber_t event() const
void Plot3D(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Contains all timing reference information for the detector.
void Plot(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const
void analyze(const art::Event &evt) override