VLNEnergyVarExtractor.cxx
Go to the documentation of this file.
3 
4 namespace VLN {
5 
6 static const std::vector<std::string> SCALAR_VARS({ "primaryE", "totalE" });
7 static const std::vector<std::string> VECTOR_VARS({});
8 
10  const std::string &prefix, const std::string &labelVLNEnergy
11 )
13  labelVLNEnergy(labelVLNEnergy)
14 { }
15 
17 {
18  auto vlnEnergy_h = evt.getHandle<VLN::VLNEnergy>(labelVLNEnergy);
19 
20  if (vlnEnergy_h.failedToGet()) {
21  return;
22  }
23 
24  setScalarVar(vars, "primaryE", vlnEnergy_h->primaryE);
25  setScalarVar(vars, "totalE", vlnEnergy_h->totalE);
26 }
27 
28 }
29 
void extractVars(const art::Event &evt, VarDict &vars) override
static const std::vector< std::string > VECTOR_VARS({})
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::string string
Definition: nybbler.cc:12
Definition: VarDict.h:8
static const std::vector< std::string > SCALAR_VARS({"run","subRun","event"})
Definition: utils.cxx:6
void setScalarVar(VarDict &vars, const std::string &name, double value) const
TCEvent evt
Definition: DataStructs.cxx:7
VLNEnergyVarExtractor(const std::string &prefix, const std::string &labelVLNEnergy)