ProngShwVars.cxx
Go to the documentation of this file.
2 
3 namespace SliceLID
4 {
5 
7  const art::FindOneP<rb::Shower> &prongShw_fop, size_t pngIdx
8 )
9 {
10  if (! prongShw_fop.isValid()) {
11  return;
12  }
13 
14  art::Ptr<rb::Shower> shw = prongShw_fop.at(pngIdx);
15  if (! shw) {
16  return;
17  }
18 
19  vvars.fillVars(*shw, pngIdx);
20 }
21 
23  const art::Event &evt, const BasicProngVars &pngVars
24 )
25 {
26  vvars.initVars(pngVars.prongs.size(), SHW_FALLBACK_VALUE);
27 
28  if (! pngVars.hasProngs) {
29  return;
30  }
31 
32  art::FindOneP<rb::Shower> prongShw_fop(
33  pngVars.prongs, evt, prongShwLabel
34  );
35 
36  for (size_t pngIdx = 0; pngIdx < pngVars.prongs.size(); pngIdx++) {
37  fillVars(prongShw_fop, pngIdx);
38  }
39 }
40 
42  std::unordered_map<std::string, std::vector<double>> &dict,
43  const std::string &prefix
44 ) const
45 {
46  vvars.saveToDict(dict, prefix);
47 }
48 
50  const art::Event &evt,
51  const BasicProngVars &pngVars,
53 ) : vvars(SHW_VAR_DEFS),
54  prongShwLabel(prongShwLabel)
55 {
56  init(evt, pngVars);
57 }
58 
59 }
const double SHW_FALLBACK_VALUE
Definition: ProngShwVars.h:13
void fillVars(const art::FindOneP< rb::Shower > &prongShw_fop, size_t pngIdx)
Definition: ProngShwVars.cxx:6
std::string prongShwLabel
Definition: ProngShwVars.h:43
std::vector< art::Ptr< rb::Prong > > prongs
void init(const art::Event &evt, const BasicProngVars &pngVars)
VectorVars< rb::Shower > vvars
Definition: ProngShwVars.h:32
int evt
ProngShwVars(const art::Event &evt, const BasicProngVars &pngVars, const std::string &prongShwLabel)
const VectorVarDefs< rb::Shower > SHW_VAR_DEFS({SIMPLE_VVAR("dir.x", Dir().X()), SIMPLE_VVAR("dir.y", Dir().Y()), SIMPLE_VVAR("dir.z", Dir().Z()), SIMPLE_VVAR("nhit", NCell()), SIMPLE_VVAR("nhitx", NXCell()), SIMPLE_VVAR("nhity", NYCell()), SIMPLE_VVAR("nplane", ExtentPlane()), SIMPLE_VVAR("nplanex", ExtentPlane(geo::kX)), SIMPLE_VVAR("nplaney", ExtentPlane(geo::kY)), SIMPLE_VVAR("len", TotalLength()), SIMPLE_VVAR("calE", CalorimetricEnergy()),})
const XML_Char * prefix
Definition: expat.h:380
Definition: fwd.h:28
void saveToDict(std::unordered_map< std::string, std::vector< double >> &dict, const std::string &prefix) const
enum BeamMode string