Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
SliceLID::BasicProngVars Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-03-03/SliceLID/art/var_dict_builder/BasicProngVars.h"

Public Member Functions

 BasicProngVars (const art::Event &evt, const std::vector< art::Ptr< rb::Vertex >> &elastics, const std::string &fuzzykLabel, const std::string &fuzzykAssnLabel)
 
void saveToDict (std::unordered_map< std::string, std::vector< double >> &dict, const std::string &prefix) const
 

Public Attributes

std::vector< double > len
 
std::vector< double > calE
 
bool hasProngs
 
std::vector< art::Ptr< rb::Prong > > prongs
 

Private Member Functions

bool getProngs (const art::Event &evt, const std::vector< art::Ptr< rb::Vertex >> &elastics, const std::string &baseLabel, const std::string &assnLabel, std::vector< art::Ptr< rb::Prong >> &prongs)
 
void initProngs (const art::Event &evt, const std::vector< art::Ptr< rb::Vertex >> &elastics)
 
void reserveVectors (size_t nProngs)
 
void initBasicVars ()
 

Private Attributes

std::string fuzzykLabel
 
std::string fuzzykAssnLabel
 

Detailed Description

Definition at line 13 of file BasicProngVars.h.

Constructor & Destructor Documentation

SliceLID::BasicProngVars::BasicProngVars ( const art::Event evt,
const std::vector< art::Ptr< rb::Vertex >> &  elastics,
const std::string fuzzykLabel,
const std::string fuzzykAssnLabel 
)

Definition at line 68 of file BasicProngVars.cxx.

References initBasicVars(), and initProngs().

76 {
77  initProngs(evt, elastics);
78  initBasicVars();
79 }
void initProngs(const art::Event &evt, const std::vector< art::Ptr< rb::Vertex >> &elastics)

Member Function Documentation

bool SliceLID::BasicProngVars::getProngs ( const art::Event evt,
const std::vector< art::Ptr< rb::Vertex >> &  elastics,
const std::string baseLabel,
const std::string assnLabel,
std::vector< art::Ptr< rb::Prong >> &  prongs 
)
private

Definition at line 16 of file BasicProngVars.cxx.

References evt, prongs, and SliceLID::sortByLength().

Referenced by initProngs().

23 {
24  auto png_fmp = art::FindManyP<rb::Prong>(
25  elastics, evt, art::InputTag(baseLabel, assnLabel)
26  );
27 
28  if (! png_fmp.isValid()) {
29  return false;
30  }
31 
32  prongs = png_fmp.at(0);
33  std::sort(prongs.begin(), prongs.end(), sortByLength);
34 
35  return true;
36 }
bool sortByLength(const art::Ptr< rb::Prong > &a, const art::Ptr< rb::Prong > &b)
std::vector< art::Ptr< rb::Prong > > prongs
int evt
void SliceLID::BasicProngVars::initBasicVars ( )
private

Definition at line 38 of file BasicProngVars.cxx.

References calE, rb::Cluster::CalorimetricEnergy(), hasProngs, prongs, reserveVectors(), and rb::Prong::TotalLength().

Referenced by BasicProngVars().

39 {
40  if (! hasProngs) {
41  return;
42  }
43 
44  reserveVectors(prongs.size());
45 
46  for (size_t pngIdx = 0; pngIdx < prongs.size(); ++pngIdx)
47  {
48  const rb::Prong &prong = *prongs[pngIdx];
49  len .push_back(prong.TotalLength());
50  calE.push_back(prong.CalorimetricEnergy());
51  }
52 }
const XML_Char int len
Definition: expat.h:262
std::vector< art::Ptr< rb::Prong > > prongs
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
Definition: Cluster.cxx:439
std::vector< double > calE
A Cluster with defined start position and direction.
Definition: Prong.h:19
void reserveVectors(size_t nProngs)
void SliceLID::BasicProngVars::initProngs ( const art::Event evt,
const std::vector< art::Ptr< rb::Vertex >> &  elastics 
)
private

Definition at line 54 of file BasicProngVars.cxx.

References fuzzykAssnLabel, fuzzykLabel, getProngs(), hasProngs, and prongs.

Referenced by BasicProngVars().

58 {
59  if (elastics.empty()) {
60  return;
61  }
62 
64  evt, elastics, fuzzykLabel, fuzzykAssnLabel, prongs
65  );
66 }
bool getProngs(const art::Event &evt, const std::vector< art::Ptr< rb::Vertex >> &elastics, const std::string &baseLabel, const std::string &assnLabel, std::vector< art::Ptr< rb::Prong >> &prongs)
std::vector< art::Ptr< rb::Prong > > prongs
void SliceLID::BasicProngVars::reserveVectors ( size_t  nProngs)
private

Definition at line 10 of file BasicProngVars.cxx.

References calE.

Referenced by initBasicVars().

11 {
12  len .reserve(nProngs);
13  calE.reserve(nProngs);
14 }
const XML_Char int len
Definition: expat.h:262
std::vector< double > calE
void SliceLID::BasicProngVars::saveToDict ( std::unordered_map< std::string, std::vector< double >> &  dict,
const std::string prefix 
) const

Definition at line 81 of file BasicProngVars.cxx.

References calE.

Referenced by SliceLID::Png3dVars::saveToDict().

85 {
86  dict.emplace(prefix + "len", len);
87  dict.emplace(prefix + "calE", calE);
88 }
const XML_Char int len
Definition: expat.h:262
std::vector< double > calE
const XML_Char * prefix
Definition: expat.h:380

Member Data Documentation

std::vector<double> SliceLID::BasicProngVars::calE

Definition at line 17 of file BasicProngVars.h.

Referenced by initBasicVars(), reserveVectors(), and saveToDict().

std::string SliceLID::BasicProngVars::fuzzykAssnLabel
private

Definition at line 25 of file BasicProngVars.h.

Referenced by initProngs().

std::string SliceLID::BasicProngVars::fuzzykLabel
private

Definition at line 24 of file BasicProngVars.h.

Referenced by initProngs().

bool SliceLID::BasicProngVars::hasProngs
std::vector<double> SliceLID::BasicProngVars::len

Definition at line 16 of file BasicProngVars.h.

Referenced by SliceLID::ProngCVNVars::getFallbackCVNVars().

std::vector<art::Ptr<rb::Prong> > SliceLID::BasicProngVars::prongs

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