Public Member Functions | Protected Member Functions | Private Attributes | List of all members
VLN::EventRecoVarExtractor Class Reference

#include <EventRecoVarExtractor.h>

Inheritance diagram for VLN::EventRecoVarExtractor:
VLN::VarExtractorBase

Public Member Functions

 EventRecoVarExtractor (const std::string &prefix, calo::CalorimetryAlg &algCalorimetry, const std::string &labelHit, unsigned int plane=2)
 
 ~EventRecoVarExtractor ()=default
 
- Public Member Functions inherited from VLN::VarExtractorBase
 VarExtractorBase (const std::string &prefix, const std::vector< std::string > &scalarVars, const std::vector< std::string > &vectorVars)
 
virtual ~VarExtractorBase ()=default
 
virtual void extract (const art::Event &evt, VarDict &vars)
 

Protected Member Functions

void extractVars (const art::Event &evt, VarDict &vars) override
 
- Protected Member Functions inherited from VLN::VarExtractorBase
void setScalarVar (VarDict &vars, const std::string &name, double value) const
 
void appendToVectorVar (VarDict &vars, const std::string &name, double value) const
 
void initScalarVars (VarDict &vars, const std::vector< std::string > &names) const
 
void initVectorVars (VarDict &vars, const std::vector< std::string > &names) const
 

Private Attributes

calo::CalorimetryAlgalgCalorimetry
 
std::string labelHit
 
unsigned int plane
 

Additional Inherited Members

- Protected Attributes inherited from VLN::VarExtractorBase
std::string prefix
 
std::vector< std::stringscalarVars
 
std::vector< std::stringvectorVars
 

Detailed Description

Definition at line 8 of file EventRecoVarExtractor.h.

Constructor & Destructor Documentation

VLN::EventRecoVarExtractor::EventRecoVarExtractor ( const std::string prefix,
calo::CalorimetryAlg algCalorimetry,
const std::string labelHit,
unsigned int  plane = 2 
)

Definition at line 17 of file EventRecoVarExtractor.cxx.

23  algCalorimetry(algCalorimetry),
25  plane(plane)
26 { }
static const std::vector< std::string > VECTOR_VARS({})
static const std::vector< std::string > SCALAR_VARS({"run","subRun","event"})
calo::CalorimetryAlg & algCalorimetry
VarExtractorBase(const std::string &prefix, const std::vector< std::string > &scalarVars, const std::vector< std::string > &vectorVars)
VLN::EventRecoVarExtractor::~EventRecoVarExtractor ( )
default

Member Function Documentation

void VLN::EventRecoVarExtractor::extractVars ( const art::Event evt,
VarDict vars 
)
overrideprotectedvirtual

Implements VLN::VarExtractorBase.

Definition at line 28 of file EventRecoVarExtractor.cxx.

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 }
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
calo::CalorimetryAlg & algCalorimetry
void setScalarVar(VarDict &vars, const std::string &name, double value) const

Member Data Documentation

calo::CalorimetryAlg& VLN::EventRecoVarExtractor::algCalorimetry
private

Definition at line 24 of file EventRecoVarExtractor.h.

std::string VLN::EventRecoVarExtractor::labelHit
private

Definition at line 25 of file EventRecoVarExtractor.h.

unsigned int VLN::EventRecoVarExtractor::plane
private

Definition at line 26 of file EventRecoVarExtractor.h.


The documentation for this class was generated from the following files: