7 #ifndef CMF_UTILITIES_CMFSELECTIONUTILITIES_H 8 #define CMF_UTILITIES_CMFSELECTIONUTILITIES_H 12 #include "cetlib_except/exception.h" 36 std::set<cmf::SelectionType_t>
sels;
46 std::set<cmf::SelectionType_t>
const&
s = std::set<cmf::SelectionType_t>())
55 std::set<long>
Keys()
const;
82 DetBeamSelSet & sels);
116 <<
"fAllAvailSelections has size 0, which can't be right.";
127 <<
"fSelectionsToUse has size 0. Have you correctly configured SelectionsToUse in fhicl?";
136 std::vector<cmf::MetaData> mds;
138 for(
auto const& sel : itr.Selections())
139 mds.emplace_back(isMC,
146 return std::move(mds);
152 std::vector<long> keys;
154 for(
auto const& sel : itr.Selections())
157 return std::move(keys);
167 <<
"fSelectionsToUse has size 0, cannot find any of any type";
172 std::set<cmf::SelectionType_t> subSetOfSels;
174 subSetOfSels.clear();
175 for(
auto const& selItr : itr.Selections()){
177 subSetOfSels.insert(selItr);
179 subSetOfSels.insert(selItr);
180 else if(sel == selItr)
181 subSetOfSels.insert(selItr);
183 sels.emplace(itr.Detector(), itr.BeamType(), subSetOfSels);
195 for(
auto const& itr :
sels)
206 return (rhs.
det == this->det &&
207 rhs.
beam == this->beam);
213 if(this->
beam < rhs.
beam)
return true;
215 if(this->
det < rhs.
det)
return true;
222 #endif //CMF_UTILITIES_CMFSELECTIONUTILITIES_H DetBeamSelSet const & SelectionsNotUsed()
std::set< cmf::SelectionType_t > const & Selections() const
cmf::DetType_t const & Detector() const
DetBeamSelSet fSelectionsNotUsed
selections which are not configured
bool operator<(DetBeamSels const &rhs) const
DetBeamSelSet const & SelectionsToUse()
bool UsesDetector(cmf::DetType_t const &d) const
bool operator==(DetBeamSels const &rhs) const
static long DetectorBeamSelectionTypesToKey(cmf::DetType_t const &det, cmf::BeamType_t const &bt, cmf::SelectionType_t const &sel)
static SelectionUtility * Instance()
enum cmf::det_type DetType_t
::xsd::cxx::tree::exception< char > exception
std::set< cmf::SelectionType_t > sels
DetBeamSelSet const & AllAvailSelections()
enum cmf::sel_type SelectionType_t
void DetermineUnusedSelections()
determine which selections were not configured from fhicl
static bool IsNuESelected(cmf::SelectionType_t const &sel)
void PrintSelections(DetBeamSelSet dbs)
print a given detector-selection map
static bool IsNuMuSelected(cmf::SelectionType_t const &sel)
std::vector< cmf::MetaData > SelectionsToUseAsMetaData(bool isMC=true) const
DetBeamSelSet fSelectionsToUse
selections which are configured
bool UsesSelection(cmf::SelectionType_t const &s) const
std::set< long > Keys() const
static int BeamToPeriod(cmf::BeamType_t const &beam)
DetBeamSels(cmf::DetType_t const &d, cmf::BeamType_t const &b, std::set< cmf::SelectionType_t > const &s=std::set< cmf::SelectionType_t >())
associates each detector-beam pair to a set of selections
Module to combine a set of results into a single file currently only does one data product type at a ...
std::set< cmf::DetType_t > const & DetectorsToUse()
DetBeamSelSet fAllAvailSelections
all available selections
std::set< cmf::DetType_t > fDetectorsToUse
bool UsesDetAndBeam(cmf::MetaData const &md) const
enum cmf::beam_type BeamType_t
void SelectionsUsedOfType(cmf::SelectionType_t const &sel, DetBeamSelSet &sels)
void Initialize(fhicl::ParameterSet const &pset)
std::set< cmf::SelectionUtility::DetBeamSels > DetBeamSelSet
cmf::BeamType_t const & BeamType() const
std::vector< long > SelectionsToUseAsKeys() const
bool UsesDetBeamAndSel(cmf::MetaData const &md) const