CovarianceBinUtility.cxx
Go to the documentation of this file.
1 //
2 // Created by Brian Rebel on 11/29/18.
3 //
4 
6 #include "cetlib_except/exception.h"
7 
8 #include "NovaDAQConventions/DAQConventions.h"
12 
13 namespace cmf {
14 
15  static CovarianceBinUtility* gCovBinUtil = nullptr;
16 
17  //-----------------------------------------------------------------------------
19  {
20  if(gCovBinUtil == nullptr) gCovBinUtil = new CovarianceBinUtility();
21 
22  return gCovBinUtil;
23  }
24 
25  //-----------------------------------------------------------------------------
27  {
28 
29  }
30 
31  //-----------------------------------------------------------------------------
33  cmf::DetType_t const& detType)
34  {
35  if(cmf::IsNuESelected(selType)){
36  if(selType == cmf::kNuESelectionPeripheral) return fNuEPeriphHighEdges.size();
37  return (detType == cmf::kNEARDET) ? fNuENDHighEdges.size() : fNuEFDHighEdges.size();
38  }
39  else if(cmf::IsNuMuSelected(selType)){
40  return fNuMuHighEdges.size();
41  }
42  else if(selType == cmf::kNCSelection){
43  return (detType == cmf::kNEARDET) ? fNCNDHighEdges.size() : fNCFDHighEdges.size();
44  }
45 
46  throw cet::exception("CovarianceBinUtility")
47  << "selection type "
48  << selType
49  << " is not recognized";
50 
51  return 0;
52  }
53 
54  //-----------------------------------------------------------------------------
55  void CovarianceBinUtility::FillOffsetAndBinMaps(std::map<long, int> & offsetMap,
56  std::vector<long> & binMap,
57  cmf::SelectionUtility::DetBeamSelSet const& detBeamSelSet)
58  {
59  long key;
60  int offset = 0;
61  int bins;
62 
63  binMap .clear();
64  offsetMap.clear();
65 
66  // loop over detectors, beam type and selection to fill the maps
67  for(auto const& dbsItr : detBeamSelSet){
68  for(auto const& selItr : dbsItr.Selections() ){
69 
70  // there is no MidPID selection for nues any more and no nue peripheral
71  // selection in the nd
72  if(dbsItr.Detector() == cmf::kNEARDET &&
74  continue;
75 
76  // set the file type to 0 so that it does not contribute to the
77  // key value in this case
78  key = DetectorBeamSelectionTypesToKey(dbsItr.Detector(),
79  dbsItr.BeamType(),
80  selItr);
81 
82  offsetMap[key] = offset;
83 
84  bins = this->NumSelectionBins(selItr, dbsItr.Detector());
85  for(int b = offset; b < bins + offset; ++b){
86  binMap.emplace_back(key);
87  LOG_DEBUG("CovarianceBinUtility")
88  << cmf::KeyToString(key)
89  << " key "
90  << key
91  << " offset "
92  << offsetMap.find(key)->second
93  << " "
94  << b
95  << " "
96  << binMap[b];
97  }
98 
99  offset += bins;
100  } // end loop over selection types
101  } // end loop over input DetBeamSels
102 
103  }
104 
105  //---------------------------------------------------------------------------
106  // create map from the vectors of bin edges read from fhicl
107  std::map<double, int> CovarianceBinUtility::EnergyBinMap(std::vector<double> const& vec)
108  {
109  std::map<double, int> ebMap;
110  for (size_t i = 0; i < vec.size(); ++i)
111  ebMap[vec.at(i)] = i;
112 
113  return ebMap;
114  }
115 
116  //---------------------------------------------------------------------------
117  // helper method to setup the energy-to-bin maps
119  {
120  auto ndConfig = fBinConfig.get<fhicl::ParameterSet>("nd");
121  auto fdConfig = fBinConfig.get<fhicl::ParameterSet>("fd");
122 
123  // numu selection has the same binning in nd and fd
124  // TODO if the numu selection is ever not the same in the detectors we
125  // need to update this
126  if(cmf::IsNuMuSelected(selType)){
127  fNuMuLowEdge = ndConfig.get<double>("low_edge");
128  fNuMuHighEdges = this->EnergyBinMap(ndConfig.get<std::vector<double>>("high_edges"));
129  }
130  else if (cmf::IsNuESelected(selType)){
131  fNuENDLowEdge = ndConfig.get<double>("low_edge");
132  fNuENDHighEdges = this->EnergyBinMap(ndConfig.get<std::vector<double>>("high_edges"));
133  fNuEFDLowEdge = fdConfig.get<double>("low_edge");
134  fNuEFDHighEdges = this->EnergyBinMap(fdConfig.get<std::vector<double>>("high_edges"));
135 
136  // nue selection also has peripheral sample at the FD
137  auto peConfig = fBinConfig.get<fhicl::ParameterSet>("peripheral");
138  fNuEPeriphLowEdge = peConfig.get<double>("low_edge");
139  fNuEPeriphHighEdges = this->EnergyBinMap(peConfig.get<std::vector<double>>("high_edges"));
140  }
141  else {
142  fNCNDLowEdge = ndConfig.get<double>("low_edge");
143  fNCNDHighEdges = this->EnergyBinMap(ndConfig.get<std::vector<double>>("high_edges"));
144  fNCFDLowEdge = fdConfig.get<double>("low_edge");
145  fNCFDHighEdges = this->EnergyBinMap(fdConfig.get<std::vector<double>>("high_edges"));
146  }
147 
148  }
149 
150  //-----------------------------------------------------------------------------
152  {
153 
154  // grab configurations from parameter set
155  auto fNuMuEdgeConfig = pset.get< fhicl::ParameterSet >("numu_bin_edges");
156  auto fNuEEdgeConfig = pset.get< fhicl::ParameterSet >("nue_bin_edges");
157  auto fNCEdgeConfig = pset.get< fhicl::ParameterSet >("nc_bin_edges");
158 
159  // using the pre-existing selection enum, doesn't matter
160  // since we just need to differentiate between numu nue and nc
161  this->SetBinning(fNuMuEdgeConfig, cmf::kNuMuSelection);
162  this->SetBinning(fNuEEdgeConfig , cmf::kNuESelection);
163  this->SetBinning(fNCEdgeConfig , cmf::kNCSelection);
164 
165  LOG_DEBUG("CovarianceBinUtility")
166  << "\nnum NuMuBins: " << fNuMuHighEdges.size()
167  << "\nnum NuENDBins: " << fNuENDHighEdges.size()
168  << "\nnum NuEFDBins: " << fNuEFDHighEdges.size()
169  << "\nnum NuEPeriphBins:" << fNuEPeriphHighEdges.size()
170  << "\nnum NCNDBins: " << fNCNDHighEdges.size()
171  << "\nnum NCFDBins: " << fNCFDHighEdges.size();
172 
175  fNuMuLowEdge);
176 
179  fNuENDLowEdge);
180 
183  fNuEFDLowEdge);
184 
188 
191  fNCNDLowEdge);
192 
195  fNCFDLowEdge);
196 
197  // call the function to check that the mapping from
198  // energy to bin and back again is consistent
199  //this->CheckBinToEnergyMapping();
200 
201  LOG_DEBUG("CovarianceBinUtility")
202  << "Fill All Selection Offset and Bin maps";
203 
206  cmf::SelectionUtility::Instance()->AllAvailSelections());
207 
208  LOG_DEBUG("CovarianceBinUtility")
209  << "Fill run time Selection Offset and Bin maps";
210 
212  fBinToKey,
213  cmf::SelectionUtility::Instance()->SelectionsToUse());
214 
215  LOG_VERBATIM("CovarianceBinUtility")
216  << "Using "
217  << fBinToKey.size()
218  << " bins for analysis out of a possible "
219  << fAllSelsBinToKey.size();
220  }
221 
222  //-----------------------------------------------------------------------------
224  {
225  fNuMuHighEdges .clear();
226  fNuENDHighEdges .clear();
227  fNuEFDHighEdges .clear();
228  fNCHighEdges .clear();
229  fNCNDHighEdges .clear();
230  fNCFDHighEdges .clear();
231  fAllSelsOffsetMap.clear();
232  fOffsetMap .clear();
233  fBinToKey .clear();
234  fAllSelsBinToKey .clear();
235 
236  fNuEPeriphHighEdges .clear();
237  fNuMuBinToEnergy .clear();
238  fNuENDBinToEnergy .clear();
239  fNuEFDBinToEnergy .clear();
240  fNuEPeriphBinToEnergy.clear();
241  fNCNDBinToEnergy .clear();
242  fNCFDBinToEnergy .clear();
243 
244  }
245 
246  //-----------------------------------------------------------------------------
247  void CovarianceBinUtility::FillBinToEnergyMap(std::map<double, int> const& selectionHighEdges,
248  std::map<int, double> & selectionBinToEnergy,
249  double lowestBound)
250  {
251  // fill the bin to energy maps for fast look up
252  double lowerBound = lowestBound;
253  for(auto const& itr : selectionHighEdges){
254  selectionBinToEnergy[itr.second] = lowerBound + (itr.first - lowerBound) * 0.5;
255 
256  LOG_DEBUG("CovarianceBinUtility")
257  << "FillBinToEnergyMap energy "
258  << itr.first
259  << " bin "
260  << itr.second
261  << " bin to energy "
262  << selectionBinToEnergy.find(itr.second)->second;
263 
264  lowerBound = itr.first;
265  }
266  }
267 
268  //-----------------------------------------------------------------------------
269 // void CovarianceBinUtility::CheckBinToEnergyMapping()
270 // {
271 // // loop over the selections and detectors to get the correct number of
272 // // bins for each and then get the energy for each bin. Use that value to
273 // // find the bin again and compare to the loop iterator
274 // std::set<cmf::SelectionType_t> selectionTypes({kNuESelectionLowPID,
275 // kNuESelectionHighPID,
276 // kNuESelectionPeripheral,
277 // kNuMuSelectionQ1,
278 // kNuMuSelectionQ2,
279 // kNuMuSelectionQ3,
280 // kNuMuSelectionQ4,
281 // kNCSelection});
282 // std::set<cmf::DetType_t> detectors({cmf::kNEARDET,
283 // cmf::kFARDET});
284 // double binEnergy;
285 // size_t binNumber;
286 //
287 // // create a MetaData for making the following easier,
288 // // set the epoch to be 1, ie epoch 1, FHC
289 // cmf::MetaData md;
290 // md.period = 1;
291 //
292 // for(auto const& st : selectionTypes){
293 // md.selectionType = st;
294 //
295 // for(auto const& det : detectors){
296 // md.detector = det;
297 //
298 // auto const& highEdges = this->SelectionHighEdges(md);
299 // for(auto const& itr : highEdges){
300 //
301 // // no peripheral selection in the ND
302 // if(det == cmf::kNEARDET &&
303 // st == cmf::kNuESelectionPeripheral) continue;
304 //
305 // binEnergy = this->BinToEnergy(itr.second + this->KeyToOffset(md.DetectorBeamSelectionKey()), md);
306 // binNumber = this->EnergyToBin(binEnergy, md);
307 //
308 // LOG_DEBUG("CovarianceBinUtility")
309 // << cmf::cSelectionType_Strings[st]
310 // << " "
311 // << md.DetectorString()
312 // << " look up of bin number: "
313 // << itr.second
314 // << " found bin number "
315 // << binNumber
316 // << " offset "
317 // << this->KeyToOffset(md.DetectorBeamSelectionKey())
318 // << " found energy "
319 // << binEnergy;
320 //
321 // }// end loop over bins
322 // } // end loop over detectors
323 // } // end loop over selections
324 // }
325 
326  //......................................................................
327  // There are 4 quantiles for numu events, 2 PID sets + 1 peripheral bin
328  // for nue events, and 1 set for NC events. Multiply that by 2 for the
329  // number of horn configurations
330  size_t CovarianceBinUtility::TotalBins(bool allSels)
331  {
332 
333  LOG_DEBUG("CovarianceBinUtility")
334  << " there are numu (each quartile): "
335  << fNuMuHighEdges.size()
336  << " nue low: "
337  << fNuENDHighEdges.size()
338  << " nue high: "
339  << fNuEFDHighEdges.size()
340  << " nue peripheral: "
341  << fNuEPeriphHighEdges.size()
342  << " nc ND: "
343  << fNCNDHighEdges.size()
344  << " nc FD: "
345  << fNCFDHighEdges.size()
346  << " total bins for all selections: "
347  << fAllSelsBinToKey.size()
348  << " total bins for run time selections: "
349  << fBinToKey.size()
350  << " "
351  << allSels;
352 
353  if(allSels) return fAllSelsBinToKey.size();
354 
355  return fBinToKey.size();
356  }
357 
358  //......................................................................
360  {
361  if(md.IsNuMuSelected())
362  return this->NuMuLowEdge();
363  else if(md.IsNuESelected()){
364  return this->NuELowEdge(md);
365  }
366 
367  return this->NCLowEdge(md.detector);
368  }
369 
370  //......................................................................
372  {
373  if(md.detector == cmf::kNEARDET) return fNuENDLowEdge;
375 
376  return fNuEFDLowEdge;
377  }
378 
379  //......................................................................
381  {
382  if(det == cmf::kNEARDET) return fNCNDLowEdge;
383 
384  return fNCFDLowEdge;
385  }
386 
387  //......................................................................
388  std::map<double, int> const& CovarianceBinUtility::NuEHighEdges(cmf::DetType_t const& det)
389  {
390  if(det == cmf::kNEARDET) return fNuENDHighEdges;
391 
392  return fNuEFDHighEdges;
393  }
394 
395  //......................................................................
396  std::map<double, int> const& CovarianceBinUtility::NCHighEdges(cmf::DetType_t const& det)
397  {
398  if(det == cmf::kNEARDET) return fNCNDHighEdges;
399 
400  return fNCFDHighEdges;
401  }
402 
403  //......................................................................
404  std::map<double, int> const& CovarianceBinUtility::SelectionHighEdges(cmf::MetaData const& md)
405  {
406  if(md.IsNuMuSelected())
407  return this->NuMuHighEdges();
408  else if(md.IsNuESelected()){
410  return this->NuEHighEdges(md.detector);
411  }
412 
413  return this->NCHighEdges(md.detector);
414  }
415 
416  //......................................................................
417  std::map<double, int> const& CovarianceBinUtility::SelectionHighEdges(long const& key)
418  {
419  auto sel = cmf::KeyToSelectionType(key);
420  auto det = cmf::KeyToDetectorType(key);
421 
422  if(cmf::IsNuMuSelected(sel))
423  return this->NuMuHighEdges();
424  else if(cmf::IsNuESelected(sel)){
426  return this->NuEHighEdges(det);
427  }
428 
429  return this->NCHighEdges(det);
430  }
431 
432  //......................................................................
434  std::vector<double> & bins)
435  {
436  std::vector<double> tmpbins;
437  auto const& highEdgeMap = this->SelectionHighEdges(md);
438  tmpbins.push_back(this->SelectionLowEdge(md));
439 
440  for(auto const& itr : highEdgeMap) tmpbins.push_back(itr.first);
441 
442  std::swap(tmpbins, bins);
443  }
444 
445  //......................................................................
447  bool allSels)
448  {
449  if(allSels) return this->KeyToOffset(key, fAllSelsOffsetMap);
450  return this->KeyToOffset(key, fOffsetMap);
451  }
452 
453  //......................................................................
455  std::map<long, int> const& offsetMap)
456  {
457 
458  if(offsetMap.count(key) < 1)
459  throw cet::exception("CovarianceBinUtility")
460  << "could not find offset in map for key "
461  << key
462  << " "
464  << " "
466  << " "
468 
469  return offsetMap.find(key)->second;
470  }
471 
472  //......................................................................
474  cmf::MetaData const& md)
475  {
476  return this->EnergyToBin(energy, md) + 1;
477  }
478 
479  //......................................................................
481  cmf::MetaData const& md)
482  {
483  auto const& edgeMap = this->SelectionHighEdges(md);
484 
485  auto const& itr = edgeMap.upper_bound(energy);
486  if(itr != edgeMap.end()) return itr->second;
487 
488  return 0;
489  }
490 
491  //......................................................................
492  std::map<int, double> const& CovarianceBinUtility::SelectionBinToEnergy(long key)
493  {
494  auto sel = cmf::KeyToSelectionType(key);
495  auto det = cmf::KeyToDetectorType(key);
496 
497  if(sel == cmf::kUnknownSelection ||
498  det == cmf::kUnknownDet )
499  throw cet::exception("Unknown Key")
500  << "key "
501  << key
502  << "corresponds to "
504  << " and "
506 
507  if(cmf::IsNuESelected(sel)){
509  if(det == cmf::kNEARDET) return fNuENDBinToEnergy;
510  return fNuEFDBinToEnergy;
511  }
512  else if(cmf::IsNuMuSelected(sel)){
513  return fNuMuBinToEnergy;
514  }
515  else{
516  if (det == cmf::kNEARDET) return fNCNDBinToEnergy;
517  else return fNCFDBinToEnergy;
518  }
519  }
520 
521  //-----------------------------------------------------------------------------
523  bool allSels)
524  {
525  return cmf::KeyToDetectorType(this->BinToKey(bin, allSels));
526  }
527 
528  //-----------------------------------------------------------------------------
530  bool allSels)
531  {
532  return cmf::KeyToSelectionType(this->BinToKey(bin, allSels));
533  }
534 
535  //-----------------------------------------------------------------------------
537  bool allSels)
538  {
539  return cmf::KeyToBeamType(this->BinToKey(bin, allSels));
540  }
541 
542  //-----------------------------------------------------------------------------
544  bool allSels)
545  {
546  if(allSels) return fAllSelsBinToKey[bin];
547  return fBinToKey[bin];
548  }
549 
550  //......................................................................
552  bool allSels)
553  {
554  auto key = this->BinToKey (bin, allSels);
555  int offset = this->KeyToOffset(key, allSels);
556 
557  auto const& binToEnergy = this->SelectionBinToEnergy(key);
558 
559  auto const btoEItr = binToEnergy.find(bin - offset);
560 
561  if(btoEItr == binToEnergy.end())
562  throw cet::exception("CovarianceBinUtility")
563  << "bin "
564  << bin
565  << " offset "
566  << offset
567  << " "
568  << bin - offset
569  << " is not in bin to energy map for key "
570  << key
571  << " "
572  << cmf::KeyToString(key);
573 
574  LOG_DEBUG("CovarianceBinUtility")
575  << "BinToEnergy: "
577  << " bin is "
578  << bin
579  << " offset "
580  << offset
581  << " energy "
582  << btoEItr->second;
583 
584  return btoEItr->second;
585  }
586 
587  //......................................................................
589 
590  std::vector<int> emptyBins;
591 
592  for (int i = 0; i < mat.GetNrows(); i++){
593 
594  // for every column, check every row is above some
595  // tolerance. If it's not, count it as an empty bin
596  double rowsum = 0;
597  for (int j = 0; j < mat.GetNcols(); j++)
598  rowsum += std::abs(mat(i,j));
599 
600  if (rowsum == 0)
601  emptyBins.push_back(i);
602  }
603 
604  return emptyBins;
605  }
606 
607  //......................................................................
609 
610  int nRowsAndColumns = mat.GetNcols() - emptyBins.size();
611  TMatrixD compactMatrix(nRowsAndColumns, nRowsAndColumns);
612  TMatrixD semiCompactMatrix(nRowsAndColumns, mat.GetNcols());
613 
614  // correct in i
615  int itest = 0;
616  for (int i = 0; i < nRowsAndColumns; ++i){
617 
618  bool isXEmptyBin = false;
619  for (size_t ieb = 0; ieb < emptyBins.size(); ++ieb){
620  if (emptyBins.at(ieb) == itest)
621  isXEmptyBin = true;
622  }
623 
624  for (int j = 0; j < mat.GetNcols(); ++j){
625  semiCompactMatrix(i,j) = mat(itest, j);
626  }
627 
628  if (isXEmptyBin)
629  --i;
630 
631  ++itest;
632 
633  }
634 
635  // correct in i
636  int jtest = 0;
637  for (int j = 0; j < nRowsAndColumns; ++j){
638 
639  bool isYEmptyBin = false;
640  for (size_t ieb = 0; ieb < emptyBins.size(); ++ieb){
641  if (emptyBins.at(ieb) == jtest)
642  isYEmptyBin = true;
643  }
644 
645  for (int i = 0; i < semiCompactMatrix.GetNrows(); ++i){
646  compactMatrix(i,j) = semiCompactMatrix(i, jtest);
647  }
648 
649  if (isYEmptyBin)
650  --j;
651 
652  ++jtest;
653 
654  }
655 
656  return compactMatrix;
657 
658  }
659 
660 } // cmf namespace
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::map< int, double > const & SelectionBinToEnergy(long key)
std::vector< int > EmptyBins(TMatrixD mat)
std::map< double, int > const & NuMuHighEdges()
int KeyToOffset(long const &key, bool allSels=false)
std::map< double, int > fNuMuHighEdges
high side of the numu bins
void SelectionHistBinning(cmf::MetaData const &md, std::vector< double > &bins)
std::map< double, int > fNCHighEdges
high side of the nc bins
const std::string cSelectionType_Strings[12]
Definition: Constants.h:93
cmf::DetType_t detector
Definition: Structs.h:114
double fNuEFDLowEdge
low side of the first nune bin in FD
double fNuMuLowEdge
low side of the first numu bin
double const & SelectionLowEdge(cmf::MetaData const &md)
static long DetectorBeamSelectionTypesToKey(cmf::DetType_t const &det, cmf::BeamType_t const &bt, cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:58
static SelectionUtility * Instance()
void FillOffsetAndBinMaps(std::map< long, int > &offsetMap, std::vector< long > &binMap, cmf::SelectionUtility::DetBeamSelSet const &detBeamSelSet)
TMatrixD CompactMatrix(TMatrixD mat, std::vector< int > emptyBins)
enum cmf::det_type DetType_t
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
long BinToKey(int const &bin, bool allSels=false)
std::map< int, double > fNuEPeriphBinToEnergy
map energy bin to central value
std::map< int, double > fNuMuBinToEnergy
map energy bin to central value
void SetBinning(fhicl::ParameterSet const &fBinConfig, cmf::SelectionType_t const &selType)
static cmf::BeamType_t KeyToBeamType(long const &key)
Definition: StaticFuncs.h:132
enum cmf::sel_type SelectionType_t
std::map< double, int > EnergyBinMap(std::vector< double > const &vec)
static bool IsNuESelected(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:372
float abs(float number)
Definition: d0nt_math.hpp:39
double fNCNDLowEdge
low side of the first nc bin in ND
std::vector< long > fAllSelsBinToKey
map bin numbers to keys for different samples
std::map< int, double > fNCNDBinToEnergy
map energy bin to central value (2020ana)
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
int EnergyToBin(double const &energy, cmf::MetaData const &md)
double BinToEnergy(int const &bin, bool allSels=false)
static bool IsNuMuSelected(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:358
std::map< double, int > fNuEPeriphHighEdges
high side of the nue bins in FD
std::map< double, int > fNCFDHighEdges
high side of the nc bins in FD (2020ana)
cmf::SelectionType_t selectionType
Definition: Structs.h:116
std::vector< long > fBinToKey
map bin numbers to keys for different samples
static cmf::DetType_t KeyToDetectorType(long const &key)
Definition: StaticFuncs.h:66
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::map< double, int > fNuEFDHighEdges
high side of the nue bins in FD
cmf::SelectionType_t BinToSelection(int const &bin, bool allSels=false)
double energy
Definition: plottest35.C:25
bool IsNuMuSelected() const
Definition: Structs.cxx:219
std::map< double, int > fNuENDHighEdges
high side of the nue bins in ND
void Initialize(fhicl::ParameterSet const &pset)
const double j
Definition: BetheBloch.cxx:29
const Binning bins
Eigen::VectorXd vec
static CovarianceBinUtility * gCovBinUtil
std::map< double, int > const & NCHighEdges(cmf::DetType_t const &det)
std::map< long, int > fAllSelsOffsetMap
map of keys to offset for different samples
float bin[41]
Definition: plottest35.C:14
std::map< int, double > fNuENDBinToEnergy
map energy bin to central value
double fNuEPeriphLowEdge
low side of the first nue bin in FD
size_t TotalBins(bool allSels=false)
std::map< long, int > fOffsetMap
map of keys to offset for different samples
Module to combine a set of results into a single file currently only does one data product type at a ...
Definition: Event.cxx:24
double const & NuELowEdge(cmf::MetaData const &md)
std::map< double, int > const & SelectionHighEdges(cmf::MetaData const &md)
double const & NCLowEdge(cmf::DetType_t const &det)
std::map< int, double > fNuEFDBinToEnergy
map energy bin to central value
std::map< int, double > fNCFDBinToEnergy
map energy bin to central value (2020ana)
std::map< double, int > fNCNDHighEdges
high side of the nc bins in ND (2020ana)
cmf::DetType_t BinToDetector(int const &bin, bool allSels=false)
enum cmf::beam_type BeamType_t
const hit & b
Definition: hits.cxx:21
static cmf::SelectionType_t KeyToSelectionType(long const &key)
Definition: StaticFuncs.h:166
int EnergyToHistogramBin(double const &energy, cmf::MetaData const &md)
static void FillBinToEnergyMap(std::map< double, int > const &selectionHighEdges, std::map< int, double > &selectionBinToEnergy, double lowestBound)
#define LOG_VERBATIM(category)
double fNuENDLowEdge
low side of the first nue bin in ND
std::set< cmf::SelectionUtility::DetBeamSels > DetBeamSelSet
const std::string cDetType_Strings[5]
Definition: Constants.h:29
double fNCFDLowEdge
low side of the first nc bin in FD
const std::string cBeamType_Strings[4]
Definition: Constants.h:51
std::map< double, int > const & NuEHighEdges(cmf::DetType_t const &det)
int NumSelectionBins(cmf::SelectionType_t const &selType, cmf::DetType_t const &detType)
cmf::BeamType_t BinToBeamType(int const &bin, bool allSels=false)
static std::string KeyToString(long const &key)
Definition: StaticFuncs.h:224
Eigen::MatrixXd mat
static CovarianceBinUtility * Instance()
bool IsNuESelected() const
Definition: Structs.cxx:225