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

#include <EventRecoEVarExtractor.h>

Inheritance diagram for VLN::EventRecoEVarExtractor:
VLN::VarExtractorBase

Public Member Functions

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

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 EventRecoEVarExtractor.h.

Constructor & Destructor Documentation

VLN::EventRecoEVarExtractor::EventRecoEVarExtractor ( const std::string prefix,
const std::string labelRecoE 
)

Definition at line 13 of file EventRecoEVarExtractor.cxx.

18 { }
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::EventRecoEVarExtractor::~EventRecoEVarExtractor ( )
default

Member Function Documentation

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

Implements VLN::VarExtractorBase.

Definition at line 20 of file EventRecoEVarExtractor.cxx.

21 {
22  auto recoE_h = evt.getHandle<dune::EnergyRecoOutput>(labelRecoE);
23 
24  if (recoE_h.failedToGet()) {
25  return;
26  }
27 
28  setScalarVar(vars, "nuE", recoE_h->fNuLorentzVector.E());
29  setScalarVar(vars, "lepE", recoE_h->fLepLorentzVector.E());
30  setScalarVar(vars, "hadE", recoE_h->fHadLorentzVector.E());
32  vars, "longestTrackContained", recoE_h->longestTrackContained
33  );
34 }
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::EventRecoEVarExtractor::labelRecoE
private

Definition at line 19 of file EventRecoEVarExtractor.h.


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