34 void Plot(
const std::vector<recob::SpacePoint>& pts,
35 const std::string& suffix)
const;
37 void Plot3D(
const std::vector<recob::SpacePoint>& pts,
38 const std::string& suffix)
const;
59 pset.get<
std::
string>("SpacePointInstanceLabel"))),
62 fPlots(pset.get<
bool>("Plots")),
71 const std::string& suffix)
const 82 const double* xyz =
pt.XYZ();
83 const double x = xyz[0];
84 const double y = xyz[1];
85 const double z = xyz[2];
86 gZX.SetPoint(gZX.GetN(),
z,
x);
87 gYX.SetPoint(gYX.GetN(),
y,
x);
88 gZY.SetPoint(gZY.GetN(),
z,
y);
91 if(gZX.GetN() == 0) gZX.SetPoint(0, 0, 0);
92 if(gYX.GetN() == 0) gYX.SetPoint(0, 0, 0);
93 if(gZY.GetN() == 0) gZY.SetPoint(0, 0, 0);
96 gPad->Print((
"plots/evd"+suffix+
".png").c_str());
99 gPad->Print((
"plots/evd_ortho"+suffix+
".png").c_str());
101 gPad->Print((
"plots/evd_zy"+suffix+
".png").c_str());
108 std::vector<recob::SpacePoint> pts_true;
110 const double err[6] = {0,};
113 for(
unsigned int i = 0; i <
hits->size(); ++i){
116 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);
162 std::string fname = TString::Format((
"anim/evd3d"+suffix+
"_%03d.png").c_str(), frame++).Data();
163 g.SetTitle(fname.c_str());
164 if(g.GetN()) g.Draw(
"ap");
165 gPad->Print(fname.c_str());
176 const std::string suffix = TString::Format(
"%s_%d",
fSuffix.c_str(), evt.
event()).Data();
190 const std::string suffix = TString::Format(
"%s_true_%d",
fSuffix.c_str(), evt.
event()).Data();
std::vector< recob::SpacePoint > TrueSpacePoints(art::Handle< std::vector< recob::Hit >> hits) const
const std::vector< double > HitToXYZ(const recob::Hit &hit)
Declaration of signal hit object.
PlotSpacePoints(const fhicl::ParameterSet &pset)
#define DEFINE_ART_MODULE(klass)
art::InputTag fSpacePointTag
EventNumber_t event() const
EDAnalyzer(Table< Config > const &config)
void Plot3D(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void analyze(const art::Event &evt)
void Plot(const std::vector< recob::SpacePoint > &pts, const std::string &suffix) const