70 std::vector<art::Ptr<recob::Vertex>> vertices;
74 bool shower_direction_set = ShowerEleHolder.
CheckElement(
"ShowerDirection");
76 TVector3 ShowerDirection = {-999, -999, -999};
79 if (shower_direction_set) { ShowerEleHolder.
GetElement(
"ShowerDirection", ShowerDirection); }
83 double xyz[3] = {-999, -999, -999};
84 proposed_vertex->
XYZ(xyz);
86 if (ShowerDirection.X() < 0) {
92 TVector3 recobshower_vertex = {xyz[0], xyz[1], xyz[2]};
93 TVector3 recobshower_err = {xyz[0] * 0.1, xyz[1] * 0.1, xyz[2] * 0.1};
95 ShowerEleHolder.
SetElement(recobshower_vertex, recobshower_err,
"ShowerStartPosition");
100 recobshower_vertex, recobshower_err,
"ShowerExampleTool_ShowerStartPosition");
103 ShowerEleHolder.
SetElement(new_vertex,
"myvertex");
106 std::vector<double> xyz_vec = {xyz[0], xyz[1], xyz[2]};
110 ShowerEleHolder.
SetElement(xyz_vec,
"xyz",
true);
115 if (will_be_checked) { std::cout <<
"Element checked at save time" <<
std::endl; }
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
int GetShowerNumber() const
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
void SetElementTag(const std::string &Name, bool checkelement)
Definition of vertex object for LArSoft.
void PrintElements() const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool CheckElement(const std::string &Name) const
bool CheckElementTag(const std::string &Name) const
int GetElement(const std::string &Name, T &Element) const
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
QTextStream & endl(QTextStream &s)