EventRecoVarExtractor.cxx
Go to the documentation of this file.
2 
6 
7 #include "utils.h"
8 
9 namespace VLN {
10 
11 static const std::vector<std::string> SCALAR_VARS({
12  "calE", "charge", "nHits"
13 });
14 
15 static const std::vector<std::string> VECTOR_VARS({});
16 
18  const std::string &prefix,
19  calo::CalorimetryAlg &algCalorimetry,
20  const std::string &labelHit,
21  unsigned int plane
23  algCalorimetry(algCalorimetry),
24  labelHit(labelHit),
25  plane(plane)
26 { }
27 
29 {
30  using namespace dune_ana;
31 
32  const auto hits = DUNEAnaHitUtils::GetHitsOnPlane(
33  DUNEAnaEventUtils::GetHits(evt, labelHit), plane
34  );
35 
36  const auto chargeCalE = calcHitsChargeCalE(
37  hits, evt, algCalorimetry, plane
38  );
39 
40  setScalarVar(vars, "charge", chargeCalE.first);
41  setScalarVar(vars, "calE", chargeCalE.second);
42  setScalarVar(vars, "nHits", hits.size());
43 }
44 
45 }
46 
Utility containing helpful functions for end users to access information about Hits.
static const std::vector< std::string > VECTOR_VARS({})
std::pair< double, double > calcHitsChargeCalE(const std::vector< art::Ptr< recob::Hit >> &hits, const art::Event &evt, calo::CalorimetryAlg &algCalorimetry, unsigned int plane)
Definition: utils.cxx:10
std::string string
Definition: nybbler.cc:12
Definition: VarDict.h:8
EventRecoVarExtractor(const std::string &prefix, calo::CalorimetryAlg &algCalorimetry, const std::string &labelHit, unsigned int plane=2)
static const std::vector< std::string > SCALAR_VARS({"run","subRun","event"})
calo::CalorimetryAlg & algCalorimetry
Definition: utils.cxx:6
Utility containing helpful functions for end users to access products from events.
void setScalarVar(VarDict &vars, const std::string &name, double value) const
void extractVars(const art::Event &evt, VarDict &vars) override
TCEvent evt
Definition: DataStructs.cxx:7