ProngShwLIDVars.cxx
Go to the documentation of this file.
2 
3 #include "Geometry/Geometry.h"
4 
5 namespace SliceLID
6 {
7 
9  const art::FindOneP<rb::Shower> &prongShw_fop,
10  const art::Event &evt,
11  size_t pngIdx
12 )
13 {
14  art::Ptr<rb::Shower> shw = prongShw_fop.at(pngIdx);
15  if (! shw) {
16  return;
17  }
18 
19  art::FindOneP<slid::ShowerLID> prongShwLID_fop(
20  {shw}, evt, prongShwLIDLabel
21  );
22  if (! prongShwLID_fop.isValid()) {
23  return;
24  }
25 
26  art::Ptr<slid::ShowerLID> slid = prongShwLID_fop.at(0);
27 
28  hasShwLID = true;
29  vvars.fillVars(*slid, pngIdx);
30 }
31 
33  const art::Event &evt, const BasicProngVars &pngVars
34 )
35 {
36  vvars.initVars(pngVars.prongs.size(), SLID_FALLBACK_VALUE);
37  if (! pngVars.hasProngs) {
38  return;
39  }
40 
41  art::FindOneP<rb::Shower> prongShw_fop(
42  pngVars.prongs, evt, prongShwLabel
43  );
44 
45  if (! prongShw_fop.isValid()) {
46  return;
47  }
48 
49  for (size_t pngIdx = 0; pngIdx < pngVars.prongs.size(); pngIdx++) {
50  fillVars(prongShw_fop, evt, pngIdx);
51  }
52 }
53 
55  std::unordered_map<std::string, std::vector<double>> &dict,
56  const std::string &prefix
57 ) const
58 {
59  vvars.saveToDict(dict, prefix);
60 }
61 
63  const art::Event &evt,
64  const BasicProngVars &pngVars,
67 ) : vvars(SLID_VAR_DEFS),
68  hasShwLID(false),
69  prongShwLabel(prongShwLabel),
70  prongShwLIDLabel(prongShwLIDLabel)
71 {
72  init(evt, pngVars);
73 }
74 
75 }
ProngShwLIDVars(const art::Event &evt, const BasicProngVars &pngVars, const std::string &prongShwLabel, const std::string &prongShwLIDLabel)
const double SLID_FALLBACK_VALUE
void init(const art::Event &evt, const BasicProngVars &pngVars)
std::vector< art::Ptr< rb::Prong > > prongs
void fillVars(const art::FindOneP< rb::Shower > &prongShw_fop, const art::Event &evt, size_t pngIdx)
VectorVars< slid::ShowerLID > vvars
int evt
const XML_Char * prefix
Definition: expat.h:380
void saveToDict(std::unordered_map< std::string, std::vector< double >> &dict, const std::string &prefix) const
const VectorVarDefs< slid::ShowerLID > SLID_VAR_DEFS({SIMPLE_VVAR("gap", Gap()), SIMPLE_VVAR("lid.eglll", EGLLL()), SIMPLE_VVAR("lid.emulll", EMuLLL()), SIMPLE_VVAR("lid.epi0lll", EPi0LLL()), SIMPLE_VVAR("lid.eplll", EPLLL()), SIMPLE_VVAR("lid.enlll", ENLLL()), SIMPLE_VVAR("lid.epilll", EPiLLL()), SIMPLE_VVAR("lid.egllt", EGLLT()), SIMPLE_VVAR("lid.emullt", EMuLLT()), SIMPLE_VVAR("lid.epi0llt", EPi0LLT()), SIMPLE_VVAR("lid.epllt", EPLLT()), SIMPLE_VVAR("lid.enllt", ENLLT()),})
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...
Definition: FillPIDs.h:13
Definition: fwd.h:28
Encapsulate the geometry of one entire detector (near, far, ndos)
enum BeamMode string