Classes | Typedefs | Functions | Variables
SliceLID Namespace Reference

Classes

class  BasicProngVars
 
struct  Config
 
class  FillSliceLID
 
class  Model
 
class  Png3dVars
 
struct  Prediction
 
class  ProngCVNVars
 
class  ProngShwLIDVars
 
class  ProngShwVars
 
class  SliceVars
 
class  VarDictBuilder
 

Typedefs

using CAFAnaModel = ResultCacher< Prediction >
 

Functions

bool sortByLength (const art::Ptr< rb::Prong > &a, const art::Ptr< rb::Prong > &b)
 
template<class T , size_t N>
std::pair< bool, size_t > getIndex (const std::array< T, N > &array, const T &value)
 
const std::array< int, N_CVNCVN_PNG_LIST ({PDG_ELECTRON, PDG_MUON, PDG_PROTON, PDG_PIPLUS, PDG_GAMMA,})
 
const std::unordered_map< int, std::string > PDG_TO_NAME_MAP ({{PDG_ELECTRON,"electronid"},{PDG_MUON,"muonid"},{PDG_PROTON,"protonid"},{PDG_PIPLUS,"pionid"},{PDG_GAMMA,"photonid"},})
 
const VectorVarDefs< slid::ShowerLIDSLID_VAR_DEFS ({SIMPLE_VVAR("gap", Gap()), SIMPLE_VVAR("lid.eglll", EGLLL()), SIMPLE_VVAR("lid.emulll", EMuLLL()), SIMPLE_VVAR("lid.epi0lll", EPi0LLL()), SIMPLE_VVAR("lid.eplll", EPLLL()), SIMPLE_VVAR("lid.enlll", ENLLL()), SIMPLE_VVAR("lid.epilll", EPiLLL()), SIMPLE_VVAR("lid.egllt", EGLLT()), SIMPLE_VVAR("lid.emullt", EMuLLT()), SIMPLE_VVAR("lid.epi0llt", EPi0LLT()), SIMPLE_VVAR("lid.epllt", EPLLT()), SIMPLE_VVAR("lid.enllt", ENLLT()),})
 
const VectorVarDefs< rb::ShowerSHW_VAR_DEFS ({SIMPLE_VVAR("dir.x", Dir().X()), SIMPLE_VVAR("dir.y", Dir().Y()), SIMPLE_VVAR("dir.z", Dir().Z()), SIMPLE_VVAR("nhit", NCell()), SIMPLE_VVAR("nhitx", NXCell()), SIMPLE_VVAR("nhity", NYCell()), SIMPLE_VVAR("nplane", ExtentPlane()), SIMPLE_VVAR("nplanex", ExtentPlane(geo::kX)), SIMPLE_VVAR("nplaney", ExtentPlane(geo::kY)), SIMPLE_VVAR("len", TotalLength()), SIMPLE_VVAR("calE", CalorimetricEnergy()),})
 
static VarDict fillVarDict (const caf::SRProxy *sr, const std::vector< std::pair< std::string, Var >> &sliceVarDefs, const std::vector< std::pair< std::string, MultiVar >> &png3dVarDefs)
 
static std::shared_ptr< CAFAnaModelinitCAFAnaModel (const std::string &modelSavedir)
 
static Var numuid (const std::shared_ptr< CAFAnaModel > &model)
 
static Var ncid (const std::shared_ptr< CAFAnaModel > &model)
 
static Var nueid (const std::shared_ptr< CAFAnaModel > &model)
 
static Var nutauid (const std::shared_ptr< CAFAnaModel > &model)
 
static Var cosmicid (const std::shared_ptr< CAFAnaModel > &model)
 

Variables

const size_t N_CVN = 5
 
const int PDG_ELECTRON = 11
 
const int PDG_MUON = 13
 
const int PDG_PROTON = 2212
 
const int PDG_PIPLUS = 211
 
const int PDG_GAMMA = 22
 
const double SLID_FALLBACK_VALUE = -5.0
 
const double SHW_FALLBACK_VALUE = -5.0
 

Typedef Documentation

using SliceLID::CAFAnaModel = typedef ResultCacher<Prediction>

Definition at line 16 of file SliceLIDVar.h.

Function Documentation

static Var SliceLID::cosmicid ( const std::shared_ptr< CAFAnaModel > &  model)
static

Definition at line 103 of file SliceLIDVar.h.

References Munits::sr.

104 {
105  return Var(
106  [model] (const caf::SRProxy *sr) -> double
107  {
108  return (*model)(sr).cosmic;
109  }
110  );
111 }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
Sum up livetimes from individual cosmic triggers.
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
const std::array<int, N_CVN> SliceLID::CVN_PNG_LIST ( {PDG_ELECTRON, PDG_MUON, PDG_PROTON, PDG_PIPLUS, PDG_GAMMA,}  )
static VarDict SliceLID::fillVarDict ( const caf::SRProxy sr,
const std::vector< std::pair< std::string, Var >> &  sliceVarDefs,
const std::vector< std::pair< std::string, MultiVar >> &  png3dVarDefs 
)
static

Definition at line 18 of file SliceLIDVar.h.

References fillBadChanDBTables::result, VarDict::scalarVarMap, and VarDict::vectorVarMap.

Referenced by initCAFAnaModel().

23 {
25 
26  for (auto &namedVar : sliceVarDefs) {
27  result.scalarVarMap[namedVar.first] = namedVar.second(sr);
28  }
29 
30  for (auto &namedMultiVar : png3dVarDefs) {
31  result.vectorVarMap[namedMultiVar.first] = namedMultiVar.second(sr);
32  }
33 
34  return result;
35 }
std::unordered_map< std::string, std::vector< double > > vectorVarMap
Definition: VarDict.h:11
Definition: VarDict.h:7
std::unordered_map< std::string, double > scalarVarMap
Definition: VarDict.h:10
template<class T , size_t N>
std::pair<bool, size_t> SliceLID::getIndex ( const std::array< T, N > &  array,
const T value 
)

Definition at line 8 of file ProngCVNVars.cxx.

References it, and make_pair().

Referenced by SliceLID::ProngCVNVars::getCVNVars(), and SliceLID::ProngCVNVars::getFallbackCVNVars().

9 {
10  auto it = std::find(array.begin(), array.end(), value);
11  if (it == array.end()) {
12  return std::make_pair(false, 0);
13  }
14 
15  return std::make_pair(true, it - array.begin());
16 }
set< int >::iterator it
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:335
const XML_Char int const XML_Char * value
Definition: expat.h:331
static std::shared_ptr<CAFAnaModel> SliceLID::initCAFAnaModel ( const std::string &  modelSavedir)
static

Definition at line 37 of file SliceLIDVar.h.

References fillVarDict(), caf::kFARDET, ana::kSliceLIDPng3dVarDefs, ana::kSliceLIDSliceVarDefs, and Munits::sr.

40 {
41  auto model = std::make_shared<Model>(modelSavedir);
42 
43  return std::make_shared<CAFAnaModel>(
44  [
45  model = std::move(model),
46  trkLenCorr = TrackLengthCorrection()
47  ] (const caf::SRProxy *sr) mutable -> Prediction
48  {
49  auto varDict = fillVarDict(
51  );
52 
53  /* TODO: remove air bubble correction once geometry is fixed */
54  bool isMC = (sr->mc.nallnus > 0) || (sr->mc.nallcosmics > 0);
55  trkLenCorr.setParams(isMC, (sr->hdr.det == caf::kFARDET));
56  trkLenCorr.shift(varDict);
57 
58  return model->predict(varDict);
59  }
60  );
61 }
Far Detector at Ash River.
Definition: SREnums.h:11
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const std::vector< std::pair< std::string, Var > > kSliceLIDSliceVarDefs
static VarDict fillVarDict(const caf::SRProxy *sr, const std::vector< std::pair< std::string, Var >> &sliceVarDefs, const std::vector< std::pair< std::string, MultiVar >> &png3dVarDefs)
Definition: SliceLIDVar.h:18
const std::vector< std::pair< std::string, MultiVar > > kSliceLIDPng3dVarDefs
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
static Var SliceLID::ncid ( const std::shared_ptr< CAFAnaModel > &  model)
static

Definition at line 73 of file SliceLIDVar.h.

References make_root_from_grid_output::nc, and Munits::sr.

74 {
75  return Var(
76  [model] (const caf::SRProxy *sr) -> double
77  {
78  return (*model)(sr).nc;
79  }
80  );
81 }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
static Var SliceLID::nueid ( const std::shared_ptr< CAFAnaModel > &  model)
static

Definition at line 83 of file SliceLIDVar.h.

References ana::nue, and Munits::sr.

Referenced by caf::Proxy< caf::SRCVNResult >::CheckEquals(), caf::Proxy< caf::SRSliceLID >::CheckEquals(), flat::FlatSliceLID::Fill(), fnex::NuEAnalysisSetup::FillRecoVars2018(), flat::FlatSliceLID::FlatSliceLID(), caf::Proxy< caf::SRCVNResult >::operator=(), caf::Proxy< caf::SRSliceLID >::operator=(), skim::ParametersNue::ParametersNue(), regcvntf::RegCVNTF::PassCVNCut(), and ProducingSA().

84 {
85  return Var(
86  [model] (const caf::SRProxy *sr) -> double
87  {
88  return (*model)(sr).nue;
89  }
90  );
91 }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
static Var SliceLID::numuid ( const std::shared_ptr< CAFAnaModel > &  model)
static

Definition at line 63 of file SliceLIDVar.h.

References Munits::sr.

Referenced by caf::Proxy< caf::SRCVNResult >::CheckEquals(), caf::Proxy< caf::SRSliceLID >::CheckEquals(), flat::FlatSliceLID::Fill(), flat::FlatSliceLID::FlatSliceLID(), caf::Proxy< caf::SRCVNResult >::operator=(), caf::Proxy< caf::SRSliceLID >::operator=(), skim::ParametersNumu::ParametersNumu(), plot_prediction_systs(), and ProducingSA().

64 {
65  return Var(
66  [model] (const caf::SRProxy *sr) -> double
67  {
68  return (*model)(sr).numu;
69  }
70  );
71 }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
static Var SliceLID::nutauid ( const std::shared_ptr< CAFAnaModel > &  model)
static

Definition at line 93 of file SliceLIDVar.h.

References Munits::sr.

Referenced by caf::Proxy< caf::SRCVNResult >::CheckEquals(), caf::Proxy< caf::SRSliceLID >::CheckEquals(), flat::FlatSliceLID::Fill(), flat::FlatSliceLID::FlatSliceLID(), caf::Proxy< caf::SRCVNResult >::operator=(), caf::Proxy< caf::SRSliceLID >::operator=(), and ProducingSA().

94 {
95  return Var(
96  [model] (const caf::SRProxy *sr) -> double
97  {
98  return (*model)(sr).nutau;
99  }
100  );
101 }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr Double_t sr
Definition: Munits.h:164
const std::unordered_map<int, std::string> SliceLID::PDG_TO_NAME_MAP ( {{PDG_ELECTRON,"electronid"},{PDG_MUON,"muonid"},{PDG_PROTON,"protonid"},{PDG_PIPLUS,"pionid"},{PDG_GAMMA,"photonid"},}  )
const VectorVarDefs<rb::Shower> SliceLID::SHW_VAR_DEFS ( {SIMPLE_VVAR("dir.x", Dir().X()), SIMPLE_VVAR("dir.y", Dir().Y()), SIMPLE_VVAR("dir.z", Dir().Z()), SIMPLE_VVAR("nhit", NCell()), SIMPLE_VVAR("nhitx", NXCell()), SIMPLE_VVAR("nhity", NYCell()), SIMPLE_VVAR("nplane", ExtentPlane()), SIMPLE_VVAR("nplanex", ExtentPlane(geo::kX)), SIMPLE_VVAR("nplaney", ExtentPlane(geo::kY)), SIMPLE_VVAR("len", TotalLength()), SIMPLE_VVAR("calE", CalorimetricEnergy()),}  )
const VectorVarDefs<slid::ShowerLID> SliceLID::SLID_VAR_DEFS ( {SIMPLE_VVAR("gap", Gap()), SIMPLE_VVAR("lid.eglll", EGLLL()), SIMPLE_VVAR("lid.emulll", EMuLLL()), SIMPLE_VVAR("lid.epi0lll", EPi0LLL()), SIMPLE_VVAR("lid.eplll", EPLLL()), SIMPLE_VVAR("lid.enlll", ENLLL()), SIMPLE_VVAR("lid.epilll", EPiLLL()), SIMPLE_VVAR("lid.egllt", EGLLT()), SIMPLE_VVAR("lid.emullt", EMuLLT()), SIMPLE_VVAR("lid.epi0llt", EPi0LLT()), SIMPLE_VVAR("lid.epllt", EPLLT()), SIMPLE_VVAR("lid.enllt", ENLLT()),}  )
bool SliceLID::sortByLength ( const art::Ptr< rb::Prong > &  a,
const art::Ptr< rb::Prong > &  b 
)

Definition at line 6 of file BasicProngVars.cxx.

References rb::Prong::TotalLength().

Referenced by SliceLID::BasicProngVars::getProngs().

6  {
7  return a->TotalLength() > b->TotalLength();
8 }
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186

Variable Documentation

const size_t SliceLID::N_CVN = 5

Definition at line 9 of file ProngCVNVars.h.

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

const int SliceLID::PDG_ELECTRON = 11

Definition at line 11 of file ProngCVNVars.h.

const int SliceLID::PDG_GAMMA = 22

Definition at line 15 of file ProngCVNVars.h.

const int SliceLID::PDG_MUON = 13

Definition at line 12 of file ProngCVNVars.h.

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

const int SliceLID::PDG_PIPLUS = 211

Definition at line 14 of file ProngCVNVars.h.

const int SliceLID::PDG_PROTON = 2212

Definition at line 13 of file ProngCVNVars.h.

const double SliceLID::SHW_FALLBACK_VALUE = -5.0

Definition at line 13 of file ProngShwVars.h.

Referenced by SliceLID::ProngShwVars::init().

const double SliceLID::SLID_FALLBACK_VALUE = -5.0

Definition at line 13 of file ProngShwLIDVars.h.

Referenced by SliceLID::ProngShwLIDVars::init().