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

#include <VLNEnergyVarExtractor.h>

Inheritance diagram for VLN::VLNEnergyVarExtractor:
VLN::VarExtractorBase

Public Member Functions

 VLNEnergyVarExtractor (const std::string &prefix, const std::string &labelVLNEnergy)
 
 ~VLNEnergyVarExtractor ()=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

std::string labelVLNEnergy
 

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 7 of file VLNEnergyVarExtractor.h.

Constructor & Destructor Documentation

VLN::VLNEnergyVarExtractor::VLNEnergyVarExtractor ( const std::string prefix,
const std::string labelVLNEnergy 
)

Definition at line 9 of file VLNEnergyVarExtractor.cxx.

14 { }
static const std::vector< std::string > VECTOR_VARS({})
static const std::vector< std::string > SCALAR_VARS({"run","subRun","event"})
VarExtractorBase(const std::string &prefix, const std::vector< std::string > &scalarVars, const std::vector< std::string > &vectorVars)
VLN::VLNEnergyVarExtractor::~VLNEnergyVarExtractor ( )
default

Member Function Documentation

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

Implements VLN::VarExtractorBase.

Definition at line 16 of file VLNEnergyVarExtractor.cxx.

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 }
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
void setScalarVar(VarDict &vars, const std::string &name, double value) const

Member Data Documentation

std::string VLN::VLNEnergyVarExtractor::labelVLNEnergy
private

Definition at line 19 of file VLNEnergyVarExtractor.h.


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