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")))
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());
101 std::vector<recob::SpacePoint>
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);
130 for (
int phase = 0; phase < 4; ++phase) {
132 for (
int iang = 0; iang < Nang; ++iang) {
133 const double ang =
M_PI / 2 * iang / double(Nang);
138 const double* xyz =
p.XYZ();
142 x = cos(ang) * xyz[1] + sin(ang) * xyz[2];
147 y = cos(ang) * xyz[0] + sin(ang) * xyz[1];
150 x = cos(ang) * xyz[2] - sin(ang) * xyz[0];
154 x = -cos(ang) * xyz[0] + sin(ang) * xyz[1];
155 y = cos(ang) * xyz[1] + sin(ang) * xyz[0];
159 const double phi = 0;
160 g.SetPoint(g.GetN(), cos(phi) *
x + sin(phi) *
y, cos(phi) * y - sin(phi) *
x);
164 TString::Format((
"anim/evd3d" + suffix +
"_%03d.png").c_str(), frame++).Data();
165 g.SetTitle(fname.c_str());
166 if (g.GetN()) g.Draw(
"ap");
167 gPad->Print(fname.c_str());
191 auto const clockData =
193 const std::vector<recob::SpacePoint> pts =
TrueSpacePoints(clockData, hits);
std::vector< recob::SpacePoint > TrueSpacePoints(detinfo::DetectorClocksData const &clockData, art::Handle< std::vector< recob::Hit >> hits) const
EventNumber_t event() const
static constexpr double g
PlotSpacePoints(const fhicl::ParameterSet &pset)
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
art::InputTag fSpacePointTag
void err(const char *fmt,...)
void Plot3D(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const
Declaration of signal hit object.
Contains all timing reference information for the detector.
auto const & get(AssnsNode< L, R, D > const &r)
void Plot(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const
void analyze(const art::Event &evt) override