8 #include "art_root_io/TFileService.h" 48 fTree = tfs->make<TTree>(
"vtxs",
"vtxs");
70 const auto& vtxs = *evt.
getValidHandle<std::vector<recob::Vertex>>(label);
90 for (
unsigned int i = 0; i < parts->size(); ++i) {
91 const int pdg =
abs((*parts)[i].PdgCode());
92 if (pdg == 12 || pdg == 14 || pdg == 16) {
93 const std::vector<art::Ptr<recob::Vertex>>& vtxs = fm.at(i);
94 if (vtxs.size() == 1)
return *vtxs[0];
96 if (vtxs.empty()) { std::cout <<
"Warning: vertex list empty!" << std::endl; }
98 std::cout <<
"Warning: " << vtxs.size() <<
" vertices for daughter?" << std::endl;
110 if (truths.empty())
return;
EvalVtx(const fhicl::ParameterSet &pset)
void analyze(const art::Event &evt) override
constexpr auto abs(T v)
Returns the absolute value of the argument.
recob::Vertex GetVtxByAssns(const std::string &label, const art::Event &evt)
std::vector< std::string > fVertexLabels
EDAnalyzer(fhicl::ParameterSet const &pset)
std::vector< double > gRecoZ
Definition of vertex object for LArSoft.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
tracking::Point_t Point_t
std::vector< double > gRecoX
#define DEFINE_ART_MODULE(klass)
recob::Vertex GetFirstVertex(const std::string &label, const art::Event &evt)
EventNumber_t event() const
std::vector< double > gRecoY
double Vx(const int i=0) const
ValidHandle< PROD > getValidHandle(InputTag const &tag) 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
double Vz(const int i=0) const
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
const Point_t & position() const
Return vertex 3D position.
double Vy(const int i=0) const