9 #include "art_root_io/TFileService.h" 10 #include "canvas/Persistency/Common/FindManyP.h" 50 fTree = tfs->make<TTree>(
"vtxs",
"vtxs");
90 art::FindManyP<recob::Vertex>
fm(parts, evt, label);
92 for(
unsigned int i = 0; i < parts->size(); ++i){
94 if(pdg == 12 || pdg == 14 || pdg == 16){
95 const std::vector<art::Ptr<recob::Vertex>>& vtxs = fm.at(i);
96 if(vtxs.size() == 1)
return *vtxs[0];
99 std::cout <<
"Warning: vertex list empty!" <<
std::endl;
102 std::cout <<
"Warning: " << vtxs.size() <<
" vertices for daughter?" <<
std::endl;
114 if(truths.empty())
return;
EventNumber_t event() const
EvalVtx(const fhicl::ParameterSet &pset)
void analyze(const art::Event &evt) override
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.
tracking::Point_t Point_t
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
std::vector< double > gRecoX
#define DEFINE_ART_MODULE(klass)
recob::Vertex GetFirstVertex(const std::string &label, const art::Event &evt)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::vector< double > gRecoY
double Vx(const int i=0) const
double Vz(const int i=0) const
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
static constexpr double fm
auto const & get(AssnsNode< L, R, D > const &r)
const Point_t & position() const
Return vertex 3D position.
double Vy(const int i=0) const
QTextStream & endl(QTextStream &s)